<dfockler>
7.bin(true), doesn't indicate what the true is doing
<drbrain>
Ox0dea: sorry, it's step, not upto
bkxd has joined #ruby
pietr0 has quit [Ping timeout: 256 seconds]
<Ox0dea>
`7.bin(prefix: :uppercase)` is almost humorously verbose.
<dfockler>
7.bin.prefix isn't that bad
<drbrain>
<Ox0dea>
What should String#prefix do in other contexts?
bronson has quit [Remote host closed the connection]
<dfockler>
maybe the bin method doesn't return a string
cytoskeletor has joined #ruby
<dfockler>
because it has state
fabrice31 has joined #ruby
<drbrain>
when I'm unfamiliar with what a method does, the more verbose its calling structure is the more likely I can guess what it does without spending 5 minutes looking up its API
shinnya has quit [Ping timeout: 248 seconds]
<Ox0dea>
dfockler: That '111'.bin => 7 would seem to suggest that 7.bin should => '111'.
devdazed has joined #ruby
<Ox0dea>
But '0b111'.bin also => 7, and being able to round-trip seems like a Good Thing.
<drbrain>
use Integer instead of to_i unless you know your input is a valid number
rushed has joined #ruby
<drbrain>
or, I suppose, know -> is supposed to be
<dorei>
changing a radix doesnt change the number, only its representation, in this case it's string representation
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<baweaver>
cantu4: group_by is a thing
robustus has quit [Ping timeout: 255 seconds]
<doctorly>
I am trying to figure out how to get a scroll bar on a nested slot in green shoes, but every time I try to add one, it is added to the parent slot. Does anyone know why? Or does anyone have an example app I can examine?
bkxd has quit [Ping timeout: 265 seconds]
<jfarmer>
baweaver What would 9.bin return?
<baweaver>
see above
<Ox0dea>
For what it's worth, Big/Fixnum#to_s and String#to_i have perfectly logical and consistent APIs.
gambl0re has quit [Ping timeout: 250 seconds]
<drbrain>
I don't think I need even A fingers to count the number of times I've needed to use even to_i with a base in the last year
<cantu4>
baweaver: ok but how would I use it here?
<baweaver>
you have response[:choice]
_blizzy_ has joined #ruby
<jfarmer>
baweaver I did; unless it's _wayyy_ up there.
<Ox0dea>
drbrain: Adding an optional prefix to #to_s for the sake of only three radixes doesn't seem reasonable.
<baweaver>
that
<baweaver>
which you're checking its value
<baweaver>
also, detect is find is one result
<baweaver>
This looks like Rails though
<drbrain>
Ox0dea: you'll see the argument of "who will use this?" for the addition of bin/hex/oct, so you will need to establish that people need to use it often
robustus has joined #ruby
balazs has joined #ruby
<drbrain>
↑ so you know how to best present your propsal
<Ox0dea>
Sure, that makes sense.
<zenspider>
I to_s(16) often enough... but only because I'm lazy
<Ox0dea>
zenspider: And would you rather hex? :)
<zenspider>
but to_i(base)? almost never
<cantu4>
baweaver: could you do some example code? Not fully understanding
rubie has joined #ruby
<zenspider>
Ox0dea: not really.
<zenspider>
he says, mistyping 0x0dea again and again
mikecmpbll has quit [Quit: i've nodded off.]
d5sx43 has joined #ruby
<baweaver>
cantu4: What you'd want to do is something like: responses.map { |r| r[:choice] }.group_by(&:itself).map { |k,v| [k, v.size] }.to_h
<baweaver>
well, that first map is unnecessary
<zenspider>
don't know why you're arguing for #hex when your own username is broken
<baweaver>
only if you want to get those out for later.
<cantu4>
baweaver: where would this replace?
<baweaver>
really you need to post sample data
Decker has joined #ruby
datanoise has joined #ruby
<baweaver>
otherwise it's impossible to tell
<baweaver>
put it in a gist and link to it
d5sx43 has quit [Client Quit]
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<baweaver>
I have a feeling there's a lot more wrong with that than I can see from that code.
<baweaver>
just post what responses looks like, that should do.
balazs has quit [Remote host closed the connection]
<Ox0dea>
After some cursory research, it does seem that Fixnum#bin/#hex/#oct are a little too niche for inclusion into core.
rubie has quit [Ping timeout: 265 seconds]
<baweaver>
you sure that's what responses returns?
<cantu4>
baweaver: What it does it take the difference between the latest polls on Pollster, then uses a T-Distribution to find the odds of a person winning
<cantu4>
baweaver: I want to change the names I have inputted like rubio[:value], into whatever the user chooses
ItSANg___ has joined #ruby
Yiota has joined #ruby
<baweaver>
you ran the entire program and gave me the result of that, I meant the results variable, sorry.
<baweaver>
responses
<baweaver>
lordy...
<baweaver>
typing is hard today.
blackmesa has joined #ruby
commondream has quit [Ping timeout: 252 seconds]
ItSANgo_ has quit [Ping timeout: 264 seconds]
datanoise has quit [Ping timeout: 272 seconds]
<cantu4>
baweaver: You want me to run just the responses?
<baweaver>
yeah, comment out everything else and just get that data.
<zenspider>
an image??
<doctorly>
promet: no problem, you usually want to put environment variables in the bashrc
<baweaver>
also, gist.github.com
drewvanstone has quit [Ping timeout: 264 seconds]
<doctorly>
sorry wrong chan
<cantu4>
baweaver: that section alone doesn't produce anything
<baweaver>
You have to use a p there
<baweaver>
p responses
<baweaver>
otherwise it doesn't output anything
<cantu4>
baweaver, wehre do I put it?
<baweaver>
cantu4: Have you ever tried a REPL?
<cantu4>
baweaver: don't think so
rubie has joined #ruby
blackmes1 has quit [Ping timeout: 246 seconds]
<baweaver>
where do you think you should put it?
<baweaver>
type in irb in your console
<baweaver>
require those libraries
<baweaver>
and try playing with the data like that
<zenspider>
cantu4: "where do I put it" suggests that you aren't even thinking about this problem or the suggestions given. THINK about this problems and then YOU suggest to US where it should go
<baweaver>
Read Eval Print Loop, lets you execute code as you will
lordkryss has quit [Quit: Connection closed for inactivity]
<zenspider>
we'll let you know if it is incorrect, but you have to meet us half way
deric_skibotn has quit [Ping timeout: 264 seconds]
masterprime has joined #ruby
netmask_ has quit [Ping timeout: 250 seconds]
dopie has quit [Quit: This computer has gone to sleep]
datanoise has joined #ruby
netmask has joined #ruby
slackbotgz has quit [Ping timeout: 256 seconds]
lennae has joined #ruby
<masterprime>
Hola. Here's the deal. I am not trying to learn ruby. I am trying to get a bot written in ruby to run on my subreddit. https://github.com/jensechu/twitchit <- this bot. The install instructions have an expectation of knowledge. Knowledge I do not have. Where do I run these commands? Specifically "bundle install"
scripore has joined #ruby
<Aeyrix>
Terminal.
_blizzy_ has quit [Ping timeout: 248 seconds]
freerobby has joined #ruby
GitGud has quit [Read error: Connection reset by peer]
<masterprime>
like command prompt with ruby?
<Aeyrix>
> command prompt
<Aeyrix>
uh oh
<sevenseacat>
the same place you ran git clone and cd
<Aeyrix>
If you're on Windows, this isn't going to work for you.
<BrianBoyko>
I did it!!!!
HotCoder has joined #ruby
Deele has joined #ruby
<masterprime>
Is it actually not going to work for me or is it just a pain in the ass? I've got linux on my laptop but I kinda need this to run all the time.
<Aeyrix>
You need a server, then.
<Aeyrix>
That's what they're for.
yh has joined #ruby
serivichi has quit [Ping timeout: 272 seconds]
datanoise has quit [Ping timeout: 256 seconds]
blackmesa has quit [Quit: WeeChat 1.2]
Encapsulation has quit [Changing host]
Encapsulation has joined #ruby
<masterprime>
I've got a crappy webhost. Would that work?
<Aeyrix>
Do you have command line access?
wallerdev_ has joined #ruby
<masterprime>
yeah.
<Aeyrix>
I mean for the web host.
<masterprime>
I know. I have shell access.
<Aeyrix>
Then yes, it'll work, so long as you can run `ruby`.
<Aeyrix>
And the version is 2.x.
<Aeyrix>
`ruby --version`.
yh has quit [Ping timeout: 264 seconds]
Agoldfish has quit [Quit: G'Bye]
lampshades has joined #ruby
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Pupeno has joined #ruby
j_mcnally has joined #ruby
HotCoder has quit [Quit: My name is your name]
GitGud has joined #ruby
Pupeno_ has quit [Ping timeout: 256 seconds]
ItSANg___ has quit [Read error: Connection reset by peer]
ItSANgo_ has joined #ruby
stardiviner has joined #ruby
husanu has quit [Remote host closed the connection]
husanu has joined #ruby
x1337807x has joined #ruby
djbkd has joined #ruby
netmask has quit [Remote host closed the connection]
Yzguy has quit [Read error: Connection reset by peer]
tuelz has quit [Quit: WeeChat 1.1.1]
netmask has joined #ruby
GPrime has joined #ruby
DoubleMalt has joined #ruby
finisherr has joined #ruby
finisherr has quit [Client Quit]
<BrianBoyko>
Hey, if jhass comes by, tell him I got my thing working!
lennae has quit [Ping timeout: 255 seconds]
Rollabunna has joined #ruby
djbkd has quit [Ping timeout: 256 seconds]
lala has joined #ruby
havenwood has joined #ruby
lennae has joined #ruby
ItSANgo_ has quit [Ping timeout: 272 seconds]
nateberkopec has quit [Quit: Leaving...]
charliesome has quit [Quit: zzz]
wallerdev_ has quit [Ping timeout: 244 seconds]
ItSANgo_ has joined #ruby
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Rollabunna has quit [Ping timeout: 248 seconds]
masterprime has quit [Quit: ChatZilla 0.9.91.1 [Firefox 38.0.5/20150525141253]]
fabrice31 has joined #ruby
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Yiota has joined #ruby
mattbillock has quit [Remote host closed the connection]
_djbkd has quit [Remote host closed the connection]
Soda has joined #ruby
fabrice31 has quit [Ping timeout: 272 seconds]
hsps__ has joined #ruby
jtdoncas has joined #ruby
DroidBurgundy has quit [Remote host closed the connection]
hsps_ has quit [Ping timeout: 264 seconds]
dfockler has joined #ruby
masterprime has joined #ruby
_blizzy_ has joined #ruby
<masterprime>
Okay. Finally got putty and my keys working. I don't do this often so it can be a pain. I'm on ruby 1.8.7. Is there a command to get the latest stable version?
<Ox0dea>
?windows
<ruboto>
I don't know anything about windows
soxet has quit [Ping timeout: 246 seconds]
bkxd has joined #ruby
adamjleonar has joined #ruby
dfockler has quit [Ping timeout: 264 seconds]
DroidBurgundy has joined #ruby
DroidBurgundy has quit [Client Quit]
bkxd has quit [Ping timeout: 252 seconds]
adamjleonard has quit [Ping timeout: 272 seconds]
mary5030 has joined #ruby
axisys has joined #ruby
djbkd has joined #ruby
bkxd has joined #ruby
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
baxx has quit [Ping timeout: 255 seconds]
findaway has joined #ruby
enroxorz has joined #ruby
mary5030 has quit [Ping timeout: 248 seconds]
phutchins has quit [Ping timeout: 252 seconds]
PlasmaStar has quit [Ping timeout: 256 seconds]
jpfuentes2 has joined #ruby
haraoka has joined #ruby
datanoise has joined #ruby
avahey has quit [Quit: Connection closed for inactivity]
PlasmaStar has joined #ruby
cytoskeletor has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
masterprime has quit [Quit: ChatZilla 0.9.91.1 [Firefox 38.0.5/20150525141253]]
thomas is now known as oldmantom
balazs has joined #ruby
blahwoop has joined #ruby
ramfjord has quit [Ping timeout: 246 seconds]
marciotex has joined #ruby
nofxxxx has quit [Ping timeout: 252 seconds]
commondream has joined #ruby
Casty has joined #ruby
swgillespie has joined #ruby
Rickmasta has joined #ruby
Lucky_ has joined #ruby
adamjleonar is now known as adamjleonard
Lucky_ has quit [Client Quit]
commondream has quit [Ping timeout: 252 seconds]
rubie has quit [Remote host closed the connection]
Lucky_ has joined #ruby
nofxx has joined #ruby
nofxx has joined #ruby
Igorshp has joined #ruby
centrx has quit [Quit: Shutting down, Please wait...]
jtdoncas has quit [Ping timeout: 244 seconds]
erts has joined #ruby
Igorshp has quit [Ping timeout: 264 seconds]
workmad3 has joined #ruby
Rollabunna has joined #ruby
Eiam has joined #ruby
davorb has quit []
workmad3 has quit [Ping timeout: 250 seconds]
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
balazs has quit [Remote host closed the connection]
Rollabunna has quit [Ping timeout: 248 seconds]
darkf has joined #ruby
netmask has quit [Remote host closed the connection]
balazs has joined #ruby
charliesome has joined #ruby
aphprentice_ has joined #ruby
ra4king1 has joined #ruby
chris2 has quit [Ping timeout: 246 seconds]
ra4king1 has quit [Remote host closed the connection]
<BrianBoyko>
god help me, I'm in a "just one more commit" cycle... and I haven't eaten for 12 hours.
enroxorz has quit [Quit: Page closed]
Yiota has joined #ruby
lennae has quit [Ping timeout: 265 seconds]
scx has quit [Ping timeout: 256 seconds]
arescorpio has quit [Quit: Leaving.]
RegulationD has joined #ruby
netmask has quit [Remote host closed the connection]
braincrash has quit [Quit: bye bye]
netmask has joined #ruby
creakybones has quit [Ping timeout: 276 seconds]
rbennacer has joined #ruby
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
icosa has joined #ruby
acovrig has joined #ruby
ghostpl has joined #ruby
<acovrig>
given: “up time: 01:31:54, idle time: 06:01:03, sleep time: 00:00:00 “.match(//) what would I use for a regexp to get “01:31:54”? /(?:up time: )([0-9]{2}:[0-9]{2}:[0-9]{2})/
RegulationD has quit [Ping timeout: 252 seconds]
<acovrig>
nevermind, got that, now what about the 06:01:03 part?
blahwoop has quit [Remote host closed the connection]
<sevenseacat>
same thing?
rbennacer has quit [Ping timeout: 264 seconds]
<acovrig>
sevenseacat: then I would just get the 01:31:54.
netmask has quit [Remote host closed the connection]
<acovrig>
it might change order, I would like to match “up time “<time>, and not ‘capture’ the “up time “, it seems like I can do (?:<string to match, but not capture>), is that not right?
<EasyCo>
Hey team, I'm parsing an ugly date like so:
<ruboto>
EasyCo # => cannot load such file -- Date (LoadError) ...check link for more (https://eval.in/386544)
<zenspider>
case sensitive
<havenwood>
EasyCo: #=> "15/08/08"
<EasyCo>
Hah, yah, exactly, thanks.
<EasyCo>
Anyways, the date is actually 08/08/2015
pontiki has joined #ruby
Channel6 has joined #ruby
<EasyCo>
Anyway around that issue other then manually parsing the date using regex?
64MAC6DSJ has joined #ruby
<Ox0dea>
EasyCo: Date.strptime takes a second argument specifying the format to expect.
GitGud has quit [Ping timeout: 265 seconds]
coffee__cup has joined #ruby
<EasyCo>
Ox0dea: Thanks, I did not know that. I just noticed that the data I'm parsing has no standard date input so it's all over the shop... So strptime wont work, cool nonetheless. Cheers.
djbkd has quit [Quit: My people need me...]
konsolebox has joined #ruby
commondream has joined #ruby
netmask has joined #ruby
iamninja has quit [Read error: Connection reset by peer]
<Ox0dea>
EasyCo: I have known the torment of heuristical date parsing.
iamninja has joined #ruby
nahtnam has quit [Quit: Connection closed for inactivity]
<EasyCo>
Ox0dea: Yep, ~50 Google spreadsheets averaging a few thousand rows each with no normalized data to be parsed and exported into a specific system format. Fun Fun.
oo_ has quit [Remote host closed the connection]
tlarevo has joined #ruby
<Ox0dea>
EasyCo: Are you using Kiba?
oo_ has joined #ruby
<EasyCo>
Ox0dea: Nah, jus rolled my own
charliesome has quit [Quit: zzz]
<Ox0dea>
EasyCo: There's just something about homemade wheels, eh? :)
gix has quit [Ping timeout: 248 seconds]
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
balazs has quit [Remote host closed the connection]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
msnyon has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
gix has joined #ruby
<EasyCo>
Ox0dea: Yep, 166 lines of gorgeous regex and loops!
<Ox0dea>
acovrig: If you're not opposed to matching against the string several times, the two-argument form of String#[] is pretty convenient.
slawrence00 has quit [Read error: Connection reset by peer]
<shevy>
Ox0dea are you still sore that regex only treats $1 up to $9 in a special way?
<Ox0dea>
shevy: Remember it turned out that those are treated specially only insofar as they are artificially appended to the array returned by Kernel::global_variables?
<shevy>
yeah you angrily showed the code here
datanoise has quit [Ping timeout: 252 seconds]
<Ox0dea>
I still don't understand why that's done.
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
RegulationD has joined #ruby
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
gianlucadv has quit [Ping timeout: 264 seconds]
temp has joined #ruby
yardenbar has quit [Quit: Leaving]
dg-ratio1 has quit [Ping timeout: 256 seconds]
temp has quit [Client Quit]
ghostpl has joined #ruby
chris2 has joined #ruby
hanmac has joined #ruby
<shevy>
read the comment!
<shevy>
:D
x1337807x has joined #ruby
RegulationD has quit [Ping timeout: 265 seconds]
<Ox0dea>
> Returns an array of the names of global variables.
<Ox0dea>
Nowhere does it say "and also pretends that $1-9 aren't magic".
micmus has quit [Quit: Leaving]
freerobby has quit [Quit: Leaving.]
ghostpl has quit [Ping timeout: 250 seconds]
kriskropd has quit [Ping timeout: 256 seconds]
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Oka has quit []
<Ox0dea>
To be clear, I'm not really opposed to their being in there, but the rationale is certainly lost on me.
<Ox0dea>
Also, why doesn't English define aliases for them if they're so special?
scripore has quit [Quit: This computer has gone to sleep]
al2o3-cr has quit [Ping timeout: 256 seconds]
msnyon has joined #ruby
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
arup_r has quit [Quit: ChatZilla 0.9.91.1 [Firefox 38.0.1/2015051400]]
<Ox0dea>
All global variables are always "accessible".
DoubleMalt has joined #ruby
<zenspider>
even with -w it doesn't warn that it isn't defined
JayJay has quit [Quit: Page closed]
Cust0sLim3n has quit [Ping timeout: 255 seconds]
<Ox0dea>
Every global variable "exists", after a fashion, but it would certainly be unwise to include them all in Kernel::global_variables' output.
sfarley has quit [Remote host closed the connection]
<zenspider>
% ruby -we 'p $woot'
<zenspider>
-e:1: warning: global variable `$woot' not initialized
<Ox0dea>
$1-9 are just as magical as $10 and beyond, but it was decided that they should appear in the output of that method, and I'd really like to know why.
yardenbar has joined #ruby
<zenspider>
Ox0dea: probably an oversight. Send in a patch
jacaballero has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Ox0dea>
zenspider: In fact, nobu refactored the code that adds them six years ago.
<zenspider>
I don't find this nearly as interesting as you do. If you want it fixed, fix it.
<Ox0dea>
I am much more interested in the "why".
<zenspider>
$0 always needs to be there. $1 and up should probably only be there based on values in $~.to_a
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sepp2k has joined #ruby
<zenspider>
asking "why" in cases like this is a waste of time
wallerdev has quit [Quit: wallerdev]
Prawnzy| has quit [Quit: Bye]
djbkd has quit [Quit: My people need me...]
fedexo has quit [Ping timeout: 248 seconds]
wallerdev has joined #ruby
rdark has joined #ruby
rdark has quit [Client Quit]
rdark has joined #ruby
AlphaAtom has joined #ruby
eGGsha has joined #ruby
workmad3 has joined #ruby
sandstrom has quit [Quit: My computer has gone to sleep.]
oo_ has quit [Remote host closed the connection]
unshadow has joined #ruby
n008f4g_ has joined #ruby
zeroDivisible has quit [Ping timeout: 255 seconds]
funburn has quit [Quit: funburn]
rushed has left #ruby [#ruby]
ramfjord has quit [Ping timeout: 246 seconds]
workmad3 has quit [Ping timeout: 264 seconds]
bronson has joined #ruby
<ljarvis>
mornin'
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Bertg has joined #ruby
<maloik>
hiya
<flughafen>
yo ljarvis
oo_ has joined #ruby
datanoise has quit [Ping timeout: 256 seconds]
Rollabunna has joined #ruby
bronson has quit [Ping timeout: 244 seconds]
oo_ has quit [Remote host closed the connection]
Iskarlar has joined #ruby
oo_ has joined #ruby
wallerdev has quit [Quit: wallerdev]
dg-ratio1 has quit [Quit: WeeChat 1.2]
jenrzzz has quit [Ping timeout: 248 seconds]
Obfuscate has quit [Ping timeout: 272 seconds]
gkra_ has quit [Ping timeout: 264 seconds]
jenrzzz has joined #ruby
tlarevo has joined #ruby
Rollabunna has quit [Ping timeout: 264 seconds]
alex88 has joined #ruby
TinkerTyper has quit [Ping timeout: 265 seconds]
TinkerTyper has joined #ruby
stan has joined #ruby
saadq has joined #ruby
skade has joined #ruby
Sypheren has quit [Ping timeout: 248 seconds]
olistik has joined #ruby
sandstrom has joined #ruby
wildroman2 has joined #ruby
bkxd has quit [Ping timeout: 264 seconds]
doublemalt_ has joined #ruby
<saadq>
Out of curiosity, do you guys use a text editor or an IDE for Ruby?
DoubleMalt has quit [Ping timeout: 264 seconds]
pwnz0r has joined #ruby
<ljarvis>
saadq: I use vim
gkra has joined #ruby
troulouliou_dev has quit [Ping timeout: 272 seconds]
<saadq>
I've been using Vintage mode on Sublime Text, I've been thinking about switching over to vim
<sevenseacat>
i use sublime text.
Obfuscate has joined #ruby
<flughafen>
sevenseacat: vim
<sevenseacat>
what did you call me
<ljarvis>
lol
<flughafen>
oops, hahaha
<zenspider>
emacs, bitches
<flughafen>
zenspider uses bsd and hasn't showered in 3 years
<flughafen>
;)
<zenspider>
true facts
<zenspider>
dust baths don't count, right?
<flughafen>
not really. ask sevenseacat
<flughafen>
she likes dust
<sevenseacat>
heh
<sevenseacat>
I've tried atom, but don't see a reason to switch to it.
* flughafen
likes vim
wallerdev has joined #ruby
<flughafen>
but i do use eclipse for java stuff at work.
<zenspider>
I'm switching to the new visual studio editor
dfockler has joined #ruby
wildroman2 has quit []
* flughafen
will definitely switch to neovim
<zenspider>
try spacemacs
<flughafen>
zenspider: is it like emacs in spaced?
<flughafen>
space*
<zenspider>
apparently a lot of vimmers like it
<zenspider>
it's emacs w/ a strong vim influence, I guess
dfockler has quit [Ping timeout: 256 seconds]
white_bear has joined #ruby
lele has quit [Ping timeout: 250 seconds]
dumdedum has joined #ruby
saadq has quit [Remote host closed the connection]
troulouliou_dev has quit [Ping timeout: 265 seconds]
<adaedra>
which one?
wallerdev has joined #ruby
<haudoing>
can u check out the gist?
Jackneill has joined #ruby
<sevenseacat>
theres a lot of syntax in that code
<ddv>
haudoing: just a method that received and yields a block
jenrzzz has quit [Ping timeout: 276 seconds]
<ddv>
receives*
<haudoing>
I know do and end is like curly
[k- has joined #ruby
<haudoing>
ok.. so it's like a method?
<adaedra>
careful, because curly braces can mean two things: block and hash
andikr has quit [Remote host closed the connection]
bucaran has joined #ruby
<haudoing>
I thought we use "def" to define a method
<adaedra>
the code between do end is a block, that is passed as argument to service
k3asd` has joined #ruby
troulouliou_dev has joined #ruby
c0m0 has joined #ruby
<adaedra>
it's not exactly a method
<ddv>
haudoing: look up implementation
<bucaran>
hi folks, I am thinking of creating a "learning ruby from javascript" guide since I cant find a decent one, but maybe I havent looked hard enough
<bucaran>
do you know any?
vikaton has quit [Quit: Connection closed for inactivity]
Lucky_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<bucaran>
most guides have too many definitions and misc information, I am looking for a comprenhensive "here is ruby and then here is js" with pertinent notes and thats it, but i cant find anything decent
BrianBoyko has quit [Quit: Leaving]
<sevenseacat>
bucaran: just comparing the syntax? because theyre two different beasts in ideology
<sevenseacat>
lots of it doesnt translate
<bucaran>
@sevenseacat: those details can be explained via sidenotes IMO
<sevenseacat>
you want to explain object oriented programming via sidenotes?
<bucaran>
can totally skip that
<sevenseacat>
o.o
<sevenseacat>
but... you want to learn ruby, dont you?
<bucaran>
well, we have classes in es6 that are really wrappers for javascript prototypical inheritance model, but classes nevertheless, it does not have to be 100% perfect
<bucaran>
they support basic polyphormism via extend
mikecmpbll has joined #ruby
<bucaran>
this would be mostly for syntax and idiomatic ruby
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
GitGud has joined #ruby
<bucaran>
OO concepts that apply in ruby that do not apply in js (like what? may I ask) we can safely leave for later, I just want to get started
Rollabunna has joined #ruby
<bucaran>
flughagen: Thanks!
wallerdev has quit [Quit: wallerdev]
joonty has joined #ruby
<flughafen>
bucaran: there is tab autocomplete
<bucaran>
flughafen: Got it! :)
<bucaran>
irrsi?
<flughafen>
bucaran: most all of them?
<bucaran>
flughafen: :) hehe k
wallerdev has joined #ruby
<bucaran>
indeed
<adaedra>
IRC clients that do not do tab-complete are not worthy.
yh has joined #ruby
<bucaran>
worthy of what?
<adaedra>
worthy.
<flughafen>
they aren't worthy of being worthy
<bucaran>
at all?
<bucaran>
too strict
scx_ is now known as scx
<bucaran>
havent looked too hard into irrsi customization options, but is it possible to change the UI colors? like e.g, the time stamp would be nicer if gray
<[k->
I thought it's irssi
wallerdev has quit [Client Quit]
<ytti>
bucaran, there are probably 100s of themes in irssi homepages
oo_ has joined #ruby
<bucaran>
thanks
Zai00 has joined #ruby
ghostpl_ has quit [Remote host closed the connection]
Scrofff has joined #ruby
Rollabunna has quit [Ping timeout: 248 seconds]
yfeldblum has quit [Ping timeout: 248 seconds]
Scroff has quit [Read error: Connection reset by peer]
<flughafen>
bucaran: use weechat
prinsen has joined #ruby
<bucaran>
I was looking for a quick, one liner to make the stamp gray right away, but Ill get me some nice themes
tlarevo has quit [Remote host closed the connection]
<zenspider>
ddv: you don't know that yields the block
<bucaran>
test
<zenspider>
only that the service call receives one
User458764 has joined #ruby
Renich has joined #ruby
senayar has joined #ruby
<bucaran>
ytti: themes are working, but the time stamp color does not change, damn software
ghostpl has joined #ruby
al2o3-cr has quit [Ping timeout: 246 seconds]
yfeldblum has joined #ruby
<yorickpeterse>
morning
oo_ has quit [Remote host closed the connection]
<[k->
morning
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
chridal has quit [Ping timeout: 250 seconds]
danielpclark has quit [Ping timeout: 276 seconds]
Siyfion has joined #ruby
ahmetkapikiran has joined #ruby
chridal has joined #ruby
bkxd has quit [Ping timeout: 264 seconds]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
postmodern has quit [Quit: Leaving]
marr has joined #ruby
bkxd has joined #ruby
<bucaran>
> puts "hi"
EasyCo has quit [Quit: Connection closed for inactivity]
ahmetkapikiran has quit [Ping timeout: 252 seconds]
<bucaran>
how can I type ruby code from here? is there like a bot or something roaming these channel?
ahmetkapikiran has joined #ruby
<flughafen>
bucaran: it's in your console and it's called irb
car has joined #ruby
symm- has quit [Ping timeout: 264 seconds]
User458764 has joined #ruby
Igorshp has joined #ruby
pagios has joined #ruby
<bucaran>
flughafen: some channels do have a bot that let you do this
<ljarvis>
bucaran: you can use ruboto (the channel bot) by prepending >> -- however, that's just for demonstration purposes, you should use irb as flughafen says
<bucaran>
flughafen: just asking if there is one in _this_ channel
<[k->
?experiment
<ruboto>
Please use your local irb or pry (see ?pry) to experiment, ruboto's eval functionality is for demonstration purposes only.
<pagios>
hi guys, can i do something like currentConfig = [ "`ip route | awk '/default/ { print $3 }'`" ] , embed the result of a command directlyu in a array element?
<ljarvis>
pagios: did you try it?
<pagios>
i am checking if it is good practice
<ljarvis>
if it works, it's fine
<bucaran>
ljarvis: thanks
oo_ has joined #ruby
<pagios>
it works, thanks
<ljarvis>
pagios: you should use snake_case variable names though
<bucaran>
bear w me, im a ruby newbie, so what is this "namespace" method/function in rails?
<bucaran>
namespace :symbol do stuff end
<ljarvis>
bucaran: pardon?
<adaedra>
?rails
<ruboto>
Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
<bucaran>
wrong channel?
<ljarvis>
bucaran: namespace is just a method, but yes for rails questions you should check out the other channel
<bucaran>
well, I wonder if this is really a rails question tho
<ljarvis>
the non-rails part I just answered
<bucaran>
it's a method, K
<bucaran>
thx
Igorshp has quit [Ping timeout: 252 seconds]
danielpclark has joined #ruby
pwnz0r has quit [Remote host closed the connection]
quimrstorres has joined #ruby
oo_ has quit [Ping timeout: 246 seconds]
lele has joined #ruby
al2o3-cr has joined #ruby
quimrstorres has quit [Remote host closed the connection]
lkba has quit [Ping timeout: 265 seconds]
andikr has joined #ruby
joneshf-laptop has quit [Ping timeout: 272 seconds]
<pagios>
whats a quick way of creating an array of object like javascript: array = [ {name: 'X' ,age:'Y' } , {name: 'A' , age: 'B' } ] ?
<ljarvis>
pagios: did you try the same thing in Ruby?
<pagios>
lol no
<ljarvis>
:/
<ljarvis>
i guess you should probably *try* before you ask for help, as willing as we all are
<[k->
people use hash rockets for compatibility with 1.8
<[k->
so you should keep that in mind
<flughafen>
i will forever be a hashrocketer
<[k->
18>> {a:_""}
<ruboto>
[k- # => /tmp/execpad-7c7e45f0272e/source-7c7e45f0272e:2: syntax error, unexpected tSYMBEG, expecting kDO or ...check link for more (https://eval.in/386666)
quimrstorres has joined #ruby
<adaedra>
or because you want to have something else than a symbol as key
<[k->
18>> {a:""}
<ruboto>
[k- # => /tmp/execpad-f547fcf0357a/source-f547fcf0357a:2: syntax error, unexpected tSYMBEG, expecting kDO or ...check link for more (https://eval.in/386667)
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<[k->
turdurr
<[k->
the a: syntax doesn't work in 1.8
michael_mbp has quit [Excess Flood]
al2o3-cr has quit [Read error: Connection reset by peer]
<adaedra>
or because the => syntax is more explicit (I use it in .join in Sequel, :fk => :id is more explicit)
michael_mbp has joined #ruby
<adaedra>
(imo)
rubie has joined #ruby
<ljarvis>
adaedra: than fk: :id?
<adaedra>
yeah, there's the idea of the first pointing to the other one
<ljarvis>
heh
<[k->
I prefer the a: syntax
<[k->
"": doesn't work as you expect, does it
abuzze has joined #ruby
olblak has joined #ruby
txdv_ is now known as txdv
<yorickpeterse>
It does in 2.2
patrick_star has quit [Ping timeout: 244 seconds]
rubie has quit [Ping timeout: 265 seconds]
<ljarvis>
not really, unless you actually expect it to be a symbol
<[k->
no, it just turns into a symbol (2.2.0p0)
Bertg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
troulouliou_dev has quit [Remote host closed the connection]
ahmetkapikiran has quit [Quit: ahmetkapikiran]
<[k->
of what
blackmesa has joined #ruby
<yorickpeterse>
err wait, I don't think I got that entirely right
yh has joined #ruby
<pagios>
ljarvis: i know how to do it via Class decleration, any easier way|?
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<yorickpeterse>
That "only" invalidates class/constant caches IIRC
senayar has joined #ruby
senayar has joined #ruby
Rollabunna has joined #ruby
<[k->
def an_instance.==
patrick_star has joined #ruby
<yorickpeterse>
pagios: what are you trying to do?
<yorickpeterse>
Ruby is not Javascript, you're not supposed to create random objects and define methods on them directly
<pagios>
yo61: store an object with different properties and then access these properties :)
<yorickpeterse>
That's common in a prototype based language such as JS/self, but not Ruby
<yorickpeterse>
For Ruby you use classes, or Struct if you have to
<[k->
>> Class A; end; a = A.new; def a.== *args; true; end; a == Hash
<ruboto>
[k- # => /tmp/execpad-362b91361538/source-362b91361538:3: syntax error, unexpected keyword_rescue, expecting ...check link for more (https://eval.in/386688)
<yorickpeterse>
hey what the, seems OpenStruct on 2.2 doesn't flush global method caches anymore
<yorickpeterse>
unless I'm doing dumb things
CustosLimen has joined #ruby
<yorickpeterse>
either way it defines methods dynamically, so that's going to hurt in some shape or form
<[k->
Class A; end; a = A.new; def a.== *args; true; end; a == Hash;
skade has quit [Ping timeout: 264 seconds]
workmad3 has joined #ruby
<[k->
pls wait while I try this out
<ljarvis>
pagios: you can use a Hash just like you've been doing
havenwood has quit [Ping timeout: 252 seconds]
terlar has joined #ruby
skade has joined #ruby
<[k->
it works!
<tomjoro>
That's a common thing to do when passing options to a method.. but in new ruby you could also used named parameters which is cleaner
Rollabunna has quit [Ping timeout: 244 seconds]
roolo has joined #ruby
<yorickpeterse>
[k-: eh yeah, you can define singleton methods on any objects
<yorickpeterse>
* object
<[k->
you can actually monkey patch hash to accept .call
<[k->
>> class Hash; alias_method :call, :[]; end; a = {a: "b"}; a.(:a)
khebbie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jesterfraud>
[k-, but why would you do that anyway?
<[k->
it is less elegant than [] tho
<jesterfraud>
hashes are hashes, and you use them as such
<[k->
to make it resemble JavaScript ;-;
<adaedra>
don;t
<adaedra>
don't
<jesterfraud>
that's a reason not to :P
<adaedra>
js is js, ruby is ruby
<[k->
I'm obviously not going to use that
bronson has joined #ruby
ndrei has quit [Ping timeout: 264 seconds]
<[k->
I'm not sure what pagios wants ;-;
<pagios>
hash hash
<pagios>
works for me
<pagios>
:D
skade has quit [Quit: Computer has gone to sleep.]
qiukun has joined #ruby
<[k->
OK :D
Xeago has joined #ruby
<qiukun>
hi i’d like to find something like ipython for ruby
<qiukun>
there are iruby
<[k->
what is this ipython
<qiukun>
ipython notebook
ndrei has joined #ruby
<flughafen>
[k-: it's like irb or the python interperter console but good
<qiukun>
however iruby could use sth like %time
<[k->
why not submit a pull request!
skade has joined #ruby
<_mh_>
IO.popen and co seems to set $? after the spawned child terminated. Is there any less ugly way to get the exitcode of a terminated child process?
<[k->
the Ruby community will <3 u
fantazo has joined #ruby
<qiukun>
well, my coding power isnt that strong yet
<qiukun>
<3
<[k->
the iruby team will review your code and suggest changes as long as you state that you aren't that good in ruby
multi_io has quit [Read error: Connection reset by peer]
<[k->
at least I hope so
Xeago has quit [Remote host closed the connection]
<_mh_>
an iruby sounds very interesting.
bronson has quit [Ping timeout: 264 seconds]
<[k->
mh: require English ;-;
<bnagy>
_mh_: check out Open3
sandstrom has quit [Quit: My computer has gone to sleep.]
<bnagy>
there are a bunch of useful capture methods, depending on what else you want to know about the execution
_blizzy_ has quit [Ping timeout: 248 seconds]
<[k->
it looks cool
<bnagy>
afaik you can't get a straight up code, though, you get a crappy Process::Status thing
<_mh_>
Process::Status is fine... just $? is driving me nuts
<bnagy>
I know, I hates it. :(
<_mh_>
esp. as I can't get any document telling me how long this var survives :(
<[k->
you could just define a method that fetches it, although that would be costly
<bnagy>
_mh_: until something else sets it
<bnagy>
which I'm sure is hilarious if you're threading
multi_io has joined #ruby
<_mh_>
yeah, likely :(
Xeago has joined #ruby
<_mh_>
[k-: I would be curious as to how you would manually fetch it. the API doc doesn't yield anything I recognized.
<bnagy>
I haven't looked at src for capture2 etc...
fabrice31 has quit [Remote host closed the connection]
sandstrom has joined #ruby
<bnagy>
oh it just threads out itself and gets the return value from the Thread
<bnagy>
that should actually be safe \o/
<_mh_>
well... at least something.
fabrice31 has joined #ruby
<[k->
don't know, didnt use processes in my life
Xeago has quit [Remote host closed the connection]
Renich has quit [Quit: leaving]
<_mh_>
Hmm... Process#waitpid2 using the pid of the io...
<_mh_>
bnagy: that seems a usable approach, still ugly as hell, but better as $?
<bnagy>
what are you trying to do?
<_mh_>
bnagy: I just want to wait for a command to terminate and read it's exit code.
<bnagy>
17:22 < bnagy> _mh_: check out Open3
<_mh_>
open3's another gem... adding gems to our project here at work is ... let's say interesting.
<bnagy>
what?
<bnagy>
it's stdlib
<_mh_>
uuh? okay, I'm confusing it with something then. Cancel everything after good morning.
<_mh_>
bnagy: going to look at it, thanks.
khebbie has joined #ruby
<bnagy>
_b
<haudoing>
hello
<Ox0dea>
haudoing: Hau doing?
<ljarvis>
heuheuheu
<[k->
haha
lugub has joined #ruby
<lugub>
how do we read from stdin mid way through a program?
<lugub>
like a getch
<[k->
gets
<lugub>
AH
<lugub>
thanks
<[k->
yw
<haudoing>
Ox0dea: what's up
<Ox0dea>
haudoing: I'm making Kernel.global_variables less of a liar. :)
<ruboto>
yorickpeterse # => "== disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>>==========\n0000 trace 1 ...check link for more (https://eval.in/386745)
<ruboto>
yorickpeterse # => "== disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>>==========\n0000 trace 1 ...check link for more (https://eval.in/386746)
<yorickpeterse>
^ check links, instructions are exactly the same
<[k->
pls why so deep
<bnagy>
thanks :)
<yorickpeterse>
The bikeshedding occurs because people have no idea how to measure performance
<yorickpeterse>
"OMG DOUBLE QUOTES SO SLOW SUCH IMPORTANT WOW"
<ruboto>
[k- # => undefined local variable or method `stdin' for main:Object (NameError) ...check link for more (https://eval.in/386749)
<lugub>
yorickpeterse: could optsparse be taking away from gets?
<bnagy>
yorickpeterse: yeah I'm having a half-argument with a friend on twitter and I was too lazy to check whether it's 'not worth worrying about' or "exactly the same"
<yorickpeterse>
lugub: no idea, hard to tell without any code
yh has quit [Ping timeout: 265 seconds]
<yorickpeterse>
bnagy: if they're argueing about it I recommend them to learn how to write a benchmark
<Ox0dea>
Then your Enter is being picked up by STDIN.getc.
<lugub>
ahhh
RegulationD has joined #ruby
<Ox0dea>
Pressing Enter puts a newline into the input stream.
<[k->
I know they are different, but I never said they were the same
<lugub>
so do I clear STDIN on each iteration?
<zenspider>
either use gets or don't hit enter
Rickmasta has joined #ruby
<Ox0dea>
Or require 'io/console' and use STDIN.getch.
<zenspider>
or deal with bad input better
eGGsha has joined #ruby
<Ox0dea>
lugub: Easiest would be to use STDIN.gets instead of STDIN.getc, and then just String#chomp off the newline before comparing the input with "y".
<lugub>
right, I sorted. gets and answer.chomp!
<lugub>
zenspider: its just a script, I don't need to worry about bad input
<lugub>
thanks guys :D took a while
chinmay_dd has quit [Read error: Connection reset by peer]
chinmay_dd has joined #ruby
<lugub>
there would be no memory worry because I'm calling ping on itself again right? is it good practice?
<bnagy>
fwiw I write those a "Hit [enter] to continue, or ^C to abort"
<Ox0dea>
lugub: You're using unbounded recursion, so your stack would overflow given enough invalid input.
ahmetkapikiran has joined #ruby
sepp2k has quit [Quit: Leaving.]
RegulationD has quit [Ping timeout: 248 seconds]
<bnagy>
y/n is for when you have a choice of "do this or not" but you're going to continue anyway
<lugub>
0x0dea: what would be the best practice?
hectortrope has joined #ruby
<zenspider>
that's a LOT of invalid input. doesn't matter here since "it's just a script"
aryaching has joined #ruby
<Ox0dea>
Right, you would need *a lot* of invalid input before it became a problem.
sepp2k has joined #ruby
bosma has quit [Ping timeout: 255 seconds]
<lugub>
yeah I thought so
<[k->
3000+?
<Ox0dea>
lugub: It's a really little thing, but not having to press Enter is a nice user experience.
<[k->
I prefer if you shift the user input out of ping
fabrice31 has quit [Remote host closed the connection]
SOLDIERz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ziprar is now known as zipace
Zai00 has quit [Quit: Zai00]
roolo has quit [Remote host closed the connection]
grzywacz has quit [Ping timeout: 276 seconds]
Macaveli has joined #ruby
joneshf-laptop has joined #ruby
sdothum has joined #ruby
ItSANgo has joined #ruby
Xeago has joined #ruby
RandyT has joined #ruby
baxx has joined #ruby
Asher1 has joined #ruby
senayar has quit [Remote host closed the connection]
RandyT_ has quit [Ping timeout: 244 seconds]
ndrei has quit [Ping timeout: 272 seconds]
Soda has quit [Remote host closed the connection]
ItSANgo_ has quit [Ping timeout: 256 seconds]
connor_goodwolf has quit [Ping timeout: 252 seconds]
Xeago has quit [Ping timeout: 246 seconds]
<[k->
did he leave before my suggestion? ;-;
Asher has quit [Ping timeout: 272 seconds]
sandstrom has joined #ruby
<lugub>
right I get you
<lugub>
no I'm still here :)
fabrice31 has joined #ruby
withnale_ has quit [Read error: Connection reset by peer]
neohunter has joined #ruby
wildroman2 has quit [Remote host closed the connection]
<[k->
:3
nettoweb has joined #ruby
Miron has quit [Ping timeout: 252 seconds]
ndrei has joined #ruby
nofxx has quit [Ping timeout: 252 seconds]
connor_goodwolf has joined #ruby
phutchins has joined #ruby
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
fabrice31 has quit [Read error: Connection reset by peer]
haudoing has quit []
fabrice31_ has joined #ruby
datanoise has joined #ruby
ta has quit [Read error: Connection reset by peer]
fabrice3_ has joined #ruby
fabrice31_ has quit [Read error: Connection reset by peer]
ta has joined #ruby
oo_ has quit [Remote host closed the connection]
CloCkWeRX has quit [Ping timeout: 256 seconds]
datanoise has quit [Ping timeout: 264 seconds]
CloCkWeRX has joined #ruby
Rollabunna has joined #ruby
oo_ has joined #ruby
Miron has joined #ruby
kith_ is now known as kith
tvw has joined #ruby
axilla has joined #ruby
connor_goodwolf has quit [Read error: Connection reset by peer]
grzywacz has joined #ruby
rodfersou has joined #ruby
Rollabunna has quit [Ping timeout: 248 seconds]
danielpclark has quit [Ping timeout: 250 seconds]
<yh>
Should a Ruby Gem specify in its Gemfile the exact version of dependencies it uses?
<jhass>
yh: rubygems doesn't read Gemfile's
unclouded has quit [Ping timeout: 246 seconds]
<jhass>
only .gemspec's
<yh>
jhass: my bad, I did mean gemspec actually
<jhass>
well, for determining a gem's dependencies that is these days
lennae has quit [Ping timeout: 272 seconds]
<yh>
Otherwise, it's leaving the decision to the consuming application's Gemfile.lock, which seems to open it to fault if it was programmed to a version that had a bug patched, say
<jhass>
and no, I'd say be as permissive as possible
maxshelley has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Bertg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Rollabunna has joined #ruby
<yorickpeterse>
hrmpf, distributed synchronization using AWS autoscaling tags is an interesting problem
* yorickpeterse
checks if he didn't put drugs in his tea this morning
thelastinuit has joined #ruby
bkxd has quit [Ping timeout: 244 seconds]
<yorickpeterse>
this would be nicer if AWS had some sort of CAS operation for their API
<yorickpeterse>
but alas
IanV0rn has joined #ruby
x44x45x41x4E has joined #ruby
DroidBur_ has joined #ruby
DroidBurgundy has quit [Read error: Connection reset by peer]
terlar has quit [Ping timeout: 246 seconds]
<shevy>
hanmac, yeah; if there is one guy that is even crazier than you are, it is Ox0dea
Rollabunna has quit [Ping timeout: 248 seconds]
neohunter has quit [Ping timeout: 246 seconds]
I has joined #ruby
DroidBur_ is now known as droidburgundy
I is now known as Guest54477
denver has joined #ruby
ndrei has quit [Ping timeout: 246 seconds]
ndrei has joined #ruby
ashemark has joined #ruby
langlands has joined #ruby
<[k->
^
ruv has joined #ruby
ashemark has quit [Client Quit]
yardenbar has quit [Ping timeout: 256 seconds]
ringarin has quit [Ping timeout: 276 seconds]
langland_ has quit [Ping timeout: 250 seconds]
zeroDi has joined #ruby
Bertg has joined #ruby
shredding has joined #ruby
chinmay_dd has quit [Read error: Connection reset by peer]
jpfuentes2 has joined #ruby
chinmay_dd has joined #ruby
zeroDivisible has quit [Ping timeout: 256 seconds]
terlar has joined #ruby
hectortrope has quit [Quit: WeeChat 0.4.2]
last_staff has joined #ruby
treehug88 has joined #ruby
roolo_ has joined #ruby
tkuchiki has quit [Remote host closed the connection]
tkuchiki has joined #ruby
RegulationD has joined #ruby
dgutierrez1287 has quit [Remote host closed the connection]
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rbennacer has joined #ruby
ahmetkapikiran has quit [Quit: ahmetkapikiran]
dblessing has joined #ruby
roolo has quit [Ping timeout: 244 seconds]
datanoise has quit [Ping timeout: 248 seconds]
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
whippythellama has joined #ruby
<shevy>
I'd wish ruby would somehow be simpler to use extensively
Bertg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Guest54477 has quit [Quit: This computer has gone to sleep]
<shevy>
Something opinionated that is streamlined.
RegulationD has quit [Ping timeout: 255 seconds]
<shevy>
for instance, i find myself to use this here a lot:
<shevy>
RbConfig::CONFIG['sitelibdir']+'/foobar/'
<shevy>
for a gem project called foobar
yh has joined #ruby
<shevy>
any better way to obtain the base directory for a project?
Rickmasta has joined #ruby
JoshL has joined #ruby
<[k->
sitelibdir?
<ljarvis>
shevy: that isn't accurate..
nateberkopec has joined #ruby
ndrei has quit [Ping timeout: 265 seconds]
Bertg has joined #ruby
endash has joined #ruby
<ljarvis>
just use File.expand_path('..', __FILE__)
devdazed has quit [Quit: Computer has gone to sleep.]
<yorickpeterse>
that isn't much more accurate either
<ljarvis>
at least it'll point to the file and not *anything*
<ljarvis>
i don't even know what "base directory for a project" means though
<adaedra>
just use __dur__ ?
<adaedra>
__dir__*
senayar has quit [Remote host closed the connection]
<shevy>
lemme test
Xeago has quit [Remote host closed the connection]
<[k->
it's funny we have __LINE__ __FILE__ but dir is __dir__
tomjoro has quit [Remote host closed the connection]
<adaedra>
iirc, it's because __LINE__ and __FILE__ are keywords, not __dir__
Igorshp has quit [Remote host closed the connection]
<ljarvis>
yeah __dir__ is a method
fmcgeough has joined #ruby
oo_ has quit [Remote host closed the connection]
<[k->
guess it doesn't make sense for dir to be a keyword
scripore has joined #ruby
ndrei has joined #ruby
endash has quit [Quit: endash]
malconis has joined #ruby
abuzze has quit [Remote host closed the connection]
<shevy>
your two solutions do not work
yardenbar has joined #ruby
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shevy>
they refer to the specific file in question rather than the base directory for a project
<ljarvis>
shevy: what are you actually trying to do?
<shevy>
RbConfig::CONFIG['sitelibdir']+'/foobar/' <-- always yields to you the base directory of a given project
Xeago has joined #ruby
<ljarvis>
no
<shevy>
your solution does?
<ljarvis>
it doesn't
<ljarvis>
what is "the base directory of a given project"
<ljarvis>
what does that even mean?
<shevy>
what is so hard to understand
<shevy>
you have a project called "foobar"
<shevy>
it'll be installed into the SITE_DIR
malconis has quit [Remote host closed the connection]
<ljarvis>
a project? Ruby has no concept of "project"
<shevy>
everything works relative to site dir
<shevy>
require 'foobar' # there we go
havenwood has joined #ruby
<ljarvis>
sigh
<shevy>
so could you now please provide an alternative?
lugub has quit [Quit: Bye]
<[k->
$LOAD_PATH?
fabrice31 has joined #ruby
<shevy>
I think that'll just be an Array of all the paths respectively that ruby will search through
<adaedra>
Your base dir has to be defined somewhere, as it is not something native to ruby
fabrice31_ has quit [Read error: Connection reset by peer]
<ccooke>
shevy: correct. What are you actually doing with this directory once you have calculated it?
Bertg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<shevy>
ccooke I use it to load all files that belong to said project
CloCkWeRX has quit [Ping timeout: 256 seconds]
abuzze has joined #ruby
jerius has joined #ruby
<shevy>
adaedra I usually follow a simple scheme, main-name like module Foo, path would be foo/ and there will be a foo.rb respectively
yh__ has joined #ruby
ta has quit [Remote host closed the connection]
<shevy>
In the past I used Pathname
rubie has joined #ruby
<ccooke>
shevy: so basically you want to load some ruby code that exists in a directory structure?
fgo has joined #ruby
<shevy>
ccooke yeah but it is already a gem actually; all my projects are essentially gems, mostly (save for some old code)
<ljarvis>
OH
<ljarvis>
it's a gem is it?
<ljarvis>
thanks for mentioning that
<shevy>
all. my. projects. are. gems
<shevy>
and I use setup.rb for installation as well
<shevy>
all the structures I use are gem-compatible as well
<adaedra>
I. feel. anger. in. there.
<shevy>
and I can install them with or without gem
* ljarvis
walks away
<sevenseacat>
lol
<shevy>
yeah because ljarvis isn't helping
hectortrope has joined #ruby
Xeago has quit [Remote host closed the connection]
<adaedra>
yeah, of course.
<ccooke>
shevy: that wasn't clear. The use of "Project" instead of "gem" is confusing, especially when people ask what you mean by "project" (Which is not a defined term in Ruby). So, you have a gem that needs to load dependant things automatically.
senayar has joined #ruby
senayar has joined #ruby
<shevy>
no, I have a project that can be like a gem
Bertg has joined #ruby
<shevy>
and no, it does not "need" to load anything; everything already works just fine
<sevenseacat>
*like* a gem?
<shevy>
<shevy> any better way to obtain the base directory for a project?
<adaedra>
If it ain't broken, don't fix it
malconis has joined #ruby
<shevy>
adaedra yeah that is fine, I can retain the current way but I am wondering if there are better ways
<ccooke>
shevy: __FILE__ on the root .rb file of the project.
yh has quit [Ping timeout: 264 seconds]
<ccooke>
That is the most accurate way to be sure.
<shevy>
ah
<shevy>
I see what you mean
Iskarlar has joined #ruby
<shevy>
I was using it on a file one directory structure down
Igorshp has joined #ruby
<shevy>
ok
bentanweihao has joined #ruby
<adaedra>
File.expand_path is here to help with relativity to a given path...
<ccooke>
Set it to a constant in the root .rb, then refer to it from the loaded file?
bruno- has quit [Ping timeout: 276 seconds]
<ccooke>
that way you have an easy way to load it, at least.
<shevy>
ccooke yeah
blackmesa has joined #ruby
ziprar has joined #ruby
<shevy>
that way it'll give the correct path
<ccooke>
Foo::BASEDIR is - if loading things from a base directory is important - perfectly reasonable.
rubie has quit [Ping timeout: 265 seconds]
<[k->
why not use json!
<ccooke>
and it's a *lot* less to type :-)
<[k->
then it's extensible!
<shevy>
thanks
lxsameer has joined #ruby
konsolebox has quit [Ping timeout: 272 seconds]
lxsameer has quit [Changing host]
lxsameer has joined #ruby
husanu has quit [Remote host closed the connection]
husanu has joined #ruby
ahmetkapikiran has joined #ruby
nettoweb has joined #ruby
GarethAdams has quit [Ping timeout: 252 seconds]
bentanweihao has quit [Client Quit]
zipace has quit [Ping timeout: 255 seconds]
luzidco has joined #ruby
abuzze_ has joined #ruby
<mikecmpbll>
is there a more sensible way to implement a min_by method that returns all the members of the collection that share the same min value than: array.select{ |x| x.foo == array.min_by { |y| y.foo }.foo } ?
Xeago has joined #ruby
roolo has joined #ruby
<apeiros>
mikecmpbll: for starters, only find the min value once
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<adaedra>
yeah, save the min in a variable and just select on x.foo == min
<apeiros>
instead of on every iteration
<mikecmpbll>
this is true.
jpfuentes2 has joined #ruby
khebbie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
crazydiamond has quit [Remote host closed the connection]
iceyec has joined #ruby
<mikecmpbll>
thanks :)
<[k->
array.lazy.map(&:foo).select { |x| x == min }
abuzze has quit [Ping timeout: 256 seconds]
<adaedra>
don't really need this .lazy
JakFrist has joined #ruby
GarethAdams has joined #ruby
Rollabunna has joined #ruby
<adaedra>
and this only returns you a table of the min value
<adaedra>
s/table/array/
<mikecmpbll>
yeah, that's a problem.
einarj has joined #ruby
<mikecmpbll>
i'll go with what i had but with the optimisation.
roolo_ has quit [Ping timeout: 256 seconds]
<adaedra>
it's not a bad way, just don't calculate the min at each time.
<mikecmpbll>
indeed.
<apeiros>
if it proves to be too slow, there's 2 alternatives. but I would only try those routes if min_by followed by select is indeed too slow.
<mikecmpbll>
nah, not slow just aiming for readability and general making sense-ness.
<apeiros>
then definitively this solution.
soulcake has quit [Ping timeout: 277 seconds]
<mikecmpbll>
ok thanks :)
<[k->
aww
jpfuentes2 has quit [Ping timeout: 252 seconds]
CloCkWeRX has joined #ruby
<[k->
.lazy ensures it doesn't loop twice
eGGsha has joined #ruby
soulcake has joined #ruby
<[k->
I wish Ruby had currying sometimes
drewvanstone has joined #ruby
<apeiros>
[k-: it'll probably still be slower, though
mtakkman has joined #ruby
<adaedra>
anyway, it doesn't return any sensible value in your sample
chinmay_dd has quit [Remote host closed the connection]
<[k->
you deserve a slap for not following convention
mrmargolis has quit []
<apeiros>
there's plenty of people who advocate not converting the return value of ? methods to boolean, instead just use the truthiness of whatever you query
<apeiros>
(which I find horrible - it's a potential leak)
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<[k->
:/
<apeiros>
[k-: oh, I do. my ? methods strictly return true/false.
* apeiros
is right back
<apeiros>
would that be `/me irb`?
<[k->
we should have <@> while we are at it
<[k->
html!
arup_r has quit [Remote host closed the connection]
<ytti>
i don't see added value of adding
<apeiros>
that'd be quite confusing to say in a ruby channel, huh? :D
<havenwood>
[k-: It's how Ruby works. It may be unintuitive for you at first but it's not surprising when you're accustomed.
Hounddog has quit [Read error: Connection reset by peer]
chinmay_dd has joined #ruby
Xeago has joined #ruby
sanguisdex has joined #ruby
<[k->
;-;
soulcake has quit [Ping timeout: 276 seconds]
abuzze has quit [Ping timeout: 252 seconds]
mtakkman has quit [Ping timeout: 246 seconds]
<[k->
that's why I prefer staticly typed
ivorpad has joined #ruby
<[k->
staticallg
<[k->
derp
ValicekB_ has joined #ruby
soulcake has joined #ruby
ValicekB_ is now known as ValicekB
husanu1 has joined #ruby
kristofferR has joined #ruby
abuzze_ has quit [Remote host closed the connection]
RegulationD has joined #ruby
bruno- has joined #ruby
shredding has quit [Ping timeout: 272 seconds]
livathinos has quit []
<apeiros>
stalactite typing?
<jhass>
crystal is doing that a lot more for ? methods, it even has Hash#[]? ;D
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<apeiros>
pondered having appended ? as a generic boolean conversion in my toy lang
sfarley has joined #ruby
denver has quit [Ping timeout: 272 seconds]
<apeiros>
sooo, what did I want to work on?
<adaedra>
ruby
<havenwood>
[k-: I say it's not surprising once you're accustomed but a few years ago Rails had a kerfuffle where some folk argued for `true` and `false`. They were rebuffed but it comes up.
Xeago has quit [Remote host closed the connection]
<jhass>
chronos for crystal
<apeiros>
adaedra: that'd be "with", not "on" :)
<adaedra>
nuclear weapons
<adaedra>
HELLO NSA
<apeiros>
nucular
<[k->
kerfuffle?
denver has joined #ruby
<apeiros>
I think I'll work on my valaptor lib. need that for quite a couple of things :)
<[k->
crystal's type system isn't doing enough imo
<havenwood>
[k-: See Mirah or Crystal if you're yearning for types. Or upcoming versions of Rubinius and Ruby may have some variant of optional/gradual/soft typing.
<[k->
dbc on github? no
<[k->
I've seen where you type Contract on top of defs
startupality has quit [Read error: Connection reset by peer]
<apeiros>
I do wonder though - a cracker could consider the max entropy to still be 256, by treating it as binary. even a bit less, by treating it as "anything valid utf-8". no?
<ClassyCritic>
havenwood: yes, that's the problem I'm receiving
<ClassyCritic>
havenwood: I'm new to Ruby, and I'm not quite sure how to fix it
k3asd` has joined #ruby
startupality has joined #ruby
<[k->
China will crack your password no problem
<volty>
that's true — total length of n bytes can still be reduced to cracking just that bytes
<volty>
s/can still/ is/
<adaedra>
This is an HTTP error ClassyCritic, your distant service don't want you to access what you're trying to access
<ClassyCritic>
adaedra: so no way around?
atomical has quit [Ping timeout: 248 seconds]
AlexRussia has quit [Remote host closed the connection]
<adaedra>
not ruby-side, I'd say - except if you have a problem in your request building
<adaedra>
try to access it with curl -v (url)
<jhass>
ClassyCritic: there's always a way around. Though if they make it hard consider if it's legal
x44x45x41x4E has quit [Remote host closed the connection]
sdwrage has joined #ruby
symm- has joined #ruby
<ClassyCritic>
jhass: Just trying to draw some mens soccer statistics from the NCAA website
<volty>
I remember the first time I was trying to crypto something, shifting, rolling, moving, and at the end in the binary I had the same password shown over the space chars :)
ahmetkapikiran has joined #ruby
<volty>
(or zeroes, can't remember)
<havenwood>
ClassyCritic: For example if they forbid certain user agent strings, you could change yours to something they don't forbid. As already mentioned, examine the legality before you bypass being forbidden.
<Tai15>
that's an interesting thought. i use passphrases already and speak Chinese. It never occured to me to use a Chinese passphrase.
<havenwood>
Tai15: :)
fantazo has joined #ruby
<adaedra>
makes sense, if you're sure you can type it anywhere you may need
<Tai15>
and I use traditional characters. those commies would be completely fooled!
<adaedra>
“commies”
senayar has quit [Remote host closed the connection]
I has joined #ruby
pontiki has joined #ruby
coderhs has joined #ruby
I is now known as Guest37459
<Tai15>
sorry, a bad joke adaedra, HK and Taiwan use different characters than communist china
* jhass
makes his next password out of box drawing characters
<adaedra>
Tai15: ah ok
<apeiros>
jhass: tetronomicon password :D
<volty>
maybe drawing chinese ideograms on a bitmap. but as apeiros pointed out, for a cracker it's just a sequence of bytes / chars / whatevers
<jhass>
mmh, or all these lovely different spaces
unshadow has quit [Quit: leaving]
umgrosscol has joined #ruby
<jhass>
narrow non-breaking space zero width space wide space
atomical_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<apeiros>
oh, fez calls it "tetronimo"
scripore has quit [Quit: This computer has gone to sleep]
coderhs has quit [Client Quit]
<apeiros>
jhass: yeah, there's at least 8 of them
<apeiros>
(spaces)
<adaedra>
all those spaces
<pontiki>
ooooo, one for every day of the week plus a spare!
<jhass>
RTL mark could be a fun addition too
psy_ has joined #ruby
anisha has quit [Quit: Leaving]
<adaedra>
poor RTL
<jhass>
my password is all spaces, but from right to left!
<apeiros>
haha
yalue has quit [Read error: Connection reset by peer]
atomical has joined #ruby
droidburgundy has joined #ruby
<Tai15>
brilliant jhass
connor_goodwolf has joined #ruby
<shevy>
unicode spaces?
<adaedra>
meh, I keep hunter2, at least it's easy to type.
freerobby has joined #ruby
Iskarlar has joined #ruby
<shevy>
no
<shevy>
you are french
<shevy>
it would be:
<shevy>
unter2
<Tai15>
adaedra, that just showed up as ******* for me
<dudedudeman>
oonter2*
<jhass>
reminds me I should try to learn neo2 again, which has all kind of nice symbols accessible
finisherr has joined #ruby
<adaedra>
shevy: …
<shevy>
lol Tai15
sinkensabe has quit [Remote host closed the connection]
AlexRussia has joined #ruby
<adaedra>
Tai15: of course it did, IRC protect my password
<adaedra>
*+s
* Tai15
nods
<apeiros>
I use a single space as password everywhere.
<apeiros>
nobody ever tries that :o)
<jhass>
I wonder how many sites you can trip with trailing space
<shevy>
I think some require more minimal characters
<jhass>
like stripping it during input but not during validation or vice versa
<shevy>
I had to change my gmail password to 9 characters... I hated that
scripore has joined #ruby
<jhass>
shevy: just use a sentence, you're easily beyond 20
<apeiros>
shevy: I would hate it too if I had to reduce the length of my password
jpfuentes2 has joined #ruby
<shevy>
jhass but then I'd type even more!!!
<Tai15>
i use a password manager that's a 20 character mix of random upper,lower, and numbers
volty has quit [Ping timeout: 246 seconds]
<apeiros>
shevy: you type your passwords?!? o0
<Tai15>
i'm amazed at how many sites i have to manually chop off 4 characters for it
<shevy>
apeiros yeah
<apeiros>
well…
<apeiros>
Tai15: yeah
<Tai15>
and then they yell at me that I need a special character
<adaedra>
I type my passwords too
volty has joined #ruby
<Tai15>
>:-(
<adaedra>
I trust no password manager
<apeiros>
it's annoying how many sites think they have to add an upper limit to pw length
<apeiros>
I mean, 255 I'd understand
ValicekB has quit []
<apeiros>
but anything below it just doesn't make sense.
<pontiki>
the stored field is likely 255 anyway :>
<shevy>
do you want to use shakespeare as password?
<adaedra>
It's hashed anyway
<[k->
they have databases types to fulfill
JoshL has quit [Read error: Connection reset by peer]
<apeiros>
storage can't be the reason either if they're doing it correctly.
<[k->
they also have space restrictions
<Tai15>
idk, my password manager is only for online stuff so I figure it's not the weakest link
<apeiros>
the hash will be the same length, no matter how long the pw
<Tai15>
my local encryption is all diceware passwords
<shevy>
Tai15 YOU are the weakest link :)
<adaedra>
all passwords have the same length in DB...
<volty>
the character set should be limited at the expense of the length
freerobby has quit [Quit: Leaving.]
freerobby has joined #ruby
<apeiros>
the default for characters would probably be \p{Any}
endash has joined #ruby
endash has quit [Client Quit]
lkba has quit [Read error: Connection reset by peer]
<volty>
n * (set) === 2 * n * (set / 2)
<apeiros>
and encoding: 'utf-8'
rbennacer has quit [Read error: Connection reset by peer]
motivated has joined #ruby
dorei has quit [Remote host closed the connection]
rbennacer has joined #ruby
Macaveli has quit [Ping timeout: 276 seconds]
<dudedudeman>
how the eff does one test for datetime in minitest
<motivated>
how to learn the oops concept?
<apeiros>
motivated: practice
Guest37459 has quit [Quit: Leaving]
terlar has quit [Ping timeout: 244 seconds]
<shevy>
motivated thing of ants
<shevy>
erm, *think
Xeago has quit [Remote host closed the connection]
dopie has joined #ruby
<volty>
naaa, not ants
dorei has joined #ruby
<volty>
absolutely
fabrice31 has quit [Remote host closed the connection]
<shevy>
class Ant
[k-_ has joined #ruby
<shevy>
ant_452356 = Ant.new
<shevy>
ant_452357 = Ant.new
[k-_ is now known as [k
Scroff has quit [Read error: Connection reset by peer]
railsraider has quit [Quit: railsraider]
Scroff has joined #ruby
<volty>
the best example for learning oop is geometry — position (coordinates), point, shape, etc etc
<motivated>
where i can practice?
<volty>
nothing better than that
jlast has joined #ruby
hahuang65 has joined #ruby
Xeago has joined #ruby
speakingcode has quit [Ping timeout: 246 seconds]
<volty>
motivated: on your desk?
<Tai15>
hey, while i'm hanging out with you guys, does anyone have any experience with any of the tools like RUBYMOTION that allow you to write cross-platform apps in Ruby
<apeiros>
Tai15: #rubymotion has plenty I'd guess ;-)
<Tai15>
or just experience with writing apps in ruby at all
nickfausnight has quit [Quit: Connection closed for inactivity]
<jhass>
?anyone ;)
<ruboto>
;), Just ask your question, if anyone has or can, they will respond.
<shevy>
it should not be too difficult to have it work on linux and windows at the same time
<Tai15>
i didn't really have a question about it specifically, just wondered if anyone had any opinions about which ones worked well. i'm thinking about trying my hand at some app development for a speciality market, and ruby is my strongest language
<Tai15>
...and I just realized I responded to a bot
<shevy>
?anyone jhass would now tell you about anyone
<ruboto>
jhass, Just ask your question, if anyone has or can, they will respond.
<Tai15>
._.
luzidco has left #ruby [#ruby]
<shevy>
damn, that bot truncates
principessa has joined #ruby
<shevy>
Tai15 happened to someone else too, about yesterday or so
nettoweb has joined #ruby
<shevy>
ruboto just looks so clever and innocent
<Tai15>
hehe, thanks shevy :-)
hahuang65 has quit [Ping timeout: 256 seconds]
scripore has quit [Quit: This computer has gone to sleep]
droidburgundy has quit [Remote host closed the connection]
<volty>
shevy: have you done something with ruboto ?
<volty>
or somebody else, here ?
<shevy>
volty I haven't
scripore has joined #ruby
<apeiros>
shevy: it doesn't truncate. the command is simply `?<factoid> <target nickname>`
<_blizzy_>
hmm, RestClient or Faraday
codecop has quit [Remote host closed the connection]
sinkensabe has quit [Remote host closed the connection]
sfarley has quit [Remote host closed the connection]
<apeiros>
JSON is serialized data.
<apeiros>
a hash is not serialized.
<l0oky>
Does that mean JSON is better? ?
r0bby_ has joined #ruby
<l0oky>
:D
pengin has quit [Remote host closed the connection]
<apeiros>
oh dear
<apeiros>
no, it doesn't mean that.
<l0oky>
JK
<pontiki>
flee!! FLEEEEE!!!!
<l0oky>
HAHHA
<Tai15>
hehe
<havenwood>
Ruby Object Notation (RON) is different than JavaScript Object Notation (JSON).
<adaedra>
!quote l0oky
sinkensabe has joined #ruby
Igorshp has quit [Remote host closed the connection]
langlands has joined #ruby
sfarley has joined #ruby
GitGud has joined #ruby
Iskarlar has joined #ruby
<l0oky>
Well both serve the same purpose and they're different in nature i guess
r0bby_ has quit [Client Quit]
Or1on has quit [Ping timeout: 244 seconds]
<havenwood>
l0oky: Are you familiar with YAML, Marshal, etc?
endash has joined #ruby
<l0oky>
havenwood: not really.. :D
<startupality>
what requirements is gmail using for threading, does it decide only on subject and senders, or it includes in-reply-to, references header to decide which email should be in the same thread with which?
<l0oky>
YAML actually a template engine?
robbyoconnor has quit [Ping timeout: 272 seconds]
<l0oky>
I think I've used it in node.js express
ndrei has joined #ruby
diegoviola has quit [Ping timeout: 255 seconds]
<Sou|cutter>
startupality: mostly seems like subject to me.
volty has joined #ruby
<havenwood>
l0oky: Check the docs for them and you'll see they're actually the serialization business.
<slash_nick>
Does anyone have any info on the performance of a method with implicit block vs method with explicit block... that is, is `def foo; yield; end` somehow more performant than `def foo(&block); yield; end` ???
<apeiros>
slash_nick: &block is faster for passing the block on. for everything else, yield is faster.
senayar has quit []
<apeiros>
e.g. `def my_each(&block); @my.each(&block); end` is better than `def my_each; @my.each do |*args| yield(*args); end; end`
IanV0rn has joined #ruby
<apeiros>
but `def my_yielder; yield 1, 2, 3; end` is better than `def my_yielder(&block); block.call(1, 2, 3); end`
<apeiros>
bundle is the command provided by the bundler gem
<Darkwater>
there is for me
inoic has joined #ruby
<shevy>
wmoxam currently I am reading up on organic chemistry and biochemistry; biochemistry is ok, I don't like organic chemistry too much... to reach compound D, starting from A, over B and C... hard to know what rules to apply when, how and where...
<apeiros>
maybe they've added it because too many were confused that bundler's executable was called bundle…
<greensoup>
apeiros: both seem to appear in my path when I install the bundler gem.
<shevy>
bundler should provide a bin/bundle file greensoup
<apeiros>
greensoup: anyway, just inspect it?
<Darkwater>
maybe it's for people who expect bundler's binary to be called bundler
<Darkwater>
ie. same as package name
<apeiros>
…
<shevy>
no sorry my mistake
<apeiros>
that's what I meant
bosma has joined #ruby
<shevy>
I just realized that bundler provides bin/bundle and also bin/bundler
<Darkwater>
oh read straight over that, sorry
<wmoxam>
shevy: ah, I assumed you were using a different language
<greensoup>
they are identical looking script files. I was wondering if there was something deeper that looked at the args and acted differently
<shevy>
wmoxam ah, nah... I still want to learn something new... C is on my immediate list... but if I look at university lectures and exams, it's a lot of C++ and Java...
<[k>
you can use a diff checker
endash has quit [Quit: endash]
<shevy>
strangely enough, bundle and bundler differ
<shevy>
in one line:
<greensoup>
someone in #travis said one worked locally for him when the other didn't. which surprised me.
<shevy>
if path =~ %r'/bundler-0\.(\d+)' && $1.to_i < 9
<shevy>
if path =~ %r'/bundler-0.(\d+)' && $1.to_i < 9
CalvinnHobbes has quit [Ping timeout: 244 seconds]
<shevy>
greensoup well almost identical :-)
<shevy>
but I may not have the most recent bundler... 1.9.4 or so
<[k>
could be a bug
creakybones has quit [Ping timeout: 244 seconds]
yfeldblum has joined #ruby
OrbitalKitten has joined #ruby
zz_Outlastsheep is now known as Outlastsheep
arturhoo has joined #ruby
msnyon has quit [Read error: Connection reset by peer]
<greensoup>
shevy: weird. mine are completely identical to each other. but programs can always act differently based on the values of argv or something like that.
<greensoup>
but I doubt that's the case here
Virtual_ has joined #ruby
<shevy>
I just realized... my favourite ruby philosophy is not the TIMTOWTDO or DRY or anything else but this quote from matz:
<shevy>
"Instead of emphasizing the what, I want to emphasize the how part: how we feel while programming."
<shevy>
greensoup well perhaps it was fixed in later versions
<shevy>
I find it confusing that two almost same-names are provided though
<shevy>
perhaps because people were wondering why "bundle" worked for a project called "bundler" hehehe
msnyon has joined #ruby
<Virtual_>
I'm having some trouble with Ruby gems on Arch Linux is this the right to place to seek help
<shevy>
yeah Virtual_
<shevy>
jhass is using arch btw
<shevy>
so he can answer!
centrx has joined #ruby
<Outlastsheep>
Virtual_: I use Arch, though I'm not a super-guru.
<Outlastsheep>
I can keep bashing my head into the wall until either one of the two breaks, or jhass comes in.
<Senjai>
?use Virtual_
<ruboto>
Virtual_, Don't ask "does anyone use <thing>?". It's better to just state your problem and if anyone has used <thing> they will most likely answer.
<Outlastsheep>
What seems to be the problem?
OrbitalKitten has quit [Client Quit]
Gnubie_ has joined #ruby
OrbitalKitten has joined #ruby
<Virtual_>
well i'm trying to install the gem 'gosu' with 'gem install gosu' I get no problems from that until I try to require gosu in irb and it tells me it can't find gosu
<Virtual_>
or any other gem im trying for that matter
<wmoxam>
shevy: Java is pretty boring ;)
<wmoxam>
shevy: it's good to know some C though
<Outlastsheep>
Hmm.
<apeiros>
Virtual_: sounds like your irb and your gem command don't use the same ruby
towski_ has quit [Remote host closed the connection]
<jhass>
Virtual_: did you change anything opposed to the defaults? gist your gem env output
shinnya has joined #ruby
<shevy>
wmoxam yeah
<apeiros>
Virtual_: what does `command -v ruby` show? and what does `gem env` list as "RUBY EXECUTABLE"?
rodfersou|lunch is now known as rodfersou
CustosLimen has joined #ruby
shadoi has joined #ruby
<shevy>
Virtual_ do you have more than one ruby? also, study the output of "gem env" or ideally upload that information to gist or somewhere
sukki07 has joined #ruby
<shevy>
if we all repeat it once, it will stick :)
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
jmoles is now known as cubicool
nertzy has quit [Quit: This computer has gone to sleep]
<cubicool>
Hey guys... I'm having a hard time figuring this out. I am developing some Ruby code I want to EVENTUALLY Gem-ify, so I'm keeping the directory struct and code laid out properly. However...
jtbnyc69 has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
<cubicool>
I'm having trouble USING this code (locally) without going through the rigamole of 'gem build; gem install' every time I make a small change. Is there any alternative?
<miah>
load your code in irb/pry.
NeverDie has joined #ruby
hahuang65 has joined #ruby
Iskarlar has quit [Ping timeout: 252 seconds]
<cubicool>
I don't follow...
jtbnyc69 has joined #ruby
xelkarin has joined #ruby
IanV0rn has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<cubicool>
Is there no way to simply symlink to my module.rb/module directories in the project that USES the Gem?
yardenbar has quit [Ping timeout: 276 seconds]
dstarh has joined #ruby
nofxx has joined #ruby
nofxx has joined #ruby
muhammadn has quit [Ping timeout: 265 seconds]
<miah>
you can use require_relative, or modify the ruby load path, or write tests so that you can test your code in isolation without the external gem
<miah>
s/external gem/external project
subtwo has quit [Quit: (null)]
casadei has joined #ruby
shadeslayer has joined #ruby
Xeago has quit [Remote host closed the connection]
<cubicool>
Ruby load path, that sounds promising. I'll google. :)
B1n4r10 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
[k- has quit [Quit: -a- IRC for Android 2.1.25]
baweaver has joined #ruby
Scrofff has joined #ruby
B1n4r10 has joined #ruby
<shevy>
miah as long as you have a cat next to the pickaxe it's ok
baroquebobcat has joined #ruby
hahuang65 has joined #ruby
nateberkopec has joined #ruby
mtakkman has quit [Ping timeout: 256 seconds]
Scroff has quit [Ping timeout: 264 seconds]
k3asd` has quit [Ping timeout: 256 seconds]
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<andywojo>
Anyone know of a good way / gem to tackle running sudo on a remote system via SSH? I've lately just been doing system calls %x[ssh #{host} "sudo -S cmd"]
ghostpl has quit [Ping timeout: 276 seconds]
<andywojo>
It stinks though for handling return codes / issues
asmodlol has joined #ruby
<andywojo>
all of the gems to do SSH natively without resorting to system calls stinks
c0m0 has quit [Ping timeout: 246 seconds]
greensoup has quit [Ping timeout: 246 seconds]
sukki07 has quit [Quit: Page closed]
Yiota has joined #ruby
gianlucadv has joined #ruby
husanu has quit [Remote host closed the connection]
husanu has joined #ruby
Yiota has quit [Client Quit]
Bertg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<apeiros>
I really wish ruby/gems had a canonical way to handle optional dependencies.
langlands has quit [Ping timeout: 244 seconds]
sfarley has joined #ruby
langlan__ has joined #ruby
exadeci has quit [Quit: Connection closed for inactivity]
Zai00 has joined #ruby
Luun has quit [Quit: Luun]
<jhass>
like "recommends" in distro package managers?
<Senjai>
apeiros: If they're optional, they aren't dependencies. But yes, I agree, but thats their argument and it also makes sense
<Senjai>
I would like a Gemfile.local or something
<Senjai>
to also load the gems for that, that wouldn't be committed and things
<apeiros>
Senjai: I'd disagree
IanV0rn has quit [Read error: Connection reset by peer]
<apeiros>
they are a dependency under a given condition
piet_ has joined #ruby
<apeiros>
"if you want to use feature X, Y is a dependency"
Igorshp has joined #ruby
<apeiros>
but please, tell me a better term
greensoup has joined #ruby
IanV0rn has joined #ruby
<Senjai>
Feature X should therefore be its own gem then.
<apeiros>
eager to learn :)
<Senjai>
Again, another argument they have made
<Senjai>
:P
blue_deref has quit [Ping timeout: 252 seconds]
<jhass>
Senjai: well, bundler has 1.10 has optional groups now, so you could spam your gemfile with developer tools and not install them by accident
<Aria>
Conditional dependency makes sense. But I think we'd do well to avoid them.
<apeiros>
Senjai: seriously not :-)
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<piet_>
how bad is performance when using method_missing
<Aria>
piet_: performance of what?
<centrx>
This bad <----->
<Senjai>
jhass: lol nice. But I still would want a Gemfile.local
<apeiros>
Senjai: example: email address validation, optionally resolving the domain
adamjleonard has joined #ruby
<apeiros>
Senjai: you don't seriously tell me you'd split the latter part into its own gem? that makes about zero sense to me…
langland_ has quit [Ping timeout: 264 seconds]
<apeiros>
(the dependency is simpleidn btw - because resolve can't handle IDNs)
<jhass>
Senjai: also install_if so you could do install_if: -> { `whoami` == "Senjai" } xD
<Senjai>
I'm not saying that. Its just an argument I've seen made
<Senjai>
install_if is terrible
<jhass>
but maybe don#t
<apeiros>
and I think the argument is flawed :)
<Senjai>
apeiros: Right, but you have to be able to convince THEM of that :)
<apeiros>
there *may* be cases where that's a way to work around it
nertzy has joined #ruby
rubie has joined #ruby
<apeiros>
Senjai: atm, YOU are THEM :-p
<apeiros>
as you're arguing on THEIR behalf :D
<Senjai>
Oh, I see, but I cant argue a point I already disagree with
<Senjai>
I'm simply saying that this conversation has gone on forever in github issues
<apeiros>
piet_: benchmark it
<Senjai>
and this is the stuff they come up with
<piet_>
just wondering how heavily i should rely on alias_method_missing type behavior in a rails app
<Senjai>
You could theoretically wrap a bunch of crap in if defined? blocks, too, but thats lamesauce
<apeiros>
well, my current way to deal with it: add the dependency in the gemspec. document in the readme that it's only needed for given feature. use a custom require with a descriptive info in case of failure.
charliesome has joined #ruby
Scroff has quit [Remote host closed the connection]
Scroff has joined #ruby
IanV0rn has quit [Read error: Connection reset by peer]
segfalt has joined #ruby
joaomdmoura has joined #ruby
Yiota has joined #ruby
<Senjai>
apeiros: I would just go the if defined? route. And tell people if x gem is included, behavior will differ
<Senjai>
or make it a configuration option
Xeago_ has joined #ruby
<Senjai>
allowing them to plug in a class
<Senjai>
Similiarly with how you can switch rails' default json parser to Oj
Luun has joined #ruby
<diegoviola>
HAL: This mission is too important for me to allow you to jeopardize it.
<Senjai>
aspiers: Honestly, everything at this moment can be solved with clean composition
<Senjai>
For email address validation, you could have a base adapter, and a GemSpecializedAdapter, and have them set to use the GemSpecializedAdapter if they want it.
<Senjai>
as a configuration option
balazs has quit [Remote host closed the connection]
<Senjai>
That way it can be declared as a development dependency, and is optional to the user
<Senjai>
The only downside of it being that its not obviously optional from the gemspec
peter_paule has joined #ruby
Scroff has quit [Ping timeout: 276 seconds]
<apeiros>
Senjai: I don't like that approach.
<apeiros>
it makes it harder for the user.
Scroff has joined #ruby
<apeiros>
I see, you suggested two approaches. but I also see that I'd say the same about the second approach :D
Xeago has quit [Ping timeout: 272 seconds]
sarkyniin has joined #ruby
<Senjai>
It adds a configuration step, which I agree adds oweness to the user, but I wouldnt say it'd make it harder
<Senjai>
if a user cant figure out how to MyGem.configure {|c| c.email_parser = ThingClass }
<Senjai>
they have larger issues
<Senjai>
and if its well documented, and in the readme, its literally just a copy and paste
dionysus69 has quit [Quit: dionysus69]
<Senjai>
and that's -only- if you dont want the change in behavior automatic
khebbie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Senjai>
if you want it automatic, you could use if defined? craziness to determine what adapter to use
jenrzzz has joined #ruby
uxp_ is now known as uxp
IanV0rn has joined #ruby
<Senjai>
apeiros: Just to reiterate, I agree with you that optional deps would be cool. I'm more talking about how it could be solved with composition now. So I'm not disagreeing with you.. just being clear :)
sarkyniin has quit [Remote host closed the connection]
<apeiros>
Senjai: oh, yes, I got that
baxx has quit [Quit: WeeChat 0.4.2]
<apeiros>
and thanks for your suggestions
peter_paule has quit [Ping timeout: 272 seconds]
Virtual_ has quit [Ping timeout: 277 seconds]
Virtual_ has joined #ruby
_seanc_ has quit [Read error: Connection reset by peer]
_seanc__ has joined #ruby
<apeiros>
sorry, I scold others for not being thankful when they get support which they don't/can't use. so I should do better myself :D
<apeiros>
s/being/expressing/
phutchins has quit [Ping timeout: 272 seconds]
piet_ has quit [Quit: leaving]
railsraider_ has joined #ruby
railsraider has quit [Ping timeout: 246 seconds]
railsraider_ is now known as railsraider
Tai15 has quit [Read error: Connection reset by peer]
railsraider has quit [Client Quit]
platzhirsch has left #ruby [#ruby]
Tai15 has joined #ruby
<Senjai>
Oh all good, never thought that way. Just wanted to make sure that errone knew what I was talkin bout
peter_paule has joined #ruby
Tai15 has quit [Read error: Connection reset by peer]
Xeago_ has quit [Remote host closed the connection]
balazs has joined #ruby
sarkyniin has joined #ruby
IanV0rn has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sinkensabe has joined #ruby
carter1 has joined #ruby
langlan__ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Outlastsheep is now known as zz_Outlastsheep
sfarley has quit [Remote host closed the connection]
sinkensabe has quit [Remote host closed the connection]
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ledestin has joined #ruby
peter_paule has quit [Ping timeout: 250 seconds]
DexterLB has quit [Ping timeout: 252 seconds]
greensoup has quit [Ping timeout: 255 seconds]
nertzy has quit [Quit: This computer has gone to sleep]
elia has joined #ruby
bluOxigen has joined #ruby
chinmay_dd has quit [Remote host closed the connection]
bruno- has quit [Ping timeout: 252 seconds]
bb010g has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
tomphp has joined #ruby
aphprentice has quit [Remote host closed the connection]
startupality has quit [Quit: startupality]
vikaton has joined #ruby
choke has joined #ruby
rjno has quit [Remote host closed the connection]
sandstrom has quit [Quit: My computer has gone to sleep.]
jahrichie has joined #ruby
balazs has quit [Remote host closed the connection]
rjno has joined #ruby
zacts has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
nua has quit [Remote host closed the connection]
<Senjai>
Ugh
<Senjai>
I have a terrible question
<Senjai>
I want to expect that any number of instances will receive 2 calls of a method total
<Senjai>
across all instances
<Senjai>
It is TERRIBLE, I understand
<apeiros>
Senjai: in a test? mocking?
<Senjai>
apeiros: Yes
<Senjai>
specifically, active record
<Senjai>
in a non rails project
<apeiros>
I guess the test double framework would matter as information ;-)
centrx has quit [Quit: Shutting down, Please wait...]
JDiPierro has joined #ruby
cj__ is now known as cj
<dfockler>
can you yield a new Sorting class that contains the state of your list as you sort it with each call
atomical_ has joined #ruby
<apeiros>
dfockler: hm? you use an array because that's how you commonly sort by multiple values with sort_by
<dfockler>
ah ok
scripore has quit [Quit: This computer has gone to sleep]
x1337807x has joined #ruby
sinkensabe has joined #ruby
skade has joined #ruby
elia has quit [Quit: Computer has gone to sleep.]
subtwo has joined #ruby
atomical has quit [Ping timeout: 248 seconds]
<apeiros>
e.g., `people.sort_by { |person| [person.first_name, person.last_name, person.age] }` works without sorting gem too
atomical_ has quit [Client Quit]
<hal_9000>
hmm. it would be *possible* to write an “invert” function for a string, to sort oppositely :)
baroquebobcat has joined #ruby
sebbers has quit [Read error: Connection reset by peer]
<apeiros>
what sorting gem adds is asc(value)/desc(value) to sort the individual values ascending/descending
<apeiros>
and it allows you to deal with nil values
<hal_9000>
just like sorting by -x for numeric
<apeiros>
hal_9000: that's precisely what desc does
scripore has joined #ruby
sinkensabe has quit [Remote host closed the connection]
<apeiros>
just in a generic way
<apeiros>
not just for strings
<hal_9000>
it doesn’t just reverse the comparison?
uptownhr has joined #ruby
<hal_9000>
that would be the way i would “really” do it
<apeiros>
I thought that's what you mean
tjbiddle has joined #ruby
<apeiros>
it creates an invertedly sorting value by having its <=> inverted
frem has joined #ruby
bronson has joined #ruby
<hal_9000>
oh - i meant you could create a function for strings analogous to - for numbers — but in real life, that would be umb
<hal_9000>
*dumb
<apeiros>
not sure that'd be possible
<apeiros>
but even if - it'd be more expensive anyway
<apeiros>
both memory and cpu
<hal_9000>
yes, mostly just kidding
jahrichie has quit [Quit: Leaving.]
<hal_9000>
i think i recognize your nick, but “get info” does not work for me in colloquy now
<Senjai>
apeiros: I believe that kind of construct would benefit from returning an object instead of an unnamed data structure thats all :P
<Obfuscate>
hal_9000, apeiros: If you have a sequence in ascending order, then you already have it sorted in descending order as well: you merely need to iterate over the sequence from right to left rather than left to right.
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jahrichie has joined #ruby
catcher has joined #ruby
<hal_9000>
Obfuscate: true enough, but that does not help in formulating a block for sorting, right?
flughafen_ has quit [Ping timeout: 252 seconds]
<catcher>
How can I assign the results of a block to a var?
jenrzzz has joined #ruby
<hal_9000>
catcher: var = meth { block }
doertedev has quit [Quit: leaving]
sinkensabe has joined #ruby
<hal_9000>
assuming meth returns tha block value
peter_paule has quit [Ping timeout: 246 seconds]
<hal_9000>
or var = block.call or var - yield
<Obfuscate>
hal_9000: True multi-indexed containers can have the same property, since each index is a constraint on the retrieval order.
rjno has quit []
speakingcode has joined #ruby
<catcher>
hal_9000, does meth already exist in your example?
<hal_9000>
catcher: well, i was assuming that was some method name - but it may not apply in your situation
<Obfuscate>
hal_9000: The problem is that sorting in most languages (rather than actual databases) is adhoc.
rbennacer has quit [Remote host closed the connection]
<catcher>
in pseudocode, I'm trying to do this: foo = { ...do some things, return a string... }
<hal_9000>
catcher: you could always do: foo = proc { blah }.call
rbennacer has joined #ruby
tomphp has joined #ruby
spygame has joined #ruby
baweaver has joined #ruby
<apeiros>
Obfuscate: try to apply that with multiple values.
<spygame>
hey guys, i have some conditions stored in the database like field_name operator value and i wanna build if else out of this. how is this possible using ruby
asmodlol has quit [Ping timeout: 256 seconds]
<Senjai>
?code spygame
<ruboto>
spygame, We can't help you without your code, please post it to https://gist.github.com
blahwoop has joined #ruby
elia has joined #ruby
<catcher>
hal_9000, that works, thanks. Is that a relatively normal way to do it?
sinkensabe has quit [Remote host closed the connection]
<blahwoop>
is there a better way to write this find_min method? min = array[0]; array.each { |num| min = num if num < min };min
<scpike>
blahwoop: you could use inject, but don't use this in the real world: array.inject() { |min, x| (min && min < x) ? min : x }
<bougyman>
◀▬▬ is not a bot
<Senjai>
spygame: You can do that, you just shouldn't
ta has quit [Remote host closed the connection]
<Senjai>
Why do you have to do that
<Senjai>
Specifying an operator is... no
jacor has quit [Read error: Connection reset by peer]
<Senjai>
You can maybe store a class name, and have a instance of that class be responsible for calculation
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jacor has joined #ruby
<Senjai>
but even then.. theres usually a better way to do whatever it is you're trying to do
tomphp has joined #ruby
Xeago has quit [Read error: Connection reset by peer]
<blahwoop>
scpike: o boy. ur right lol
<spygame>
Senjai: i don't think i get it completely. so you are saying have everything store in a separate class but again how do i do the calculation ?
balazs has quit [Ping timeout: 256 seconds]
<Senjai>
spygame: I dont have enough context about the problem you're trying to solve
bruno- has joined #ruby
<jhass>
mmh, do we have ?context already
<jhass>
?context
<ruboto>
Please add more context to your question, what are you doing, why are you doing it, which libraries are involved. Post some code to gist if it clarifies your question.
<jhass>
\o/
<scpike>
blahwoop: actually without a first arg to `inject` it passest in the first element of the collection, so you can just do `.inject { |min, x| min < x ? min : x }`
<scpike>
neat
<apeiros>
Obfuscate: it does not work when you have different orientations
<spygame>
Senjai: so i have a form where you can build certain conditions. like selecting the field_name and operator and what should be the desired value. so its a bunch of conditions like if this and that or that then do this
Kricir has quit [Remote host closed the connection]
freerobby has joined #ruby
<jhass>
and what problem does that form solve?
<Senjai>
^
<spygame>
and i'm storing each condition as a row in the db
<Senjai>
spygame: We're just going to ask "Why?" until you tell us what the actual problem is :P
<spygame>
it acts like a filter for user submitted values
<Senjai>
Get us to a point where we cant ask why anymore
<jhass>
are you implementing a DSL by treating data as logic?
<Senjai>
spygame: Why?
kirun has quit [Quit: Client exiting]
last_staff has quit [Quit: last_staff]
luzidco has quit [Quit: Bye, bye...]
<sweeper>
so like, lisp?
luzidco has joined #ruby
<jhass>
heh
luzidco is now known as Guest83840
<diegoviola>
I like writing Ruby code
rbennacer has quit [Remote host closed the connection]
<jhass>
spygame: how many operators are there, how are the actions defined and is there a defined set of those
Alayde_ has quit [Ping timeout: 246 seconds]
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<apeiros>
diegoviola: despite what people say, not everything is an object.
<apeiros>
it's a keyword, yes. like def. yes.
<diegoviola>
ok thanks
Guest83840 has quit [Quit: Bye, bye...]
spygame has quit [Ping timeout: 246 seconds]
<diegoviola>
people should stop saying that everything is an object
<Senjai>
E.g, you do not return.new(myreturnvalue)
commondream has quit [Remote host closed the connection]
<Senjai>
diegoviola: Every "thing" is an object
<Senjai>
return is not a "thing"
<Senjai>
you cannot pass it around
<slash_nick>
Senjai: so... is a keyword an object?
<Senjai>
def is not a thing
<scpike>
Senjai: %r can be nice in small doses
Zai00 has joined #ruby
<Senjai>
a keyword in the form of a symbol :keyword is
<Senjai>
If that's what you emant
spygame has joined #ruby
B1n4r10 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Xeago has joined #ruby
maxshelley has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
fabrice31 has quit [Ping timeout: 248 seconds]
<diegoviola>
thanks
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
hck89 has joined #ruby
<jhass>
spygame: I still don't get it, you only did the "add code" part of ?context. I'd suggest you answer Senjai's questions (in case you didn't get it)
griffindy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Igorshp has quit [Remote host closed the connection]
sumark has quit [Remote host closed the connection]
s2013 has joined #ruby
joshbamboo2 has quit [Quit: Leaving]
<spygame>
jhass: i'm sorry, i was searching in log to find Senjai's question :) . So i'm not sure how to explain this. Its a rules based system where you define certain rules which basically is if/else condition(s) and if the statement is true you perform a certain action. why am i doing this? i guess i'm replicating a system and that's the business requirement if that's serves as an explanation
sumark has joined #ruby
RegulationD has quit [Remote host closed the connection]
Xeago has quit [Remote host closed the connection]
__butch__ has joined #ruby
<_blizzy_>
havenwood, thxs.
<havenwood>
_blizzy_: There the literal is a bit more than 6x as fast.
Xeago has joined #ruby
<_blizzy_>
ok then. I'll use literal.
<Ontolog>
Gemfile question. Suppose I have a couple of gems I personally want to use for development and debugging (e.g., "awesome_print"), but I don't want to make changes to the Gemfile for everyone else, is there a way to do that?
micmus has quit [Ping timeout: 272 seconds]
ht__ has quit [Quit: Konversation terminated!]
<jhass>
Ontolog: no sane one
<Senjai>
jhass: Not really
greensoup has quit [Ping timeout: 264 seconds]
<Senjai>
jhass: I guessed the system type
<Senjai>
spygame: How often do the rules need to change?
<Senjai>
jhass: <3
<jhass>
Ontolog: note there are optional groups with bundler 1.10
<Senjai>
jhass: besides, you cheated, everything eventually boils down to because management
<jhass>
Senjai: I saw no rules defined yet, so...
<spygame>
Senjai: once defined i doubt they will change for that particular landing point
<Senjai>
spygame: Okay, there is a better way of doing this.
powersurge has left #ruby ["WeeChat 0.4.3"]
dgutierrez1287 has joined #ruby
lavros has quit [Quit: leaving]
<_blizzy_>
also, havenwood, seems like that wasn't it
<diegoviola>
why can't I return() from the ruby main scope?
<_blizzy_>
I put a print statement to find out if all the conditions were being met, and they are
<diegoviola>
I get some stupid error
asmodlol has quit [Ping timeout: 256 seconds]
<_blizzy_>
however, the array still resets for some reason.
<diegoviola>
LocalJumpError
<diegoviola>
sigh
<shevy>
DanceCrazyError
<apeiros>
diegoviola: you can't think of a reason why you can't?
<diegoviola>
apeiros: yeah sorry I wasn't thinking about what I was asking
<_blizzy_>
havenwood, oh ok.
<apeiros>
diegoviola: so what should happen when you return from main?
<_blizzy_>
let's try this then.
duderonomy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Senjai>
spygame: This approach, unaltered, would allow admins to check box a list of rulesets that they want for that action, but oyou would define the rulset in code.
<shevy>
exit!
<Senjai>
You could also have each ruleset take an argument
<diegoviola>
apeiros: I don't know, you tell me
<Senjai>
and only store those arguments in a serialized column on the database
<shevy>
exit!
<Senjai>
TLDR, thousands of ways to solve your problem :P
<apeiros>
shevy: you need help exiting the channel? :-p
JDiPierro has quit [Remote host closed the connection]
commondream has joined #ruby
einarj has quit [Ping timeout: 248 seconds]
<_blizzy_>
havenwood, yeah, but that is never reached for a while
jlast has joined #ruby
<havenwood>
_blizzy_: Don't create global variables.
<_blizzy_>
havenwood, oh, ok.
<_blizzy_>
c:
<havenwood>
_blizzy_: Looks like the first few globals you use should be constants.
asmodlol has quit [Remote host closed the connection]
<havenwood>
_blizzy_: Do you have any unit tests?
<_blizzy_>
havenwood, not atm.
jtbnyc69 has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
s2013 has quit [Read error: Connection reset by peer]
<havenwood>
_blizzy_: Just glancing at the #run method I don't follow what it's doing. It's doing a lot.
Scrofff has joined #ruby
einarj has joined #ruby
catcher has quit [Remote host closed the connection]
<_blizzy_>
havenwood, it's connecting to a websocket, so I pass the message to the method. based on the data in the message, it does something different.
<_blizzy_>
thus the switch case /case when.
<havenwood>
_blizzy_: Try to make methods shorter than hundreds of lines. ;)
rubie has joined #ruby
<_blizzy_>
havenwood, ok. :)
sarkyniin has joined #ruby
atom3 has quit [Ping timeout: 276 seconds]
adamjleonard has quit [Quit: Leaving...]
pdoherty has quit [Quit: Leaving]
balazs has joined #ruby
<havenwood>
_blizzy_: You might try putting a few `p "this place: #{@team}"`s in there in different places to sanity check that it's doing what you think it's doing. Once you hone in, maybe a`require 'pry'` and a `binding.pry` or two to explore.
<havenwood>
_blizzy_: Breaking methods down into smaller units that you test might help you gain confidence in your code.
atom3 has joined #ruby
spygame has quit [Quit: Page closed]
Channel6 has quit [Quit: Leaving]
Scroff has quit [Ping timeout: 256 seconds]
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
hck89 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<_blizzy_>
havenwood, thanks for the advice.
<_blizzy_>
I just wish I could find this bug.
adamjleonard has joined #ruby
rbennacer has quit [Remote host closed the connection]
baroquebobcat has joined #ruby
AlphaAtom has joined #ruby
pengin_ has quit [Remote host closed the connection]
diegoviola has quit [Quit: WeeChat 1.2]
<postmodern>
is there any documentation on using database-backed sessions with warden?
einarj has quit [Ping timeout: 248 seconds]
balazs has quit [Ping timeout: 244 seconds]
aphprentice has joined #ruby
sarkyniin has quit [Read error: Connection reset by peer]
kadoppe has quit [Ping timeout: 264 seconds]
greensoup has joined #ruby
<_blizzy_>
idk if I should upgrade to ruby 2.2 or stick with ruby 2.1.0
einarj has joined #ruby
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
skade has quit [Quit: Computer has gone to sleep.]
kadoppe has joined #ruby
sanjivupadhyaya has joined #ruby
<sanjivupadhyaya>
hello
Takasm has joined #ruby
Takasm is now known as Guest10751
Guest10751 has quit [Client Quit]
mikecmpbll has quit [Quit: i've nodded off.]
<sanjivupadhyaya>
hello
blackmesa has joined #ruby
<_blizzy_>
hello, sanjivupadhyaya
<sanjivupadhyaya>
i am just testing.. sorry for that ;)
<slash_nick>
hello, hello, sanjivupadhyaya :)
baroquebobcat has quit [Quit: baroquebobcat]
sarkyniin has joined #ruby
<sanjivupadhyaya>
hello , hello
<sanjivupadhyaya>
:)
<sanjivupadhyaya>
can you guys tell me why we specify rails version while creating a new app
<sanjivupadhyaya>
eg : rails __versionNumber__ new exampleApp ?
scripore has quit [Quit: This computer has gone to sleep]
baroquebobcat has joined #ruby
scripore has joined #ruby
sanjivupadhyaya is now known as __noob_
decoponyo has quit [Quit: Leaving...]
__noob_ is now known as __noob__
Palmer11 has left #ruby [#ruby]
<Senjai>
__noob__: Dont neeed __ in your name yo
micmus has quit [Quit: Leaving]
<__noob__>
haha
<__noob__>
i like to keep my name a secret since I am asking silly questions ;)
Juanchito has quit [Quit: Connection closed for inactivity]
<__noob__>
I will flash my name after i become a CEO of some fancy startup ;)
<slash_nick>
__noob__: if you register a nickname, you can join us in #rubyonrails to get some help with that... And no one here will fault you for asking silly questions.
<__noob__>
okay slash.. i will try that now
FernandoBasso has joined #ruby
Pumukel has quit [Quit: ChatZilla 0.9.91.1 [Firefox 38.0.5/20150525141253]]
arturhoo has quit [Quit: arturhoo]
elia has quit [Quit: Computer has gone to sleep.]
bronson has quit [Remote host closed the connection]
arooni-mobile has joined #ruby
* Senjai
googles sanjivupadhyaya
Yiota has joined #ruby
<__noob__>
well I googled it but could not find it..
<Senjai>
__noob__: I'm bugging you, I was more pointing to the fact typing _ to adress you is annoying
<Senjai>
:P
<Senjai>
address*
IanV0rn has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<__noob__>
now this shoudl be fine
IanV0rn has joined #ruby
duderonomy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Virtual_ has quit [Ping timeout: 275 seconds]
blahwoop has quit [Remote host closed the connection]
__noob__ is now known as noob
<noob>
sould be fine now ;)
jerius has quit [Quit: /quit]
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
michael_mbp has quit [Excess Flood]
Virtual_ has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
scripore has quit [Read error: Connection reset by peer]
Igorshp has joined #ruby
michael_mbp has joined #ruby
Xeago has quit [Remote host closed the connection]
shellie_ has joined #ruby
bronson has joined #ruby
datanoise has quit [Ping timeout: 272 seconds]
rdark has quit [Quit: leaving]
adamjleonard has quit [Read error: Connection reset by peer]
Yiota has joined #ruby
Soda has quit [Remote host closed the connection]
adamjleonard has joined #ruby
IanV0rn has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Scrofff has quit [Remote host closed the connection]
sarkyniin has quit [Remote host closed the connection]
<Senjai>
There should be the concept of an "Opponent" because it is a "thing"
<Senjai>
as I said, I can go on forever
<_blizzy_>
ok.
<Senjai>
but I suggest you get a good book on programming
<_blizzy_>
I know how to program.
<_blizzy_>
I'm just trying to get it to 'work' atm. I'll refactor later.
fabrice31 has quit [Ping timeout: 252 seconds]
<Senjai>
You don't, you have to admit that. This is brute force programming. It's not something someone who understand how to solve programs with code would even try
<Senjai>
Also the refacotoring book by martin fowler
<_blizzy_>
how can you say I don't know how to program
<_blizzy_>
when I obviously do.
noob has joined #ruby
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Narzew has quit [Ping timeout: 252 seconds]
<slash_nick>
_blizzy_: you know a programming language
<_blizzy_>
slash_nick, I know that. I also know how to 'program'. I know the difference
<Senjai>
_blizzy_: Just because you can copy paste code, and it does something, is not knowing "how to use a computer to solve problems effectively"
<_blizzy_>
Senjai, I'm not c/p code.
<Senjai>
It's a saying
workmad3 has joined #ruby
<_blizzy_>
atm, I want to code to work, then, like I said earlier, I will refactor.
<_blizzy_>
since everything has a rough draft.
<Senjai>
Sure thing, go for it. I'm going to just drop this as I can't convince you of any of this.
<_blizzy_>
this is not even 'beta'
<_blizzy_>
ok.
Asher has joined #ruby
greensoup has quit [Ping timeout: 246 seconds]
ndrei has quit [Ping timeout: 244 seconds]
ndrei has joined #ruby
mary5030 has quit [Remote host closed the connection]
<slash_nick>
_blizzy_: how about this... I'll paste your class into my console... do you have any code to reproduce the problem? something like `b = Battle.new(plz_give_me_this, plz_give_me_this); b.run; b.team == []`
Scroff has joined #ruby
adamjleonard has quit [Quit: Leaving...]
workmad3 has quit [Ping timeout: 256 seconds]
charliesome has joined #ruby
noob has quit []
<umgrosscol>
_blizzy_: You'd have to break that code up in to more manageable pieces for people to easily reason about it.
dopie has joined #ruby
<umgrosscol>
_blizzy_: does @team end up being nil or an empty array?
<_blizzy_>
umgrosscol, nil
<_blizzy_>
slash_nick, um, give me a few minutes. I think I found something.
<umgrosscol>
puts @team returns a value though?
<umgrosscol>
Err... displays a value.
segmond has joined #ruby
Scroff has quit [Ping timeout: 248 seconds]
Luun has quit [Quit: Luun]
<slash_nick>
_blizzy_: I will say that I got something strange when I pasted your class definition into my console...class definitions normally return nil. Yours returned :effectiveness .... there is something very wrong in there :) but as everyone is telling you, you'll need to refactor to move forward
<_blizzy_>
using byebug, after it reaches a certain line, it becomes nil
havenwood has joined #ruby
<umgrosscol>
_blizzy_: I see. Which line does it become nil? you might have gotten out of scope.
<_blizzy_>
slash_nick, ok, thank you. sorry if I was acting defensive or 'dickish' to anyone. sorry also, Senjai c:
baweaver has quit [Remote host closed the connection]
<_blizzy_>
after line 91
<umgrosscol>
although I don't see how as this is all supposed to be one monolithic class.
GPrime has joined #ruby
<_blizzy_>
it's a Pokemon AI. It's connecting using a web socket, so I have to parse each line the web socket sends.
B1n4r10 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<_blizzy_>
then I use a switch case based on the line the web socket sends.
<Senjai>
umgrosscol: We went through all of that already. Depending on when you joined the channel
JDiPierro has joined #ruby
<umgrosscol>
Senjai: I see.
<umgrosscol>
Yeah... too much complexity in one place for me to easily reason about.
<_blizzy_>
well, ok, I'll start to refactor.
Lucky_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
CamonZ has quit [Read error: Connection reset by peer]
<umgrosscol>
Variables like t, p1, m, data[] reminds me of looking at C.
<umgrosscol>
I thought one of the implicit language rules of ruby was cute naming of things.
__rpc has joined #ruby
__rpc has left #ruby [#ruby]
Ropeney has joined #ruby
<umgrosscol>
_blizzy_: You might want to write a few simple tests where you're passing in some recorded websocket response. That way you can edit your logic and make sure it's returning the expected results for the input.
volty has joined #ruby
JDiPierro has quit [Remote host closed the connection]
meph has joined #ruby
mandarinkin has quit [Quit: Leaving]
hahuang65 has quit [Ping timeout: 256 seconds]
<_blizzy_>
umgrosscol, ok. I still don't understand how this is mind blowingly complex, but ok. ._.
<_blizzy_>
I'll add comments
<umgrosscol>
_blizzy_: Not mind blowingly complex. You have a lot of nesting and large blocks of code. That generally makes it difficult to reason about at a glance, and more difficult to test generally.
<_blizzy_>
umgrosscol, oh.
blue_deref has quit [Quit: bbn]
<umgrosscol>
_blizzy_: Some people don't have any problem with that style. I just find it easier to deal with things that are chunked smaller.
<_blizzy_>
umgrosscol, oh ok. :)
<Senjai>
umgrosscol: You're a much nicer person than I am <3
spider-mario has quit [Read error: Connection reset by peer]
<Senjai>
Maybe I'm just bitter
sandstrom has quit [Quit: My computer has gone to sleep.]
<_blizzy_>
sorry again, Senjai. I was just defensive.
<Senjai>
_blizzy_: Yeah, my point is that you shouldn't be. This whole industry is all about other people telling you your code sucks. And telling other people the same.
<Senjai>
Criticism makes everything better.
<_blizzy_>
Senjai, oh.
umgrosscol has quit [Remote host closed the connection]
<Senjai>
and learning from other peoples mistakes
<Senjai>
I often think my code last month is terrible
<_blizzy_>
atm I'm splitting up my code
<_blizzy_>
into different files
<_blizzy_>
like a helper file where some of my methods will be at
speakingcode has quit [Ping timeout: 246 seconds]
_ht has quit [Quit: Konversation terminated!]
greensoup has joined #ruby
datanoise has joined #ruby
<Senjai>
_blizzy_: I would start by extracting into classes in the same file so its easier, and then you can move them elsewhere if you want
<_blizzy_>
Senjai, ok. :)
<Senjai>
_blizzy_: A good thing to ask yourself when refactoring: Does this method only do one thing? If not, should it be refactored so it only does one thing?
<havenwood>
_blizzy_: Have you played around with Minitest yet? It ships with Ruby.
Papierkorb has quit [Quit: ArchLinux completes an endless loop faster than any other distro!]
<Senjai>
Same with classes, each class should be responsible for a certain set of data
<_blizzy_>
havenwood, I was going to try rspec
danielpclark has quit [Ping timeout: 264 seconds]
<Senjai>
_blizzy_: That, and adding meaningful names to your methods and variables
hahuang65 has joined #ruby
<Senjai>
You can never have too many methods, if it adds legibility and follows SRP
<Senjai>
well you can, but your not likely to
<Senjai>
And either rspec or minitest is fine.
<havenwood>
_blizzy_: RSpec is popular indeed. Minitest is simpler and ships with Ruby.
<havenwood>
_blizzy_: You can get a long way with just `assert` and `refute`.
dopie has quit [Quit: This computer has gone to sleep]
<Senjai>
Yep
<havenwood>
_blizzy_: Then once you have something working and the tests pass, you're free to refactor and the tests can confirm if things are still green of if they've gone red.
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Senjai>
havenwood: I still think that would be a bit much to ask at this particular point :P
enebo has quit [Quit: enebo]
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<_blizzy_>
havenwood, ok then. thanks again for your comment.
<havenwood>
Senjai: Hem, I'm not sure. You think Minitest asserts are too much cognitive overhead early on?
<volty>
of course, he has to refactor that ugly code first :)
<havenwood>
_blizzy_: if you changed that `refute` to `assert` the test will fail
wilbert has quit [Ping timeout: 272 seconds]
<_blizzy_>
havenwood, ok.
<volty>
(and wrong, e.g. ws = ws
<Senjai>
volty: be nice
<havenwood>
volty: easier to refactor with tests ;)
<volty>
Senjai: I am nice
<Senjai>
havenwood: Yeah, the problem being that getting test coverage for all that, even though its all going to change is going to be difficult
einarj has quit [Remote host closed the connection]
<zenspider>
did someone say minitest? :P
<havenwood>
zenspider: \o/
pontiki has joined #ruby
<zenspider>
huh. I don't have that as a keyword
<volty>
havenwood: I do not believe so. I think you just can't test a nightmare :)
<havenwood>
volty: You could just add a test or two at a zoomed out level. Then extract method refactor and test the units.
<zenspider>
bacon is a primary ingredient in my diet
<_blizzy_>
volty, oh. c:
<Senjai>
zenspider: TLDR convincing _blizzy_ to refactor his code to avoid bugs. Debating on if suggesting test coverage for the existing code before refactor or not
<havenwood>
_blizzy_: Have a link to your latest code? (You can update gists by the way, intead of creating new gists.)
adamjleonard has joined #ruby
<Senjai>
Psht, I never update gists. gist gem ftw
<_blizzy_>
havenwood, well, I'll still refactoring.
<zenspider>
always refactor against tests
<Senjai>
zenspider: Look at his code first
vasilakisfil__ has quit [Read error: Connection reset by peer]
<zenspider>
damn
<zenspider>
1134.1: flog total 189.0: flog/method average
<zenspider>
785.2: Battle#run a.rb:24
<zenspider>
270.1: Battle#decide a.rb:189
<zenspider>
59.6: Battle#effectiveness a.rb:288
finisherr has quit [Quit: finisherr]
wildroman2 has quit [Remote host closed the connection]
<zenspider>
that's... untestable
<Senjai>
See what I mean? :P
<Senjai>
in this case I would refactor first, test second
<Senjai>
as currently its not fleshed out or fully working as is
<pontiki>
i hate to ask, but.. no, wait, i don't want to see
<volty>
logic can be tested only after right semantics. — you have to know what your code does, and how it does. But that's just my humble opinion. I don't mind (and don't like) tests.
<_blizzy_>
I feel bad now c:
ndrei has quit [Ping timeout: 265 seconds]
wildroman2 has joined #ruby
<havenwood>
_blizzy_: Don't feel bad!
<Senjai>
_blizzy_: Don't be, just take it constructively
<zenspider>
ok. so, "basic" refactorings, split run into actions and replace the case with send
finisherr has joined #ruby
<Senjai>
_blizzy_: We've all written terrible code, nobody just writes good code right away
<zenspider>
that'll make each action its own thing, and each one should be (relatively) testable from there on
danielpclark has joined #ruby
<Senjai>
zenspider: More like seperate objects etc. but yeah. Dont need to reference specific actions
<Senjai>
zenspider: We did go over that too
vasilakisfil has joined #ruby
<zenspider>
I wouldn't bother with separate objects at this point. he's not doing the command pattern, just dispatching
<Senjai>
zenspider: The logic in each "dispatch" can be a seperate object
<zenspider>
action_faint(m)
<zenspider>
send "action_#{m[0]}"
<zenspider>
err
<Senjai>
Or Command if you want to be explicit on the pattern
<zenspider>
send "action_#{m[0]}", *m[1..-1]
<Senjai>
I'm anti send
<Senjai>
zenspider: We're just going to confuse him, lets let him try, and see what he comes up with
<zenspider>
I'm anti-gc-for-no-good-reason
<volty>
imho the only test possible test at this stage is to see if the prog is running, even if wrong :) // then rewrite from scratch (looking at the old code). but that is a question of style
<Senjai>
expect{program}.to_not raise_error
<Senjai>
#fixed_forever
<zenspider>
ugh
<grex25>
Senjai, drbrain: Yeah was a timeout, but works now. Thanks for help!
<Senjai>
grex25: <3
<zenspider>
worst testing pattern that ever got popular
<Senjai>
zenspider: You know I'm joking right
<zenspider>
well, at this point, that pretty much IS the only test you can write
<Senjai>
Aye haha
neanderslob has joined #ruby
<Senjai>
grex25: FYI, 99% of the time, with no output, it usually is
<zenspider>
_blizzy_: those numbers I pasted above are from a tool called "flog". The higher the number, the more complex a method is. (non-rails) Industry average is 10/method.
<grex25>
Senjai: Was just wondering why there is no output, just like "trying to load gem XYZ.. connecting to 1.2.3.4 "
<zenspider>
you should break your code down and in so doing, your flog score goes down and your testability goes up
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
<Senjai>
grex25: If you use the verbose flag, there should be according to drbrain
hahuang65 has quit [Ping timeout: 255 seconds]
<Senjai>
grex25: Otherwise, probably just not implimented
pontiki has quit [Remote host closed the connection]
<zenspider>
there's verbose and debug if you really want to go overboard
<zenspider>
the latter really is just noise
<volty>
verbose for/at whom?
<grex25>
Nono, but I just think just getting confronted with a blinkin cursor and zero output before is bad ;)
<havenwood>
_blizzy_: This stuff is hard and you're taking really good stabs at it and adapting quickly to advice. Go in the direction and simpler methods with tests and you're on a good track.
vasilakisfil has quit [Ping timeout: 256 seconds]
<havenwood>
direction of*
<volty>
people, stop pls torturing _blizzy_ :)
<volty>
he has too many errors in that code
gigetoo has joined #ruby
<volty>
I think he does not have enough experience. And so I suggest him to implement a simple tic-tac-toe before battling with initializiers
jlast has joined #ruby
CloCkWeRX has joined #ruby
<volty>
e.g. @team = Array.new; @team = false
Lucky_ has joined #ruby
<_blizzy_>
volty, I have experience
<Senjai>
Nono, what hes doing is fine.
<_blizzy_>
c:
<zenspider>
this is far from torture. :P
<havenwood>
Small and simple is really important.
<Senjai>
We just need to stop suggesting things, and see what his refactoring turns out like
freerobby has quit [Quit: Leaving.]
<zenspider>
agreed
<havenwood>
Senjai: :)
<Senjai>
This convo has gone on for over an hour now :P
RegulationD has quit [Ping timeout: 246 seconds]
<havenwood>
Senjai: I've been away so full of vigor!
Musashi007 has quit [Quit: Musashi007]
<havenwood>
Senjai: The evening shift is arriving.
<zenspider>
dudedudeman: "how the eff does one test for datetime in minitest" ? what does that mean? (real q)
<Senjai>
havenwood: Please, you have the same shift as I do
<volty>
_blizzy_: then (if experienced) you must be very very tired. Get a rest.
<Senjai>
Or at least a superset of it
<havenwood>
Senjai: Yeah, we do overlap.
<Senjai>
volty: Chill :P
<_blizzy_>
volty, I'm not tired. c:
<volty>
then by experience you must mean «experience of "particular coding"» :)
<zenspider>
volty: "your code sucks. you must be very very tired." ... kinda rude, no?
<volty>
at
<Senjai>
^
jlast has quit [Ping timeout: 250 seconds]
<Senjai>
volty: That's not constructive, and doesnt help anyone
<_blizzy_>
volty, no, I have experience in programming in general.
<volty>
absolutely.I'm sure. and good
<volty>
and I am not rude at all. And _blizzy_ must know that if he has general experience in programming
<Senjai>
havenwood: I think the only reason I'm not on after work si because I run windows at home for the videogames and things. And I refuse to use putty to IRC :P
<Senjai>
Also irc drains a lot of time
<Senjai>
Best procrastination system
* zenspider
looks around shiftily... goes back to coding like he should be
<Senjai>
^
<grex25>
this channel is quite funny today *grabs popcorn*
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
greensoup has quit [Ping timeout: 250 seconds]
* dfockler
is just over here writing python
arooni-mobile has quit [Ping timeout: 248 seconds]
nobitanobi has joined #ruby
jenrzzz has joined #ruby
pontiki has joined #ruby
mandarinkin2 has joined #ruby
icarus has quit [Ping timeout: 265 seconds]
mandarinkin has quit [Ping timeout: 256 seconds]
ruv has joined #ruby
Tempesta has quit [Read error: Connection reset by peer]
Tempesta has joined #ruby
joshbamboo1 has joined #ruby
Grok has joined #ruby
dfockler has quit []
grex25 has quit [Quit: Leaving]
Grok has left #ruby [#ruby]
NeverDie has joined #ruby
WildBamboo-Josh has quit [Ping timeout: 256 seconds]
Virtual_ has left #ruby ["Goodbye!"]
baweaver has joined #ruby
greensoup has joined #ruby
MyMind has quit [Ping timeout: 276 seconds]
scripore has joined #ruby
Pisuke has joined #ruby
baweaver has quit [Ping timeout: 246 seconds]
gigetoo has quit [Ping timeout: 246 seconds]
<_blizzy_>
so it's wrong for methods to be big?
theery has quit [Remote host closed the connection]
<volty>
it isn't wrong, it's just easier to grasp if you decompose your logic & flow in smaller units. A genius can write all the program in a single method. And even without a method :)
<Senjai>
_blizzy_: It's wrong for a method to have more than one responsibility
<Senjai>
There are exceptions, but thats a good rule to live by
davedev2_ has joined #ruby
<_blizzy_>
I'm getting confused now with refactoring.
<volty>
refactoring = rewriting // you write a novel, then you seen it's a mess, then you rewrite it correcting and polishing
Soda has joined #ruby
<Senjai>
Not always man.
<Senjai>
Refactoring in theory should not include a change in any logic
<Senjai>
rewriting != refactoring
sdwrage has quit [Quit: This computer has gone to sleep]
<Senjai>
he's kind of doing a mix of both
sdwrage has joined #ruby
<volty>
sorry Senjai. But that about logic isn't true.
<Senjai>
volty: Sorry dude, yes it is. A pure refactoring has no change in logic.
soahccc_ is now known as soahccc
<Senjai>
Refactoring. …is a disciplined technique for restructuring an existing body of code, altering its internal structure without changing its external behavior
<volty>
for sure you wanted to say «behavior» (external)
<Senjai>
Sure
<Senjai>
semantics
<volty>
yes, you can change the internal logic as much as you please.
<volty>
changing the internal structure is about changing the logic of solving / calculating
<jhass>
changing the logic would change the behavior, no? if we're fighting about semantics I'd say changing the way the logic is expressed
<Senjai>
jhass: That's more correct, the logic surrounding the component as a whole is static. Given the same inputs, you get the same outputs. How that's handled can be changed in any which way
<volty>
changing the logic does not necessarily change the behavior
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
snockerton has quit [Quit: Leaving.]
<Senjai>
Yes, nobody disagrees with you :p
xelkarin has quit [Quit: WeeChat 1.1.1]
swgillespie has joined #ruby
wildroman2 has quit [Remote host closed the connection]
<Senjai>
I googled "how to tell people they're right on the internet" but it didn't help
jpfuentes2 has joined #ruby
jamesaxl_ has quit [Read error: Connection reset by peer]
<volty>
behaviour of the whole prog, of course (while internal units, of the chain, could change their external behaviour)
gigetoo has joined #ruby
<volty>
ahah
<volty>
let's conclude with «Internal Logic»
cpruitt has quit [Quit: cpruitt]
shinnya has quit [Ping timeout: 252 seconds]
sfarley has quit [Remote host closed the connection]