havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com || Ruby 2.4.1, 2.3.4 & 2.2.7: https://www.ruby-lang.org || Paste >3 lines of text to: https://gist.github.com || Rails questions? Ask in: #RubyOnRails || Logs: https://irclog.whitequark.org/ruby || Books: https://goo.gl/wpGhoQ
knight33 has joined #ruby
cats has quit [Ping timeout: 240 seconds]
xzhao_ has quit [Remote host closed the connection]
ddffg has quit [Ping timeout: 240 seconds]
t-recx has quit [Quit: t-recx]
polishdub has quit [Remote host closed the connection]
enterprisey has joined #ruby
jooni has quit [Ping timeout: 240 seconds]
AnoHito has joined #ruby
AnoHito_ has quit [Ping timeout: 240 seconds]
[Butch] has quit [Quit: I'm out . . .]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ecuanaso has joined #ruby
Kug3lis_ is now known as Kug3lis_off
Kug3lis_off is now known as Kug3lis_
Kug3lis_ is now known as Kug3lis_off
Danny_ has joined #ruby
nesoi has quit [Quit: Leaving.]
duderonomy has joined #ruby
Danny_ has quit [Ping timeout: 240 seconds]
Rodya_ has quit [Remote host closed the connection]
Rodya_ has joined #ruby
Rodya_ has quit [Remote host closed the connection]
Rodya__ has joined #ruby
weathermaker has quit [Ping timeout: 240 seconds]
d^sh has quit [Ping timeout: 246 seconds]
d^sh has joined #ruby
cats has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
ghs39ghsggf has joined #ruby
ghs39ghsggf has left #ruby [#ruby]
br0d1n has quit [Quit: Leaving]
Rodya__ has quit [Remote host closed the connection]
konsolebox has quit [Ping timeout: 246 seconds]
eightlimbed has quit [Ping timeout: 240 seconds]
enterprisey has quit [Read error: Connection reset by peer]
perniciouscaffei has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Rodya_ has joined #ruby
hightower3 has quit [Ping timeout: 255 seconds]
bruce_lee has quit [Ping timeout: 260 seconds]
shinnya has joined #ruby
gusrub has quit []
bruce_lee has joined #ruby
bruce_lee has joined #ruby
bruce_lee has quit [Changing host]
latemus has quit [Quit: leaving]
centrx has joined #ruby
nesoi has joined #ruby
konsolebox has joined #ruby
shinnya has quit [Ping timeout: 240 seconds]
charliesome has joined #ruby
centrx has quit [Client Quit]
dionysus69 has quit [Ping timeout: 246 seconds]
Danny_ has joined #ruby
ascarter has joined #ruby
Danny_ has quit [Client Quit]
Kilo`byte has quit [Ping timeout: 260 seconds]
marxarelli|afk has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
Kilo`byte has joined #ruby
vincent_ has quit [Remote host closed the connection]
KillerFox has quit [Write error: Broken pipe]
FastJack has quit [Remote host closed the connection]
forgot has quit [Write error: Broken pipe]
KillerFox has joined #ruby
forgot has joined #ruby
cats has quit [Ping timeout: 260 seconds]
FastJack has joined #ruby
ascarter has quit [Ping timeout: 268 seconds]
quobo has quit [Quit: Connection closed for inactivity]
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<SeepingN> Anyone have a decent online ruby checker where you can dump your single file and have it check for unmatched begin/end and parens?
Kug3lis_off is now known as Kug3lis_
Kug3lis_ is now known as Kug3lis_off
d^sh has quit [Ping timeout: 240 seconds]
<havenwood> SeepingN: echo "def hi" > seepingn.rb; ruby -w seepingn.rb #!> seepingn.rb:1: syntax error, unexpected end-of-input
PatrikasZvaigzde has quit [Ping timeout: 246 seconds]
<havenwood> err, i mean to use -c
<havenwood> SeepingN: ruby -c seepingn.rb
<havenwood> -c check syntax only
d^sh has joined #ruby
dviola has quit [Quit: WeeChat 1.8]
gothicsouth has joined #ruby
dviola has joined #ruby
mjuszczak has joined #ruby
<SeepingN> yep, just re-learned of -w, thank you
mjuszczak has quit [Max SendQ exceeded]
<SeepingN> it was enough to find all sort of glorious to-do's :\
mjuszczak has joined #ruby
<SeepingN> and I found where I had dumped some code but hadn't commented it out for testing/tweaking
weathermaker has joined #ruby
vincent_ has joined #ruby
vincent_ has quit [Remote host closed the connection]
vincent_ has joined #ruby
mjuszczak has quit [Client Quit]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
PorcoRex has joined #ruby
<PorcoRex> Good evening.
sleetdrop has quit [Quit: Computer has gone to sleep.]
cats has joined #ruby
troys_ is now known as troys
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
elifoster has joined #ruby
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
theunraveler has joined #ruby
theunraveler has quit [Client Quit]
gothicsouth has joined #ruby
brent__ has quit [Remote host closed the connection]
Rodya_ has quit [Remote host closed the connection]
jameser has joined #ruby
poloych has quit [Remote host closed the connection]
jackjackdripper has joined #ruby
jackjackdripper has quit [Client Quit]
poloych has joined #ruby
uZiel has joined #ruby
Asher has quit [Quit: Leaving.]
jenrzzz has quit [Ping timeout: 255 seconds]
im0nde has quit [Ping timeout: 255 seconds]
gizmore|2 has joined #ruby
username1 has quit [Ping timeout: 240 seconds]
Asher has joined #ruby
gizmore has quit [Ping timeout: 258 seconds]
kies has quit [Ping timeout: 240 seconds]
Hunter1 has quit [Remote host closed the connection]
Hunter1 has joined #ruby
dviola has quit [Quit: WeeChat 1.8]
knight33 has quit [Quit: Textual IRC Client: www.textualapp.com]
hobodave has quit [Quit: Computer has gone to sleep.]
blackwind_123 has quit [Ping timeout: 240 seconds]
troys is now known as troys_
ascarter has joined #ruby
poloych has quit [Remote host closed the connection]
d^sh has quit [Ping timeout: 260 seconds]
d^sh has joined #ruby
eightlimbed has joined #ruby
enterprisey has joined #ruby
__Yiota has joined #ruby
ascarter has quit [Ping timeout: 268 seconds]
arescorpio has joined #ruby
[dmp] has quit [Ping timeout: 240 seconds]
AnoHito has quit [Read error: Connection reset by peer]
hlmjr has quit [Remote host closed the connection]
AnoHito has joined #ruby
__Yiota has quit [Client Quit]
shadeslayer has quit [Read error: Connection reset by peer]
[dmp] has joined #ruby
turingbombe has joined #ruby
shadeslayer has joined #ruby
__Yiota has joined #ruby
bkxd has joined #ruby
bkxd_ has joined #ruby
__Yiota has quit [Client Quit]
genpaku has quit [Remote host closed the connection]
__Yiota has joined #ruby
bkxd has quit [Ping timeout: 258 seconds]
bkxd has joined #ruby
genpaku has joined #ruby
_whitelogger has joined #ruby
bkxd_ has quit [Ping timeout: 258 seconds]
bkxd has quit [Ping timeout: 258 seconds]
belmoussaoui has quit [Quit: belmoussaoui]
brent__ has joined #ruby
turingbombe has quit [Quit: Leaving]
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
belmoussaoui has joined #ruby
gothicsouth has joined #ruby
brent__ has quit [Ping timeout: 260 seconds]
sleetdrop has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Rodya_ has joined #ruby
jrafanie has joined #ruby
xall has joined #ruby
j0bk has left #ruby ["Textual IRC Client: www.textualapp.com"]
sleetdrop has quit [Quit: Computer has gone to sleep.]
belmoussaoui has quit [Ping timeout: 260 seconds]
belmoussaoui has joined #ruby
sleetdrop has joined #ruby
yeticry_ has quit [Ping timeout: 255 seconds]
yeticry has joined #ruby
sleetdrop has quit [Client Quit]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
HoierM has quit [Ping timeout: 255 seconds]
QpQ4 has joined #ruby
cschneid_ has quit [Read error: Connection reset by peer]
cschneid_ has joined #ruby
__Yiota has joined #ruby
ascarter has joined #ruby
eightlimbed has quit [Remote host closed the connection]
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
pankaj has joined #ruby
eightlimbed has joined #ruby
s1kx has quit [Quit: s1kx]
KeyJoo has quit [Ping timeout: 240 seconds]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cschneid_ has quit [Read error: Connection reset by peer]
cschneid_ has joined #ruby
lightstalker has quit [Ping timeout: 240 seconds]
gix has quit [Ping timeout: 240 seconds]
ascarter has quit [Ping timeout: 240 seconds]
weathermaker has quit [Quit: weathermaker]
gix has joined #ruby
SeepingN has joined #ruby
__Yiota has joined #ruby
skixlix has joined #ruby
username_ has joined #ruby
PorcoRex has quit [Remote host closed the connection]
username_ has quit [Ping timeout: 260 seconds]
skixlix has quit [Ping timeout: 240 seconds]
enterprisey has quit [Remote host closed the connection]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rohitpaulk has joined #ruby
skixlix has joined #ruby
nofxxxx has joined #ruby
elifoster has quit [Ping timeout: 240 seconds]
nofxxx has quit [Ping timeout: 240 seconds]
Vingador has joined #ruby
Vingador has quit [Remote host closed the connection]
skixlix has quit [Ping timeout: 240 seconds]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rohitpaulk has quit [Ping timeout: 240 seconds]
ruby-lang817 has joined #ruby
<ruby-lang817> How can I pass in a function into ruby's map? I don't want to use an anonymous function...
ascarter has joined #ruby
Coldblackice has quit [Ping timeout: 255 seconds]
<havenwood> ruby-lang817: What do you mean by function? A proc or method?
<ruby-lang817> method
<ruby-lang817> sorry
<havenwood> >> 3.times.map &:abs2
<ruby[bot]> havenwood: # => [0, 1, 4] (https://eval.in/816529)
<havenwood> >> :abs2.to_proc.call 2
<ruby[bot]> havenwood: # => 4 (https://eval.in/816530)
<havenwood> ruby-lang817: The `&` calls #to_proc on the object to its right then passes that as the block.
<ruby-lang817> then what is the colon for?
<havenwood> >> :abs2.class
<ruby[bot]> havenwood: # => Symbol (https://eval.in/816531)
renchan has joined #ruby
<havenwood> >> module Example; module_function def example n; n * 42 end end; 3.times.map &Example.public_method(:example)
<ruby[bot]> havenwood: # => [0, 42, 84] (https://eval.in/816532)
<havenwood> Which is more nicely written without the shorthand: 3.times.map { |n| Example.example n }
<havenwood> >> ['ruby-lang817', 'yarrr'].map &:upcase
<ruby[bot]> havenwood: # => ["RUBY-LANG817", "YARRR"] (https://eval.in/816533)
<ruby-lang817> That's it!
<ruby-lang817> Thank you
ascarter has quit [Ping timeout: 240 seconds]
<havenwood> ruby-lang817: You're welcome.
Hunter1 has quit [Remote host closed the connection]
Hunter1 has joined #ruby
Bilge has quit [Ping timeout: 255 seconds]
svkurowski has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #ruby
oz has quit [Ping timeout: 255 seconds]
zack6849_ has quit [Ping timeout: 255 seconds]
Batholith has quit [Ping timeout: 255 seconds]
PaulCapestany has quit [Ping timeout: 246 seconds]
Bilge has joined #ruby
mradmacher has quit [Ping timeout: 260 seconds]
mradmacher has joined #ruby
<KrzaQ> Can I have the %03d functionality while using %{name} to format my strings? Something like '%{03d:foo}' % { foo: 1 }
<elomatreb> `%{}`? Are you sure you don't mean `#{}`?
<KrzaQ> yes
<elomatreb> From the docs: %{name} does not support modifiers, but %<name> does
oz has joined #ruby
Batholith has joined #ruby
zack6849 has joined #ruby
zack6849 has joined #ruby
zack6849 has quit [Changing host]
gothicsouth has joined #ruby
<KrzaQ> the problem with % is that it's really difficult to google if you don't know the name for it :)
<KrzaQ> thanks
<elomatreb> Remember that % is just a method in Ruby, which does formatstrings on String: http://ruby-doc.org/core-2.4.1/String.html#method-i-25
haylon has joined #ruby
texasmynsted has quit [Ping timeout: 240 seconds]
<KrzaQ> It works, thanks again :)
svkurowski has joined #ruby
jamdaman has joined #ruby
<KrzaQ> and what if my question was about `#{}`?
QpQ4 has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
<KrzaQ> (it wasn't, but I'm curious)
<elomatreb> #{} is ruby code, unless you do formatting yourself it doesn't do anything special
haylon has quit [Ping timeout: 240 seconds]
<elomatreb> I.e. you can put any Ruby expression in there and it will insert the .to_s of that value into the String
vincent_ has quit [Remote host closed the connection]
vincent_ has joined #ruby
<KrzaQ> okay, so it basically puts eval(code).to_s in place of #{code}?
<KrzaQ> ^ might be pseudocode
Hunter1 has quit [Remote host closed the connection]
Hunter1 has joined #ruby
<elomatreb> In effect, yeah. It doesn't do a detour with eval but it works like that
<baweaver> eval isn't used there
<baweaver> it just calls to_s on it
<baweaver> Hunter1: where's hunter2?
<elomatreb> Forgot their password
<KrzaQ> I meant it conceptually
vincent_ has quit [Remote host closed the connection]
maxexcloo1234 has joined #ruby
vincent_ has joined #ruby
<Hunter1> He's been deprecated
<KrzaQ> It does execute the code, at least for me
cschneid_ has quit [Read error: Connection reset by peer]
cschneid_ has joined #ruby
<elomatreb> Try `"this is a String with interpolation: #{puts 'I was executed!'}"`
<elomatreb> (I'd present a demo but eval.in is broken again)
<maxexcloo1234> Hi, I'm having some trouble with mapping arrays, it's probably a very quick fix, if anyone could have a look at https://pastebin.com/jfunYp8n it would be greatly appreciated. Basically, I'm trying to map a nested array and it's not working properly, happy to explain in more detail if anyone can help
<ruby[bot]> maxexcloo1234: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/c576e70981621d2fe63d8fcd841a1636
<ruby[bot]> maxexcloo1234: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
<maxexcloo1234> sorry ruby bot ;)
<KrzaQ> I did try something to that effect and puts was executed
<maxexcloo1234> I realise it's rails code but I'm having trouble with map! syntax so I figured it was more appropriate to post here
<baweaver> >> 1
balazs_ has joined #ruby
<ruby[bot]> baweaver: # => 1 (https://eval.in/816536)
<baweaver> Map returns the last value in the block
<baweaver> >> [1,2,3].map { |x| x * 2 }
<ruby[bot]> baweaver: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
<baweaver> >> [1,2,3].map { |x| x * 2; 'foo!' }
<ruby[bot]> baweaver: # => ["foo!", "foo!", "foo!"] (https://eval.in/816538)
<baweaver> ...
<baweaver> >> [1,2,3].map { |x| x * 2 }
<ruby[bot]> baweaver: # => [2, 4, 6] (https://eval.in/816539)
<baweaver> there we go
<maxexcloo1234> @baweaver I assumed that actually, have had some trouble finding how to do what I'd like
<maxexcloo1234> any chance you could point me in the right direction?
<maxexcloo1234> ahh
<elomatreb> You want each iteration of the block to reutnr the value you want the new items in your array to have
<elomatreb> *return
<baweaver> So you're trying to take a CSV row, replacing two columns with the entities, and trying to take a certain subset (trim) of it
<maxexcloo1234> yes, basically
<baweaver> What's up with the delete_at?
<baweaver> seems fairly arbitrary
<baweaver> [1,2,3,4,5,6,7,8][3..-1]
<baweaver> >> [1,2,3,4,5,6,7,8][3..-1]
<ruby[bot]> baweaver: # => [4, 5, 6, 7, 8] (https://eval.in/816542)
<baweaver> arrays can be sliced with ranges like that.
balazs has quit [Ping timeout: 260 seconds]
<maxexcloo1234> each command individually works, if I print out csv_line after line 6 it works
<baweaver> make a new line with csv_line on it
<baweaver> done
<elomatreb> >> [1, 2, 3].each {|i| i * 2 } # Observe the difference to the map above
<ruby[bot]> elomatreb: # => [1, 2, 3] (https://eval.in/816543)
govg has joined #ruby
govg has quit [Client Quit]
<maxexcloo1234> will have a look now
<maxexcloo1234> :)
<baweaver> >> a = [1,2,3,4,5,6,7,8]; [a[2], a[1], *a[3..-1]] # if you want to go slicing segments of the array out.
<ruby[bot]> baweaver: # => [3, 2, 4, 5, 6, 7, 8] (https://eval.in/816545)
pankaj has quit [Quit: Leaving]
<maxexcloo1234> @baweaver, I'm assuming I shouldn't be mapping csv_line as well?
<maxexcloo1234> basically a map inside a map?
<elomatreb> Unrelated: Are there any conventions yet for how we should name refinement modules?
<baweaver> Comment on that gist with an example line and what you want to get out of it as a result
<baweaver> elomatreb: -able mostly if you go by the module extension pattern
<baweaver> or just go with hungarian notation style: RefinedClassName
<baweaver> not sure if there really is one though
<elomatreb> Oh, that makes sense. Nice, thank you
<maxexcloo1234> @baweaver I added a comment :)
ruby-lang817 has quit [Quit: Page closed]
howdoi has quit [Quit: Connection closed for inactivity]
igniting has quit [Ping timeout: 260 seconds]
oleo has quit [Quit: irc client terminated!]
cschneid_ has quit [Read error: Connection reset by peer]
astrobunny has joined #ruby
roshanavand has joined #ruby
cschneid_ has joined #ruby
roshanavand has quit [Client Quit]
<baweaver> the delete_at is hacky. Which columns specifically do you want maxexcloo1234 ?
arescorpio has quit [Quit: Leaving.]
kies has joined #ruby
username_ has joined #ruby
<baweaver> How many lines do you have there?
<baweaver> because that find_by is going to do two queries for every single line. That adds up fast.
<baweaver> You may want to do something instead like querying for all of them at once
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Hunter1 has quit [Remote host closed the connection]
SeepingN has joined #ruby
SeepingN has quit [Client Quit]
Hunter1 has joined #ruby
<baweaver> patient_ids, bank_ids = importer.csv_lines[1..-2].map { |line| [line[22].to_s, line[23].to_s.rjust(6, '0')] }.transpose; Patient.where(uid: patient_ids).pluck(:uid, :id); Bank,where(bsb: bank_ids).pluck(:bsb, :id)
govg has joined #ruby
<baweaver> that way you do two larger queries once instead of potentially thousands of smaller ones
<maxexcloo1234> ahhh
<baweaver> pluck will also be efficient in only getting back the individual fields
<maxexcloo1234> that makes sense now
<baweaver> you probably need their unique ids and the rails id to map 1 to 1 there for the other bit.
<baweaver> play with that some
PaulCapestany has joined #ruby
<maxexcloo1234> Thank you so much, lifesaver!
<maxexcloo1234> Really appreciate your help :)
bkxd has joined #ruby
bkxd_ has joined #ruby
ascarter has joined #ruby
bkxd_ has quit [Ping timeout: 240 seconds]
bkxd has quit [Ping timeout: 240 seconds]
blackwind_123 has joined #ruby
nadir has quit [Quit: Connection closed for inactivity]
troys_ is now known as troys
rohitpaulk has quit [Ping timeout: 240 seconds]
maxexcloo1234 has quit [Quit: Page closed]
AlexRussia has quit [Ping timeout: 255 seconds]
ascarter has quit [Ping timeout: 240 seconds]
Garo_ has left #ruby [#ruby]
PatrikasZvaigzde has joined #ruby
cschneid_ has quit [Remote host closed the connection]
biberu has joined #ruby
dionysus69 has joined #ruby
roshanavand has joined #ruby
Bock has joined #ruby
Bock has quit [Max SendQ exceeded]
xall has quit [Ping timeout: 240 seconds]
biberu has quit []
ascarter has joined #ruby
Bock has joined #ruby
Dimik has quit [Ping timeout: 246 seconds]
igniting has joined #ruby
xall has joined #ruby
username_ has quit [Ping timeout: 255 seconds]
rgr_ has joined #ruby
biberu has joined #ruby
eightlimbed has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #ruby
xall has quit [Ping timeout: 255 seconds]
xall_ has joined #ruby
enterprisey has joined #ruby
xall_ has quit [Ping timeout: 255 seconds]
eightlimbed has joined #ruby
blackwind_123 has quit [Ping timeout: 240 seconds]
anisha has joined #ruby
rohitpaulk has quit [Ping timeout: 240 seconds]
xall_ has joined #ruby
harfangk has joined #ruby
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ascarter has joined #ruby
xall_ has quit [Client Quit]
enterprisey has quit [Remote host closed the connection]
PaulCapestany has quit [Ping timeout: 246 seconds]
eightlimbed has quit [Remote host closed the connection]
TomyLobo has quit [Ping timeout: 255 seconds]
Coldblackice has joined #ruby
davidmichaelkarr has quit [Quit: Connection closed for inactivity]
conta has joined #ruby
ta_ has quit [Remote host closed the connection]
ascarter_ has joined #ruby
vincent_ has quit []
uZiel has quit [Ping timeout: 248 seconds]
dh64 has joined #ruby
cyphase has quit [Ping timeout: 255 seconds]
uZiel has joined #ruby
PaulCapestany has joined #ruby
SenpaiSilver has quit [Quit: Leaving]
mtkd has quit [Read error: Connection reset by peer]
mtkd has joined #ruby
BloodSkin has joined #ruby
troys has quit [Quit: Bye]
anisha_ has joined #ruby
anisha has quit [Ping timeout: 255 seconds]
cyphase has joined #ruby
ascarter_ has quit [Ping timeout: 268 seconds]
anisha__ has joined #ruby
anisha_ has quit [Ping timeout: 260 seconds]
dionysus69 has quit [Remote host closed the connection]
dionysus69 has joined #ruby
patarr has joined #ruby
apparition has joined #ruby
patarr has quit [Ping timeout: 246 seconds]
* BloodSkin waves at Talltree_
pandaant has joined #ruby
<Talltree_> o
<Talltree_> o/
Mortomes|Work has joined #ruby
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
aufi has joined #ruby
jaruga________ has joined #ruby
ascarter has joined #ruby
nesoi has quit [Quit: Leaving.]
bithon has joined #ruby
<bithon> Is ruby a programming language or a meme ?
rohitpaulk has joined #ruby
<elomatreb> >> ["meme", "programming language"].sample
<ruby[bot]> elomatreb: # => "meme" (https://eval.in/816598)
<elomatreb> Damn, I thought I could earn money with this
<bithon> elomatreb: "Internal Server Error" seems like it's a meme, pretty evident to me.
agent_white has quit [Quit: bai]
<havenwood> bithon: 500
ascarter has quit [Client Quit]
ddffg has joined #ruby
spectrum has joined #ruby
dreamthese has quit [Quit: WeeChat 1.4]
<BloodSkin> what are some reasons i should learn ruby
<bithon> It's a meme language. That should be a reason enough for you BloodSkin
<BloodSkin> what does that even mean
<bithon> nvm
AlexRussia has joined #ruby
TomyWork has joined #ruby
<BloodSkin> anyone who doesnt have their head up their ass got an answer?
<bithon> If I was an OP I'd ban you this instant, you worm
<elomatreb> havenwood: I'm detecting some trolling here
<havenwood> BloodSkin: Please don't be rude.
<elomatreb> BloodSkin: Fun scripting language with a very usable standard library
nicesignal has joined #ruby
<elomatreb> havenwood: I was talking more about bithon
<havenwood> bithon: Please don't be rude.
<bithon> I was merely making I joke elomatreb.
ascarter has joined #ruby
<BloodSkin> is there anything that sets it apart from other languages?
<bithon> I wasn't being rude havenwood. The gent here was being condiscending
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<BloodSkin> or that makes it easier to achieve a certain goal
<BloodSkin> or something it excels at
<BloodSkin> idk how to ask what im thinking
uZiel has quit [Remote host closed the connection]
<dminuoso> BloodSkin: It excels at giving you the tools to be stupid and lazy.
<dminuoso> It also has a pretty awesome logo.
<havenwood> BloodSkin: Ruby is designed to make programmers happy.
<dminuoso> havenwood: So is porn.
<elomatreb> Ruby's syntax is fairly unique, and the standard library is probably one of the best I've worked with
<BloodSkin> ok so its for advanced programmers to just have fun with?
<dminuoso> No.
<dminuoso> Though I wish it was.
Silthias1 has joined #ruby
<dminuoso> The best thing about Ruby is that you have ObjectSpace, send, Fiddle and Module#prepend.
Silthias has quit [Ping timeout: 240 seconds]
postmodern has quit [Quit: Leaving]
<BloodSkin> ok i am someone who has a tiny bit of scripting experience
<BloodSkin> i dont know any language inside and out
<BloodSkin> i guess what im asking is what would be a reason to make ruby the first lang i really dive into
xall has joined #ruby
<havenwood> BloodSkin: It's a general purpose programming language that's used for all sorts of things. Beyond web it's often used for text processing and system administration. Though it's also used for all sorts of stuff from modeling fighter jet hardware and software to supercomputers (which surprised even Matz) or telephony like Adhearsion, etc.
<havenwood> BloodSkin: It's a multi-paradigm language that will give you plenty of room to dive in deeply.
<BloodSkin> hmm
<BloodSkin> thanks for the info
aupadhye has joined #ruby
<havenwood> BloodSkin: If you want something simpler with a single paradigm consider a functional language like Elixir or Clojure.
<dminuoso> Never not clojure.
<dminuoso> It's still downright amazing that LISP is so vibrant and alive.
<BloodSkin> ultimately i am looking for somthing diverse
<BloodSkin> i dont have any specific goal
<havenwood> BloodSkin: Then Ruby is a great option.
<BloodSkin> i see a lot of peopl really praise it
<BloodSkin> so thats why i figured id come ask
<dminuoso> I dont.
<BloodSkin> people*
<dminuoso> I am great people.
<BloodSkin> my E key is on its way out the door
<herwin> your ky?
<BloodSkin> i dont think ive ever actually bought a keyboard to be honest
<BloodSkin> they just show up
<dminuoso> I think the legal term is "theft"
<BloodSkin> people used to give me their old computers
<BloodSkin> they seem to think that just because i can google something im a computer genius
bithon has quit [Quit: Page closed]
<BloodSkin> which im sure everyone in this channel has experienced
<havenwood> >> (Math::PI ** 4 / 36 * 100_000_000).floor.to_s.reverse.each_char.first(4).map(&:to_i).map { |n| (n + 100).succ.chr }.join
<ruby[bot]> havenwood: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
<havenwood> boo
mark_66 has joined #ruby
ascarter_ has joined #ruby
cschneid_ has joined #ruby
andikr has joined #ruby
<havenwood> >> ((Math::E ** Math::E) ** Math::E * 100_000_000).floor.digits.first(4).map { |n| n + 100 }.map(&:chr).join.reverse
<ruby[bot]> havenwood: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
<havenwood> >> "meme"
<ruby[bot]> havenwood: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<havenwood> You win ruby[bot], you win.
rgr_ has quit [Quit: rgr_]
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cschneid_ has quit [Ping timeout: 246 seconds]
Burgestrand has joined #ruby
jameser_ has joined #ruby
jameser has quit [Ping timeout: 260 seconds]
ascarter_ has quit [Ping timeout: 255 seconds]
ta_ has joined #ruby
ur5us has quit [Remote host closed the connection]
Kug3lis_off is now known as Kug3lis_
mim1k has joined #ruby
antgel has joined #ruby
bigkevmcd has quit [Read error: Connection reset by peer]
bigkevmcd has joined #ruby
bigkevmcd has quit [Client Quit]
bigkevmcd has joined #ruby
Kug3lis has joined #ruby
rohitpaulk has quit [Ping timeout: 268 seconds]
mim1k has quit [Disconnected by services]
mim1k_ has joined #ruby
webopsx has joined #ruby
<havenwood> >> require 'bigdecimal/math'; include BigMath; best = 0; last_best_char = nil; seen = Hash.new(0); PI(1000).to_s[2..-3].each_char.with_object([]) { |char, results| seen[char] += 1; results << char and last_best_char = char and best = seen[char] if seen[char] > best and last_best_char != char }.last(4).map { |s| (s.to_i + 100).chr }.join
<ruby[bot]> havenwood: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
<havenwood> #=> "meme"
joonty has joined #ruby
Kug3lis_ is now known as Kug3lis_off
<ljarvis> :D
<ljarvis> cheat
webopsx has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bigkevmcd has quit [Read error: Connection reset by peer]
webopsx has joined #ruby
Puppet_ has quit [Read error: Connection reset by peer]
mim1k_ has quit [Read error: Connection reset by peer]
<dminuoso> There's no cheats.
<dminuoso> They are called efficient solutions.
pandaant has quit [Remote host closed the connection]
Bhootrk_ has joined #ruby
wnd has quit [Excess Flood]
webopsx has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
wnd has joined #ruby
mim1k has joined #ruby
mikecmpbll has joined #ruby
AnoHito_ has joined #ruby
AnoHito has quit [Ping timeout: 260 seconds]
haylon has joined #ruby
rohitpaulk has joined #ruby
haylon has quit [Ping timeout: 246 seconds]
ferr1 has joined #ruby
marr has joined #ruby
ascarter has joined #ruby
patarr has joined #ruby
lxsameer has joined #ruby
patarr has quit [Ping timeout: 240 seconds]
<ljarvis> efficient cheats
ascarter has quit [Ping timeout: 246 seconds]
cfec0b8d has joined #ruby
jamdaman has quit [Quit: Ex-Chat]
mim1k has quit [Ping timeout: 258 seconds]
mim1k has joined #ruby
quobo has joined #ruby
ur5us has joined #ruby
harfangk has quit [Quit: Textual IRC Client: www.textualapp.com]
uZiel has joined #ruby
brent__ has joined #ruby
mim1k has quit [Ping timeout: 255 seconds]
brent__ has quit [Ping timeout: 246 seconds]
belmoussaoui has quit [Read error: Connection reset by peer]
belmoussaoui has joined #ruby
rohitpaulk has quit [Ping timeout: 246 seconds]
hightower3 has joined #ruby
jokke has quit [Read error: Connection reset by peer]
bigkevmcd has joined #ruby
jokke has joined #ruby
im0nde has joined #ruby
im0nde has quit [Client Quit]
workmad3 has joined #ruby
mim1k has joined #ruby
uZiel has quit [Ping timeout: 248 seconds]
<zenspider> tok>> 1 + 2
<ruby[bot]> zenspider: I have tokenized your code, the result is at https://eval.in/816736
<zenspider> ast>> 1 + 2
<ruby[bot]> zenspider: I have parsed your code, the result is at https://eval.in/816737
<zenspider> >> 1 + 2
<ruby[bot]> zenspider: # => 3 (https://eval.in/816739)
<zenspider> >> puts "Hello"
<ruby[bot]> zenspider: # => Hello ...check link for more (https://eval.in/816740)
<zenspider> hrm... I wonder what happens when it freaks out
AlexRussia has quit [Ping timeout: 240 seconds]
<elomatreb> eval.in 500s *sometimes*
ascarter has joined #ruby
Hunter1 has quit [Remote host closed the connection]
Hunter1 has joined #ruby
Burgestrand has quit [Quit: Closing time!]
futilegames has joined #ruby
futilegames has quit [Client Quit]
hightower3 has quit [Ping timeout: 260 seconds]
jameser_ has quit [Ping timeout: 260 seconds]
ascarter has quit [Ping timeout: 255 seconds]
ur5us has quit [Remote host closed the connection]
ledestin has joined #ruby
gix has quit [Quit: Client exiting]
mim1k has quit [Ping timeout: 255 seconds]
rohitpaulk has joined #ruby
mim1k has joined #ruby
sonOfRa has quit [Ping timeout: 255 seconds]
uZiel has joined #ruby
sonOfRa has joined #ruby
idakyne has joined #ruby
iamayam has quit [Ping timeout: 268 seconds]
patarr has joined #ruby
Rodya_ has quit [Remote host closed the connection]
patarr has quit [Ping timeout: 246 seconds]
KeyJoo has joined #ruby
ur5us has joined #ruby
idakyne has quit [Quit: Textual IRC Client: www.textualapp.com]
gix has joined #ruby
jane_booty_doe has joined #ruby
ur5us has quit [Ping timeout: 246 seconds]
iamayam has joined #ruby
rohitpaulk has quit [Ping timeout: 240 seconds]
psychicist__ has joined #ruby
xall has quit [Quit: xall]
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ascarter has joined #ruby
johnmccabe has joined #ruby
ascarter has quit [Ping timeout: 246 seconds]
andikr has quit [Ping timeout: 240 seconds]
Rodya_ has joined #ruby
hlmjr has joined #ruby
Kug3lis has joined #ruby
Kug3lis has quit [Client Quit]
psychicist__ has quit [Ping timeout: 240 seconds]
Rodya_ has quit [Ping timeout: 246 seconds]
andikr has joined #ruby
astrobunny has quit [Remote host closed the connection]
astrobunny has joined #ruby
stamina has joined #ruby
rohitpaulk has joined #ruby
astrobunny has quit [Ping timeout: 255 seconds]
ltem has joined #ruby
ur5us has joined #ruby
HoierM has joined #ruby
Rodya_ has joined #ruby
ayonkhan has joined #ruby
AlexRussia has joined #ruby
nadir has joined #ruby
cschneid_ has joined #ruby
ldnunes has joined #ruby
ur5us has quit [Remote host closed the connection]
cschneid_ has quit [Ping timeout: 240 seconds]
xall has joined #ruby
joonty has quit [Quit: This computer has gone to sleep]
uZiel has quit [Remote host closed the connection]
sepp2k has joined #ruby
ldnunes has quit [Ping timeout: 260 seconds]
<dminuoso> Do you folks ever do type checks?
<dminuoso> Or .responds_to? checks?
<adam12> respond_to is better than is_a, for sure.
<dminuoso> adam12: Why?
<dminuoso> I mean not everything is duck typy
<adam12> dminuoso: duck typing.
hs366 has joined #ruby
<dminuoso> adam12: That is just giving that recommendation a name, but not a reason why it's better.
<adam12> dminuoso: I guess on your own code, it doesn't really matter, but for libraries, why should you dictate what is passed
<adam12> as long as the contract for what is passed is satisfied.
hfp_work has quit [Ping timeout: 240 seconds]
<dminuoso> adam12: Well let's think in terms of C++ inheritance. When I have a library package_delivery, and a class DeliveryTruck with a method "load", it stands to reason I have an abstract class Package that users can derive from and modify.
<dminuoso> adam12: Just because a class has "size", it doesn't mean it will return what my DeliveryTruck expects.
<dminuoso> >> [1,2,3].size
<ruby[bot]> dminuoso: # => 3 (https://eval.in/816836)
mim1k has quit [Ping timeout: 258 seconds]
<dminuoso> adam12: If my DeliveryTruck does a package.size and expects an array of dimensions, then merely responding to is not enough, it wants to know whether the class follows an interface.
<dminuoso> Whether invariants are held.
<dminuoso> I mean technically deriving from Package does not make that guarantee either, but if a user intentionally overrides size to return back stuff that's just the dev shooting his own foot.
hfp_work has joined #ruby
<matthewd> I do (often spelled as case/when), when there are multiple types the value could be, and I want to handle each of them
apparition has quit [Quit: Bye]
<matthewd> I don't do it to attempt to implement strict typing though. If I don't have a specific need to distinguish which of several valid arguments you gave me, IMO ruby style is to just trust the caller, and leave you with whatever NoMethodError eventually arises otherwise
<dminuoso> matthewd: Do you ever check against modules or base classes? Or do your checks imply that you expect those types directly?
<elomatreb> That size example is a nasty one
ldnunes has joined #ruby
<dminuoso> elomatreb: Granted, the proper method would in reality rather be named "dimensions".
gnufied has joined #ruby
quobo has quit [Quit: Connection closed for inactivity]
<matthewd> There are, for example, places in Rails that'll handle an instance of any subclass of AR::Base one way, and other types another
<dminuoso> matthewd: Could you name any such example from the top off your head?
<matthewd> A simple abstract example is where we'd call .id on an AR record, and otherwise assume we have the "raw" string/integer/whatever directly
<matthewd> A complex concrete example of type-distinguishing is in processing the RHS of where(foo: x)
<dminuoso> matthewd: Oh yeah that last example makes immediate sense.
<dminuoso> For the first, is that when you care about generic equality?
<matthewd> No... two records with the same [class and] PK are equal, but they're not equal *to* their PK. I don't know that the first actually occurs anywhere specific in itself... it's more a simplification of what #where does.
synthroid has joined #ruby
<matthewd> Looking at the 7 places in rails/rails we raise a TypeError: one is a re-raise, one is explicitly disallowing one type, and the others are all `case when A; ..; when B; ..; else raise TypeError; end`
Mortomes|Work has quit [Ping timeout: 260 seconds]
__Yiota has joined #ruby
<matthewd> (just because that's easy to search for; clearly not exhaustive)
ineb has joined #ruby
<ineb> hello, quick question: how to? system("echo", "foobar", ">>", "/tmp/test")
<ineb> this approach does not work
mjuszczak has joined #ruby
__Yiota has quit [Client Quit]
mjuszczak has quit [Max SendQ exceeded]
<matthewd> ineb: That doesn't work because the multiple-argument form bypasses the shell, and the shell is what does the >> redirect
<matthewd> ineb: You can either run it through a shell, or read the output and add it to the file yourself
<ineb> i see, makes sense
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ineb> like system("sh -c 'echo foobar >> /tmp/test'"
<ineb> system("sh -c 'echo foobar >> /tmp/test'")
konsolebox has quit [Max SendQ exceeded]
konsolebox has joined #ruby
<dminuoso> matthewd: That's interesting. Ill take a look at those cases later.
<matthewd> ineb: Well, system("sh", "-c", "echo foobar >> /tmp/test"), or you can just system("echo foobar >> /tmp/test")
ecuanaso has joined #ruby
johnmccabe_ has joined #ruby
<matthewd> ineb: If you need to approximate the safety of separated parameters while building a string that a shell will parse, you may be interested in Shellwords from stdlib
mjuszczak has joined #ruby
johnmccabe has quit [Ping timeout: 240 seconds]
warrshrike has joined #ruby
<warrshrike> hey
<warrshrike> I have an error
andikr has quit [Remote host closed the connection]
<dminuoso> Really
<warrshrike> consider this: Base = '/state/partition1/APPSEC/APKMirror/' GL = "/state/partition1/home/17100148/paper93/artifact/binary"
<warrshrike> and this if !(File.exist?("#{Base}#{appname}/#{appname}.yml")) puts "File doesnt exist!" File.open("#{Base}#{appname}/#{appname}.yml", "w") do |file| file.write(YAML::dump(cflArray(appname))) end end
<dminuoso> warrshrike: ?gist
<dminuoso> warrshrike: !gist
<dminuoso> !gist warrshrike
<dminuoso> ?gist warrshrike
<ruby[bot]> warrshrike: https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
<dminuoso> There we go.
<warrshrike> finally these errors /state/partition1/home/17100148/Malware/DroidInfer_Wrapper.rb:28:in `initialize': No such file or directory @ rb_sysopen - /state/partition1/APPSEC/APKMirror/1Password_-_Password_Manager_6.5.BETA-9_ (Errno::ENOENT) /1Password_-_Password_Manager_6.5.BETA-9_ .yml
<dminuoso> Yeah no.
<dminuoso> Gist.
<warrshrike> okay sorry brothers
<warrshrike> i will remake a gist
<dminuoso> warrshrike: please name your file with an .rb extension so it gets syntax highlighting
uZiel has joined #ruby
<warrshrike> dminuoso: Duly done good sir.
<claw> if i have {foo: "bar"} how do i get the key ?
<dminuoso> warrshrike: My first instinct is: update 1password! badly
<dminuoso> :P
<claw> i can do {foo: "bar"}keys.first but thats kind of ugly
<dminuoso> claw: That's it.
<claw> {foo: "bar"}.keys.first
<claw> :(
<warrshrike> dminuoso: hahaa it isnt an actual password...just the name of an app
<dminuoso> claw: you can also do .keys[0], .keys.reverse.last
<dminuoso> tons of funny other ways
<ineb> matthewd: my real system call looks a bit more messy, but its working now https://gist.github.com/anonymous/70e115c735c43defc6586573f8a1e03f but i dont like it a bit
pupsicle has joined #ruby
<claw> dminuoso: what about shuffle
<dminuoso> warrshrike: No I know, which is why I know that your 1Password is out of date
<dminuoso> claw: Depends. Is there only one key available?
<claw> dminuoso: yes thats why the .keys.first is ugly
<warrshrike> dminuoso: whats a 1password?
<warrshrike> im confused
<dminuoso> claw: Dont use a Hash. Use Struct.
<dminuoso> warrshrike: haha nevermind.
Fernando-Basso has joined #ruby
<warrshrike> dminuoso: any idea whats wrong here?
DoubleMalt has joined #ruby
<matthewd> warrshrike: You can't write a file into a directory that doesn't exist
<dminuoso> matthewd: Does the error look at bit broken to you?
rohitpaulk has quit [Ping timeout: 268 seconds]
<warrshrike> matthewd: but pasting /state/partition1/APPSEC/APKMirror/1Password_-_Password_Manager_6.5.BETA-9_ into terminal says
<warrshrike> Is a directory
<dminuoso> warrshrike: I cant relate the error to the code.
<warrshrike> dminuoso: yeah error does seem broken....its over ssh tho
<warrshrike> should i paste entire code dminuoso ?
<dminuoso> warrshrike: Yeah. Did you introduce a linebreak between lines 15 and 16?
ltem has quit [Quit: Leaving]
<dminuoso> No even then...
<dminuoso> Did you put a newline/carriage return in there perhaps?
<matthewd> warrshrike: Looks like there's a space on the end of the path
<dminuoso> matthewd: That still wouldn't explain why the (Errno::ENOENT) would appear right in the middle fo the path :S
<warrshrike> Okay to give context
<warrshrike> this code worked fine before I changed BASE and GL
<warrshrike> to process over a different set of data
<warrshrike> dminuoso: how would i intro a linebreak? by pressing enter>
<dminuoso> warrshrike: Yeah Im fairly sure there is a linebreak in there.
<warrshrike> dminuoso: in the paths?
<dminuoso> "/state/partition1/APPSEC/APKMirror/1Password_-_Password_Manager_6.5.BETA-9_ \n/1Password_-_Password_Manager_6.5.BETA-9_ \n"
<dminuoso> warrshrike: Yes.
<dminuoso> warrshrike: ^- Im sure it looks like that.
t-recx has joined #ruby
<dminuoso> warrshrike: for lines 6 and 8 use a variable, and then print that path.inspect
<dminuoso> Perhaps a carriage return too, or maybe only a carriage return - depending on your system
<warrshrike> dminuoso: yeah doing exactly that
<warrshrike> lets see
jane_booty_doe has quit [Quit: Leaving]
rohitpaulk has joined #ruby
hs366 has quit [Quit: Leaving]
Kug3lis has joined #ruby
stamina has quit [Quit: WeeChat 1.8]
<warrshrike> damn taking long
charliesome has joined #ruby
my123 has quit [Ping timeout: 240 seconds]
<dminuoso> warrshrike: This btw is in addition to the "space" at the end of appname that matthewd mentioned.
my123 has joined #ruby
my123 has joined #ruby
<warrshrike> damn
<warrshrike> yes theres a space
<warrshrike> dminuoso: what is in addition to that?
<dminuoso> matthewd | warrshrike: Looks like there's a space on the end of the path
<warrshrike> yup
<warrshrike> before the yml
texasmynsted has joined #ruby
<warrshrike> dminuoso: how can i remove it
<warrshrike> .strip?
<warrshrike> i think there is an \n. how to remove that?
catphish has joined #ruby
<catphish> is there a good way to install a modern ruby on centos 7 without compiling it? i'm used to usin ubuntu PPAs
<dminuoso> warrshrike: Do you just care about the newline? Or all whitespace?
<dminuoso> catphish: ruby-install
<dminuoso> And I blatantly ignored your "without compiling it" to preserve sanity.
<catphish> i actually have no real problem with compiling it
<dminuoso> catphish: Then use ruby-install. It does it cleanly and automaticalyl for you :)
<catphish> i'm just used to using a PPA and have it maintained forme
<dminuoso> catphish: It's just as easy as apt
<catphish> dminuoso: happy with that, thanks :)
<warrshrike> dminuoso: both good sir
<dminuoso> warrshrike: Take your pick between chomp and strip
<warrshrike> but
<warrshrike> they dont remove newlines do they?
<warrshrike> isnt ti just whitespace
<dminuoso> warrshrike: Please read the documentation for each.
<dminuoso> &ri String#chomp String#strip
chouhoulis has joined #ruby
nanoz has joined #ruby
<warrshrike> okay thanks!
etehtsea has joined #ruby
banisterfiend has quit [Quit: Textual IRC Client: www.textualapp.com]
svkurowski has quit [Ping timeout: 240 seconds]
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hurricanehrndz has quit [Read error: Connection reset by peer]
sami has joined #ruby
<sami> I'm having some trouble with learning arrays and hashes.
svkurowski has joined #ruby
spectrum has quit [Ping timeout: 240 seconds]
<dminuoso> sami: Get pry, and toy around manually.
<dminuoso> Helps you preserve sanity while learning arrays and hashes.
rohitpaulk has quit [Ping timeout: 240 seconds]
Kug3lis has joined #ruby
rohitpaulk has joined #ruby
etehtsea has quit [Quit: Textual IRC Client: www.textualapp.com]
Kug3lis has quit [Client Quit]
my123_ has joined #ruby
my123_ has joined #ruby
haylon has joined #ruby
my123 has quit [Ping timeout: 240 seconds]
mim1k has joined #ruby
bkxd has joined #ruby
bkxd_ has joined #ruby
yehowyada has joined #ruby
<pupsicle> sami: in your loop, you are reassigning the entire movie_complete hash each iteration.
<dminuoso> sami: Oh yeah. Also, there's a slightly better pattern to this.
<dminuoso> sami: movies_complete = movies_hash.each.with_object({}) { |acc, movie| ...now modify acc... }
<catphish> for starters, you probably mean: movies_complete[movie['name']] = { id: movie['id'], plot: movie_temp['Plot'], image: movies_temp['image'] }
<catphish> or even just: movies_complete[movie['name']] = get_movie_info(movie['name'])
<catphish> unless you want to change the data
bkxd_ has quit [Ping timeout: 255 seconds]
bkxd has quit [Ping timeout: 255 seconds]
ta_ has quit [Remote host closed the connection]
<sami> dminuoso: solved it by doing movies = [] and then movies << {...}
bkxd has joined #ruby
<catphish> sami: ah yes, making an array of hashes
<sami> thank you all for the help!
<catphish> you can do that with map
shinnya has joined #ruby
<catphish> movies_array = movie_hash.map { movie| {...} }
<catphish> it'll automatically add each thing to the array :)
jrafanie has joined #ruby
<sami> catphish: Hmm, interesting!
<dminuoso> sami: same thing again.
<dminuoso> sami: use each.with_object([]) then
cyphase has quit [Ping timeout: 255 seconds]
<catphish> dminuoso: why would you use that over map?
<dminuoso> sami: It does the same thing, but just is a lot more ruby-esque.
<dminuoso> catphish: Oh.
<dminuoso> Well.
<dminuoso> Maybe..
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<dminuoso> catphish: How are you doing! Fine weather today.
<catphish> it is indeed!
<catphish> i'm stuck inside
<catphish> because work
<dminuoso> I've been doing JavaScript too much :D
mim1k has quit [Ping timeout: 255 seconds]
belmoussaoui has quit [Ping timeout: 255 seconds]
Hunter1 has quit [Remote host closed the connection]
<catphish> dminuoso: if you really wanted that i suppose
<dminuoso> catphish: What can I say, I stopped disliking implicit returns at the end of blocks and functions.
bkxd has quit [Ping timeout: 240 seconds]
<catphish> i finally got over my fear of implicit return
Hunter1 has joined #ruby
<dminuoso> catphish: I developed it this year.
<dminuoso> From 0 to 100.
belmoussaoui has joined #ruby
DLSteve has joined #ruby
kobain has joined #ruby
cyphase has joined #ruby
mim1k has joined #ruby
elifoster has joined #ruby
belmoussaoui has quit [Read error: Connection reset by peer]
belmoussaoui has joined #ruby
xall has quit [Quit: xall]
cschneid_ has joined #ruby
ur5us has joined #ruby
cschneid_ has quit [Ping timeout: 258 seconds]
ur5us has quit [Ping timeout: 240 seconds]
chouhoul_ has joined #ruby
rohitpaulk has quit [Ping timeout: 255 seconds]
warrshrike has quit [Ping timeout: 260 seconds]
chouhoulis has quit [Ping timeout: 240 seconds]
AnoHito_ has quit [Ping timeout: 255 seconds]
centrx has joined #ruby
enterprisey has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
oleo has joined #ruby
spectrum has joined #ruby
dances_with_taco has quit [Read error: Connection reset by peer]
meshsmith has joined #ruby
nanoz has left #ruby ["Leaving"]
synthroid has quit [Remote host closed the connection]
__Yiota has joined #ruby
cttttt has joined #ruby
enterprisey has quit [Remote host closed the connection]
aupadhye has quit [Ping timeout: 260 seconds]
belmoussaoui has quit [Read error: Connection reset by peer]
belmoussaoui has joined #ruby
merlac has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
merlac has quit [Quit: Leaving]
bkxd has joined #ruby
mwlang has joined #ruby
harfangk has joined #ruby
mim1k has quit [Ping timeout: 258 seconds]
dances_with_taco has joined #ruby
dances_with_taco has quit [Client Quit]
Hunter1 has quit [Remote host closed the connection]
bkxd_ has joined #ruby
Hunter1 has joined #ruby
dances_with_taco has joined #ruby
igniting has quit [Ping timeout: 255 seconds]
cdg has joined #ruby
anisha__ has quit [Quit: This computer has gone to sleep]
mim1k has joined #ruby
aurelien has quit [Remote host closed the connection]
DoubleMalt has quit [Remote host closed the connection]
aurelien has joined #ruby
ahrs has quit [Remote host closed the connection]
ahrs has joined #ruby
belmoussaoui has quit [Ping timeout: 255 seconds]
johnmccabe_ has quit [Quit: Textual IRC Client: www.textualapp.com]
cdg has quit [Remote host closed the connection]
belmoussaoui has joined #ruby
elifoster has quit [Ping timeout: 240 seconds]
bkxd__ has joined #ruby
bkxd___ has joined #ruby
bkxd_ has quit [Ping timeout: 240 seconds]
bkxd has quit [Ping timeout: 260 seconds]
haylon has quit [Remote host closed the connection]
haylon has joined #ruby
joonty has joined #ruby
<cjohnson> Using guard/guard-rspec, when I make a file change on the guest machine (vbox) guard inspects and tests, however when I make the change on my host via NFS share, it doens't pick it up
<cjohnson> Does anybody know a straight forward way to get it to watch nfs? Do I have to use polling mode? And if so, how do I configure that?
jrafanie has joined #ruby
Rodya_ has quit [Remote host closed the connection]
Burgestrand has joined #ruby
cbyrda has quit [Quit: leaving]
haylon has quit [Ping timeout: 246 seconds]
<cjohnson> Nevermind found an article on exactly this issue
jrafanie_ has joined #ruby
<cjohnson> -p passed to guard tells it to use polling mode
Rodya_ has joined #ruby
jrafanie has quit [Ping timeout: 240 seconds]
<cjohnson> there's also some sort of tcp listener you can set up
arne is now known as Bish
cschneid_ has joined #ruby
<cjohnson> Ah, I will have to go that route because the -p method really chews up CPU. Even delaying to every 5 seconds
anisha__ has joined #ruby
cschneid_ has quit [Ping timeout: 240 seconds]
dionysus69 has quit [Ping timeout: 240 seconds]
enterprisey has joined #ruby
Kug3lis_off is now known as Kug3lis_
nothingnew has joined #ruby
JustTheDoctor has quit [Quit: Connection closed for inactivity]
Rodya_ has quit [Remote host closed the connection]
<ineb> cjohnson: this comes down to nfs and inotify which simply does not work because of the way nfs is designed
<cjohnson> Right, makes sense
<cjohnson> the listen approach in this article looks like it will be easy to get going :)
quobo has joined #ruby
<cjohnson> Ok that prompts another question. My OS X ruby is not new enough for listen
<cjohnson> So I installed rvm and rvm install 2.2
<cjohnson> then rvm use 2.2
polishdub has joined #ruby
<cjohnson> Is there a special way to use gem in conjunction with rvm?
<cjohnson> Or do I just
<cjohnson> # gem install listen
<cjohnson> after rvm use 2.2
<elomatreb> If your RVM is set up properly you just use gem install regularly
<cjohnson> perfect
<cjohnson> Does gem naturally sort gems by ruby version or something?
<cjohnson> Just curious how it keeps things safe
ayonkhan has quit [Quit: Textual IRC Client: www.textualapp.com]
dc4 has joined #ruby
igniting has joined #ruby
<elomatreb> I think RVM does that, but I don't know how much safety it gives you there
cschneid_ has joined #ruby
cschneid_ has quit [Remote host closed the connection]
cschneid_ has joined #ruby
<cjohnson> oh it looks like it puts the gems in ~/.rvm so yeah looks fairly safe
rippa has joined #ruby
jrafanie_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ujjain has joined #ruby
ujjain has joined #ruby
ujjain has quit [Changing host]
haylon has joined #ruby
mjuszczak has quit []
cadillac_ has joined #ruby
mjolnird has joined #ruby
mjolnird has quit [Read error: Connection reset by peer]
GinoMan has joined #ruby
blackwind_123 has joined #ruby
skweek has joined #ruby
bkxd has joined #ruby
thatsnotjack has joined #ruby
bkxd_ has joined #ruby
mjuszczak has joined #ruby
bkxd__ has quit [Ping timeout: 246 seconds]
bkxd___ has quit [Ping timeout: 268 seconds]
JustTheDoctor has joined #ruby
patarr has joined #ruby
mim1k has quit [Ping timeout: 260 seconds]
mim1k has joined #ruby
jrafanie has joined #ruby
mjuszczak has quit []
belmoussaoui has quit [Remote host closed the connection]
belmoussaoui has joined #ruby
ecuanaso has joined #ruby
uZiel has quit [Ping timeout: 248 seconds]
balazs_ has quit [Ping timeout: 260 seconds]
ben_____ has joined #ruby
jaruga_________ has joined #ruby
TomyLobo has joined #ruby
shinnya has quit [Ping timeout: 255 seconds]
balazs_ has joined #ruby
ben__ has quit [Ping timeout: 246 seconds]
jaruga________ has quit [Ping timeout: 240 seconds]
dc4 has quit [Ping timeout: 255 seconds]
conta has quit [Ping timeout: 268 seconds]
synthroid has joined #ruby
mark_66 has quit [Remote host closed the connection]
PatrikasZvaigzde has quit [Ping timeout: 268 seconds]
PatrikasZvaigzde has joined #ruby
ferr1 has quit [Quit: WeeChat 1.8]
ur5us has joined #ruby
brent__ has joined #ruby
Rodya_ has joined #ruby
ascarter has joined #ruby
mim1k has quit [Ping timeout: 268 seconds]
Burgestrand has quit [Quit: Closing time!]
plujon has joined #ruby
ur5us has quit [Ping timeout: 268 seconds]
<plujon> What's the inverse of klass.name?
<matthewd> plujon: Object.const_get
<plujon> matthewd: Object.const_get(Integer.name) # cool, thanks!
<pupsicle> plujon: ActiveSupport also has a method called "constantize" if you happen to be depending on it.
cadillac_ has quit [Ping timeout: 260 seconds]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<pupsicle> It adds method to String object I should say.
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chouhoul_ has quit [Remote host closed the connection]
<plujon> Integer.name.constantize == Object.const_get(Integer.name) # good to know
username_ has joined #ruby
bkxd has quit [Ping timeout: 268 seconds]
bkxd_ has quit [Ping timeout: 255 seconds]
hobodave has joined #ruby
pazzaz has joined #ruby
__Yiota has joined #ruby
apollo274 has joined #ruby
firstdayonthejob has joined #ruby
patarr has quit [Ping timeout: 240 seconds]
firstdayonthejob has quit [Client Quit]
patarr has joined #ruby
jaruga_________ has quit [Quit: jaruga_________]
synthroid has quit [Remote host closed the connection]
mim1k has joined #ruby
ecuanaso has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cdg has joined #ruby
ltem has joined #ruby
synthroid has joined #ruby
roshanavand has quit [Remote host closed the connection]
cdg_ has joined #ruby
cdg has quit [Read error: Connection reset by peer]
cdg has joined #ruby
__Yiota has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kies has quit [Ping timeout: 258 seconds]
cdg_ has quit [Ping timeout: 268 seconds]
lxsameer has quit [Quit: WeeChat 1.7]
amclain has joined #ruby
xzhao has quit [Remote host closed the connection]
xzhao has joined #ruby
nitric has joined #ruby
Kug3lis_ is now known as Kug3lis_off
joonty has quit [Quit: This computer has gone to sleep]
Kug3lis has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kobain has quit [Ping timeout: 255 seconds]
AlexRussia has quit [Ping timeout: 240 seconds]
chouhoulis has joined #ruby
dc4 has joined #ruby
apollo274 has quit [Ping timeout: 255 seconds]
gothicsouth has joined #ruby
mikecmpbll has quit [Ping timeout: 240 seconds]
dionysus69 has joined #ruby
mim1k has quit [Ping timeout: 258 seconds]
anisha__ has quit [Quit: This computer has gone to sleep]
nullset68 has joined #ruby
__Yiota has quit [Ping timeout: 246 seconds]
Rodya_ has quit [Remote host closed the connection]
[Butch] has joined #ruby
AlexRussia has joined #ruby
dcluna has quit [Read error: No route to host]
catphish has quit [Quit: Leaving]
nullset68 has quit [Client Quit]
cadillac_ has joined #ruby
dcluna has joined #ruby
Kerea has joined #ruby
Rodya_ has joined #ruby
nesoi has joined #ruby
bvcosta has joined #ruby
<bvcosta> hey
<bvcosta> I'm using JRuby+Puma
<bvcosta> +RabbitMQ
<bvcosta> I'm starting a new connection on the startup of the application
<bvcosta> and I need to close the connection on the shutdown
<bvcosta> do you guys know any shutdown hook to use for this use case?
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jrafanie has joined #ruby
chouhoulis has quit [Remote host closed the connection]
ascarter has joined #ruby
chouhoulis has joined #ruby
ledestin has joined #ruby
<adam12> bvcosta: can you use at_exit ?
<bvcosta> where should I use it? I did try it, but I'm not sure if I'm using it at the right place
<adam12> bvcosta: It should be effective in any file that's evaluated.
ledestin has quit [Ping timeout: 255 seconds]
nanoz has joined #ruby
nanoz has joined #ruby
nanoz has quit [Changing host]
dc4 has quit [Ping timeout: 240 seconds]
nesoi has quit [Quit: Leaving.]
aufi has quit [Quit: Leaving]
<bvcosta> trying now on boot.rb
ldnunes has quit [Quit: Leaving]
<bvcosta> yes, I think it will work
<bvcosta> thanks
duderonomy has quit [Ping timeout: 246 seconds]
bruce_lee has quit [Read error: Connection reset by peer]
bvcosta has quit []
uZiel has joined #ruby
TomyWork has quit [Ping timeout: 240 seconds]
gusrub has joined #ruby
psychicist__ has joined #ruby
renchan has quit [Quit: Leaving...]
nanoz has quit [Read error: Connection reset by peer]
kies has joined #ruby
shinnya has joined #ruby
tubuliferous has joined #ruby
GinoMan2440 has joined #ruby
GinoMan2440 has quit [Remote host closed the connection]
GinoMan2440 has joined #ruby
GinoMan has quit [Ping timeout: 260 seconds]
antgel has quit [Ping timeout: 260 seconds]
ur5us has joined #ruby
meshsmith has quit [Read error: Connection reset by peer]
railswebdev has joined #ruby
haylon has quit [Remote host closed the connection]
centrx has quit [Remote host closed the connection]
ur5us has quit [Ping timeout: 258 seconds]
uZiel has quit [Ping timeout: 248 seconds]
Guest69 has joined #ruby
mikecmpbll has joined #ruby
SeepingN has joined #ruby
marxarelli has joined #ruby
synthroi_ has joined #ruby
Kerea has quit [Ping timeout: 258 seconds]
meshsmith has joined #ruby
JoshS has quit [Quit: Leaving]
synthroid has quit [Ping timeout: 268 seconds]
aenialis has joined #ruby
rohitpaulk has joined #ruby
haylon has joined #ruby
uZiel has joined #ruby
__Yiota has joined #ruby
sepp2k has quit [Read error: Connection reset by peer]
sepp2k has joined #ruby
mwlang has quit [Quit: mwlang]
__Yiota has quit [Ping timeout: 240 seconds]
jrafanie_ has joined #ruby
duderonomy has joined #ruby
mwlang has joined #ruby
jrafanie has quit [Ping timeout: 255 seconds]
Kerea has joined #ruby
bkxd has joined #ruby
bkxd_ has joined #ruby
Silthias1 has quit [Ping timeout: 240 seconds]
bkxd_ has quit [Ping timeout: 255 seconds]
bkxd has quit [Ping timeout: 255 seconds]
uZiel has quit [Ping timeout: 248 seconds]
aenialis has quit [Read error: Connection reset by peer]
dc4 has joined #ruby
ecuanaso has joined #ruby
rohitpaulk has quit [Ping timeout: 240 seconds]
cadillac__ has joined #ruby
ldnunes has joined #ruby
cadillac_ has quit [Read error: Connection reset by peer]
ma0 has joined #ruby
gnufied has quit [Ping timeout: 246 seconds]
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mim1k has joined #ruby
thisguy123 has joined #ruby
cyphase has quit [Quit: cyphase.com]
Bock has quit [Read error: Connection reset by peer]
Dimik has joined #ruby
A124 has quit [Quit: '']
Silthias has joined #ruby
tubuliferous has quit [Ping timeout: 246 seconds]
Kug3lis has joined #ruby
gnufied has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
__Yiota has joined #ruby
Silthias1 has joined #ruby
GinoMan2440 has quit [Remote host closed the connection]
ujjain has quit [Ping timeout: 255 seconds]
GinoMan2440 has joined #ruby
Silthias has quit [Ping timeout: 246 seconds]
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
andrzejk_ has joined #ruby
cyphase has joined #ruby
elifoster has joined #ruby
skweek has quit [Ping timeout: 255 seconds]
Silthias1 has quit [Ping timeout: 258 seconds]
eckhardt has joined #ruby
xall has joined #ruby
ascarter has joined #ruby
A124 has joined #ruby
johnny56_ has joined #ruby
johnny56 has quit [Ping timeout: 264 seconds]
__Yiota has quit [Ping timeout: 240 seconds]
gusrub_ has joined #ruby
gusrub has quit [Ping timeout: 240 seconds]
__Yiota has joined #ruby
cdg_ has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gusrub_ has quit [Ping timeout: 240 seconds]
cdg has quit [Ping timeout: 255 seconds]
quobo has quit [Quit: Connection closed for inactivity]
xall has quit [Quit: xall]
nankyokusei has joined #ruby
saschavoid has joined #ruby
AndBobsYourUncle has joined #ruby
ecuanaso has joined #ruby
cdg has joined #ruby
nowhereman_ has quit [Quit: Konversation terminated!]
nowhereman_ has joined #ruby
weaksauce has joined #ruby
DoubleMalt has joined #ruby
kobain has joined #ruby
cdg_ has quit [Ping timeout: 246 seconds]
Kerea has quit [Ping timeout: 255 seconds]
nesoi has joined #ruby
Silthias has joined #ruby
mjuszczak has joined #ruby
mjuszczak has quit [Max SendQ exceeded]
mjuszczak has joined #ruby
gusrub has joined #ruby
postmodern has joined #ruby
DoubleMalt has quit [Ping timeout: 246 seconds]
mim1k has quit [Ping timeout: 240 seconds]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Joufflu has joined #ruby
cadillac__ has quit [Ping timeout: 268 seconds]
<Joufflu> any ruby developers from Los Angeles
<Zarthus> just ask your question
<Zarthus> if you're recruiting, this is not the right channel to do it in
<Joufflu> I'd like to know where other ruby developers meetup so I can code with them
<Joufflu> I am a ruby developer not a recruiter
<Zarthus> have you tried meetup.com
<Joufflu> yeah
nankyokusei has quit [Remote host closed the connection]
pupsicle has quit [Quit: pupsicle]
<havenwood> Joufflu: Join us at Ruby in Hollywood every Wednesday in Silver Lake.
<havenwood> (Maybe we should change the name to Ruby in Silver Lake.)
nofxxxx has quit [Ping timeout: 255 seconds]
SeepingN has quit [Read error: Connection reset by peer]
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Joufflu> @havenwood, awesome ! is that the Lamill Coffee shop one?
SeepingN has joined #ruby
<havenwood> Joufflu: Yup!
<Joufflu> Sweet!
gusrub has quit [Remote host closed the connection]
pupsicle has joined #ruby
DoubleMalt has joined #ruby
<meshsmith> is there a Ruby installer/compilier I can download or do I need to hunker down and learn to command line?
Kerea has joined #ruby
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<SeepingN> one cannot get far in Ruby land without using the command line
<havenwood> meshsmith: What OS are you on?
<SeepingN> unless you have others to do all the lifting for you and all you do is program
<SeepingN> (don't say windows, don't say windows)
<meshsmith> windows 7
<bougyman> I dunno.
<SeepingN> DOH!
<bougyman> I know some rubymine people who have never seen the command line.
<SeepingN> frightening
<havenwood> meshsmith: If you ever upgrade to Windows 10 there's a very nice Windows Subsystem for Linux for developers that works great with Ruby.
<havenwood> meshsmith: There's currently a WindowsInstaller and DevKit for windows but I believe it's shy on maintenance while RubyInstaller2 is being worked on.
<meshsmith> Ill take that as a "get up off your ass and get gud"
<havenwood> meshsmith: Or there's a Ruby package for Chocolatey if you want to use a command line package manager.
<havenwood> meshsmith: https://rubyinstaller.org/
<havenwood> Looks like RubyInstaller has 2.4.1 for Windows, not bad!
Joufflu has quit [Ping timeout: 240 seconds]
<havenwood> Latest stable ftw.
<meshsmith> Fair. Its looks better coming from not-github to be honest. I will take a look and hopefully it works out. Thanks.
<havenwood> meshsmith: If you want to try a Ruby version switcher to get at different Ruby VMs or versions on Windows there's uru: https://bitbucket.org/jonforums/uru
nobodyzxc has joined #ruby
gusrub has joined #ruby
<havenwood> meshsmith: There's a Chocolatey package for uru as well: https://bitbucket.org/jonforums/uru/wiki/Chocolatey
username_ has quit [Ping timeout: 246 seconds]
nobodyzxc has quit [Client Quit]
<havenwood> meshsmith: If you're going to stay on Windows 7 instead of using some sort of Linux, via WSL or VM or whatev, consider using a package manager for Windows: https://chocolatey.org/
<havenwood> meshsmith: If you run into install trouble we might be able to help. Happy coding!
<meshsmith> Its my first time handling this sort of thing, I'd rahter know what to do about this before I start messing with a virtual machine.
<meshsmith> I already see myself doing something similar with node.js, but you gotta start somewhere...
<havenwood> meshsmith: I'd still suggest upgrading to Win 10 Creative Update so you can just start with bash.
<havenwood> Bash on Windows.
<havenwood> WSL.
<havenwood> meshsmith: Unless you're already fluent in PowerShell, you'll probably have a better time on bash.
andrzejk_ has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<havenwood> Then you can just follow tutorials and not worry about library compatibility or Windows quirks like no fork.
<meshsmith> In neither actually, not to overwhelm myself and hope to get to a state everyone seems to prefer in a not-windows environment.
eckhardt has joined #ruby
<havenwood> meshsmith: Win 10 makes it easy for developers by just giving you bash.
centrx has joined #ruby
thisguy123 has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
<havenwood> meshsmith: It also looks like Chocolatey and RubyInstaller support the latest stable Ruby, so that's promising.
GinoMan1423 has joined #ruby
andrzejk_ has joined #ruby
mim1k has joined #ruby
centrx has quit [Ping timeout: 240 seconds]
GinoMan2440 has quit [Ping timeout: 240 seconds]
pupsicle has quit [Quit: Leaving]
HoierM has quit [Ping timeout: 240 seconds]
pupsicle has joined #ruby
poloych has joined #ruby
ecuanaso has joined #ruby
vuoto has joined #ruby
mjuszczak has quit []
vuoto has quit [Client Quit]
mwlang has quit [Quit: mwlang]
__Yiota has quit [Ping timeout: 246 seconds]
ma0 has left #ruby [#ruby]
<zenspider> chocolatey?
mwlang has joined #ruby
<zenspider> what a great name
mwlang has quit [Client Quit]
mjuszczak has joined #ruby
muelleme has joined #ruby
gusrub has quit [Remote host closed the connection]
nofxx has joined #ruby
pazzaz has quit [Quit: WeeChat 1.7]
gusrub has joined #ruby
amclain has quit [Quit: Leaving]
ta_ has joined #ruby
justizin has joined #ruby
muelleme has quit [Ping timeout: 255 seconds]
Xyvir has joined #ruby
PatrikasZvaigzde has quit [Ping timeout: 240 seconds]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gnufied has quit [Ping timeout: 258 seconds]
jrafanie_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ascarter has joined #ruby
centrx has joined #ruby
username_ has joined #ruby
jrafanie has joined #ruby
enterprisey has quit [Remote host closed the connection]
rgr has joined #ruby
troys has joined #ruby
andrzejk_ has quit [Quit: Textual IRC Client: www.textualapp.com]
JoshS has joined #ruby
AndBobsYourUncle has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<zenspider> In bundler, is there a way to do pessimistic versioning for major.minor but say "include beta releases"? I currently have: gem "sexp_processor", "~> 4.10.0b1" but would rather specify "~> 4.10"
gnufied has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<zenspider> the doco is piss poor imho
harfangk has quit [Quit: Textual IRC Client: www.textualapp.com]
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
workmad3 has joined #ruby
<patarr> Does Ruby support using a hash to map an array?
<patarr> I mean it should be as simple as my_array.map(my_hash)
<patarr> Instead of my_array.map{ |i| my_hash[i] }
<zenspider> patarr: did you try it? or look at the doco for Array.map?
PatrikasZvaigzde has joined #ruby
<havenwood> >> desired = %i[aim another]; h = {aim: true, another: :yerp, more: false}; h.values_at(*desired) # patarr
<ruby[bot]> havenwood: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
ascarter has joined #ruby
<havenwood> #=> [true, :yerp]
<havenwood> patarr: Maybe consider the other way around ^
synthroi_ has quit []
<zenspider> seems like the bot is more down than up these days
ur5us has joined #ruby
<apeiros> it's still eval.in, but yes, it is :|
<zenspider> can we at least improve the message to say that? or make it retry?
<apeiros> I've got a holiday tomorrow. will see what I can do.
<apeiros> will try to switch it to jhass server, or at least improve the message. also switch it to 2.4.
BSaboia has joined #ruby
hutch34 has joined #ruby
AndBobsYourUncle has joined #ruby
dionysus69 has quit [Ping timeout: 240 seconds]
dc4 has quit [Ping timeout: 255 seconds]
chrisgopher has joined #ruby
marxarelli is now known as marxarelli|afk
BSaboia has quit [Ping timeout: 240 seconds]
<thatsnotjack> zenspider: I don't think twiddlewakka ever matches prereleases https://github.com/rubygems/rubygems/blob/master/test/rubygems/test_gem_requirement.rb#L292
Rodya_ has quit [Remote host closed the connection]
workmad3 has quit [Ping timeout: 255 seconds]
reacquaint has joined #ruby
mtkd has quit [Ping timeout: 268 seconds]
gheegh has joined #ruby
Fernando-Basso has quit [Quit: WeeChat 1.8]
<matthewd> thatsnotjack: That's because 1.1.pre is < 1.1; 1.2.pre would match
mtkd has joined #ruby
<thatsnotjack> Ah right, my mistake!
arup_r has joined #ruby
<matthewd> zenspider: "~> 4.10.x" will do what you want, IIRC
reacquaint has quit []
reacquaint has joined #ruby
mim1k has quit [Ping timeout: 246 seconds]
ldnunes has quit [Quit: Leaving]
<Xyvir> Not that anyone cares, I found the answer to my Dashing question I asked yesterday, there is a certain tag you have to add to the HTML file of the widget so that Batman won't strip out the HTML
dmtd has quit [Quit: Connection closed for inactivity]
<Xyvir> By default Batman strips all HTML out of data it is binding to. If you want to get around this, simply pass in the raw filter.
<Xyvir> Example:
<zenspider> matthewd: .x ? literally?
<zenspider> there's nothing in the doco for that, that I can find.
<matthewd> zenspider: Yeah: it's a prerelease of 4.10, which means it comes before 4.10.[number].pre
<zenspider> but what I don't want is to specify the bug version, so they'll update to 4.11 if/when I release it
Xyvir has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
<zenspider> ahhhh... interesting. I'd try it out, but I'm in the middle of a painful docker rebuild thanks to touching the Gemfile at all. :(
<zenspider> maybe after, once I'm plugged in again :)
<matthewd> So the .x isn't actually special: it could be any alpha string... it's just a slightly more indicative choice than .a or whatever
<zenspider> building node instead of updating your shit to use a packaged version is a DUMB idea
reacquaint has left #ruby [#ruby]
<zenspider> right. 4.10.including_betas
ecuanaso has joined #ruby
<matthewd> Doesn't help you if you want a minimum of a specific prerelease, of course... then you'd still need to add a second >= qualifier
<zenspider> true, luckily this one is pretty clean
cfec0b8d has quit [Remote host closed the connection]
<zenspider> seriously... why are they still using node 5 or at least why aren't they packaging their own??
GinoMan1423 has quit [Ping timeout: 260 seconds]
ivanskie has joined #ruby
<ivanskie> hi all!
<ivanskie> i have a method which uses net/http to download something.
<ivanskie> i need to implement a timeout and raise if reached time out. after some research it sounds like ruby's own TIMEOUT isn't safe.
<ivanskie> any suggestions?
cfec0b8d has joined #ruby
<zenspider> isn't safe for what?
<ivanskie> nevermind looks like it already does it on its own lol
reacquaint has joined #ruby
nankyokusei has joined #ruby
xenops has joined #ruby
nankyokusei has quit [Ping timeout: 246 seconds]
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<cjohnson> Can somebody explain to me what syntax magic provides for this? post :create, params: params
<cjohnson> named params? mixing named and non-named?
<centrx> Where's the magic?
<cjohnson> I'm new to ruby I'm just trying to understand what is going on
<cjohnson> I'm guessing ruby does named params, that's not hard to grasp
<cjohnson> but is this mixing positional + named params?
<cjohnson> and how might the method def look for this?
<pupsicle> def post action, params: nil
<pupsicle> def post(action, params: nil)
<pupsicle> sorry
<cjohnson> Do keyword params always have to come after positional?
mtkd has quit [Read error: Connection reset by peer]
<cjohnson> def foo(a, b, c: nil, d: nil)
[Butch] has quit [Quit: I'm out . . .]
mtkd has joined #ruby
<cjohnson> (if you hae an article on mixing the two I could read that would be good as well)
dc4 has joined #ruby
<pupsicle> thats the actual code for your posted example.
<cjohnson> I just read that one but it didn't explain mixing
<cjohnson> just one or the other
<cjohnson> just found this though
<cjohnson> bookmarking
nesoi has quit [Quit: Leaving.]
<pupsicle> ah
<pupsicle> positional args must come before
chouhoul_ has joined #ruby
<pupsicle> otherwise you get a syntax error
<cjohnson> that is a mess lol
chouhoulis has quit [Ping timeout: 255 seconds]
Rodya_ has joined #ruby
<cjohnson> I only knew about arguments + the special block argument + named block arguments before
<cjohnson> Oh that was my other question
<cjohnson> what would a function def look like that doesn't use the named &block syntax that still accepts a block
<cjohnson> how do you reference the block
<centrx> "yield"
<matthewd> cjohnson: If you're going code-reading, it'll be worth knowing that it used to work differently: post(:create, params: x) might also invoke a method def post(foo, options) -- where options is a hash
<cjohnson> ah yes yield
<matthewd> i.e., it's "actually" post(:create, { params: x }), with the braces elided
<cjohnson> is that magic specific to method calls?
<pupsicle> it's not magic
<cjohnson> or did foo: 'a' imply braces anywhere?
pupsicle has quit [Quit: Leaving]
<matthewd> Mostly method calls. I know it's also true in an array literal... but you can't do `v = a: 1`, for example
<cjohnson> got it
<cjohnson> IMO that's absolutely magic then :P
<cjohnson> if it knows it's in a method call and you can use special alternate syntax to get the same thing, that's magic
<cjohnson> thanks for clarifying
<havenwood> Now a days we have keyword args.
<havenwood> Nowadays*
<matthewd> havenwood: Yeah, we started there.. I was just filling in backstory because so much existing code still uses the old form
<SeepingN> now (a daze)
<havenwood> nowadæges
<havenwood> matthewd: Aye, and the Hash form is still in wide use so you've got to know it.
<cjohnson> matthewd: Ok so how about this:
<cjohnson> post(:create, params: x, other: bar)
<cjohnson> does that become one hash? or two hashes
<matthewd> cjohnson: One
<cjohnson> and then how do you know what it's going to become? You have to know which ruby version you are targeting?
<matthewd> Anything that looks like hash key-value pairs, at the end of the method argument list, will always become a positional parameter, in that position, containing a hash
<cjohnson> very strange
<matthewd> It'll do whichever thing the called method's signature wants
<cjohnson> got it ok that makes more sense then
<cjohnson> so does it actually match the keywords against the signature to see if it's keyword form or hash form?
<cjohnson> like if I had def foo(a, b: nil, c: nil) and called foo('a', b: 5, d: 5) it would turn that into a hash since there's no c?
dc4 has quit [Ping timeout: 246 seconds]
lxsameer has joined #ruby
<matthewd> No, that's an error
<matthewd> (for a start, there'd be nowhere for the hash to go)
<cjohnson> Oh true
<matthewd> But even with foo(a, hash_maybe=nil, b: nil, c: nil), you'll get an error for foo('a', b: 5, d: 5)
<matthewd> (I just checked -- I didn't know)
<cjohnson> because it found b and then assumed it was keyword?
<cjohnson> Or how does it know it's an error and shouldn't become a hash
<cjohnson> foo('a', x: 5, y: 5) for example I'm guessing wouldn't error since there's no ambiguous possibly-keyword
<matthewd> Nothing to do with the names: the called method has kwargs, so if the last parameter in the call is a hash, it'll get unpacked as kwargs
<matthewd> So yes, that will still error
<zenspider> cjohnson: don't guess. put it in a file and try it out
<zenspider> this is all really cheap and easy to figure out
<cjohnson> Well I wasn't sure if this required a specific version of ruby to observe
<cjohnson> so testing locally with faulty assumptions would just confuse further
ltem has quit [Quit: Leaving]
<cjohnson> and, we are already here talking after all, and irb won't explain the things matthewd just explained to me :)
<matthewd> No, this is all true for any modern version (2.0 for kwargs, 2.1 for optional kwargs, I think?)
<cjohnson> Yeah that sounds right
graft has joined #ruby
username_ has quit [Read error: Connection reset by peer]
<matthewd> cjohnson: So the only way to do foo('a', x: 5, y: 5) would actually be foo('a', { x: 5, y: 5 }, {}), AFAICS
biberu has quit []
username_ has joined #ruby
dc4 has joined #ruby
<matthewd> Which would make this a good point to emphasise that this is an edge case I've not yet encountered in practice :)
roshanavand has joined #ruby
<cjohnson> got it. seems like you wouldn't ever want to intentionally do that
<cjohnson> I was more just curious about when you might accidentally invoke hash instead of kwargs
<cjohnson> thanks for clarifying
mjuszczak has quit []
graft has quit [Ping timeout: 246 seconds]
<matthewd> No worries!
psychicist__ has quit [Ping timeout: 246 seconds]
bkxd has joined #ruby
bkxd_ has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mjuszczak has joined #ruby
gheegh has quit [Ping timeout: 268 seconds]
graft has joined #ruby
sonOfRa has quit [Remote host closed the connection]
sonOfRa has joined #ruby
jinie_ has quit [Quit: ZNC 1.6.1 - http://znc.in]
arup_r has quit []
TomyLobo2 has joined #ruby
meshsmith has quit [Read error: Connection reset by peer]
AKPWD has quit [Read error: Connection reset by peer]
<baweaver> matthewd: yeah, it's 2.1 for optionals
elifoster has quit [Ping timeout: 240 seconds]
jinie_ has joined #ruby
AKPWD has joined #ruby
AKPWD has quit [Read error: Connection reset by peer]
TomyLobo has quit [Ping timeout: 258 seconds]
AKPWD has joined #ruby
Fysicus has joined #ruby
FysiWRK has joined #ruby
Fysicus has quit [Client Quit]
FysiWRK has quit [Client Quit]
Fysicus has joined #ruby
bkxd_ has quit [Ping timeout: 240 seconds]
bkxd has quit [Ping timeout: 240 seconds]
creshiem has joined #ruby
Kerea has quit [Ping timeout: 240 seconds]
chouhoulis has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chouhoul_ has quit [Ping timeout: 268 seconds]
chouhoulis has quit [Ping timeout: 258 seconds]
saschavoid has quit [Quit: leaving]
creshiem has quit [Quit: WeeChat 1.8]
<zenspider> matthewd: hrm... turns out that "~> 4.10including_betas" is considered "illformed"
haylon has quit []
centrx has quit []
dc4 has quit [Ping timeout: 240 seconds]
<zenspider> ah. it's the underscore
<zenspider> "~> 4.10including-betas0"
Qommand0r has quit [Quit: WeeChat 1.8]
KeyJoo has quit [Ping timeout: 260 seconds]
PresidentBiscuit has joined #ruby
marxarelli|afk is now known as marxarelli
HoierM has joined #ruby
HoierM has quit [Max SendQ exceeded]
gizmore|2 has quit [Ping timeout: 240 seconds]
bvcosta has joined #ruby
ddffg has quit [Ping timeout: 240 seconds]
polishdub has quit [Quit: Leaving]
mjuszczak has quit []
patarr has quit [Ping timeout: 240 seconds]
eightlimbed has joined #ruby
gusrub has quit [Remote host closed the connection]
<eightlimbed> i'm trying to get a string "[5, 8, 11]" to an array, [5, 8, 11]. i used .scan(/\d/).map(&:to_i) and it returned [5, 8, 1, 1]. is there a simpler way?
<eightlimbed> \d++ worked - nevermind - sorry, i'm new to regex
Kug3lis_off is now known as Kug3lis_
Kug3lis_ has quit [Quit: Textual IRC Client: www.textualapp.com]
troys is now known as troys_
gusrub has joined #ruby
<apeiros> depending on what it is, you might also want JSON/YAML
Antiarc has quit [Ping timeout: 246 seconds]
Antiarc has joined #ruby
<eightlimbed> oh, cool. thanks apeiros!
<ule> hey guys.. after passing {orderBy: '"company_id"', equalTo: 7} via parameter to my method, it's being converted to: {:orderBy=>"\"company_id\"", :equalTo=>7}
jjunior_ has quit [Quit: Connection closed for inactivity]
<SeepingN> much happiness after discovering Sublime Text _UI_ themes
<ule> how can I avoid this convertion?
<darix> eightlimbed: keep using regexp. it is much easier to shoot yourself in the foot with them. ;)
<SeepingN> lol
<SeepingN> what conversion are you talking about. you wanted company_id with double quotes around it, so that's what you got
<SeepingN> if you don't, then remove the single quotes around it all
<apeiros> ule: '"' == "\""
<thatsnotjack> ule: Those look like the same hash to me, with no conversion occuring. Those are just two different ways of representing it
<SeepingN> ^
<apeiros> eightlimbed: also are you a spider or an octopus?
<thatsnotjack> Or pregnant?
<ule> apeiros: thatsnotjack
<ule> thank you
<apeiros> saywhat? :D
<eightlimbed> i'm an ashtanga yogi :)
hobodave has quit [Ping timeout: 260 seconds]
dc4 has joined #ruby
SeepingN has quit [Ping timeout: 240 seconds]
muelleme has joined #ruby
ziyangtian has joined #ruby
ziyangtian has quit [Remote host closed the connection]
eightlimbed has quit [Ping timeout: 240 seconds]
muelleme has quit [Ping timeout: 255 seconds]
reacquaint has quit [Remote host closed the connection]
kgzm has joined #ruby
lel has quit [K-Lined]
cschneid_ has quit [Remote host closed the connection]
al2o3-cr has quit [Ping timeout: 240 seconds]
poloych has quit [Remote host closed the connection]
Kerea has joined #ruby
Rutix has quit [Ping timeout: 260 seconds]
Rutix has joined #ruby
Rutix has joined #ruby
Rutix has quit [Changing host]
quobo has joined #ruby
lxsameer has quit [Quit: WeeChat 1.7]
nankyokusei has joined #ruby
gothicsouth has joined #ruby
nankyokusei has quit [Ping timeout: 240 seconds]
Joufflu has joined #ruby
t-recx has quit [Quit: t-recx]
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Fysicus has quit [Quit: The Truth Is Just An Excuse For A Lack Of Imagination]
agent_white has joined #ruby
xenops has quit [Ping timeout: 240 seconds]
cdg_ has joined #ruby
<zenspider> yay! I think it all works! boo! I think my contract with codeclimate might be over as a result.
elifoster has joined #ruby
duderonomy has quit [Ping timeout: 246 seconds]
eckhardt has quit [Quit: Textual IRC Client: www.textualapp.com]
ascarter has joined #ruby
cdg has quit [Ping timeout: 246 seconds]
cdg_ has quit [Ping timeout: 240 seconds]
zapata has quit [Quit: WeeChat 1.8]
zapata has joined #ruby
cschneid_ has joined #ruby
im0nde has joined #ruby
banisterfiend has joined #ruby
nitric has quit [Ping timeout: 240 seconds]
bauruine has quit [Ping timeout: 255 seconds]
cschneid_ has quit [Ping timeout: 246 seconds]
PresidentBiscuit has quit [Remote host closed the connection]
alveric3 has joined #ruby
thatsnotjack has quit [Quit: WeeChat 1.7]
bauruine has joined #ruby
alveric2 has quit [Ping timeout: 260 seconds]
solocshaw has joined #ruby
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
AndBobsYourUncle has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
eightlimbed has joined #ruby
kgzm has quit [Quit: leaving]
Rodya_ has quit [Remote host closed the connection]
al2o3-cr has joined #ruby