apeiros_ changed the topic of #ruby-lang to: Ruby 2.2.0; 2.1.5; 2.0.0-p598; 1.9.3-p551: http://ruby-lang.org || Paste code on http://gist.github.com
martinbmadsen has joined #ruby-lang
mcclurmc_ has quit [Remote host closed the connection]
mcclurmc has joined #ruby-lang
mcclurmc has quit [Remote host closed the connection]
mcclurmc has joined #ruby-lang
brooks has joined #ruby-lang
wallerdev has joined #ruby-lang
elia has joined #ruby-lang
stef1a has joined #ruby-lang
houhoulis has joined #ruby-lang
skade has joined #ruby-lang
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nofxx has quit [Read error: Connection timed out]
nofxx has joined #ruby-lang
nofxx has joined #ruby-lang
postmodern has joined #ruby-lang
Rodya_ has joined #ruby-lang
emmesswhy has quit [Quit: This computer has gone to sleep]
emmesswhy has joined #ruby-lang
malconis has joined #ruby-lang
skade has quit [Quit: Computer has gone to sleep.]
tectonic has quit []
emmesswhy has quit [Ping timeout: 240 seconds]
michaeldeol has joined #ruby-lang
Lewix has quit [Remote host closed the connection]
yatish27 has quit [Remote host closed the connection]
sangwoojoo has quit [Remote host closed the connection]
nofxx has quit [Read error: Connection timed out]
yatish27_ has joined #ruby-lang
nofxx has joined #ruby-lang
rocco88 has quit []
elia has quit [Quit: Computer has gone to sleep.]
emmesswhy has joined #ruby-lang
nertzy has joined #ruby-lang
lsegal has quit [Read error: Connection reset by peer]
lsegal has joined #ruby-lang
emmesswhy has quit [Quit: This computer has gone to sleep]
Sadin has quit []
kalehv has joined #ruby-lang
emmesswhy has joined #ruby-lang
houhoulis has quit [Remote host closed the connection]
Sadin has joined #ruby-lang
havenwood has joined #ruby-lang
nertzy has quit [Quit: This computer has gone to sleep]
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
houhoulis has joined #ruby-lang
michaeldeol has joined #ruby-lang
klmlfl has quit [Remote host closed the connection]
klmlfl has joined #ruby-lang
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
klmlfl has quit [Remote host closed the connection]
hendranata_ has joined #ruby-lang
iamninja has joined #ruby-lang
hahuang61 has joined #ruby-lang
kiyote23 has joined #ruby-lang
Lewix has joined #ruby-lang
hendranata_ has quit [Read error: Connection reset by peer]
hendranata_ has joined #ruby-lang
hahuang61 has quit [Ping timeout: 244 seconds]
kiyote23 has quit [Ping timeout: 264 seconds]
houhoulis has quit [Remote host closed the connection]
rbowlby has quit [Remote host closed the connection]
arBmind has quit [Quit: Leaving.]
konr has quit [Quit: Connection closed for inactivity]
malconis has joined #ruby-lang
malconis has quit [Client Quit]
<darix> nofxx: check what tools like multi_json/multi_xml do
<darix> maybe
nofxx has quit [Read error: Connection timed out]
nofxx has joined #ruby-lang
shinnya_ has quit [Quit: ZNC - http://znc.in]
malconis has joined #ruby-lang
malconis has quit [Client Quit]
shinnya_ has joined #ruby-lang
Rodya_ has quit [Read error: Connection reset by peer]
aef has quit [Remote host closed the connection]
chills42 has joined #ruby-lang
aef has joined #ruby-lang
kalehv has quit [Remote host closed the connection]
brooks has quit [Quit: brooks]
hendranata_ has quit [Remote host closed the connection]
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
michaeldeol has joined #ruby-lang
hendranata_ has joined #ruby-lang
yatish27_ has quit []
kiyote23 has joined #ruby-lang
face has quit [Read error: Connection reset by peer]
face has joined #ruby-lang
Lewix has quit [Remote host closed the connection]
Lewix has joined #ruby-lang
Lewix has quit [Changing host]
Lewix has joined #ruby-lang
yusuf has joined #ruby-lang
kiyote23 has quit [Remote host closed the connection]
kiyote23 has joined #ruby-lang
houhoulis has joined #ruby-lang
Lewix has quit [Ping timeout: 245 seconds]
bradland has quit [Quit: bradland]
bradland has joined #ruby-lang
charliesome has joined #ruby-lang
houhoulis has quit [Client Quit]
nathanstitt has joined #ruby-lang
bradland has quit [Client Quit]
wakwakwak99 has joined #ruby-lang
aef has quit [Remote host closed the connection]
<wakwakwak99> hi
aef has joined #ruby-lang
<wakwakwak99> hi i started learning ruby yesterday
<wakwakwak99> ??
charliesome has quit [Quit: zzz]
wakwakwak99 has quit [Client Quit]
charliesome has joined #ruby-lang
Lewix has joined #ruby-lang
Lewix has joined #ruby-lang
nofxx has quit [Read error: Connection timed out]
nofxx has joined #ruby-lang
bradland has joined #ruby-lang
bradland has left #ruby-lang [#ruby-lang]
shubhamg_ has quit [Remote host closed the connection]
bradland has joined #ruby-lang
bradland has left #ruby-lang [#ruby-lang]
Averna has joined #ruby-lang
kapil__ has joined #ruby-lang
araujo has quit [Quit: Leaving]
tkuchiki has joined #ruby-lang
RobertBirnie has joined #ruby-lang
slawrence00 has joined #ruby-lang
shubhamgoyal has joined #ruby-lang
shubhamg_ has joined #ruby-lang
kiyote23 has quit [Remote host closed the connection]
shubhamgoyal has quit [Ping timeout: 244 seconds]
kiyote23 has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
kiyote23 has quit [Ping timeout: 264 seconds]
gwendall has quit [Remote host closed the connection]
shinnya_ has quit [Quit: ZNC - http://znc.in]
shinnya_ has joined #ruby-lang
rbowlby has joined #ruby-lang
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ledestin has joined #ruby-lang
michaeldeol has joined #ruby-lang
meschi has quit [Remote host closed the connection]
michaeldeol has quit [Client Quit]
michaeldeol has joined #ruby-lang
chills42 has quit [Remote host closed the connection]
tkuchiki has quit [Remote host closed the connection]
sross_work|2 has left #ruby-lang ["Once you know what it is you want to be true, instinct is a very useful device for enabling you to know that it is"]
tkuchiki has joined #ruby-lang
Musashi007 has joined #ruby-lang
sross07 has joined #ruby-lang
yfeldblu_ has joined #ruby-lang
yfeldblum has quit [Ping timeout: 245 seconds]
tkuchiki has quit [Ping timeout: 265 seconds]
brooks has joined #ruby-lang
red_menace has quit [Quit: leaving...]
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
michaeldeol has joined #ruby-lang
kiyote23 has joined #ruby-lang
pepperbreath has joined #ruby-lang
kiyote23 has quit [Remote host closed the connection]
stef1a has quit [Ping timeout: 264 seconds]
kalehv has joined #ruby-lang
sangwoojoo has joined #ruby-lang
Hyperfocal has joined #ruby-lang
tectonic has joined #ruby-lang
kalehv has quit [Ping timeout: 264 seconds]
gwendall has joined #ruby-lang
rand0mbits has quit [Read error: Connection reset by peer]
dellavg_ has joined #ruby-lang
gix has quit [Ping timeout: 256 seconds]
gwendall has quit [Ping timeout: 244 seconds]
<levifig> is there a way to do a split, specifying a bunch of different delimiters in a specific order? :)
<levifig> Like the first delimiter is a -, the second a ", the third a [, and the fourth a ]?
<|jemc|> levifig: sounds like you should be using a Regexp and capture groups
<levifig> hmm… |jemc|, you may be right… :X
<bnagy> or just a token array
sangwoojoo has quit [Remote host closed the connection]
<levifig> |jemc|, can I use regex and assign each value to a variable?
gix has joined #ruby-lang
<levifig> preferably, creating a hash of values from the string
<levifig> versus array[0] type locators
<|jemc|> check out named captures
<levifig> I'll take a look, thanks :)
<levifig> bnagy, I'll check that too
Hyperfocal has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<bnagy> if it's some kind of nested thing then [delim1, delim2, delim3 ...].each {|d| stuff=stuff.map {|substr| substr.split(d) or something
<bnagy> probably needs some flatten and some error checking
<levifig> FWIW, trying to find a way to parse an nginx access.log
Lewix has quit [Remote host closed the connection]
<levifig> (to eventually put it into SQL)
<levifig> it's an old, predefined access.log, not a streaming one
Lewix has joined #ruby-lang
<bnagy> that sounds super unsafe
mistym has quit [Remote host closed the connection]
<bnagy> a lot of that is attacker controlled
<bnagy> especially if you're regexing on it
<bnagy> I'd probably split on space and go from there - you can clean up the [] in the timestamp manually
<levifig> not a publicly available script
<levifig> and not a live access.log
<levifig> QA needs to go through a specific timeframe of access logs to figure something out :)
fclausen has quit [Ping timeout: 272 seconds]
<levifig> I'm in charge of getting the logs, parsing them, and dump them into a SQL DB to be analyzed by them :)
<levifig> good point on the space delimeter
Lewix has quit [Ping timeout: 256 seconds]
<bnagy> if the url is encoded ( like %20 ) then each line should be a fixed number of fields?
<bnagy> or am I crazy? I have a very limited access.log from my own nginx
Musashi007 has quit [Ping timeout: 256 seconds]
<levifig> definitely a defined number of fields
<bnagy> then that seems easiest. You can reconstruct the timestamp by joining and cleaning those two tokens
<levifig> interesting
<levifig> so token array?
<bnagy> nah just split on ' '
<levifig> ah
<bnagy> timestamp is toks[3][1..-1] + toks[4][0..-2] or whatever
<levifig> ya
<bnagy> don't use + irl use <<
<levifig> what's the easiest way to output to SQL?
<levifig> bnagy, FWIW, access.log in question = 11GB :X
sondr3 has quit [Quit: Ich bin ein sleep.]
<bnagy> all the more reason to do it line by line
<bnagy> I'm tapping out on the SQL stuff though
<bnagy> I used Sequel but like 5 years ago
rbowlby has quit [Remote host closed the connection]
Averna has quit [Quit: Leaving.]
kyb3r_ has joined #ruby-lang
Hyperfocal has joined #ruby-lang
BadQuanta has joined #ruby-lang
brooks has quit [Quit: brooks]
<levifig> I can probably just export it as JSON and there are ways to import JSON to SQL :)
nathanstitt has quit [Quit: I growing sleepy]
sondr3 has joined #ruby-lang
dellavg_ has quit [Ping timeout: 264 seconds]
slawrence00 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mistym has joined #ruby-lang
kiyote23 has joined #ruby-lang
charliesome has quit [Quit: zzz]
michaeldeol has joined #ruby-lang
gjaldon has joined #ruby-lang
|jemc| has quit [Quit: WeeChat 1.0.1]
|jemc| has joined #ruby-lang
gwendall has joined #ruby-lang
kiyote23 has quit [Ping timeout: 264 seconds]
ledestin has quit [Quit: ledestin]
kiyote23 has joined #ruby-lang
gjaldon has quit [Remote host closed the connection]
gwendall has quit [Ping timeout: 265 seconds]
rbowlby has joined #ruby-lang
gjaldon has joined #ruby-lang
charliesome has joined #ruby-lang
pwnz0r has joined #ruby-lang
pwnz0r has quit [Remote host closed the connection]
Musashi007 has joined #ruby-lang
sondr3 has quit [Quit: Ich bin ein sleep.]
Musashi007 has quit [Client Quit]
deol has joined #ruby-lang
michaeldeol has quit [Ping timeout: 264 seconds]
michaeldeol has joined #ruby-lang
deol has quit [Ping timeout: 245 seconds]
apeiros has quit [Remote host closed the connection]
apeiros has joined #ruby-lang
gjaldon has quit [Ping timeout: 264 seconds]
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Xzanron has joined #ruby-lang
skade has joined #ruby-lang
tectonic has quit []
gwendall has joined #ruby-lang
AKASkip has joined #ruby-lang
gwendall has quit [Ping timeout: 265 seconds]
kiyote23 has quit [Remote host closed the connection]
apeiros has quit [Remote host closed the connection]
rahul_j has joined #ruby-lang
gwendall has joined #ruby-lang
Hyperfocal has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
gjaldon has joined #ruby-lang
kiyote23 has joined #ruby-lang
kiyote23 has quit [Ping timeout: 245 seconds]
mattyohe has quit [Quit: Connection closed for inactivity]
gjaldon has quit [Read error: Connection reset by peer]
Seized has joined #ruby-lang
rbowlby has quit [Remote host closed the connection]
gjaldon has joined #ruby-lang
ottlikg has joined #ruby-lang
charliesome has quit [Quit: zzz]
shubhamg_ has quit [Remote host closed the connection]
charliesome has joined #ruby-lang
ddd has quit [Quit: leaving]
apeiros has joined #ruby-lang
gjaldon has quit [Ping timeout: 256 seconds]
<levifig> when parsing a file with each_line, how do I make it output an array (each line being an item in the array)?
iamninja has quit [Quit: ZZZzzz…]
<apeiros> s/parsing/reading/. parsing is a different thing ;-)
<levifig> ya… :X
<levifig> I think I got it actually :X
shubhamgoyal has joined #ruby-lang
<apeiros> levifig: File.readlines(path) will return an array directly
Forgetful_Lion has joined #ruby-lang
hahuang61 has joined #ruby-lang
benten has joined #ruby-lang
hahuang61 has quit [Ping timeout: 264 seconds]
rahul_j has quit [Quit: rahul_j]
rahul_j has joined #ruby-lang
fclausen has joined #ruby-lang
<[spoiler]> Morning
<[spoiler]> this droplr thing seems fancy
<[spoiler]> Gah my boss brought some kinetic sand the other day and I was playing with it for a few minutes and I can find little sand thingies everywhere
<[spoiler]> Is there that notice bot around
<apeiros> chris2: ping: do you see any reason why Rack::Utils::HeaderHash#to_hash should not be implemented as `{}.replace(self)`. it's ~60% faster than the current implementation for a hash with 9 elements.
fclausen has quit [Ping timeout: 272 seconds]
skade has quit [Read error: Connection reset by peer]
skade has joined #ruby-lang
kiyote23 has joined #ruby-lang
amclain has quit [Quit: Leaving]
skade has quit [Remote host closed the connection]
skade has joined #ruby-lang
solars has joined #ruby-lang
kiyote23 has quit [Ping timeout: 264 seconds]
jxie has quit [Quit: leaving]
fclausen has joined #ruby-lang
Seized has quit [Quit: Page closed]
mistym has quit [Remote host closed the connection]
duderonomy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<chris2> apeiros: nope, propose a pr
<chris2> i guess this one doesnt normalize?
jxie has joined #ruby-lang
|jemc| has quit [Quit: WeeChat 1.0.1]
duderonomy has joined #ruby-lang
Integralist has joined #ruby-lang
rahul_j has quit [Quit: rahul_j]
Integral2st has joined #ruby-lang
Integral1st has joined #ruby-lang
GBrawl has joined #ruby-lang
fclausen has quit [Ping timeout: 272 seconds]
arBmind has joined #ruby-lang
|jemc| has joined #ruby-lang
tmi__ has joined #ruby-lang
tmi_ has quit [Ping timeout: 252 seconds]
stardiviner has quit [Ping timeout: 244 seconds]
<apeiros> chris2: no, but neither does the current implementation since it calls []= on the hash
futilegames has joined #ruby-lang
<apeiros> chris2: oooh, I omitted to check #each
zucaritas has joined #ruby-lang
<apeiros> and #each applies transformations to the value
<apeiros> yeah, replace(self) would produce different results for values which respond to to_ary, since `v.respond_to?(:to_ary) ? v.to_ary.join("\n") : v`
hahuang61 has joined #ruby-lang
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
BadQuanta has quit [Remote host closed the connection]
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
hahuang61 has quit [Ping timeout: 265 seconds]
emmesswhy has quit [Quit: Leaving]
havenwood has quit [Remote host closed the connection]
stardiviner has joined #ruby-lang
stardiviner has quit [Changing host]
stardiviner has joined #ruby-lang
rahul_j has joined #ruby-lang
JohnBat26 has joined #ruby-lang
dangerousdave has joined #ruby-lang
rocco88 has joined #ruby-lang
pwnz0r has joined #ruby-lang
rbowlby has joined #ruby-lang
rbowlby has joined #ruby-lang
vondruch has joined #ruby-lang
GBrawl has quit [Ping timeout: 265 seconds]
<ljarvis> moin
dangerousdave has quit [Client Quit]
nux443 has quit [Quit: leaving]
nofxx has quit [Ping timeout: 256 seconds]
zucaritas has quit [Ping timeout: 244 seconds]
skade has quit [Remote host closed the connection]
rahul_j has quit [Quit: rahul_j]
gwendall has quit [Remote host closed the connection]
gwendall has joined #ruby-lang
skade has joined #ruby-lang
gwendall_ has joined #ruby-lang
gwendall has quit [Ping timeout: 265 seconds]
|jemc| has quit [Ping timeout: 264 seconds]
gwendall_ has quit [Ping timeout: 265 seconds]
qba73 has joined #ruby-lang
arBmind has quit [Quit: Leaving.]
kyb3r_ has quit [Ping timeout: 244 seconds]
ledestin has joined #ruby-lang
kapil__ has quit [Quit: Connection closed for inactivity]
gwendall has joined #ruby-lang
elia has joined #ruby-lang
Missphoenix has quit [Quit: Leaving]
Miphix has joined #ruby-lang
Miphix has quit [Client Quit]
RobertBirnie has joined #ruby-lang
<yorickpeterse> morning
zucaritas has joined #ruby-lang
mikecmpbll has joined #ruby-lang
arBmind has joined #ruby-lang
Kryptonita has joined #ruby-lang
<Kryptonita> Hello everydoby..
<Kryptonita> I am creating a gem that use an extension C code. What I note is that my gems only runs with the ruby version that is build with
elia has quit [Read error: No route to host]
<Kryptonita> How can I make my gem to be compatible with other ruby versions
<Kryptonita> ?
elia has joined #ruby-lang
Forgetful_Lion has quit [Remote host closed the connection]
<levifig> anybody know how I can get LONGTEXT in Sequel? :X
rahul_j has joined #ruby-lang
<levifig> never mind
<levifig> Text works :)
zucaritas has quit [Ping timeout: 252 seconds]
shubhamgoyal has quit [Remote host closed the connection]
benlovell has joined #ruby-lang
Sadin has quit [Remote host closed the connection]
hendranata_ has quit [Quit: Leaving]
workmad3 has joined #ruby-lang
benten has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Eising> *sigh* It's been so long since I've worked on this project that I forget how my docker image works...
ocdmw has quit [Ping timeout: 245 seconds]
pwnz0r has quit [Remote host closed the connection]
ldnunes has joined #ruby-lang
shubhamgoyal has joined #ruby-lang
qba73 has quit [Read error: Connection reset by peer]
gwendall has quit [Remote host closed the connection]
qba73 has joined #ruby-lang
francisfish has joined #ruby-lang
iamninja has joined #ruby-lang
stardiviner has quit [Ping timeout: 244 seconds]
GBrawl has joined #ruby-lang
ocdmw has joined #ruby-lang
kapil__ has joined #ruby-lang
gwendall has joined #ruby-lang
stardiviner has joined #ruby-lang
kiyote23 has joined #ruby-lang
rbowlby has quit [Remote host closed the connection]
kiyote23 has quit [Ping timeout: 255 seconds]
benlovell has quit [Ping timeout: 256 seconds]
benlovell has joined #ruby-lang
cornerma1 has joined #ruby-lang
hanjin has joined #ruby-lang
cornerman has quit [Ping timeout: 245 seconds]
cornerma1 is now known as cornerman
skade has quit [Remote host closed the connection]
skade has joined #ruby-lang
Guest81780 has joined #ruby-lang
ottlikg has quit [Ping timeout: 244 seconds]
mfaeh has joined #ruby-lang
iamninja has quit [Quit: ZZZzzz…]
francisfish has quit [Remote host closed the connection]
francisfish has joined #ruby-lang
martinbmadsen has quit [Ping timeout: 252 seconds]
solars has quit [Ping timeout: 245 seconds]
tcopeland has quit [Quit: Leaving.]
Kryptonita has quit [Ping timeout: 255 seconds]
rocco88 has quit [Read error: Connection reset by peer]
ddd has joined #ruby-lang
mfaeh has quit [Remote host closed the connection]
solars has joined #ruby-lang
yusuf has quit [Quit: Leaving.]
sideshowcoder has joined #ruby-lang
postmodern has quit [Quit: Leaving]
iamninja has joined #ruby-lang
gwendall has quit [Remote host closed the connection]
<Xzanron> Hi. Is there a way to get rake to redirect output to logger? (I'm not using rails)
chills42 has joined #ruby-lang
skade has quit [Remote host closed the connection]
skade has joined #ruby-lang
gwendall has joined #ruby-lang
tkuchiki has joined #ruby-lang
tkuchiki has quit [Remote host closed the connection]
tkuchiki has joined #ruby-lang
joast has joined #ruby-lang
tkuchiki has quit [Ping timeout: 244 seconds]
<yorickpeterse> Does anybody know of a tool for setting up test data (factories/fixtures/whatever you'd call them) that works with regular Ruby objects? Or basically any custom Ruby code?
<yorickpeterse> e.g. I might have some tests that require some mocked objects
<yorickpeterse> those mocked objects might be re-used
<ljarvis> Xzanron: $stdout = Logger.new(...)
<yorickpeterse> I basically just want to smack those somewhere in a file, give them a name, and load them in
<ledestin> could anybode enlighten me how I can make warden to be authenticated for several requests. Currently, it works for first request (html), but not for AJAX (json).
<yorickpeterse> Without having to use the fat pig that is factory_girl/factory_grill
<ljarvis> yorickpeterse: no, sounds like a decent idea though. But probably opinionated enough to not be useful for most
<yorickpeterse> hmpf
<yorickpeterse> e.g. in this case I have some classes that are normally populated from an XML file
<yorickpeterse> But that means having fixture files, which are a mess in this particular case
<yorickpeterse> so I'd rather stub a bunch of things, but I don't want to stub the same stuff every time
<ddd> could you marshal out the objects to a file and then pull back in?
<ljarvis> ledestin: bit confused, but you just use warden in the scope you want. Be that html or json
<yorickpeterse> I can abuse rspec shared examples for this, but blegh
<ledestin> ljarvis: um, I use login_as and, well, it doesn’t work
<ljarvis> ledestin: what framework?
<ledestin> ljarvis: Rails + Devise
<ledestin> Capybara
<ljarvis> ledestin: you need to do it manually in your custom controller
migbar has joined #ruby-lang
<ljarvis> ie format.js { warden.authenticate!(...) }
<ljarvis> i think devise only does it for html requests
<ledestin> ljarvis: thanks a lot, I’ll research that. Gonna look at Devise first.
tkuchiki has joined #ruby-lang
<Xzanron> ljarvis, thanks
<yorickpeterse> ljarvis: hmpf, seems you're right in that there's nothing out there for this
<yorickpeterse> at least that I can find so far
<yorickpeterse> clearly I should be using factory grill here because the rspec/rails gods tell us to
<yorickpeterse> fukit, I'll just use helper methods
benlovell has quit [Ping timeout: 255 seconds]
yfeldblum has joined #ruby-lang
yfeldblu_ has quit [Ping timeout: 245 seconds]
fclausen has joined #ruby-lang
<whitequark> lol, factory grill
<whitequark> thought of mocha?
tcopeland has joined #ruby-lang
vondruch has quit [Ping timeout: 244 seconds]
pepperbreath has quit [Quit: Leaving.]
<yorickpeterse> whitequark: not really sure, I'm already using rspec's mocking stuff
<yorickpeterse> https://gist.github.com/YorickPeterse/f3c854e13b3bd27c17cb something like this is what I'd want
benlovell has joined #ruby-lang
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rahul_j has quit [Quit: rahul_j]
stamina has joined #ruby-lang
gwendall has quit [Remote host closed the connection]
vondruch has joined #ruby-lang
slawrence00 has joined #ruby-lang
bradland has joined #ruby-lang
chouhoulis has joined #ruby-lang
stef1a has joined #ruby-lang
kiyote23 has joined #ruby-lang
<ledestin> ljarvis: I don’t want to authenticate via JSON, I just want JSON to use session auth when I login
<ledestin> it works in a browser, but not in tests :(
<ledestin> well, I fake it in tests with login_as
<DefV> ledestin: browsers just send your session cookie along
<DefV> your tests probably don't
<ledestin> DefV: I use login_as to communicate with warden directly
wprice has joined #ruby-lang
<DefV> you are telling me something, but I have no idea why
<ledestin> I’m explaining what I do
<ledestin> it’s supposed to work, people say it works for them :(
<ljarvis> sounds like bad tests
kiyote23 has quit [Ping timeout: 264 seconds]
malconis has joined #ruby-lang
<ledestin> why bad?
<ledestin> what’s bad about them?
tcopeland has quit [Ping timeout: 265 seconds]
<ledestin> there’s an open bug in Warden for that
<ledestin> in the end, Google trumps my attempts to figure it out looking at the source
rbowlby has joined #ruby-lang
AKASkip has quit [Ping timeout: 264 seconds]
<yorickpeterse> literally all I needed
<yorickpeterse> factory_grill eat your heart out
<ljarvis> man, yardoc still makes me vomit
<yorickpeterse> meh, it beats rdoc in consistency
<ljarvis> yeah i dont like either tbh
<ljarvis> but prefer rdoc
ottlikg has joined #ruby-lang
<yorickpeterse> My main reason for using it is because it leaves no room for creativity when it comes to describing argument input/return values
<yorickpeterse> That is, there's one way to do it: @param
<yorickpeterse> I've found that when people write things by hand you'll end up with 5 methods using 8 different ways of describing things
<yorickpeterse> it's also pretty useful for tools, although I think that besides YARD itself I'm the only person using it
<yorickpeterse> (that is, ruby-lint uses it for figuring out input/output types)
rbowlby has quit [Ping timeout: 265 seconds]
<ljarvis> ah neat
Bwild has quit [Ping timeout: 244 seconds]
futilegames_ has joined #ruby-lang
lcdhoffman has joined #ruby-lang
futilegames has quit [Ping timeout: 255 seconds]
futilegames_ is now known as futilegames
Bwild has joined #ruby-lang
malconis has quit [Remote host closed the connection]
mattyohe has joined #ruby-lang
Lewix has joined #ruby-lang
malconis has joined #ruby-lang
benlovell has quit [Ping timeout: 245 seconds]
nathanstitt has joined #ruby-lang
workmad3 has quit [Read error: Connection reset by peer]
workmad3 has joined #ruby-lang
martinbmadsen has joined #ruby-lang
meschi has joined #ruby-lang
fclausen has quit [Ping timeout: 272 seconds]
futilegames_ has joined #ruby-lang
futilegames has quit [Ping timeout: 264 seconds]
futilegames_ is now known as futilegames
[spoiler] has quit [Quit: Leaving]
martinbmadsen has quit [Ping timeout: 245 seconds]
mikecmpb_ has joined #ruby-lang
mikecmpbll has quit [Read error: Connection reset by peer]
benlovell has joined #ruby-lang
callumacrae has joined #ruby-lang
<callumacrae> Are there any templating languages which work in both Rails and JavaScript that support functions? {{ t('something') }} like
<callumacrae> not rails, ruby. sorry, i suck xD
<callumacrae> Best option I've found is mustache, but {{#t}}something{{/t}} is horrible
hahuang61 has joined #ruby-lang
<DefV> handlebars does the same
charliesome has quit [Quit: zzz]
benten has joined #ruby-lang
<callumacrae> {{ t 'something' }} might work, looks like handlebars can do that
<callumacrae> Is there a ruby port of handlebars?
hahuang61 has quit [Ping timeout: 244 seconds]
tcopeland has joined #ruby-lang
<DefV> there used to be
<bradland> callumacrae: http://jade-lang.com
<bradland> woops
<bradland> last release was about a year ago though
charliesome has joined #ruby-lang
<callumacrae> any easy way to find a github repo from that?
<callumacrae> oh god im such a frontend developer
<DefV> callumacrae: link right to "Homepage"
<bradland> yeah, click on the “Homepage” link on the right hand side of the page
<callumacrae> ah thats the one I was looking at just now
<callumacrae> I can't decide if it's abandonned or just stable
<bradland> anyone know if coyboyd’s irc handle is cowboyd?
<DefV> 15:54 -!- ircname : Charles Lowell
<DefV> looks like it is
<callumacrae> nunjucks is my favourite templating language (based on jinja2), but I couldn't find a ruby port of that
rocco88 has joined #ruby-lang
Xzanron has quit [Quit: Leaving]
<bradland> i think you should build a port :)
<callumacrae> I don't know ruby at all :(
<bradland> well, the up side is, you won’t need to know much
<bradland> you can embed JS in Ruby with therubyracer, so you’ll really only need to write Ruby bindings for it
<callumacrae> wonder how far I can get if I set {% to <%= and {{ to <% and just use erb files
<bradland> the actual implementation can remain JS
<callumacrae> Basically the only logic in these files are i18n stuff
<callumacrae> Which is currently <%= t('lmn.bla.bla.bla') %>
mikecmpb_ is now known as mikecmpbll
ledestin has quit [Quit: ledestin]
_elia has joined #ruby-lang
ottlikg has quit [Ping timeout: 264 seconds]
sangwoojoo has joined #ruby-lang
elia has quit [Ping timeout: 240 seconds]
stef1a has quit [Quit: leaving]
tkuchiki has quit [Remote host closed the connection]
tkuchiki has joined #ruby-lang
hrs has joined #ruby-lang
havenwood has joined #ruby-lang
rahul_j has joined #ruby-lang
osw has joined #ruby-lang
kiyote23 has joined #ruby-lang
tkuchiki has quit [Ping timeout: 245 seconds]
j2p2 has joined #ruby-lang
leonshalimov has quit [Ping timeout: 264 seconds]
vondruch_ has joined #ruby-lang
futilegames_ has joined #ruby-lang
futilegames has quit [Ping timeout: 245 seconds]
futilegames_ is now known as futilegames
vondruch has quit [Ping timeout: 264 seconds]
kiyote23 has quit [Ping timeout: 252 seconds]
ottlikg has joined #ruby-lang
shazaum has joined #ruby-lang
loincloth has joined #ruby-lang
shazaum has quit [Changing host]
shazaum has joined #ruby-lang
nathanstitt has quit [Quit: I growing sleepy]
fijimunkii has joined #ruby-lang
Lewix has quit [Remote host closed the connection]
lcdhoffman has quit [Quit: lcdhoffman]
mcclurmc_ has joined #ruby-lang
Lewix has joined #ruby-lang
bmichelsen has joined #ruby-lang
nathanstitt has joined #ruby-lang
Bwild has quit [Ping timeout: 256 seconds]
hal_9000_ has joined #ruby-lang
btiefert has quit [Read error: Connection reset by peer]
whippythellama has joined #ruby-lang
rikkipitt has joined #ruby-lang
mcclurmc has quit [Ping timeout: 245 seconds]
leonshalimov has joined #ruby-lang
Lewix has quit [Ping timeout: 265 seconds]
Lewix has joined #ruby-lang
mistym has joined #ruby-lang
tenderlove has joined #ruby-lang
tectonic has joined #ruby-lang
mistym has quit [Remote host closed the connection]
tobiassvn has joined #ruby-lang
diegoviola has joined #ruby-lang
slawrence00 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
[H]unt3r has joined #ruby-lang
lcdhoffman has joined #ruby-lang
bmichels_ has joined #ruby-lang
skade has quit [Quit: Computer has gone to sleep.]
kiyote23 has joined #ruby-lang
skade has joined #ruby-lang
bmichels_ has quit [Quit: Bye!]
bmichelsen has quit [Quit: Bye!]
jgpawletko has joined #ruby-lang
jgpawletko is now known as jgpawletko_mtg
gwendall has joined #ruby-lang
apeiros has quit [Remote host closed the connection]
apeiros has joined #ruby-lang
mistym has joined #ruby-lang
ocdmw has quit [Remote host closed the connection]
slawrence00 has joined #ruby-lang
apeiros has quit [Ping timeout: 265 seconds]
|jemc| has joined #ruby-lang
kapil__ has quit [Quit: Connection closed for inactivity]
charliesome has quit [Quit: zzz]
kiyote23 has quit [Remote host closed the connection]
svajone has joined #ruby-lang
<svajone> anyone here?
<svajone> Anyone know a good way to filter hash using multiple keys and values?
<callumacrae> dont ask to ask, just ask :)
<callumacrae> i am slow
<svajone> Haha. I am using irc on mac for the first time, it doesn’t show me the users. :D
<callumacrae> theres loads of people here. im just a front-end developer who forgot to a leave, and not much use
oleo has joined #ruby-lang
nathanstitt has quit [Read error: Connection reset by peer]
<svajone> Hehe. It’s ok. :)
lcdhoffman has quit [Quit: lcdhoffman]
kiyote23 has joined #ruby-lang
klmlfl has joined #ruby-lang
nathanstitt has joined #ruby-lang
lcdhoffman has joined #ruby-lang
charliesome has joined #ruby-lang
<bradland> svajone: side-topic, but check out Colloquy for Mac if you need a more user-friendly IRC client.
qba73 has quit []
<svajone> I am using colluquy :D
<svajone> Haha.
<bradland> haha, click the little triangle to the left of “ruby”
<svajone> Been a linux person for so long, kinda weird transitioning.
<bradland> that will show you the list of users
<svajone> Haha. I see that now.
<bradland> as far as filtering hashes, it depends on what you want to do
<svajone> At first I thought I connected the wrong server.
<bradland> there’s select and reject
<bradland> which are pretty well documented
<svajone> So hash filtering, let’s say I have a hash that contains keys and subnested keys, I want to filter those keys with values equivalent to those keys.
<bradland> the best thing to do is to post a code snippet with the missing parts commented
intersect has quit [Ping timeout: 244 seconds]
kiyote23 has quit [Ping timeout: 264 seconds]
<bradland> how deep is the nesting?
<svajone> just two levels.
<svajone> Would be like this { key: 1 { key2: value } }
<bradland> if the depth is fixed, you can use a nested select
<bradland> you just wrap one select call in another
<svajone> nested select?
<ljarvis> "I want to filter those keys with values equivalent to those keys
<ljarvis> "
<ljarvis> wat
<svajone> yep.
<svajone> I was thinking something like this.
<ljarvis> svajone: please add input and desired output
<svajone> def search (options = {})
skade has quit [Ping timeout: 255 seconds]
<svajone> result = @hash.map dp |k,v|
<bradland> svajone: https://gist.github.com
<bradland> it’s better to drop the code in a gist so we can easily download, run, comment, and update it
intersect has joined #ruby-lang
skade has joined #ruby-lang
charliesome has quit [Quit: zzz]
<bradland> svajone: if you’re going to do filtering, you’ll want to use select/reject, rather than map. they’re very similar, but they alter the Hash based on whether the block evals true/false
<ljarvis> they dont alter the hash, nor does map
skade has quit [Read error: Connection reset by peer]
<ljarvis> </pedant>
<bradland> sry, bad wording
<bradland> they return a Hash based on whether the block evals true/false
<bradland> select!/reject! alter the hash
michaeldeol has joined #ruby-lang
<ljarvis> if only everything was immutable
<bradland> you no like the bang methods ljarvis?
hahuang61 has joined #ruby-lang
<ljarvis> bradland: I dont really like mutability all that much
<bradland> so cases where you want to modify the hash, do you prefer reassignment to the variable?
<bradland> >> foo = { bar: 'baz', qux: 'quux' };foo = foo.reject { |k, v| v == 'quux' }
<eval-in> bradland => {:bar=>"baz"} (https://eval.in/241421)
<bradland> normally, i’d just do
<bradland> >> foo = { bar: 'baz', qux: 'quux' };foo.reject! { |k, v| v == 'quux' }
<eval-in> bradland => {:bar=>"baz"} (https://eval.in/241422)
<bradland> just out of curiosity
oak1 has quit [Ping timeout: 265 seconds]
rikkipitt has quit [Read error: Connection reset by peer]
<ljarvis> bradland: generally, yeah. I use a lot of methods, though, and enjoy a functional look. So generally the outer method would be returning foo so there'd be no need to mutate. Obviously there are more cases than that, though
osw has quit [Quit: WeeChat 1.1]
intinig has joined #ruby-lang
rikkipitt has joined #ruby-lang
ocdmw has joined #ruby-lang
<ljarvis> however, you just can't avoid it in Ruby and im ok with that
hahuang61 has quit [Ping timeout: 244 seconds]
oleo has quit [Quit: Verlassend]
ascarter has joined #ruby-lang
JohnBat26 has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
Lewix has quit [Remote host closed the connection]
ascarter has quit [Client Quit]
Lewix has joined #ruby-lang
Lewix has quit [Changing host]
Lewix has joined #ruby-lang
sangwoojoo has quit [Remote host closed the connection]
ascarter has joined #ruby-lang
ascarter has quit [Client Quit]
oleo has joined #ruby-lang
oleo has quit [Changing host]
oleo has joined #ruby-lang
ascarter has joined #ruby-lang
Lewix has quit [Ping timeout: 240 seconds]
ascarter has quit [Max SendQ exceeded]
rippa has joined #ruby-lang
ascarter has joined #ruby-lang
Lewix has joined #ruby-lang
Lewix has quit [Changing host]
Lewix has joined #ruby-lang
hrs has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ascarter has quit [Max SendQ exceeded]
__butch__ has joined #ruby-lang
ascarter has joined #ruby-lang
Sadin has joined #ruby-lang
lcdhoffman has quit [Quit: lcdhoffman]
Hunew has joined #ruby-lang
igalic has joined #ruby-lang
<igalic> hello happy people o/~
<igalic> i'm trying to find out what "options" can be passed to to_yaml
<ljarvis> igalic: did you check the documentation?
<igalic> which documents :indentation, and, that's it.
<ljarvis> igalic: :indentation, :line_width, and :canonical
mistym has quit [Remote host closed the connection]
<ljarvis> igalic: agreed about the docs, might be worth filing an issue
<igalic> ljarvis: yeah, i just stumbled onto those, while browsing the source, looking for more info
<igalic> ljarvis: might also be nice to know what these things do :S
apeiros has joined #ruby-lang
rahul_j has quit [Quit: rahul_j]
<ljarvis> igalic: line_width: Set the preferred line with to +width+.
<igalic> also, given that it remains unfixed in http://ruby-doc.org/stdlib-2.2.0/libdoc/psych/rdoc/Psych.html#method-c-dump i might *really* wanna file a bug.
<ljarvis> canonical: Set the output style to canonical, or not.
<ljarvis> heh
<igalic> what does that mean?
Musashi007 has joined #ruby-lang
<ljarvis> im not sure :)
rahul_j has joined #ruby-lang
<igalic> ugh.. we just tried it out. it looks.. weird.
<igalic> :P
kiyote23 has joined #ruby-lang
vozcelik has joined #ruby-lang
chills42 has quit [Remote host closed the connection]
charliesome has joined #ruby-lang
rikkipitt has quit []
<svajone> I have return from my pooping.
<svajone> :D
<svajone> So, basically i was thinking of passing options and setting that as my filters and do a loop.
<apeiros> svajone: TMI
<svajone> apeiros:
<svajone> apeiros: hahaha. :D
AKASkip has joined #ruby-lang
<workmad3> apeiros: nah, TMI would be a review of size, shape and density...
<apeiros> that'd be /ban TMI
<workmad3> how about colour-matching it to a dulux paint? :)
<apeiros> I think I'll go back to solve other problems :)
chills42 has joined #ruby-lang
tectonic has quit []
kiyote23 has quit [Ping timeout: 244 seconds]
mistym has joined #ruby-lang
rikkipitt has joined #ruby-lang
<levifig> any regex pros here? :P Trying to do a .sub on a string for a specific character but only if it's the first character of the string… :P
vozcelik has quit [Quit: Textual IRC Client: www.textualapp.com]
<levifig> how would I match that? :)
leonshalimov has quit [Ping timeout: 245 seconds]
vozcelik has joined #ruby-lang
nathanst_ has joined #ruby-lang
bb010g has quit [Quit: Connection closed for inactivity]
nathanstitt has quit [Read error: Connection reset by peer]
<whitequark> /\Ax/
lytol has joined #ruby-lang
leonshalimov has joined #ruby-lang
<ericwood> or yeah use \A it's safer
<levifig> and I can use that straight on a .sub, .gsub or .delete?
<jhass> I'd consider str[0] = replacement if str.first == special
<whitequark> \A is not "safer", it's the only correct choice here
<whitequark> jhass: that's sub! though
<ericwood> whitequark: in the web world you can get into security issues with ^
<whitequark> levifig: yes
<whitequark> ericwood: I'm aware. ^ doesn't mean "first character of string"
<ericwood> whitequark: I've been told to just always use \A and not think about it unless it's not working for ya
<ericwood> yeah
mjc__ has quit []
nathanst_ has quit [Ping timeout: 240 seconds]
mjc_ has joined #ruby-lang
nathanstitt has joined #ruby-lang
centrx has joined #ruby-lang
Integralist has quit [Ping timeout: 255 seconds]
Hunew has quit [Quit: Http://www.ZeroIRC.NET ¢Æ Zero IRC ¢Æ Ver 2.9G]
Integral1st has quit [Ping timeout: 264 seconds]
hanjin has quit [Quit: Http://www.ZeroIRC.NET ¢Æ Zero IRC ¢Æ Ver 2.9G]
Integral2st has quit [Ping timeout: 264 seconds]
gwendall has quit []
mikecmpbll has quit [Ping timeout: 256 seconds]
<svajone> Can someone look at that and perhaps improve it where I can pass keys and matching values dynamically to filter my nested hash?
nathanstitt has quit [Ping timeout: 264 seconds]
charliesome has quit [Quit: zzz]
rbowlby has joined #ruby-lang
nathanstitt has joined #ruby-lang
migbar has quit []
hrs has joined #ruby-lang
cawil1 is now known as cawil
hrs has quit [Client Quit]
intinig has quit [Remote host closed the connection]
hrs has joined #ruby-lang
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
francisfish has quit [Remote host closed the connection]
elia has joined #ruby-lang
Lewix has quit [Remote host closed the connection]
Musashi007 has quit [Quit: Musashi007]
Lewix has joined #ruby-lang
rikkipitt has quit [Remote host closed the connection]
benlovell has quit [Ping timeout: 265 seconds]
francisfish has joined #ruby-lang
elia has quit [Client Quit]
_elia has quit [Ping timeout: 256 seconds]
ascarter has joined #ruby-lang
ascarter has quit [Max SendQ exceeded]
ascarter has joined #ruby-lang
rikkipitt has joined #ruby-lang
Lewix has quit [Ping timeout: 256 seconds]
rikkipitt has quit [Remote host closed the connection]
francisfish has quit [Ping timeout: 265 seconds]
shubhamgoyal has quit [Remote host closed the connection]
michaeldeol has quit [Read error: Connection reset by peer]
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Fretta has joined #ruby-lang
wallerdev has joined #ruby-lang
Lewix has joined #ruby-lang
Lewix has joined #ruby-lang
tenderlove has quit [Quit: Leaving...]
rahul_j has quit [Quit: rahul_j]
go|dfish has quit [Ping timeout: 245 seconds]
go|dfish has joined #ruby-lang
stamina has quit [Quit: WeeChat 1.0.1]
shubhamgoyal has joined #ruby-lang
shubhamgoyal has quit [Read error: Connection reset by peer]
workmad3 has quit [Ping timeout: 240 seconds]
shubhamgoyal has joined #ruby-lang
dik_dak has joined #ruby-lang
martinbmadsen has joined #ruby-lang
symm- has joined #ruby-lang
jgpawletko_mtg is now known as jgpawletko
martinbmadsen has quit [Ping timeout: 265 seconds]
Sadin has quit [Read error: Connection reset by peer]
Sadin has joined #ruby-lang
ruby-lang995 has joined #ruby-lang
hahuang61 has joined #ruby-lang
dellavg_ has joined #ruby-lang
leonshalimov has quit [Ping timeout: 245 seconds]
leonshalimov has joined #ruby-lang
chills42 has quit [Remote host closed the connection]
<levifig> whitequark, jhass, ericwood, thanks for the help previously btw :)
setanta_ has joined #ruby-lang
leonshalimov has quit [Ping timeout: 244 seconds]
chills42 has joined #ruby-lang
tmi__ has quit [Remote host closed the connection]
RobertBirnie has joined #ruby-lang
nathanstitt has quit [Ping timeout: 244 seconds]
nathanstitt has joined #ruby-lang
[H]unt3r has quit [Remote host closed the connection]
benlovell has joined #ruby-lang
Kryptonita has joined #ruby-lang
[H]unt3r has joined #ruby-lang
solars has quit [Ping timeout: 240 seconds]
lytol has quit [Remote host closed the connection]
tenderlove has joined #ruby-lang
<ruby-lang995> Has anyone made a shell script where changing directories is an option?
lytol has joined #ruby-lang
<centrx> What do you mean by that
benlovell has quit [Ping timeout: 256 seconds]
Kryptonita has quit [Ping timeout: 265 seconds]
<ruby-lang995> sorry about that my english is not good. I mean to ask how does a good ruby programmer get directory name from input?
<wallerdev> take it as a param?
<ruby-lang995> like cmd for eg, it's not made on ruby ofc but i'd like to know how cmd would work with "cd c:\examplE"
<ruby-lang995> umm who is talking to whom?? :|
<wallerdev> you can use Dir.chdir to change directories
<wallerdev> Dir.chdir("C:/examplE") { Dir.pwd }
iamninja has quit [Remote host closed the connection]
<ruby-lang995> ok i'll just send you a link to check https://github.com/cyniclimbu/HideContents/blob/master/HideContents.rb on line 26
fusillicode has quit [Quit: Leaving.]
iamninja has joined #ruby-lang
fusillicode has joined #ruby-lang
<ruby-lang995> i'm just cutting "cd" out of "cd c:\example" and doing Dir.chdir which is not good,,,
bantic has joined #ruby-lang
<ruby-lang995> hello..?
<jhass> your indentation is hard to follow
<ruby-lang995> i'm not sure what that means but i'd agree.
<jhass> mh, it's probably because you use tabs
<jhass> ruby community standard is two spaces
<ruby-lang995> ok i'm sorry.
<yorickpeterse> The penalty for using tabs is a paddlin'
<ruby-lang995> omg no...i have request??
<yorickpeterse> request?
<jhass> ruby-lang995: I'd probably do directory = command.split(/\s+/, 2).last
nathanstitt has quit [Ping timeout: 264 seconds]
yfeldblum has quit [Ping timeout: 265 seconds]
<ruby-lang995> thanks jhass, i'll try that :) but what does that regex mean?
<jhass> and system(%Q{attrib +s +h "#{command}"})
fijimunkii has quit [Quit: leaving]
amsi has joined #ruby-lang
lytol has quit []
<jhass> \s means any whitespace character
<jhass> + means one or more
nathanstitt has joined #ruby-lang
lytol has joined #ruby-lang
<ruby-lang995> yornickpeterse, i was about to request about how you'd go on about making your own tiny program where you can cd to directories...
<ruby-lang995> thanks jhass
<yorickpeterse> oh right
<yorickpeterse> FYI I was joking, nobody will give you a paddlin' for your indentation
<ruby-lang995> no tabs next time :)
araujo has joined #ruby-lang
araujo has joined #ruby-lang
<ruby-lang995> one last question, did you guys massage your temple when you saw my code xD ???
<yorickpeterse> "massage your temple"?
theta88 has joined #ruby-lang
<pipework> ruby-lang995: Well, something was being massaged.
leonshalimov has joined #ruby-lang
<ruby-lang995> facepalm, lose hope, oh god why
<ruby-lang995> What was?
<theta88> is there a way to generate a set of hash keys(not values) such as 1..24 ?
<pipework> theta88: hash keys are just objects, so sure.
<pipework> But if you want the objects as keys in a hash, you need values for them. Otherwise, it's just an array of objects.
arBmind has quit [Quit: Leaving.]
<theta88> ah, im trying to get the frequency of a sample of numbers
nathanstitt has quit [Quit: I growing sleepy]
nathanstitt has joined #ruby-lang
ruby-lang608 has joined #ruby-lang
<ruby-lang608> how to change "for i in 1..@list.size" to each command? I have problem with 'i'
<jhass> (1..@list.size).each do |i|
<jhass> but I prefer 1.upto(@list.size) do |i|
<apeiros> +1 upto
<apeiros> temples were massaged, faces palmed, desks faced…
<pipework> I dislike upto for not following ruby's naming conventions, but other than that it's nice.
rocco88 has left #ruby-lang [#ruby-lang]
ruby-lang995 has quit [Ping timeout: 246 seconds]
<jhass> I could get Integer#to into Crystal <3
<apeiros> sadly, core has a couple of oddities
|jemc| has quit [Ping timeout: 245 seconds]
nathanstitt has quit [Client Quit]
ocdmw has quit [Remote host closed the connection]
slawrence00 has quit [Ping timeout: 264 seconds]
Musashi007 has joined #ruby-lang
shazaum has quit [Quit: Leaving]
<ruby-lang608> The |x| is returned value so correct code should be list.max { |x.number| x.number } instead of list.max { |x| x.number }.number
<ruby-lang608> Am I correct ?
<centrx> |x| is the element of the enumerable in the current iteration
<centrx> can't put method calls in there
<ruby-lang608> so I have to keep it { }.number ?
<centrx> What are you trying to do? Is there some code?
arBmind has joined #ruby-lang
martinbmadsen has joined #ruby-lang
<ruby-lang608> I am using find fuction to get some properties like id, number, l
<ruby-lang608> @list.find { |x| x.id == precedent_id }
<ruby-lang608> and I have to always use something like this @list.find { |x| x.id == precedent_id }.precedents to get property
<ruby-lang608> and I wanna know if there is better option to do it
theta88 has quit [Quit: leaving]
<centrx> ok so in the case of finding a max number, you can try this alternative:
wallerdev has quit [Quit: wallerdev]
<centrx> list.map(&:number).max
<centrx> this is equivalent to: list.map { |x| x.number }.max
<pipework> max_by pls
wallerdev has joined #ruby-lang
<centrx> ah right, so you have, ruby-lang608 list.max_by(&:number) even more concise
bjessbrown has joined #ruby-lang
<centrx> ruby-lang608, You may also want to look at the bigger picture, why are you using list.find so much? Maybe you want to use a Hash (aka dictionary) instead of an array, to store these records by their id/key
blacktulip has joined #ruby-lang
<ruby-lang608> I am writing critical path method structure
fumduq has quit [Ping timeout: 272 seconds]
yfeldblum has joined #ruby-lang
yfeldblum has quit [Remote host closed the connection]
DarkBushido has quit [Ping timeout: 272 seconds]
yfeldblum has joined #ruby-lang
theta88 has joined #ruby-lang
fumduq has joined #ruby-lang
blacktulip has quit [Ping timeout: 244 seconds]
solars has joined #ruby-lang
DarkBushido has joined #ruby-lang
solars has quit [Client Quit]
solars has joined #ruby-lang
blacktulip has joined #ruby-lang
blacktulip has quit [Client Quit]
bmichelsen has joined #ruby-lang
|jemc| has joined #ruby-lang
svajone has quit [Quit: svajone]
<ljarvis> ruby-lang608: sounds like you want a Hash as centrx suggests
Musashi007 has quit [Quit: Musashi007]
dagda1 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hahuang61 has quit [Quit: WeeChat 1.0.1]
svajone has joined #ruby-lang
hahuang65 has joined #ruby-lang
dik_dak has quit [Read error: Connection reset by peer]
dik_dak has joined #ruby-lang
dik_dak has quit [Max SendQ exceeded]
dik_dak has joined #ruby-lang
svajone has quit [Read error: Connection reset by peer]
sideshowcoder has quit [Ping timeout: 264 seconds]
wallerdev has quit [Quit: wallerdev]
dagda1 has joined #ruby-lang
djbkd has joined #ruby-lang
sideshowcoder has joined #ruby-lang
emmesswhy has joined #ruby-lang
ldnunes has quit [Quit: Leaving]
dik_dak has quit [Client Quit]
martinbmadsen has quit [Ping timeout: 244 seconds]
lytol has quit [Remote host closed the connection]
hrs has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hrs has joined #ruby-lang
ta_ has quit [Read error: Connection reset by peer]
nifoc has quit [Remote host closed the connection]
symm- has quit [Ping timeout: 244 seconds]
rikkipitt has joined #ruby-lang
ta has joined #ruby-lang
nifoc has joined #ruby-lang
DarkBushido has quit [Ping timeout: 265 seconds]
chancancode has quit [Read error: Connection reset by peer]
spastorino has quit [Read error: Connection reset by peer]
manveru has quit [Ping timeout: 265 seconds]
lacrosse__ has quit [Ping timeout: 265 seconds]
dlackty__ has quit [Write error: Connection reset by peer]
Guest81780 has quit [Ping timeout: 265 seconds]
heftig has quit [Remote host closed the connection]
x0f has quit [Ping timeout: 265 seconds]
twe4ked has quit [Ping timeout: 265 seconds]
meizaps has quit [Ping timeout: 265 seconds]
ritek has quit [Ping timeout: 244 seconds]
akahn has quit [Ping timeout: 244 seconds]
mostlybadfly has quit [Ping timeout: 265 seconds]
hellome has quit [Remote host closed the connection]
fclausen has joined #ruby-lang
womble has quit [Ping timeout: 265 seconds]
tobiasvl has quit [Ping timeout: 265 seconds]
havenwood has quit [Remote host closed the connection]
avdi has quit [Read error: Network is unreachable]
ramblinpeck_ has quit [Write error: Connection reset by peer]
jlpeters has quit [Ping timeout: 245 seconds]
tvl has joined #ruby-lang
tvl is now known as tobiasvl
melter has quit [Ping timeout: 265 seconds]
dlackty__ has joined #ruby-lang
manveru has joined #ruby-lang
havenwood has joined #ruby-lang
benten has quit [Quit: ...]
heftig has joined #ruby-lang
workmad3 has joined #ruby-lang
lacrosse__ has joined #ruby-lang
spastorino has joined #ruby-lang
lytol has joined #ruby-lang
avdi has joined #ruby-lang
chancancode has joined #ruby-lang
ritek has joined #ruby-lang
ramblinpeck_ has joined #ruby-lang
akahn has joined #ruby-lang
jlpeters has joined #ruby-lang
sangwoojoo has joined #ruby-lang
womble has joined #ruby-lang
melter has joined #ruby-lang
mostlybadfly has joined #ruby-lang
ocdmw has joined #ruby-lang
hotpancakes has joined #ruby-lang
ocdmw has quit [Remote host closed the connection]
ocdmw has joined #ruby-lang
workmad3 has quit [Ping timeout: 244 seconds]
meizaps has joined #ruby-lang
aef has quit [Remote host closed the connection]
hrs has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
twe4ked has joined #ruby-lang
allolex___ has quit [Ping timeout: 244 seconds]
aef has joined #ruby-lang
aef has quit [Remote host closed the connection]
allolex____ has joined #ruby-lang
x0f has joined #ruby-lang
linc01n has quit [Ping timeout: 244 seconds]
hramrach has quit [Remote host closed the connection]
ishikawa has quit [Remote host closed the connection]
ishikawa has joined #ruby-lang
gnufied has quit [Ping timeout: 244 seconds]
yfeldblum has quit [Read error: Network is unreachable]
bryancp has quit [Read error: Connection reset by peer]
Raycaster has left #ruby-lang [#ruby-lang]
yfeldblum has joined #ruby-lang
hramrach has joined #ruby-lang
DarkBushido has joined #ruby-lang
DarkBushido has quit [Changing host]
DarkBushido has joined #ruby-lang
bryancp has joined #ruby-lang
hrs has joined #ruby-lang
aef has joined #ruby-lang
nomadicoder has quit [Ping timeout: 244 seconds]
linc01n has joined #ruby-lang
leonshalimov has quit [Ping timeout: 240 seconds]
gnufied has joined #ruby-lang
Kryptonita has joined #ruby-lang
odin22 has joined #ruby-lang
nomadicoder has joined #ruby-lang
odin22 has quit [Client Quit]
aef has quit [Remote host closed the connection]
yalue has quit [Quit: return 0;]
aef has joined #ruby-lang
momomomomo has joined #ruby-lang
Kryptonita has quit [Ping timeout: 244 seconds]
aef has quit [Remote host closed the connection]
aef has joined #ruby-lang
michaeldeol has joined #ruby-lang
ocdmw has quit [Remote host closed the connection]
aef has quit [Remote host closed the connection]
symm- has joined #ruby-lang
hotpancakes has quit []
diegovio1 has joined #ruby-lang
wallerdev has joined #ruby-lang
diegoviola has quit [Ping timeout: 252 seconds]
leonshalimov has joined #ruby-lang
wallerdev has quit [Client Quit]
leonshalimov has quit [Ping timeout: 245 seconds]
aef has joined #ruby-lang
bantic has quit [Quit: bantic]
djbkd has quit [Remote host closed the connection]
fusillicode has quit [Quit: Leaving.]
bantic has joined #ruby-lang
|jemc| has quit [Quit: WeeChat 1.0.1]
yfeldblu_ has joined #ruby-lang
yfeldblum has quit [Ping timeout: 245 seconds]
nifoc has quit [Remote host closed the connection]
nifoc has joined #ruby-lang
ruby-lang608 has quit [Quit: Page closed]
wallerdev has joined #ruby-lang
FastJack_ has joined #ruby-lang
setanta_ has quit [Quit: Leaving]
chills42 has quit [Remote host closed the connection]
melter has quit [Quit: Client exiting]
dellavg_ has quit [Ping timeout: 264 seconds]
martinbmadsen has joined #ruby-lang
matp has quit [Remote host closed the connection]
svajone has joined #ruby-lang
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
FastJack has quit [*.net *.split]
<svajone> Anyone know a good way of indentfying if someone passes + or - on the console?
ottlikg has quit [Ping timeout: 255 seconds]
leonshalimov has joined #ruby-lang
<svajone> say if I pay +300 then it means I am looking for values greater than 300, if I pass -300 it means I am looking for values less than 300
<eam> what do you mean passes?
momomomomo_ has joined #ruby-lang
ruby-lang994 has joined #ruby-lang
<ruby-lang994> ghhk
ruby-lang994 has quit [Client Quit]
michaeldeol has joined #ruby-lang
hrs has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
elia has joined #ruby-lang
melter has joined #ruby-lang
momomomomo has quit [Ping timeout: 244 seconds]
momomomomo_ is now known as momomomomo
<pipework> svajone: Look into thor
martinbmadsen has quit [Ping timeout: 265 seconds]
Mon_Ouie has quit [Ping timeout: 245 seconds]
hrs has joined #ruby-lang
yfeldblu_ has quit [Remote host closed the connection]
elia has quit [Client Quit]
bmichelsen has quit [Read error: Connection reset by peer]
postmodern has joined #ruby-lang
rikkipitt has quit []
<svajone> The norse god? :D
kiyote23 has joined #ruby-lang
nathanstitt has joined #ruby-lang
klmlfl_ has joined #ruby-lang
kiyote23 has quit [Ping timeout: 255 seconds]
klmlfl has quit [Ping timeout: 264 seconds]
djbkd has joined #ruby-lang
benlovell has joined #ruby-lang
arBmind has quit [Quit: Leaving.]
arBmind has joined #ruby-lang
leonshalimov has quit [Ping timeout: 245 seconds]
ItSANgo__ has quit [Quit: Leaving...]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
GBrawl has quit [Quit: (null)]
theta88 has quit [Quit: leaving]
dik_dak has joined #ruby-lang
bjessbrown has quit []
diegovio1 is now known as diegoviola
ocdmw has joined #ruby-lang
GBrawl has joined #ruby-lang
leonshalimov has joined #ruby-lang
matp has joined #ruby-lang
ascarter has joined #ruby-lang
tcopeland has quit [Ping timeout: 264 seconds]
elia has joined #ruby-lang
Nixsos has joined #ruby-lang
<svajone> Hey guys, say the options hash a key is passed twice (the same key) how would i combine the key and the values into an OR statement?
mistym has quit [Remote host closed the connection]
<apeiros> svajone: you can't pass the same key twice.
<svajone> I can’t?
<svajone> So if I have method(:key1 => value, :key1 => different_value
mistym has joined #ruby-lang
<apeiros> you can't.
<centrx> in a Hash, the same key overwrites the previous key
<centrx> You might want an Array of Hashes?
yfeldblum has joined #ruby-lang
<apeiros> or an array as value
<apeiros> probably the saner way.
djbkd has quit [Remote host closed the connection]
<svajone> Ah, I see.
<svajone> Can you post me a sample gist?
<svajone> Say, I pass in the key and have an array for the value, how would I iterate through them then?
aef has quit [Remote host closed the connection]
djbkd has joined #ruby-lang
nathanstitt has quit [Quit: I growing sleepy]
yfeldblum has quit [Ping timeout: 265 seconds]
aef has joined #ruby-lang
klmlfl_ has quit [Remote host closed the connection]
<drbrain> options.each do |key, values| values.each do |value| # ~
klmlfl has joined #ruby-lang
djbkd has quit [Remote host closed the connection]
ocdmw has quit [Remote host closed the connection]
<svajone> I see, thanks!
[H]unt3r has quit [Remote host closed the connection]
[H]unt3r has joined #ruby-lang
emmesswhy has quit [Quit: This computer has gone to sleep]
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mistym has quit [Remote host closed the connection]
[H]unt3r has quit [Ping timeout: 244 seconds]
[H]unt3r has joined #ruby-lang
emmesswhy has joined #ruby-lang
GBrawl has quit [Ping timeout: 265 seconds]
dagda1 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rocco88 has joined #ruby-lang
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rocco88 has left #ruby-lang [#ruby-lang]
ascarter has joined #ruby-lang
ascarter has quit [Max SendQ exceeded]
ItSANgo has joined #ruby-lang
ascarter has joined #ruby-lang
dagda1 has joined #ruby-lang
nathanstitt has joined #ruby-lang
Lewix has quit [Remote host closed the connection]
djbkd has joined #ruby-lang
Lewix has joined #ruby-lang
Lewix has quit [Changing host]
Lewix has joined #ruby-lang
mistym has joined #ruby-lang
Lewix has quit [Ping timeout: 252 seconds]
leonshalimov has quit [Ping timeout: 264 seconds]
djbkd has quit [Ping timeout: 252 seconds]
solars has quit [Ping timeout: 244 seconds]
pwnz0r has joined #ruby-lang
lytol has quit [Remote host closed the connection]
benlovell has quit [Ping timeout: 264 seconds]
djbkd has joined #ruby-lang
leonshalimov has joined #ruby-lang
[H]unt3r has quit []
Mon_Ouie has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
Guest81780 has joined #ruby-lang
martinbmadsen has joined #ruby-lang
sondr3 has joined #ruby-lang
GBrawl has joined #ruby-lang
<svajone> Hey guys, need a nudge on how to approach this.
<svajone> So let’s say I can pass an option for weight, so :weight =
<svajone> :weight => number
GBrawl has quit [Client Quit]
<svajone> What’s the best way to hand say someone enters, +300 or -300 and if one of the operators exist it’ll do a >, < or == operation.
martinbmadsen has quit [Ping timeout: 245 seconds]
dik_dak_ has joined #ruby-lang
duderonomy has quit [Ping timeout: 256 seconds]
<centrx> svajone, This is user input from gets? command-line argument?
dik_dak_ has quit [Client Quit]
yfeldblum has joined #ruby-lang
dik_dak_ has joined #ruby-lang
<svajone> Yep, without using thor.
<svajone> I want to learn how to do this right. :D
<svajone> Or let’s start with easy, just an argument when calling the class method.
<centrx> svajone, so either at the beginning when you get the parameter, or the end when you use it, you have a string
<centrx> svajone, I would separate the string into an operator and a value
<centrx> >> "+300"[0]
<eval-in> centrx => "+" (https://eval.in/241500)
<centrx> or, say:
dik_dak has quit [Ping timeout: 265 seconds]
<centrx> op, value = str[0], str[1..-1]
<centrx> and you can use a case statement
hrs has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<centrx> case op when '+' then x > value when '-' then x < value end
tcopeland has joined #ruby-lang
<svajone> I see, thanks!
<svajone> Tried runinng this on the command line and can’t get it to work however, “+300”[0]
<centrx> may be due to fancy smart quotes?
leonshalimov has quit [Ping timeout: 240 seconds]
<bradland> i think he’s using colloquy
<bradland> which uses CoreText on OS X, which embeds smart quotes
<ericwood> yep
<bradland> svajone: did you do it at a shell prompt, or an irb prompt?
<bradland> … which annoys the hell out of me (re smart quotes)
ocdmw has joined #ruby-lang
<svajone> I did it on pry.
<svajone> :D
<svajone> Did on irb and it worked.
<svajone> Why did it not work on irb though?
<bradland> it should work in both
<bradland> did you copy/paste, or do it by hand?
<bradland> also, do you know what “smart quotes” are?
<bradland> see the quotes in my last message? those are smart quotes, and they won't work in Ruby
<bradland> i just disabled them, so these should be "regular quotes"
<bradland> if you copy/paste smart quotes in to irb, they won't work
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<svajone> Oh, what are smart quotes?
<svajone> “ <- this is a smart quote?
<bradland> read my last few messages
<bradland> yeah, it looks like a smart quote
momomomomo has quit [Quit: momomomomo]
<bradland> you're using colloquy, right?
<svajone> Yep yep.
<bradland> ok, right click in the text field, and choose Substitutions > Smart Quotes
<bradland> that will disable smart quotes in colloquy
<bradland> so you don't accidentally type them
<bradland> you have to do that every time you start colloquy though (۶ૈ ᵒ̌ Дᵒ̌)۶
aef has quit [Remote host closed the connection]
Bwild has joined #ruby-lang
<svajone> Gotcha. Haha, thanks.
<svajone> One more thing, so now I have the operator taken out,
<svajone> What's the method then to retrieve the rest?
lytol has joined #ruby-lang
<svajone> so if "+300"[0] returns the "+" sign, how will I access 300?
<bradland> well, your original string remains unchanged
<bradland> there's a cool trick you can do with the string [] method
<svajone> What's that?
<bradland> >> "+300[1..-1]
<eval-in> bradland => /tmp/execpad-f3646964cd55/source-f3646964cd55:6:in `raise': exception object expected (TypeError) ... (https://eval.in/241515)
<bradland> "+300"[1..-1]
<bradland> here we go again :)
<bradland> shevy !
<bradland> this is all your fault
<bradland> >> "+300"[1..-1]
<eval-in> bradland => "300" (https://eval.in/241518)
<bradland> there we go
<bradland> so, do you understand how that [] method is working?
<bradland> doing "string"[1] is just like calling any other method
<bradland> >> "+300".[1..-1]
<eval-in> bradland => /tmp/execpad-6754bc56747c/source-6754bc56747c:2: syntax error, unexpected '[', expecting '(' ... (https://eval.in/241519)
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<bradland> wasn't sure if that would work
<bradland> it doesn't, but, that's not really important
<bradland> have a look at this documentation: http://www.ruby-doc.org/core-2.2.0/String.html#method-i-5B-5D
<bradland> being able to read the documentation is really important
<svajone> Thanks, yeah I got it. :D I knew it had something to do with arrays.
<bradland> so, the String#[] method is like accessing a string as an array
<bradland> see how I used 1..-1 as the argument though?
<bradland> that's a range
aef has joined #ruby-lang
<bradland> the number 1 to -1
<bradland> with String#[], -1 means "end of string"
<svajone> Ah, thanks thanks! :)
<bradland> you bet
cornerma1 has joined #ruby-lang
<svajone> One more. :D :D
<bradland> haha, sure
cornerman has quit [Ping timeout: 256 seconds]
cornerma1 is now known as cornerman
<svajone> so I am setting the operator right?
<svajone> operator = < || > || ==
<svajone> How would I set it's default value and use that in my block?
<bradland> do you have a github account?
<svajone> yes, it is magicalbanana
<svajone> :D
mistym has quit [Remote host closed the connection]
<svajone> But I have not put this on my repo.
<bradland> ok, the best thing to do would be to put this project in a github repo
<bradland> and push the code you're working with, so we can look at it
<svajone> :D It's very simple. One sec.
<bradland> ok, you can gist it too
<svajone> I'll gist this one. :D
ocdmw has quit [Remote host closed the connection]
ocdmw has joined #ruby-lang
Lewix has joined #ruby-lang
Lewix has joined #ruby-lang
whippythellama has quit [Quit: whippythellama]
ocdmw has quit [Remote host closed the connection]
arBmind has quit [Ping timeout: 244 seconds]
<svajone> Ah, I can't gist it cause I can't copy form my stupid vim
arBmind has joined #ruby-lang
<svajone> yank does not go to clipboard.
<bradland> save the file
Guest81780 is now known as marr
<bradland> then, in a separate terminal, do: cat filename.rb | pbcopy
momomomomo has joined #ruby-lang
<bradland> pbcopy is an OS X command line utility for your clipboard
<bradland> you can pipe output to it
<bradland> cat just prints the file
<svajone> so :pbcopy?
<bradland> obviously you'll have to replace filename.rb with your file
<bradland> this is just at a terminal
<bradland> no irb or pry
<bradland> cat filename.rb | pbcopy
enebo has quit [Quit: enebo]
<bradland> that's the command
arBmind has quit [Client Quit]
djbkd has quit [Remote host closed the connection]
<wnd> I'm sorry, but I just have to say this before going to bed: useless use of cat :-) (and the off to feeding one)
pwnz0r has quit [Remote host closed the connection]
AKASkip has quit [Ping timeout: 265 seconds]
<svajone> There. :D
<bradland> wnd: i am the king of useless cat!
<svajone> So on search, I just want a way to check the weight option and basically dynamically pass the operator for comparison on my block.
<bradland> do me a favor. edit that gist and change the filename so it ends in .rb
<bradland> that way github will do syntax highlighting
<svajone> gotit.
klmlfl has quit [Ping timeout: 264 seconds]
<svajone> done sir.
<bradland> ok, having a look
<bradland> ok, lots to work on here :)
<svajone> Haha. :D It's ok.
<bradland> first things first, think about your methods and the arguments you're passing
simi has joined #ruby-lang
<svajone> What about them?
<simi> hello
<bradland> methods should describe what they do, and take arguments that are relevant
djbkd has joined #ruby-lang
mistym has joined #ruby-lang
<simi> Does cache: bundler works for multiple rubies and gemfiles by default?
<bradland> for example, "search" is an instance method of the DinoDex class
<svajone> Yep, that's true.
<bradland> so, you create an instance of the DinoDex, then you call search on it. but what are you searching for?
<bradland> should search accept an argument?
<svajone> Dinosaurs! :)
<bradland> "options" is very vague
<bradland> tell me what search should do?
<svajone> Oh, I see what oyu mean now.
<bradland> does it compare something internally?
<svajone> You want me to be more descriptive, OI'll fix that.
<bradland> that's what it looks like
musl has quit [Ping timeout: 265 seconds]
<bradland> yeah, also. options is probably a bad name
<svajone> But can you tell me how I can approach line 52 and the default operator when the key is not weight?
<bradland> sry, i've typed like three replies
<svajone> It's cool.
<bradland> but i'm struggling with understanding what that line is supposed to achieve
apeiros has quit [Remote host closed the connection]
<bradland> that's the nature of code
bantic has quit [Quit: bantic]
<bnagy> looks like homework
<bradland> if the foundations aren't good, it's hard to get to a result
<svajone> Hehe. "D
apeiros has joined #ruby-lang
<svajone> Kinda homework, I'm more used to database driven app than this. :D
<bnagy> but, just use send
<svajone> just send?
<bnagy> you can send your methods as strings or symbols
<svajone> Can I just use send without an object?
<bradland> right now you can't because your operators on 42, 44, and 46 aren't assigned anywhere
pwnz0r has joined #ruby-lang
<bnagy> >> 3.send "==", 3
<eval-in> bnagy => true (https://eval.in/241535)
<svajone> gotcha, so it would be object.send(operator, value()
<bnagy> dino[criterion].send op, query
<bnagy> with the understanding that this is all just awful
<svajone> Haha. Sorry, I know. I'll fix it tomorrow, but thank you everyone! :D
<svajone> See you later.
<bradland> famous last words ;)
Paradox has quit [Ping timeout: 272 seconds]
momomomomo_ has joined #ruby-lang
momomomomo has quit [Ping timeout: 240 seconds]
momomomomo_ is now known as momomomomo
svajone has quit [Ping timeout: 244 seconds]
mikecmpbll has joined #ruby-lang
Paradox has joined #ruby-lang
ur5us has joined #ruby-lang
nathanstitt has quit [Quit: I growing sleepy]