havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.5.1, 2.4.4, 2.3.7, 2.6.0-preview2: https://www.ruby-lang.org | Paste 4+ lines of text to https://gist.github.com | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby
<havenwood> Kensei: Exactly.
chouhoul_ has quit [Ping timeout: 256 seconds]
eckhardt has joined #ruby
<havenwood> Kensei: You can just monkey patch for the behaviour you want, for better or worse: https://gist.github.com/havenwood/025435ccb893a86920f32820e0b50b6b
chouhoul_ has joined #ruby
<Kensei> havenwood: good to know. thanks.
<havenwood> Kensei: you're welcome
chouhou__ has quit [Ping timeout: 260 seconds]
<Kensei> too bad there isn't a Hash#dig_values :-)
<havenwood> Kensei: Maybe add to_json to Regexp in a refinement?
<havenwood> Kensei: would that give you back the keys? :-O
chouhou__ has joined #ruby
chouh____ has quit [Ping timeout: 245 seconds]
herbmillerjr has quit [Ping timeout: 240 seconds]
<Kensei> nah, i was just noodling. to handle deep structures, i gotta walk 'em myself.
chouh____ has joined #ruby
chouhoulis has quit [Ping timeout: 245 seconds]
chouhoulis has joined #ruby
<Kensei> that monkey patch would need a little more work to handle embedded slashes, but i could see doing it.
chouho___ has quit [Ping timeout: 276 seconds]
chouho___ has joined #ruby
chouhoul_ has quit [Ping timeout: 245 seconds]
chouhoul_ has joined #ruby
chouhou__ has quit [Ping timeout: 256 seconds]
kmurphy4 has quit [Quit: kmurphy4]
chouhou__ has joined #ruby
<cthulchu> File.read() relative?
<cthulchu> anyone?>
chouh____ has quit [Ping timeout: 276 seconds]
quobo has quit [Quit: Connection closed for inactivity]
chouh____ has joined #ruby
chouhoulis has quit [Ping timeout: 245 seconds]
chouhoulis has joined #ruby
herbmillerjr has joined #ruby
chouho___ has quit [Ping timeout: 276 seconds]
<cthulchu> this is why I always try to avoid FS manipulations
<cthulchu> it's awkward AF cuz they never create neat methods
<cthulchu> they consider it "low-level", so no comfortable handles
chouho___ has joined #ruby
wontruefree has quit [Quit: bye]
<al2o3-cr> wtf
chouhoul_ has quit [Ping timeout: 264 seconds]
chouhoul_ has joined #ruby
chouhou__ has quit [Ping timeout: 240 seconds]
aviraldg has joined #ruby
Hanma[m] has joined #ruby
bascht has joined #ruby
luna_x[m] has joined #ruby
jonjits[m] has joined #ruby
Giphy[m] has joined #ruby
redlegion[m] has joined #ruby
iceskins[m] has joined #ruby
haylon_ has joined #ruby
turt2live has joined #ruby
KevinMGranger has joined #ruby
velu_aon[m] has joined #ruby
zalipuha[m] has joined #ruby
chouhou__ has joined #ruby
chouh____ has quit [Ping timeout: 264 seconds]
chouh____ has joined #ruby
<cthulchu> have to use some crap like this now: JSON.parse(File.read(File.dirname(__FILE__)+'/analytics_tests.json'))
chouhoulis has quit [Ping timeout: 256 seconds]
chouhoulis has joined #ruby
<al2o3-cr> using json/add/* is ruby specific
<havenwood> &ri IO.read
chouho___ has quit [Ping timeout: 264 seconds]
<cthulchu> so having require_relative was important enough for implementation, but read_relative wasn't
gigetoo has joined #ruby
chouho___ has joined #ruby
<cthulchu> would be cool to use require.relative and have the relative method used for all FS-related stuff
tvw has quit [Remote host closed the connection]
chouhoul_ has quit [Ping timeout: 276 seconds]
<al2o3-cr> no, and no.
chouhoul_ has joined #ruby
chouhou__ has quit [Ping timeout: 264 seconds]
chouhou__ has joined #ruby
chouh____ has quit [Ping timeout: 256 seconds]
<al2o3-cr> cthulchu: and use File.join also
<al2o3-cr> or Pathname
chouh____ has joined #ruby
chouho___ has quit [Ping timeout: 240 seconds]
chou_____ has joined #ruby
chouhoulis has quit [Ping timeout: 276 seconds]
clemens31 has quit [Ping timeout: 240 seconds]
<cthulchu> what? why?
<cthulchu> I know why
<cthulchu> : No
halt has joined #ruby
halt is now known as Guest37179
clemens3_ has quit [Ping timeout: 256 seconds]
chouhoulis has joined #ruby
<cthulchu> also, saying no with no reason is useless
chouhoul_ has quit [Ping timeout: 256 seconds]
chouhoul_ has joined #ruby
<al2o3-cr> why wouldn't you. you've used the rest then use String#+ when File.join is safer
chouhou__ has quit [Ping timeout: 240 seconds]
ramfjord has joined #ruby
<eam> cthulchu: you should use File.join because it will work on platforms where / isn't the directory separator
<havenwood> chamunks: ::read is already relative.
<eam> it's a fairly minor concern
<havenwood> cthulchu: File.expand_path __dir__, 'analytics_tests.json'
chouhou__ has joined #ruby
<havenwood> cthulchu: ::read is already relative.
<cthulchu> errr
<cthulchu> then why do I need to expand path?
chouh____ has quit [Ping timeout: 256 seconds]
<cthulchu> it's in this directory
<havenwood> cthulchu: You don't need to do any of this. I'm pointing out if you want a full path, that's how.
chouho___ has joined #ruby
<eam> just add every directory on your system to $: problem solved
darkhanb has joined #ruby
<cthulchu> ah
<havenwood> eam: ha
banisterfiend has quit [Read error: Connection reset by peer]
<cthulchu> and it's not relative
<al2o3-cr> eam: lol
<havenwood> cthulchu: It is. ¯\_(ツ)_/¯
chou_____ has quit [Ping timeout: 264 seconds]
chouh____ has joined #ruby
chouhoulis has quit [Ping timeout: 240 seconds]
<cthulchu> it may be relative to something else
<cthulchu> It doesn't even bother to give me the path in the error
<cthulchu> not to the file I try to read from
chouhoulis has joined #ruby
<cthulchu> err
<cthulchu> it's not relative to the file I have the File.read in
chouhoul_ has quit [Ping timeout: 265 seconds]
<cthulchu> I don't run it directly though. it's been required many times before fired
chouhoul_ has joined #ruby
pankaj has quit [Quit: leaving]
chouhou__ has quit [Ping timeout: 240 seconds]
kmurphy4 has joined #ruby
<cthulchu> this is my error: /Users/Shared/repos/qa_automation/lib/analytics/init.rb:3:in `read': No such file or directory @ rb_sysopen - analytics_tests.json (Errno::ENOENT)
chouho___ has quit [Ping timeout: 245 seconds]
chouhou__ has joined #ruby
<cthulchu> and this is the 3d line: JSON.parse(File.read('analytics_tests.json'))
<cthulchu> this is terrible
<cthulchu> every language just fails to make FS handlers comfortable
chouho___ has joined #ruby
<cthulchu> even errors are awkward
chouh____ has quit [Ping timeout: 240 seconds]
<jrich523> lol
zachk has joined #ruby
<jrich523> powershell does it pretty well :D
kt has quit [Ping timeout: 260 seconds]
<cthulchu> well it's not a language
<al2o3-cr> >> SystemCallError.new(Errno::ENOENT::Errno).message
<ruby[bot]> al2o3-cr: # => "No such file or directory" (https://eval.in/1020178)
<havenwood> eam: PATH="$(mdfind 'kMDItemContentType == public.folder' | tr "\n" ":")"
<jrich523> no more than anything else you're working with
chouh____ has joined #ruby
chouhoulis has quit [Ping timeout: 245 seconds]
<cthulchu> aha
<cthulchu> that's why I didn't want to use the awkward FS handler
kt has joined #ruby
<cthulchu> it's always bad with io
<cthulchu> end up writing wrappers around that crap
sytherax has joined #ruby
chouhoulis has joined #ruby
<cthulchu> anyhow, havenwood, it is NOT relative
<cthulchu> don't mislead peeps
chouhoul_ has quit [Ping timeout: 255 seconds]
chouhoul_ has joined #ruby
chouhou__ has quit [Ping timeout: 264 seconds]
chouhou__ has joined #ruby
chouho___ has quit [Ping timeout: 255 seconds]
ramfjord has quit [Ping timeout: 255 seconds]
<eam> cthulchu: read is most certainly relative
<eam> cmon now, we're willing to teach you ruby but be nice
Asher has quit [Ping timeout: 268 seconds]
<cthulchu> look at my paste
<cthulchu> it's obvious that it's not
chouho___ has joined #ruby
<eam> in fact, I'm not sure ruby has access to the set of non-relative filesystem access calls on linux
chouh____ has quit [Ping timeout: 265 seconds]
herbmillerjr has quit [Remote host closed the connection]
<al2o3-cr> eam: it doesn't at all.
<cthulchu> I'm sure it does here
<cthulchu> on mac
<cthulchu> gonna try
chouh____ has joined #ruby
<al2o3-cr> not even on bsd
chouhoulis has quit [Ping timeout: 240 seconds]
<eam> no, it definitely does not on a mac-- I don't think OSX even implements openat()
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<eam> like, at least linux implements non relative calls but OSX can't do it unless you're going to do something like write your own kernel module
chouhoulis has joined #ruby
chouhoul_ has quit [Ping timeout: 255 seconds]
<al2o3-cr> neither does.
chouhoul_ has joined #ruby
<eam> al2o3-cr: not linux?
<al2o3-cr> no
<eam> or you mean inside ruby
chouhou__ has quit [Ping timeout: 245 seconds]
<al2o3-cr> no linux.
<eam> linux certainly has non relative calls
<eam> it's openat()
<cthulchu> maybe it's relative to the project, not to this folder?
<eam> you pass an extra parameter which is the explicit relative directory
<cthulchu> what is it relative to?
<eam> useful for threads!
<cthulchu> where is the base folder?
<cthulchu> hell it's awkward
chouhou__ has joined #ruby
<eam> cthulchu: it's relative to your process current working directory
<cthulchu> it's different from require_relative
chouho___ has quit [Ping timeout: 264 seconds]
<cthulchu> okay, how do I make it print my current working directory?
<cthulchu> I want to debug it
<al2o3-cr> eam: corrected it does, wfm
<havenwood> cthulchu: I didn't mislead you, haha. I'm not that nefarious.
<havenwood> cthulchu: Dir.pwd
chouho___ has joined #ruby
<cthulchu> pwd?
<eam> not *quite* that nefarious ... currently
<cthulchu> what does it mean?
<havenwood> ;-)
chouh____ has quit [Ping timeout: 248 seconds]
<al2o3-cr> present working directory
<cthulchu> oh, cool
<havenwood> cthulchu: man pwd
<al2o3-cr> TIL
<havenwood> chamunks: echo $PWD
chouh____ has joined #ruby
<havenwood> chamunks: sorry for the misstells
<havenwood> I can't type cthulchu
chouhoulis has quit [Ping timeout: 248 seconds]
<havenwood> cthulchu: PWD Logical current working directory.
chouhoulis has joined #ruby
samort7 has quit []
chouhoul_ has quit [Ping timeout: 260 seconds]
sytherax has quit [Remote host closed the connection]
<al2o3-cr> little bash tip; !* reuses last command args.
chouhoul_ has joined #ruby
chouhou__ has quit [Ping timeout: 260 seconds]
<havenwood> pwd is usually in PATH or it's a builtin as well in zsh
<cthulchu> ahahahah
<cthulchu> it's project dir
zachk has quit [Quit: Leaving]
<cthulchu> and it prints it absolutely
<cthulchu> starting from /
chouhou__ has joined #ruby
<cthulchu> so it is different from require_relative indeed
chouho___ has quit [Ping timeout: 248 seconds]
<cthulchu> require_relative is this file's folder
<havenwood> cthulchu: compare with __dir__
<cthulchu> well I know __dir__
<cthulchu> that's what I used
<cthulchu> errr
<al2o3-cr> eg; blah -lHas; ls !*
<havenwood> cthulchu: nerp
<havenwood> cthulchu: require_relative is like:
<havenwood> absolute_path = File.absolute_path file, __dir__
<havenwood> realpath = File.realpath "#{absolute_path.chomp '.rb'}.rb"
chouho___ has joined #ruby
<cthulchu> yes, __dir__ is what require_relative does
<havenwood> cthulchu: no, no it isn't quite
<havenwood> cthulchu: see above
jenrzzz has quit [Ping timeout: 245 seconds]
<al2o3-cr> what is this shit storm
chouh____ has quit [Ping timeout: 256 seconds]
sytherax has joined #ruby
chouh____ has joined #ruby
<cthulchu> Dir.pwd is: /Users/Shared/repos/qa_automation
<cthulchu> __dir__ is: /Users/Shared/repos/qa_automation/lib/analytics
chouhoulis has quit [Ping timeout: 264 seconds]
<cthulchu> tbh, I don't trust .pwd
<cthulchu> it looks weird
<cthulchu> no idea where it gets .pwd from
<havenwood> cthulchu: Yeah, that's not surprising. Hahaha. You have trust issues!
<al2o3-cr> analtics is relative to lib
chouhoulis has joined #ruby
chouhoul_ has quit [Ping timeout: 240 seconds]
<havenwood> So far havenwood and pwd are liars. ¯\_(ツ)_/¯
<cthulchu> __dir__ seems to be a lot more reliable.
<al2o3-cr> simple as that.
<cthulchu> I'm gonna go with that, I guess. I think .pwd is project's root defined somewhere in this context.
chouhoul_ has joined #ruby
chouhou__ has quit [Ping timeout: 248 seconds]
<cthulchu> whereas __dir__ is lower
<havenwood> cthulchu: The current working directory and the directory of the file from where the method is called are just different things.
<havenwood> cthulchu: One isn't *wrong*.
<cthulchu> yeah, I see now
<cthulchu> just didn't expect it to take that by default
chouhou__ has joined #ruby
<cthulchu> makes no sense to me at all, especially after require_retive being so different
<cthulchu> so it is relative, but in a way that is not intuitive.
elomatreb has quit [Ping timeout: 248 seconds]
<havenwood> cthulchu: So if you're cding around doing things, when you load a file you expect it to be relative to the current working directory.
<al2o3-cr> cthulchu: require_relative is requiring a file realtive to where you are.
chouho___ has quit [Ping timeout: 264 seconds]
<havenwood> cthulchu: On the other hand, when you require a source file, you expect it to be relative to the current file.
ramfjord has joined #ruby
chouho___ has joined #ruby
<cthulchu> I don't know. I kinda expect that in both cases
<havenwood> cthulchu: It may not seem intuitive to you, but it is sensible.
<cthulchu> but I guess that's just style
<cthulchu> it is, ok
<cthulchu> thanks for clarifying that
chouh____ has quit [Ping timeout: 248 seconds]
<cthulchu> also it's really misleading that the error doesn't print the absolute path
<cthulchu> makes it really difficult to debug
chouh____ has joined #ruby
<cthulchu> when you don't know what path it uses by default
chouhoulis has quit [Ping timeout: 240 seconds]
Kestrel-029 has quit [Read error: Connection reset by peer]
Nicmavr has joined #ruby
Nicmavr is now known as Guest40516
chouhoulis has joined #ruby
chouhoul_ has quit [Ping timeout: 264 seconds]
chouhoul_ has joined #ruby
<al2o3-cr> cthulchu: how helpful were we on a scale of 1..100?
chouhou__ has quit [Ping timeout: 264 seconds]
chouhou__ has joined #ruby
chouho___ has quit [Ping timeout: 248 seconds]
<al2o3-cr> you have to answer in a ruby expression lol
chouh____ has quit [Ping timeout: 240 seconds]
chouho___ has joined #ruby
<eam> >> (1..100).to_a.sample
<ruby[bot]> eam: # => 86 (https://eval.in/1020179)
<eam> not bad
<al2o3-cr> :P
za1b1tsu has joined #ruby
chouh____ has joined #ruby
chouhoulis has quit [Ping timeout: 264 seconds]
chouhoulis has joined #ruby
chouhoul_ has quit [Ping timeout: 260 seconds]
QCF has joined #ruby
RougeR has quit [Ping timeout: 264 seconds]
chouhoul_ has joined #ruby
chouhou__ has quit [Ping timeout: 240 seconds]
<al2o3-cr> >> __dir__
<ruby[bot]> al2o3-cr: # => "/tmp/execpad-fd7b9df55ea1" (https://eval.in/1020180)
<al2o3-cr> >> __FILE__
<ruby[bot]> al2o3-cr: # => "/tmp/execpad-a9f03eaaa6d8/source-a9f03eaaa6d8" (https://eval.in/1020181)
chouhou__ has joined #ruby
<al2o3-cr> >> RUBY_VERSION
<ruby[bot]> al2o3-cr: # => "2.3.0" (https://eval.in/1020182)
chouho___ has quit [Ping timeout: 264 seconds]
<al2o3-cr> is this bot ever gonna get upgraded???
chouho___ has joined #ruby
chouh____ has quit [Ping timeout: 248 seconds]
za1b1tsu has quit [Ping timeout: 240 seconds]
chouh____ has joined #ruby
<al2o3-cr> >> Etc.uname
<ruby[bot]> al2o3-cr: # => uninitialized constant Etc (NameError) ...check link for more (https://eval.in/1020183)
<al2o3-cr> haha
chouhoulis has quit [Ping timeout: 240 seconds]
<al2o3-cr> >> require 'etc'; Etc.uname
<ruby[bot]> al2o3-cr: # => {:sysname=>"Linux", :nodename=>"ev1.eval.in", :release=>"2.6.32-41-generic-pae", :version=>"#94-Ubun ...check link for more (https://eval.in/1020184)
regedit has joined #ruby
<al2o3-cr> that's an old kernel.
chouhoulis has joined #ruby
chouhoul_ has quit [Ping timeout: 248 seconds]
<al2o3-cr> >> require 'etc'; Etc.nprocessors
<ruby[bot]> al2o3-cr: # => 1 (https://eval.in/1020185)
chouhoul_ has joined #ruby
chouhou__ has quit [Ping timeout: 260 seconds]
<al2o3-cr> >> require 'etc'; Etc.sysconf Etc::SC_NPROCESSORS_ONLN
<ruby[bot]> al2o3-cr: # => (https://eval.in/1020186)
chouhou__ has joined #ruby
<al2o3-cr> forbidden access to /proc/stat so the former is a syscall.
chouho___ has quit [Ping timeout: 260 seconds]
chouh____ has quit [Ping timeout: 240 seconds]
chouho___ has joined #ruby
chouh____ has joined #ruby
chouhoulis has quit [Ping timeout: 264 seconds]
<zenspider> eam: rand 1..100
chouhoulis has joined #ruby
cschneid has joined #ruby
chouhoul_ has quit [Ping timeout: 264 seconds]
<eam> oh well that's certainly shorter
chouhoul_ has joined #ruby
orbyt_ has joined #ruby
chouhou__ has quit [Ping timeout: 256 seconds]
wontruefree has joined #ruby
chouhou__ has joined #ruby
chouho___ has quit [Ping timeout: 264 seconds]
chouho___ has joined #ruby
chouh____ has quit [Ping timeout: 240 seconds]
chouh____ has joined #ruby
chouhoulis has quit [Ping timeout: 240 seconds]
chouhoulis has joined #ruby
AJA4350 has quit [Quit: AJA4350]
chouhoul_ has quit [Ping timeout: 260 seconds]
<al2o3-cr> >> 20.times.map { srand / srand }.inject :+
<ruby[bot]> al2o3-cr: # => 51 (https://eval.in/1020190)
sytherax has quit [Remote host closed the connection]
chouhoul_ has joined #ruby
chouhou__ has quit [Ping timeout: 240 seconds]
<al2o3-cr> well it's more than 50%
Mia has quit [Read error: Connection reset by peer]
<zenspider> !fix chouhoul_
<zenspider> !connection chouhoul_
chouho___ was kicked from #ruby by ruby[bot] [repeated join/part detected]
chouh____ was kicked from #ruby by ruby[bot] [repeated join/part detected]
chouhoulis was kicked from #ruby by ruby[bot] [repeated join/part detected]
chouhoul_ was kicked from #ruby by ruby[bot] [repeated join/part detected]
<al2o3-cr> zenspider: you been eating anything good lately?
<zenspider> man... you don't need 6 logins... let alone 6 BAD logins
chouho___ has quit [Ping timeout: 256 seconds]
<zenspider> al2o3-cr: eating? um. I've mostly been focusing on killer steaks
<al2o3-cr> zenspider: you like chinese?
<zenspider> but I also made a nice swimming rama with a impromptu peanut sauce
chouh____ has quit [Ping timeout: 264 seconds]
<zenspider> I don't like american chinese... but we have a couple pretty nice places here
<al2o3-cr> sounds nice?
<zenspider> this one place does their dry saute greenbeans soooo good. I can't replicate it and I think it's mostly a matter of having a million BTUs
chouhoulis has quit [Ping timeout: 264 seconds]
<al2o3-cr> zenspider: check this guy out; https://www.youtube.com/watch?v=ni65ra6ZRLE
<zenspider> I've gotten close once... but their consistency is absurd
<al2o3-cr> this guy is awesome.
<al2o3-cr> uk style chippy/chinese
chouhoul_ has quit [Ping timeout: 240 seconds]
<al2o3-cr> check all is other dishes out there'll be something you'll like :)
<zenspider> I really REALLY miss our hakka chinese restaurant. it was one of 2 or 3 in the US
chat_ has joined #ruby
<al2o3-cr> zenspider: do you get salt and pepper/chilli in us?
chat has quit [Ping timeout: 245 seconds]
<al2o3-cr> really tasty.
<al2o3-cr> khoan is based in hull uk. amazing.
<zenspider> I really should get a chinese cleaver
<al2o3-cr> zenspider: seriously invest in one.
<al2o3-cr> i think it's about 13kw whatever that is in btu's
<zenspider> I have a gas range... I just don't have a jet engine attached to it.
<al2o3-cr> haha i know right, that thing boils water in seconds ;)
<zenspider> serious thai and chinese places here do. I'll never replicate the level of blistering they can do to a green bean
<al2o3-cr> zenspider: you'll like this dish then; https://www.youtube.com/watch?v=JFLD2LeOcGk
karapetyan has joined #ruby
<zenspider> now I'm humbry
chat has joined #ruby
<eam> I have a 500k BTU torch that I bet would heat a wok nicely
<eam> can't use it indoors though
cyberg has quit [Quit: Leaving]
<eam> my best range burner is like 20k BTU
<al2o3-cr> eam: how btu's you reckon that's kicking out?
johnny56_ has quit [Ping timeout: 276 seconds]
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sytherax has joined #ruby
chat_ has quit [Ping timeout: 264 seconds]
<al2o3-cr> 45k btu wow
karapetyan has quit [Ping timeout: 260 seconds]
<al2o3-cr> and that torch of yours, where did you get it?
<al2o3-cr> so i bet you don't braze with that then lol ;)
<eam> when I turn it on full it sounds like a jet engine and it lifts my hair on end and creates a huge upward draft
<al2o3-cr> haha no shit lol
<eam> I used to use it to torch weeds in my side yard but now I use it to instantly start my charcoal bbq
yokel has quit [Ping timeout: 256 seconds]
<eam> ready to use coals in about 20s
<al2o3-cr> i need to get one
johnny56_ has joined #ruby
<eam> they're fantastic
<al2o3-cr> :( temporarily out of em
<eam> here's a dude using one for weed control https://www.youtube.com/watch?v=125L5E3N7wU#t=1m
<al2o3-cr> but that khoan vong is the best thing sliced bread, i'm addicted to watching his uploads.
<al2o3-cr> shit, that things insane
<al2o3-cr> to incinerate chlorophyl like that wow
yokel has joined #ruby
SeepingN has joined #ruby
<al2o3-cr> zenspider: i've tried a few of his recipies and there awesome; especially char siu pork, salt and pepper anything, szechuan chicken and black bean sauce dishes.
<al2o3-cr> and don't be scared of using msg.
QCF has quit [Ping timeout: 264 seconds]
workmad3 has joined #ruby
sytherax has quit [Remote host closed the connection]
sytherax has joined #ruby
sytherax has quit [Remote host closed the connection]
workmad3 has quit [Ping timeout: 240 seconds]
ramfjord has quit [Ping timeout: 240 seconds]
konsolebox has quit [Ping timeout: 256 seconds]
konsolebox has joined #ruby
nadir has joined #ruby
sytherax has joined #ruby
agent_white has quit [Quit: leaving]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orbyt_ has joined #ruby
sytherax has quit [Ping timeout: 268 seconds]
wontruefree has quit [Quit: bye]
sytherax has joined #ruby
knight33 has joined #ruby
sytherax has quit [Remote host closed the connection]
sytherax has joined #ruby
sytherax has quit [Remote host closed the connection]
knight33 has quit [Ping timeout: 240 seconds]
nicht has quit [Ping timeout: 245 seconds]
za1b1tsu has joined #ruby
za1b1tsu has quit [Ping timeout: 256 seconds]
kmurphy4 has quit [Quit: kmurphy4]
cschneid has quit [Remote host closed the connection]
sytherax has joined #ruby
sytherax has quit [Remote host closed the connection]
sytherax has joined #ruby
WAFFLEMAKER3000 has joined #ruby
cadillac_ has quit [Quit: I quit]
cadillac_ has joined #ruby
subroot has joined #ruby
WAFFLEMAKER3000 has quit [Ping timeout: 264 seconds]
braincrash has quit [Quit: bye bye]
braincrash has joined #ruby
ramfjord has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nicht has joined #ruby
Jonno_FTW has joined #ruby
<Jonno_FTW> hello, I get this error when I try to install gems: ERROR: While executing gem ... (Errno::EIO) Input/output error @ fptr_finalize - /home/CSEM/mack0242/.gem/ruby/2.3.0/cache/devise-two-factor-2.0.1.gem
<Radar> That's a new one
<Jonno_FTW> my home directory is on an nfs, could this be the problem?
<Radar> Possibly.
t0xik has joined #ruby
sytherax has quit [Remote host closed the connection]
sytherax has joined #ruby
sytherax has quit [Remote host closed the connection]
sytherax has joined #ruby
gravitation has joined #ruby
gravitation has quit [Client Quit]
karapetyan has joined #ruby
dviola has quit [Quit: WeeChat 2.1]
darkhanb has joined #ruby
karapetyan has quit [Ping timeout: 260 seconds]
DroidBurgundy has quit []
sytherax has quit [Remote host closed the connection]
cschneid has joined #ruby
za1b1tsu has joined #ruby
sytherax has joined #ruby
jamesaxl has quit [Quit: WeeChat 2.1]
subroot has quit [Read error: Connection reset by peer]
zapata has quit [Quit: WeeChat 2.1]
workmad3 has joined #ruby
regedit has quit [Quit: Connection closed for inactivity]
workmad3 has quit [Ping timeout: 260 seconds]
QCF has joined #ruby
sytherax has quit [Ping timeout: 264 seconds]
comrade_RMS is now known as coffeecupp__
tdy has quit [Ping timeout: 256 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nicht has quit [Ping timeout: 245 seconds]
tdy has joined #ruby
wontruefree has joined #ruby
wontruefree has quit [Client Quit]
cschneid has quit [Remote host closed the connection]
karapetyan has joined #ruby
shinnya has quit [Ping timeout: 264 seconds]
karapetyan has quit [Ping timeout: 256 seconds]
karuna has joined #ruby
drale2k_ has joined #ruby
sytherax has joined #ruby
elomatreb has joined #ruby
za1b1tsu has quit [Ping timeout: 264 seconds]
QCF has quit [Ping timeout: 265 seconds]
reber has joined #ruby
sytherax has quit [Ping timeout: 268 seconds]
twe4ked has quit [Ping timeout: 276 seconds]
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sinduck has joined #ruby
cadillac_ has quit [Ping timeout: 240 seconds]
cadillac_ has joined #ruby
Fraeon has quit [Ping timeout: 256 seconds]
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
twe4ked has joined #ruby
sytherax has joined #ruby
sauvin has joined #ruby
duderonomy has joined #ruby
nadir has quit [Quit: Connection closed for inactivity]
cadillac_ has quit [Ping timeout: 264 seconds]
lytol has quit [Remote host closed the connection]
cadillac_ has joined #ruby
za1b1tsu has joined #ruby
sytherax has quit [Remote host closed the connection]
sytherax has joined #ruby
troys has quit [Quit: Bye]
cadillac_ has quit [Read error: Connection reset by peer]
Guest9306 has quit [Quit: ZNC - http://znc.in]
tpendragon has quit [Quit: ZNC - http://znc.in]
anisha has joined #ruby
cadillac_ has joined #ruby
dionysus69 has joined #ruby
konsolebox has quit [Ping timeout: 268 seconds]
za1b1tsu has quit [Quit: WeeChat 2.1]
wget has quit [Ping timeout: 265 seconds]
wget has joined #ruby
giraffe has joined #ruby
giraffe is now known as Guest28040
cadillac_ has quit [Ping timeout: 276 seconds]
tpendragon has joined #ruby
cadillac_ has joined #ruby
KeyJoo has joined #ruby
workmad3 has joined #ruby
jcarl43 has joined #ruby
sytherax has quit [Remote host closed the connection]
workmad3 has quit [Ping timeout: 248 seconds]
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
mzo has quit [Ping timeout: 255 seconds]
chat_ has joined #ruby
cadillac_ has quit [Ping timeout: 264 seconds]
aupadhye has joined #ruby
konsolebox has joined #ruby
chat has quit [Ping timeout: 268 seconds]
ur5us has quit [Ping timeout: 276 seconds]
cadillac_ has joined #ruby
chat has joined #ruby
chat_ has quit [Ping timeout: 276 seconds]
cadillac_ has quit [Ping timeout: 260 seconds]
biberu has joined #ruby
nadir has joined #ruby
crimsontr has joined #ruby
crimsontr has quit [Client Quit]
workmad3 has joined #ruby
pwnd_nsfw` has joined #ruby
umesh has joined #ruby
pwnd_nsfw has quit [Ping timeout: 240 seconds]
<umesh> Hi
<umesh> Hello I need help on HTTPARTY
karapetyan has joined #ruby
<umesh> If you can share any link or KB on HTTPARTY, I have to call an API also pass authentication before we connect to end point
sytherax has joined #ruby
<dminuoso> umesh: HTTP is stateless. How does your service work with authentication?
Fraeon has joined #ruby
<umesh> I need to parse API,
<umesh> Which requires Authentication
<dminuoso> How does it authenticate users?
jcarl43 has quit [Quit: WeeChat 2.1]
karapetyan has quit [Ping timeout: 260 seconds]
<umesh> I don't know how authentication works on http
<dminuoso> umesh: HTTP comes with basic authentication, but the service may require some stateful authentication scheme.
<dminuoso> So Im asking *you* - what does your service require exactly?
sytherax has quit [Ping timeout: 255 seconds]
marius has quit [Quit: baj]
<umesh> we have appliance known as infoblox where in only authenticated user is able to modify DNS records
marius has joined #ruby
amar has joined #ruby
pskosinski has quit [Ping timeout: 245 seconds]
<umesh> Infoblox is DNS appliance which exposes API which we can consume, I want to use CHEF to modify DNS records, I thought HTTPARTY would be best to utilise
clemens3_ has joined #ruby
<umesh> I am new to programming, did I answered your question
clemens31 has joined #ruby
saTchymoto has joined #ruby
pskosinski has joined #ruby
ciscam has quit [Ping timeout: 264 seconds]
karuna has quit [Quit: Connection closed for inactivity]
ciscam has joined #ruby
sameerynho has joined #ruby
<dminuoso> umesh: No. Authentication is the process of determining ones identity.
<dminuoso> I do not know how your webservice does this. Is an extra request beforehand necessary? Do you authenticate with Basic authentication? Do you pass a JWT header along?
<dminuoso> The latter would rather be authorization, but lets not split hairs.
Nussi has joined #ruby
_aeris_ has quit [Remote host closed the connection]
_aeris_ has joined #ruby
<umesh> It's just basic authentication
sameerynho has quit [Ping timeout: 245 seconds]
karuna has joined #ruby
<dminuoso> umesh: What have you tried so far?
Asher has joined #ruby
nowhere_man has quit [Ping timeout: 256 seconds]
clemens31 has quit [Ping timeout: 264 seconds]
nowhere_man has joined #ruby
Asher has quit [Ping timeout: 240 seconds]
braindead_ has joined #ruby
Mia has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
DeepIO has joined #ruby
<ruby[bot]> umesh: we in #ruby do not like irccloud.com, it has no syntax highlighting, distracting formatting and loads slowly for most. Please use https://gist.github.com
clemens31 has joined #ruby
TomyWork has joined #ruby
<dminuoso> umesh: And what problem do you have?
<dminuoso> umesh: Oh you cant use spaces in between the colon and the symbol name
<dminuoso> You have to write it { :username => ..., :password => ... }
<dminuoso> Or use the modern shortcut: { username: ..., password: ... }
claudiuinberlin has joined #ruby
pabs has quit [Ping timeout: 248 seconds]
dionysus69 has quit [Ping timeout: 264 seconds]
pabs has joined #ruby
sytherax has joined #ruby
wald0 has quit [Ping timeout: 256 seconds]
j0bk has quit [Ping timeout: 240 seconds]
<umesh> Ok, thank you
sytherax has quit [Ping timeout: 276 seconds]
andikr has joined #ruby
<umesh> Actually I had missed require 'httparty'
<umesh> @dminuoso Thanks again for Ur help
j0bk has joined #ruby
j0bk has joined #ruby
j0bk has quit [Changing host]
iMadper has joined #ruby
ellcs has joined #ruby
za1b1tsu has joined #ruby
sytherax has joined #ruby
sysvalve has joined #ruby
ramfjord has quit [Ping timeout: 264 seconds]
sytherax has quit [Remote host closed the connection]
sytherax has joined #ruby
<umesh> I only have details of .get but how to use other verbs like post delete
DarkUnicorn_ has joined #ruby
DarkUnicorn_ is now known as DarkUnicorn
tvl has joined #ruby
tvl is now known as tobiasvl
iMadper` has joined #ruby
iMadper has quit [Ping timeout: 256 seconds]
Zaab1t has joined #ruby
iMadper`` has joined #ruby
iMadper` has quit [Ping timeout: 248 seconds]
schleppel has joined #ruby
dionysus69 has joined #ruby
sytherax has quit [Remote host closed the connection]
nowhere_man has quit [Read error: Connection reset by peer]
nowhere_man has joined #ruby
dionysus69 has quit [Ping timeout: 240 seconds]
Burgestrand has joined #ruby
jrafanie_ has joined #ruby
VladGh_ has joined #ruby
mtkd has joined #ruby
mikecmpbll has joined #ruby
VladGh has quit [Ping timeout: 240 seconds]
Es0teric has joined #ruby
jrafanie has quit [Ping timeout: 264 seconds]
ramfjord has joined #ruby
yohji has joined #ruby
jottr has joined #ruby
ramfjord has quit [Ping timeout: 256 seconds]
sytherax has joined #ruby
TinkerT has quit [Read error: Connection reset by peer]
sytherax has quit [Remote host closed the connection]
TinkerT has joined #ruby
sytherax has joined #ruby
ellcs has quit [Ping timeout: 260 seconds]
nowhere_man has quit [Read error: Connection reset by peer]
nowhereman_ has joined #ruby
dionysus69 has joined #ruby
cabotto has joined #ruby
sytherax has quit [Remote host closed the connection]
amar has quit [Remote host closed the connection]
sytherax has joined #ruby
jottr has quit [Ping timeout: 264 seconds]
Pisuke has joined #ruby
karapetyan has joined #ruby
MyMind has quit [Ping timeout: 268 seconds]
Es0teric has quit [Quit: Computer has gone to sleep.]
iMadper`` is now known as Madper
sytherax has quit [Remote host closed the connection]
sytherax has joined #ruby
sytherax has quit [Remote host closed the connection]
karapetyan has quit [Ping timeout: 260 seconds]
sytherax has joined #ruby
sytherax has quit [Remote host closed the connection]
sytherax has joined #ruby
amar_ has joined #ruby
crankharder has quit [Ping timeout: 264 seconds]
crankharder has joined #ruby
Beams has joined #ruby
sytherax has quit [Remote host closed the connection]
sytherax has joined #ruby
tvw has joined #ruby
sytherax has quit [Remote host closed the connection]
WAFFLEMAKER3000 has joined #ruby
andikr has quit [Ping timeout: 264 seconds]
dhollin3 has joined #ruby
WAFFLEMAKER3000 has quit [Ping timeout: 260 seconds]
dhollinger has quit [Ping timeout: 276 seconds]
sytherax has joined #ruby
andikr has joined #ruby
sytherax has quit [Remote host closed the connection]
sytherax has joined #ruby
mtkd has quit []
sytherax has quit [Remote host closed the connection]
mtkd has joined #ruby
Eiam has quit [Ping timeout: 276 seconds]
KeyJoo has quit [Ping timeout: 260 seconds]
ellcs has joined #ruby
voxxit has quit [Ping timeout: 240 seconds]
Burgestrand has quit [Quit: Closing time!]
voxxit has joined #ruby
arne_ has joined #ruby
<arne_> is there someway to reenter a "case" ?
<arne_> like..
<dminuoso> arne_: Hey. Did you catch my previous messages by the way? =P
<arne_> dminuoso: i guess not i had to reboot :(
<arne_> sorry for being impolite
<dminuoso> No worries.
<dminuoso> arne_: So I have determined the stm implementation of Ruby to be beneath consideration.
<dminuoso> well. of concurrent-ruby
<arne_> that means?
<dminuoso> arne_: You'll be happier with a SizedQueue or manual conditional variabling yourself.
<arne_> :> i already used that one
<arne_> it's great, didn't know about that
<dminuoso> arne_: I keep forgetting that languages other than Haskell dont have an STM implementation worth considering.
<arne_> is there some neat trick to end up in multiple "when" in a case?
<dminuoso> Well clojure perhaps *shrugs*
<arne_> well, other languages lack the abstraction and you will end up with so much code managing that
<dminuoso> arne_: there's no fallthrough
<dminuoso> (which I think is a good thing))
<arne_> so it's not worth considering it in other languages
<arne_> well i have something like
<dminuoso> arne_: well you can implement stm in other languages - but it requires a lot of effort.
<dminuoso> it's more than just writing 100 lines of code and having a fully sleek and powerful transaction manager
<arne_> case a; when x; if b; c;end;else c;end; when y; c;
<arne_> and c is pretty long.
<arne_> that code doesnt make sense
<dminuoso> arne_: Sometimes it can be helpful to flip the logic around.
<arne_> dminuoso: you can implement everything in everything.. thats what turing-completeness describes..
<dminuoso> That is, dont successively try to filter out the cases you dont want, but specify conditions for the cases you do want
<arne_> all languages lacking abstraction counter their lack of it by using patterns
thinkpad has quit [Quit: lawl]
<dminuoso> arne_: STM basically requires a) a good type system to avoid you shooting yourself in the foot, b) good RTS support if you want it efficiently done.
<arne_> but it's ugly af, so you should not do it, unless you have a really good reason to
<dminuoso> Ruby has neither. :(
tdy has quit [Read error: Connection reset by peer]
tdy has joined #ruby
steerio has left #ruby [#ruby]
RougeR has joined #ruby
RougeR has joined #ruby
RougeR has quit [Changing host]
andikr has quit [Read error: Connection reset by peer]
crptck has joined #ruby
thinkpad has joined #ruby
ramfjord has joined #ruby
Asher has joined #ruby
<arne_> good rts support, ruby barely has threads
<arne_> :D
sytherax has joined #ruby
<arne_> dminuoso: someone linked a paper a few days ago
<arne_> how hardware transactional memory could kill GIL
<arne_> mean i'd love that
<arne_> man*
ramfjord has quit [Ping timeout: 255 seconds]
Asher has quit [Ping timeout: 255 seconds]
sytherax has quit [Ping timeout: 265 seconds]
micutzu has quit [Ping timeout: 248 seconds]
sytherax has joined #ruby
micutzu has joined #ruby
lbracher has quit [Ping timeout: 264 seconds]
hfp_work has quit [Quit: bye]
sytherax has quit [Remote host closed the connection]
\void has quit [Quit: So long, and thanks for all the fish.]
AJA4350 has joined #ruby
hfp_work has joined #ruby
jrafanie_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jrafanie has joined #ruby
lbracher has joined #ruby
jrafanie has quit [Client Quit]
Madper has quit [Remote host closed the connection]
sylario has joined #ruby
karapetyan has joined #ruby
jrafanie has joined #ruby
amar_ has quit [Remote host closed the connection]
karapetyan has quit [Ping timeout: 260 seconds]
cabotto has quit [Remote host closed the connection]
cabotto has joined #ruby
dionysus69 has quit [Remote host closed the connection]
dionysus69 has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
andikr has joined #ruby
aufi has joined #ruby
cabotto has quit [Remote host closed the connection]
ciscam has quit [Ping timeout: 268 seconds]
ciscam has joined #ruby
donofrio has joined #ruby
ramfjord has joined #ruby
dionysus69 has quit [Remote host closed the connection]
aupadhye has quit [Ping timeout: 240 seconds]
dionysus69 has joined #ruby
DarkUnicorn has quit [Quit: Connection closed for inactivity]
ramfjord has quit [Ping timeout: 265 seconds]
aupadhye has joined #ruby
Burgestrand has joined #ruby
cabotto has joined #ruby
micutzu has quit [Ping timeout: 255 seconds]
aupadhye has quit [Ping timeout: 265 seconds]
nadir has quit [Quit: Connection closed for inactivity]
fmcgeough has joined #ruby
karapetyan has joined #ruby
ldnunes has joined #ruby
amar_ has joined #ruby
jidar has quit [Ping timeout: 240 seconds]
claudiuinberlin has joined #ruby
aupadhye has joined #ruby
karuna has quit [Quit: Connection closed for inactivity]
conta has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kapil___ has joined #ruby
apparition has joined #ruby
venmx has joined #ruby
sytherax has joined #ruby
KeyJoo has joined #ruby
sytherax has quit [Ping timeout: 248 seconds]
vondruch_ has joined #ruby
fffco has joined #ruby
KeyJoo has quit [Remote host closed the connection]
venmx has quit [Ping timeout: 260 seconds]
vondruch has quit [Ping timeout: 248 seconds]
vondruch_ is now known as vondruch
KeyJoo has joined #ruby
KeyJoo has quit [Max SendQ exceeded]
KeyJoo has joined #ruby
micutzu has joined #ruby
sytherax has joined #ruby
aupadhye has quit [Ping timeout: 245 seconds]
sytherax has quit [Remote host closed the connection]
andikr has quit [Remote host closed the connection]
aupadhye has joined #ruby
mtkd has quit []
cabotto has quit [Remote host closed the connection]
belsaur has joined #ruby
<belsaur> hi, I got a question. New to Ruby.
aufi has quit [Ping timeout: 264 seconds]
<belsaur> Am trying to map over an array
sytherax has joined #ruby
<belsaur> To remove one field
<belsaur> Is there a handy function?
<apeiros> &ri Array#map
<belsaur> Like, if an array of hashes are there
<apeiros> aaand I keep forgetting that this bot is still offline :(
<belsaur> And from every hash, I want to remove one field
<belsaur> If I do vanilla map
<belsaur> I
<belsaur> I've to manually include all 30 fields
jcalla has joined #ruby
<apeiros> though, depends if you want a new array with new hashes
<belsaur> I just want to keep 29 fields, and remove 1 field
<apeiros> or the old array with the old hashes mutated
<belsaur> I want a new array with new hashes
<belsaur> No, I don't want to mutate old hashes
gizmore has joined #ruby
<apeiros> ok. I don't think you have to manually include the 29 fields you want.
<apeiros> dup the hashes and .delete the field you don't want.
<belsaur> hmm, makes sense
<belsaur> thanks apeiros
sytherax has quit [Ping timeout: 256 seconds]
belsaur has quit [Quit: Page closed]
conta has quit [Quit: conta]
Biappi has joined #ruby
bruno- has joined #ruby
Burgestrand has quit [Quit: Closing time!]
Burgestrand has joined #ruby
cyberg has joined #ruby
venmx has joined #ruby
karapetyan has quit [Remote host closed the connection]
aufi has joined #ruby
amar_ has quit [Ping timeout: 240 seconds]
subroot has joined #ruby
nielsk has quit [Quit: So Long, and Thanks for All the Fish]
mtkd has joined #ruby
nielsk has joined #ruby
nowhereman_ has quit [Ping timeout: 260 seconds]
cabotto has joined #ruby
FernandoBasso has joined #ruby
nowhereman_ has joined #ruby
jidar has joined #ruby
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
karapetyan has joined #ruby
nowhereman_ has quit [Read error: Connection reset by peer]
KeyJoo has quit [Read error: Connection reset by peer]
Asher has joined #ruby
nowhereman_ has joined #ruby
karapetyan has quit [Ping timeout: 240 seconds]
Asher has quit [Ping timeout: 240 seconds]
ramfjord has joined #ruby
cadillac_ has joined #ruby
Tempesta has quit [Remote host closed the connection]
fffco has quit [Ping timeout: 245 seconds]
ramfjord has quit [Ping timeout: 256 seconds]
cadillac_ has quit [Read error: Connection reset by peer]
alex`` has joined #ruby
nowhereman_ has quit [Remote host closed the connection]
cadillac_ has joined #ruby
sytherax has joined #ruby
gheegh has joined #ruby
bmurt has joined #ruby
sytherax has quit [Remote host closed the connection]
reber has quit [Remote host closed the connection]
DroidBurgundy has joined #ruby
DroidBurgundy has quit [Remote host closed the connection]
DroidBurgundy has joined #ruby
DroidBurgundy has quit [Remote host closed the connection]
<gheegh> Hey all.. so I have this problem.. i'm using an intermediate proxy to retrieve some documents. Sometimes, the intermediate response will be passed as a GZip encoded body.. but i can't for the life of me seem to decode it.. Gzip gives a "not a gzip format" error..
nowhereman_ has joined #ruby
m1st3rwr0ng has joined #ruby
Asher has joined #ruby
sytherax has joined #ruby
orbyt_ has joined #ruby
nowhereman_ has quit [Remote host closed the connection]
nowhereman_ has joined #ruby
m1st3rwr0ng has quit [Quit: Textual IRC Client: www.textualapp.com]
DeepIO has quit [Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/]
anisha has quit [Quit: This computer has gone to sleep]
orbyt_ has quit [Ping timeout: 240 seconds]
sytherax has quit [Remote host closed the connection]
sytherax has joined #ruby
cadillac_ has quit [Ping timeout: 260 seconds]
nowhereman_ has quit [Ping timeout: 245 seconds]
Kensei has quit [Ping timeout: 260 seconds]
p0p0pr37 has quit [Remote host closed the connection]
nowhereman_ has joined #ruby
cadillac_ has joined #ruby
sytherax has quit [Remote host closed the connection]
nowhereman_ has quit [Read error: Connection reset by peer]
cadillac_ has quit [Ping timeout: 264 seconds]
cadillac_ has joined #ruby
sytherax has joined #ruby
p0p0pr37 has joined #ruby
nowhereman_ has joined #ruby
amar_ has joined #ruby
karapetyan has joined #ruby
karapetyan has quit [Remote host closed the connection]
sytherax has quit [Remote host closed the connection]
sytherax has joined #ruby
cadillac_ has quit [Read error: Connection reset by peer]
cadillac_ has joined #ruby
sytherax has quit [Remote host closed the connection]
vondruch_ has joined #ruby
vondruch has quit [Ping timeout: 240 seconds]
vondruch_ is now known as vondruch
reber has joined #ruby
jamesaxl has joined #ruby
aupadhye has quit [Remote host closed the connection]
cadillac_ has quit [Ping timeout: 256 seconds]
desperek has joined #ruby
<dminuoso> gheegh: what does `file` tell you it is?
<dminuoso> gheegh: Also check out the file with a text editor, as well as a hex editor.
<gheegh> let me figure out how to tell you the answer..
sytherax has joined #ruby
<havenwood> gheegh: file FILENAME
dionysus69 has quit [Ping timeout: 260 seconds]
<havenwood> gheegh: xxd FILENAME
<gheegh> it's s tring in my retrieval response.. not a file
<gheegh> it's a string in my retrieval response.. not a file
thebetrayer has joined #ruby
amar_ has quit [Remote host closed the connection]
<havenwood> gheegh: echo string | xargs file
<havenwood> gheegh: echo string | xxd
<dminuoso> havenwood: say what? :p
amar_ has joined #ruby
<havenwood> dminuoso: coffeetime!
<havenwood> ew, file doesn't handle piping very nicely
<havenwood> i guess its name shows its bias
<dminuoso> havenwood: also the authors have little humor
<dminuoso> file `which file`
<dminuoso> I somehow expected some joke about recursion.
jrafanie has joined #ruby
dhollin3 is now known as dhollinger
amar_ has quit [Ping timeout: 265 seconds]
venmx has quit [Ping timeout: 256 seconds]
pastorinni has joined #ruby
sytherax has quit [Remote host closed the connection]
sytherax has joined #ruby
icy` has joined #ruby
WAFFLEMAKER3000 has joined #ruby
t0xik has quit [Quit: Connection closed for inactivity]
<swein> Anyone have nokojiri experience?
<havenwood> swein: Many do, yerp.
* dminuoso usually puts some cinnamon in his nokogiri
<dminuoso> And a strawberry.
<swein> I've been reading tuts and postings but I still can't seem to scrape a div class block. anyone care to help for a second?
<swein> I am scraping off: https://www.nasdaq.com/symbol/ps , I want a div and it's contents that start at the key stock data (class="row overview-results relativeP")
saTchymoto has quit []
sytherax has quit [Remote host closed the connection]
za1b1tsu has quit [Ping timeout: 268 seconds]
<swein> reading html in with nokogiri I keep getting empty results with items = doc.css('div.row overview-results relativeP')
<havenwood> !unban chouhoulis
chouhoulis has joined #ruby
mtkd has quit []
vondruch has quit [Quit: vondruch]
apparition has quit [Quit: Bye]
vondruch has joined #ruby
mtkd has joined #ruby
amar_ has joined #ruby
BlopMonster has joined #ruby
Burgestrand has quit [Quit: Closing time!]
chouhoul_ has joined #ruby
sphenxes has joined #ruby
chouhoulis has quit [Ping timeout: 276 seconds]
karapetyan has joined #ruby
amar_ has quit [Remote host closed the connection]
kmurphy4 has joined #ruby
kmurphy4 has quit [Max SendQ exceeded]
DeepIO has joined #ruby
DeepIO has quit [Max SendQ exceeded]
karapetyan has quit [Ping timeout: 245 seconds]
kmurphy4 has joined #ruby
dendazen has joined #ruby
amar_ has joined #ruby
biberu has quit []
ldnunes has quit [Quit: Leaving]
BlopMonster has quit [Ping timeout: 240 seconds]
<jrich523> so i now need to correct my script for the version it has to run on.. and dig isnt an option.. what was the method prior to dig to do that safely?
chouhoul_ has quit [Remote host closed the connection]
<gheegh> fetch(x, nil)
<jrich523> awesome, thanks!
<gheegh> or just [] and it will return a nil if there isn't a key
chouhoulis has joined #ruby
<jrich523> oh i could have sworn that caused an error.. hmm guess i'll double check that
<gheegh> well, if you do [] for example on a nil, it will
<gheegh> variable.try(:[], x) is also an option
Biappi has left #ruby [#ruby]
<jrich523> i think try is what i had come across previously
<jrich523> n.dig('facts', 'kvm', 'pool', 'default', 'allocation'),
<jrich523> pretty sure because it was so deep try would be a pain (probably the same with fetch?)
za1b1tsu has joined #ruby
ramfjord has joined #ruby
rippa has joined #ruby
<jrich523> lol yeah... found the feature request for dig :)
<gheegh> you can also & the front of it.. variable&.dig('x')
<gheegh> i think that works with nil
<jrich523> yeah but the & is 2.3 i think, im 2.0 :(
garyserj has quit [Ping timeout: 248 seconds]
<jrich523> i wrote it locally, and now im fixing for the version (ooppps)
za1b1tsu has quit [Ping timeout: 256 seconds]
SeepingN has joined #ruby
ramfjord has quit [Ping timeout: 264 seconds]
cschneid has joined #ruby
garyserj has joined #ruby
<jrich523> you are right tho, if its not a valid path, no error
za1b1tsu has joined #ruby
clemens31 has quit [Ping timeout: 240 seconds]
<jrich523> which i guess is ok, a nil in a field shouldnt screw anything
grilix_ has joined #ruby
<swein> figured out my nokogiri issue doc.css('div.text here needs periods between words not spaces')
sytherax has joined #ruby
bga57 has quit [Quit: Leaving.]
sytherax has quit [Ping timeout: 240 seconds]
Asher has quit [Quit: Leaving.]
bga57 has joined #ruby
BlopMonster has joined #ruby
tty has quit [Quit: tty]
sytherax has joined #ruby
<havenwood> jrich523: Use the backport_dig gem to get #dig in 2.0: https://github.com/koic/backport_dig
sytherax has quit [Remote host closed the connection]
Azure has quit [Ping timeout: 256 seconds]
karapetyan has joined #ruby
shinnya has joined #ruby
<jrich523> oh cool, thanks havenwood
jcarl43 has joined #ruby
RougeR has quit [Ping timeout: 240 seconds]
chmurifree has quit [Ping timeout: 256 seconds]
delsol has joined #ruby
BlopMonster has quit [Ping timeout: 264 seconds]
ramfjord has joined #ruby
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sytherax has joined #ruby
yokel has quit [Ping timeout: 256 seconds]
yokel has joined #ruby
ramfjord has quit [Ping timeout: 256 seconds]
cagomez has joined #ruby
ramfjord has joined #ruby
sytherax has quit [Remote host closed the connection]
amar_ has quit [Remote host closed the connection]
ramfjord has quit [Ping timeout: 256 seconds]
Kundun has quit [Quit: leaving]
sysvalve has quit [Quit: Leaving]
clemens31 has joined #ruby
AJA4350 has quit [Quit: AJA4350]
<jrich523> is there a template for a bin/cmd rename? as in, a stub for the old name that says use the new name and fwds on to the new cmd?
sytherax has joined #ruby
chmurifree has joined #ruby
ellcs has quit [Remote host closed the connection]
wontruefree has joined #ruby
mzo has joined #ruby
kt has quit [Ping timeout: 264 seconds]
wontruefree has quit [Client Quit]
shinnya has quit [Ping timeout: 264 seconds]
wontruefree has joined #ruby
sytherax has quit [Remote host closed the connection]
cabotto has quit []
dar123 has joined #ruby
Immune has joined #ruby
Immune has left #ruby [#ruby]
<dar123> anyone knows how to write '@obj.method?.should == true' in rspec3 expect statement
darkhanb has joined #ruby
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
<baweaver> dar123: what have you tried?
<baweaver> Where have you looked?
<dar123> 'expect(@obj.method?).to == true'
sanscoeur has joined #ruby
<baweaver> Close. Are you sure it's `== true`?
<dar123> nope i am not sure about that
<dar123> maybe its just 'eq'
<baweaver> Yep.
clemens31 has quit [Ping timeout: 248 seconds]
<baweaver> expect(something).to eq(something_else)
<dar123> eq(true)
<dar123> that works
<dar123> thanks
za1b1tsu has quit [Quit: WeeChat 2.1]
lytol has joined #ruby
nowhereman_ has quit [Remote host closed the connection]
nowhereman_ has joined #ruby
cthulchu has quit [Read error: Connection reset by peer]
cthulchu has joined #ruby
Mike11 has joined #ruby
Beams has quit [Quit: .]
biberu has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
amar_ has joined #ruby
ramfjord has joined #ruby
nowhereman_ has quit [Ping timeout: 265 seconds]
yohji has quit [Remote host closed the connection]
SeepingN has quit [Ping timeout: 260 seconds]
ramfjord has quit [Client Quit]
[Butch] has joined #ruby
DTZUZO has quit [Ping timeout: 255 seconds]
amar_ has quit [Ping timeout: 260 seconds]
nowhereman_ has joined #ruby
kapil___ has quit [Quit: Connection closed for inactivity]
nowhereman_ has quit [Ping timeout: 265 seconds]
tvw has quit [Remote host closed the connection]
BlopMonster has joined #ruby
za1b1tsu has joined #ruby
nowhereman_ has joined #ruby
BlopMonster has quit [Ping timeout: 256 seconds]
d^sh has quit [Ping timeout: 265 seconds]
d^sh has joined #ruby
nowhereman_ has quit [Ping timeout: 260 seconds]
nowhereman_ has joined #ruby
Azure has joined #ruby
jottr has joined #ruby
nowhereman_ has quit [Ping timeout: 260 seconds]
dionysus69 has joined #ruby
drale2k_ has joined #ruby
nowhereman_ has joined #ruby
RougeR has joined #ruby
mzo has quit [Ping timeout: 260 seconds]
karapetyan has quit [Remote host closed the connection]
delsol has quit []
pankaj has joined #ruby
<pankaj> Is their any good book on ruby. I have searched a lot but they are start with basic and also they are not well structured. I want to learn more ruby in depth but most of the books do not focus in its depth like what are other different classes how to build them and modules etc and such deep concepts.
hahuang65_ has joined #ruby
<dminuoso> pankaj: Eloquent Ruby
<pankaj> dminuoso: OK
hahuang65 has quit [Ping timeout: 256 seconds]
<pankaj> dminuoso: It happened to me that time also when I learned java. I was going throught but in every book I find that it tells you to basic and do not deal with it fully. But when I saw a boot which was for SCJP certification then it was what I wanted. I told each and every aspect of java and in depth.
<pankaj> dminuoso: /s/boot/book
eckhardt has joined #ruby
eckhardt has quit [Client Quit]
<pankaj> dminuoso: And also deal with libraries and other stuff internally going on with language. That is what i want with ruby also.
eckhardt has joined #ruby
<pankaj> dminuoso: Will eloquent ruby be sufficient?
<jrich523> oh cool, thanks havenwoodim reading it now, so far so good :)
<jrich523> a tad wordy, but good
<jrich523> weird lol
<jrich523> the start of that msg was from before, and not shown on my console...
<dminuoso> pankaj: There are few good books. Eloquent Ruby is the best for "how to get things done" for more advanced readers.
<dminuoso> Ruby under a microscope covers a bit how ruby works internally, but it's old and will become gradually less accurate.
TomyWork has quit [Ping timeout: 240 seconds]
BH23 has quit [Remote host closed the connection]
bruno- has quit [Quit: leaving]
SeepingN has joined #ruby
BH23 has joined #ruby
<pankaj> dminuoso: OK.
<pankaj> dminuoso: But I did not understood what point you made in the last statement.
zachk has joined #ruby
zachk has quit [Changing host]
zachk has joined #ruby
orbyt_ has joined #ruby
dar123 has quit [Quit: Textual IRC Client: www.textualapp.com]
wrkrcoop has joined #ruby
jottr has quit [Ping timeout: 248 seconds]
<wrkrcoop> hello. i haven’t used ruby in a while, i’m trying to do something with node but it’s not working, it seems to work with ruby so i figured i’d just use sinatra
<wrkrcoop> i only need like one route does anyone have a sinatra skeleton that i can use?
DTZUZO has joined #ruby
<apeiros> wrkrcoop: just read sinatra's readme?
BlopMonster has joined #ruby
<dminuoso> pankaj: Its not exactly up to date anymore, and with every passing year Ruby core drifts away from the details covered in the book.
wrkrcoop has quit [Ping timeout: 265 seconds]
workmad3 has quit [Ping timeout: 240 seconds]
BlopMonster has quit [Ping timeout: 264 seconds]
sytherax has joined #ruby
ellcs has joined #ruby
<pankaj> dminuoso: So, what is the best advice to keep upto date in ruby?
<Zarthus> what do you want to stay up to date about?
sytherax has quit [Ping timeout: 260 seconds]
nowhereman_ has quit [Ping timeout: 256 seconds]
<eam> hang out in this irc channel, obviously
nowhereman_ has joined #ruby
thadtheman has joined #ruby
<thadtheman> In pry how can I list lines of code?
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
karapetyan has joined #ruby
sauvin has quit [Remote host closed the connection]
<akaiiro> pankaj when you get done with «Eloquent Ruby», try «Practical Object-Oriented Design in Ruby» http://www.poodr.com/
drale2k_ has joined #ruby
lbracher has quit [Ping timeout: 245 seconds]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
<pankaj> akaiiro: OK. I will keep track of it so that when finished with first one I will definitely check out the second one. Thanks for that.
dionysus69 has quit [Ping timeout: 256 seconds]
karapetyan has quit [Ping timeout: 256 seconds]
desnudopenguino has joined #ruby
<desnudopenguino> anyone have any experience working with ruby-build on openbsd?
ellcs has quit [Ping timeout: 265 seconds]
pastorinni has quit [Remote host closed the connection]
pastorinni has joined #ruby
SeepingN has quit [Disconnected by services]
SeepingN_ has joined #ruby
mtkd has quit []
agent_white has joined #ruby
pastorinni has quit [Ping timeout: 264 seconds]
mtkd has joined #ruby
conta1 has joined #ruby
Asher has joined #ruby
nowhereman_ has quit [Remote host closed the connection]
nowhereman_ has joined #ruby
drale2k_ has quit [Read error: Connection reset by peer]
za1b1tsu has quit [Ping timeout: 240 seconds]
za1b1tsu has joined #ruby
mikecmpbll has joined #ruby
Zaab1t has quit [Quit: Zaab1t]
apeiros has quit [Read error: Connection reset by peer]
apeiros has joined #ruby
cagomez has quit [Remote host closed the connection]
mikecmpbll has quit [Quit: inabit. zz.]
cagomez has joined #ruby
mikecmpbll has joined #ruby
cagomez has quit [Ping timeout: 245 seconds]
karapetyan has joined #ruby
nowhereman_ has quit [Ping timeout: 256 seconds]
cschneid has quit [Read error: Connection reset by peer]
karapetyan has quit [Remote host closed the connection]
biberu has quit []
karapetyan has joined #ruby
pankaj has quit [Ping timeout: 260 seconds]
Azure has quit [Ping timeout: 260 seconds]
akkad has joined #ruby
cagomez has joined #ruby
Azure has joined #ruby
tdy has quit [Ping timeout: 268 seconds]
cagomez has quit [Ping timeout: 240 seconds]
icarus_ has joined #ruby
tdy has joined #ruby
icarus has quit [Disconnected by services]
icarus_ is now known as icarus
kmurphy4 has quit [Quit: Leaving]
nowhereman_ has joined #ruby
megamos has joined #ruby
cagomez has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
dbugger_ has joined #ruby
\void has joined #ruby
cagomez has quit [Ping timeout: 248 seconds]
redlegion has quit [Read error: Connection reset by peer]
_aeris_ has quit [Read error: Connection reset by peer]
jnollette has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
skryking has joined #ruby
Azure has quit [Ping timeout: 245 seconds]
Mike11 has quit [Quit: Leaving.]
Asher has quit [Quit: Leaving.]
Azure has joined #ruby
_aeris_ has joined #ruby
karapetyan has quit [Remote host closed the connection]
Asher has joined #ruby
karapetyan has joined #ruby
redlegion has joined #ruby
redlegion has quit [Remote host closed the connection]
redlegion has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
jnollette has joined #ruby
FernandoBasso has quit [Quit: Leaving]
dviola has joined #ruby
mmattice has joined #ruby
SeepingN_ is now known as SeepingN
amatas has joined #ruby
<mmattice> Is it reasonable to load a kitchen config yaml and then override something in the transport setup?
dreamthese has quit [Read error: Connection reset by peer]
karapetyan has quit [Remote host closed the connection]
za1b1tsu has quit [Ping timeout: 260 seconds]
DarkUnicorn has joined #ruby
dreamthese has joined #ruby
jenrzzz_ has joined #ruby
wontruefree has quit [Quit: bye]
jenrzzz has quit [Ping timeout: 248 seconds]
workmad3 has joined #ruby
grilix_ has quit [Quit: Ooops]
za1b1tsu has joined #ruby
cagomez has joined #ruby
conta1 has quit [Quit: conta1]
braindead_ has quit [Quit: Page closed]
fffco has joined #ruby
c0ncealed2 has quit [Remote host closed the connection]
Azure has quit [Ping timeout: 248 seconds]
c0ncealed2 has joined #ruby
workmad3 has quit [Ping timeout: 260 seconds]
KeyJoo has joined #ruby
KeyJoo has quit [Max SendQ exceeded]
karapetyan has joined #ruby
wontruefree has joined #ruby
amatas has quit [Remote host closed the connection]
amatas has joined #ruby
zlogan2003 has joined #ruby
nima_m has joined #ruby
amatas has quit [Quit: amatas]
kapil___ has joined #ruby
<baweaver> I can officially announce it now: https://southeastruby.com/
<baweaver> Speaking at Southeast Ruby in August on "Reducing Enumerable - An Illustrated Adventure". It's based loosely on this post series: https://medium.com/@baweaver/reducing-enumerable-the-basics-fa042ce6806
dendazen has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<SeepingN> congrats
icarus has quit [Quit: Lost terminal]
ogres has joined #ruby
<Zarthus> baweaver: When: August 2-3 2018 -- boo :P
<Zarthus> I don't even know how to interpret that date.
<Zarthus> ah, it's two days
* Zarthus 's feeble european mind is not used to seeing the month notation first.
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
regedit has joined #ruby
<baweaver> They'll be recording so I'll likely post the video afterwards.
<baweaver> Just expect lots of lemurs and illustrations, as is my way.
<Zarthus> yeah, I don't think I can convince my company to ship me over to NA.
KeyJoo has joined #ruby
KeyJoo has quit [Max SendQ exceeded]
KeyJoo has joined #ruby
bmurt has joined #ruby
<baweaver> Going to gun hard to speak at RubyConf, but that's always hard to get into. Maybe pattern matching will do the trick this year.
wontruefree has quit [Quit: bye]
KeyJoo has quit [Remote host closed the connection]
fffco has quit [Ping timeout: 276 seconds]
KeyJoo has joined #ruby
workmad3 has joined #ruby
KeyJoo has quit [Max SendQ exceeded]
chat_ has joined #ruby
KeyJoo has joined #ruby
chat has quit [Ping timeout: 240 seconds]
aufi has quit [Quit: Leaving]
pastorinni has joined #ruby
karapetyan has quit [Remote host closed the connection]
sphenxes has quit [Read error: Connection reset by peer]
gheegh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sanscoeu_ has joined #ruby
eckhardt has joined #ruby
eckhardt has quit [Client Quit]
sanscoeur has quit [Ping timeout: 240 seconds]
t0xik has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
KeyJoo has quit [Remote host closed the connection]
pastorinni has quit []
[Butch] has quit [Quit: Textual IRC Client: www.textualapp.com]
KeyJoo has joined #ruby
KeyJoo has quit [Max SendQ exceeded]
KeyJoo has joined #ruby
kmurphy4 has joined #ruby
ur5us has joined #ruby
dbugger_ has quit [Ping timeout: 260 seconds]
ur5us has quit [Client Quit]
sanscoeu_ has quit [Remote host closed the connection]
sanscoeur has joined #ruby
tvw has joined #ruby
ellcs has joined #ruby
AJA4350 has joined #ruby
BlopMonster has joined #ruby
mtkd has quit [Remote host closed the connection]
BlopMonster has quit [Ping timeout: 248 seconds]
mtkd has joined #ruby
KeyJoo has quit [Remote host closed the connection]
KeyJoo has joined #ruby
KeyJoo has quit [Max SendQ exceeded]
KeyJoo has joined #ruby
theRoUS has quit [Ping timeout: 260 seconds]
jottr has joined #ruby
gheegh has joined #ruby
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
phenom has quit [Ping timeout: 265 seconds]
megamos has quit [Ping timeout: 245 seconds]
WAFFLEMAKER3000 has quit [Ping timeout: 265 seconds]
karapetyan has joined #ruby
wontruefree has joined #ruby
zapata has joined #ruby
karapetyan has quit [Ping timeout: 240 seconds]
amar has joined #ruby
Azure has joined #ruby
cadillac_ has joined #ruby
gheegh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gheegh has joined #ruby
gheegh has quit [Client Quit]
Eiam has joined #ruby
dendazen has joined #ruby
za1b1tsu has quit [Quit: WeeChat 2.1]
pankaj has joined #ruby
nowhereman_ has quit [Ping timeout: 256 seconds]
DarkUnicorn has quit [Quit: Connection closed for inactivity]
zapata has quit [Ping timeout: 256 seconds]
reber has quit [Remote host closed the connection]
dendazen has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
weaksauce has joined #ruby
gheegh has joined #ruby
Guest40516 has quit [Read error: Connection reset by peer]
mtkd has quit [Read error: Connection reset by peer]
Nicmavr has joined #ruby
icarus has joined #ruby
Nicmavr is now known as Guest26473
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mtkd has joined #ruby
sameerynho has joined #ruby
mtkd has quit [Client Quit]
Azure has quit [Ping timeout: 276 seconds]
amar has quit [Remote host closed the connection]
Azure has joined #ruby
schleppel has quit [Quit: Konversation terminated!]
nima_m has quit [Quit: Connection closed for inactivity]
BlopMonster has joined #ruby
gheegh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
BlopMonster has quit [Ping timeout: 240 seconds]
Siarkowy has quit [Ping timeout: 248 seconds]
pskosinski has quit [Ping timeout: 245 seconds]
karapetyan has joined #ruby
gray_-_wolf has quit [Read error: Connection reset by peer]
_insomniac has joined #ruby
zachk has quit [Quit: Leaving]
nowhereman_ has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
karapetyan has quit [Ping timeout: 240 seconds]
Siarkowy has joined #ruby
pskosinski has joined #ruby
sanscoeur has quit [Ping timeout: 248 seconds]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tvw has quit [Remote host closed the connection]
ciscam has quit [Ping timeout: 256 seconds]
ciscam has joined #ruby
Lyubo1 has quit [Ping timeout: 256 seconds]
Lyubo1 has joined #ruby
desperek has quit [Quit: xoxo]
thinkpad has quit [Quit: lawl]
<cthulchu> conjunction in ruby?
<cthulchu> omg is it double &
<Radar> maybe
kapil___ has quit [Quit: Connection closed for inactivity]
<Radar> cthulchu: example input + output please
<Radar> or did I mean input && output?
<cthulchu> looks like ruby doesn't know what & is
<Radar> [09:26:44] <Radar>cthulchu: example input + output please
<Radar> I won't ask nicely again.
<cthulchu> or maybe it does something else with it
<cthulchu> I should read a bit
<Radar> cthulchu: Do you want help or no?
<cthulchu> nah, it's ok
<Radar> kl
<cthulchu> I just expected single & to work as a conjunction
<apeiros> Radar: I think you meant input and output, even if that's not having precedence :D
<cthulchu> apparently, ruby has an interesting usage for it
<cthulchu> never seen it before
<cthulchu> do you guys use & to pass a... a functional block into an arbitrary method to be executed?
<Radar> cthulchu: If you want to have a meaningful discussion about it then we're going to need to see some code.
<apeiros> cthulchu: na, I use & when I want an intersection
<Radar> Or in map(&:method)
<cthulchu> oh wow
<apeiros> sometimes though I use it if I want to store a block
<cthulchu> okay, that's interesting. If the ampersand has multiple usage, then why not keep it in the logical operations
<Radar> cthulchu: Are you intentionally being obtuse or is it just because it is early morning hered>?
<Radar> here*
<cthulchu> for something like this to work: if type == "1" & test == "2" & step == "3"
jottr has quit [Ping timeout: 256 seconds]
<apeiros> & in that context is a method
<cthulchu> yeah
<cthulchu> I thought so
<cthulchu> okay then
<cthulchu> I'll just use double ampersands
<apeiros> so you'll have to first figure out predence
<apeiros> then determine lhs' class
<cthulchu> but generally single ampersand has its functionality
<apeiros> and then you'll know what & does there.
<apeiros> "its"?
<cthulchu> well I mean, in C syntax
<apeiros> generally & is a sigil with at least 3 meanings.
<apeiros> we're in #ruby, not sure how C syntax matters.
<cthulchu> not in logical operations
<cthulchu> probably it doesn't
<cthulchu> then the usage of double ampersands is confusing
<apeiros> & being a method means it can do *anything*
<cthulchu> ok, ok
<cthulchu> I actually got an answer, thanks :)
<apeiros> && is syntax and always logical and
<apeiros> same with `and` keyword.
<cthulchu> ok, folks, could you please glance at my class. I'm not sure where the error is, but I'm sure it's trivial
thinkpad has joined #ruby
<cthulchu> /Users/Shared/repos/qa_automation/lib/analytics/init.rb:25: syntax error, unexpected end-of-input, expecting keyword_end (SyntaxError)
<apeiros> I will, if you come up with an actually useful problem description ;-)
<apeiros> ah, I was too impatient
<cthulchu> aha
<apeiros> line numbers match with the paste?
<apeiros> your… indentation is terrible. really. you should fix that first.
<cthulchu> they do
<cthulchu> I use Atom
<cthulchu> I'll switch to an actual IDE later
<apeiros> so? atom can't do indents or what?
<cthulchu> that's how it does it
<Radar> [09:38:59] <apeiros>your… indentation is terrible. really. you should fix that first. <- strong confirm
<apeiros> I haven't used atom, but I doubt it did it like that on its own
<cthulchu> what don't you like about it?
<Radar> cthulchu: methods are indented one step too far
<cthulchu> right
<cthulchu> that's me copying them from somewhere else :)
<Radar> You're also missing an end after line 22. The end you have there is matching the `if`, not the `def`
<apeiros> if you fixed your indentation, look for places where it indents or deintents multiple levels at once.
<cthulchu> but I don't know how to move everything to the left, so I don't bother
<apeiros> then you'll see your issue.
<cthulchu> I don't have a format all option here
jcarl43 has quit [Quit: WeeChat 2.1]
<cthulchu> Do I need to explicitly end ifs with only one item in them?!
<apeiros> most text editors I know it's "select all relevant lines, hit shift-tab"
<cthulchu> apeiros, thanks a lot!
<cthulchu> helped
<apeiros> yes. ruby isn't C, as we've just recently noticed :)
<apeiros> `action if condition` if you don't want to indent. only recommended for very short code on both sides of the if.
orbyt_ has quit [Ping timeout: 260 seconds]
dogweather has joined #ruby
<cthulchu> I guess I still can do ternaries
<cthulchu> Ruby motivates me to do more of them
<SeepingN> puts ("Analytics Test Success") if (type == "1" && test == "2" && step == "3") # 1 line
rgiscard has joined #ruby
<cthulchu> will it eat (type == "1" && test == "2" && step == "3")?puts ("Analytics Test Success"):null
<SeepingN> nil
<cthulchu> right
<cthulchu> nil
<apeiros> if you want to write ugly code like that, at least do it right: `(type == "1" && test == "2" && step == "3") and puts ("Analytics Test Success")`
<apeiros> (perlism btw.)
<cthulchu> what
<cthulchu> and?!
<cthulchu> why and?
<cthulchu> doesn't make sense
<apeiros> eh, you not being able to make sense of it != it not making sense.
<cthulchu> me not being make sense of it == it not making sense to me
<cthulchu> you do love to discuss irrelevant stuff
<apeiros> sure, just like you :-p
<cthulchu> will that be a ternary?
<apeiros> no
<cthulchu> what does it do?
<apeiros> that's a logical "and"
<apeiros> it puts if the condition is truthy
<cthulchu> aaaah
<cthulchu> that's very weird
<cthulchu> very very weird
eckhardt has joined #ruby
<cthulchu> I would never write anything like that
<cthulchu> gonna go ask node folks if they would
<cthulchu> it's an interesting approach though
<apeiros> not much weirder than (ab-)using ternary without wanting its value.
roamingdog has joined #ruby
smithja has joined #ruby
<cthulchu> it's negative value
<apeiros> as said, it's a perlism. and also as said, I consider it ugly code.
<apeiros> though, less ugly than the way you used the ternary :)
<cthulchu> also
ellcs has quit [Ping timeout: 260 seconds]
<cthulchu> I can replace that and with &&?
<apeiros> also, pleeeease don't put spaces before method argument parens
<cthulchu> it's just a synonym, right?
sameerynho has quit [Ping timeout: 248 seconds]
<apeiros> `puts("stuff")`, not `puts ("stuff")`
<cthulchu> ok
<apeiros> cthulchu: no, `and` and `&&` are not synonyms (or aliases)
<cthulchu> what's the difference
<apeiros> they have the same functionality, but different precedence.
<cthulchu> oh
<cthulchu> cool
<cthulchu> and is left to right, obviously
<cthulchu> and &&?
<apeiros> I think they have the same associativity direction.
<cthulchu> what's the difference then
<cthulchu> ah
<apeiros> but honestly, I'm not sure. I tend to make cases unambiguous.
<cthulchu> && has higher priority
<cthulchu> cool
karapetyan has joined #ruby
karapetyan has quit [Ping timeout: 260 seconds]