jhass changed the topic of #ruby to: Welcome new users migrating from #ruby-lang! || Rules & more: http://ruby-community.com || Ruby 2.2.2; 2.1.6; 2.0.0-p645: https://ruby-lang.org || Paste >3 lines of text on https://gist.github.com || log @ http://irclog.whitequark.org/ruby/
Igorshp has joined #ruby
symm- has joined #ruby
<havenwood> >> ['Frank Lloyd 123 Wright', 'Frank 123 Lloyd Wright', 'Frank 123 Robinson'].map { |addy| addy.sub /\s\d+/, '' }
<ruboto> havenwood # => ["Frank Lloyd Wright", "Frank Lloyd Wright", "Frank Robinson"] (https://eval.in/397236)
kies^ has quit [Ping timeout: 256 seconds]
<havenwood> carpeliam: What if there are more than one set of digits?
Igorshp has quit [Remote host closed the connection]
scripore has quit [Quit: This computer has gone to sleep]
<havenwood> carpeliam: Impossible?
saadq has joined #ruby
<carpeliam> havenwood: impossible :) or extremely unlikely - i’m trying to match against names, a name would have to stretch across 3 lines
tcdowney has quit [Ping timeout: 255 seconds]
<havenwood> >> ['Frank Lloyd 123 Wright', 'Frank 123 Lloyd Wright', 'Frank 123 Robinson'].map { |addy| addy.delete('0-9').sub ' ', ' ' }
<ruboto> havenwood # => ["Frank Lloyd Wright", "Frank Lloyd Wright", "Frank Robinson"] (https://eval.in/397237)
sevenseacat has joined #ruby
<carpeliam> i don’t know the possible names beforehand, so it could be “Sarah 98 Jessica Parker”
scripore has joined #ruby
<havenwood> carpeliam: Pretty fancy to have a digit in your name.
<carpeliam> havenwood: they’re line numbers
<havenwood> carpeliam: For better suggestions show some possible input data with the return values you'd like.
<carpeliam> so if your first name “Henry” is at the end of line 3 and your last name “Fonda” is at the end of line 4, it’d show up as “Henry 4 Fonda”
dfockler has joined #ruby
atomical has joined #ruby
<carpeliam> input data would be any sentence with a name in it, where a number could be between any word, and the return value would be the name without a number in between
<havenwood> carpeliam: Example input would be nicer than a description if you have any.
blackmes1 has joined #ruby
<havenwood> carpeliam: Like the real stuff.
<carpeliam> so “hello my 6 name is Jim Smith” would return “Jim Smith”, and “hello my name is Sarah 8 Jessica Parker” would return Sarah Jessica Parker
y0da has joined #ruby
<havenwood> carpeliam: So you just want to remove any digits and the space either preceding or following them? Is that all?
freerobby has quit [Quit: Leaving.]
freerobby has joined #ruby
fabrice31 has joined #ruby
<havenwood> carpeliam: Are there any digits you don't want to remove?
but3k4 has quit [Ping timeout: 240 seconds]
blackmesa has quit [Ping timeout: 246 seconds]
<havenwood> carpeliam: Do you ever want double spaces?
josh2 has joined #ruby
dfockler has quit [Ping timeout: 250 seconds]
kies^ has joined #ruby
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
GitGud has quit [Ping timeout: 256 seconds]
<havenwood> >> 'Frank Lloyd 123 Wright'.delete('0-9').squeeze
<ruboto> havenwood # => "Frank Lloyd Wright" (https://eval.in/397238)
<carpeliam> havenwood: I can always do something like name.split.reject{|x| x =~ /\d+/ }.join(‘ ‘) if there’s no better way to do it, but i’m specifically asking how to remove text from a match group in a regular expression
<carpeliam> that works too
fabrice31 has quit [Ping timeout: 252 seconds]
<havenwood> carpeliam: A positive lookahead or lookbehind.
pulgolino has quit [Remote host closed the connection]
ndrei has joined #ruby
shock_one has joined #ruby
robbyoconnor has quit [Max SendQ exceeded]
Thomas-0725 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
robbyoconnor has joined #ruby
oo_ has quit [Remote host closed the connection]
Yzguy has joined #ruby
freerobby has quit [Quit: Leaving.]
freerobby has joined #ruby
<BStheHD> whenever I write a script or something it executes in the console.. but how do I build an interface for a program?
<BStheHD> ^again new to this stuff guys :p
shock_one has quit [Ping timeout: 246 seconds]
Aderium has quit [Quit: Textual IRC Client: www.textualapp.com]
josh2 has quit [Ping timeout: 240 seconds]
kies^ has quit [Ping timeout: 256 seconds]
n008f4g_ has quit [Ping timeout: 252 seconds]
josh2 has joined #ruby
bruno- has quit [Ping timeout: 256 seconds]
<havenwood> BStheHD: Usually you'd cut a gem to distribute, install and update your tool and pick a lib for option parsing.
<havenwood> BStheHD: OptionParser ships with Ruby but is a bit verbose: http://ruby-doc.org/stdlib/libdoc/optparse/rdoc/OptionParser.html
ndrei has quit [Ping timeout: 265 seconds]
<havenwood> BStheHD: You might prefer the Slop gem: https://github.com/leejarvis/slop#readme
dellavg has quit [Ping timeout: 264 seconds]
arescorpio has joined #ruby
zacstewart has quit [Ping timeout: 244 seconds]
<havenwood> BStheHD: Or if you really need a more complex, git-like command parsing maybe consider Thor: https://github.com/erikhuda/thor#readme
<pontiki> BStheHD: what do you mean by "interface"?
EllisTAA has quit [Quit: EllisTAA]
<pontiki> graphical? terminal-based? api? web?
Synthbread has joined #ruby
<havenwood> pontiki: said "console," so i assumed terminal-based
<havenwood> pontiki: Though I guess it could execute in the console and be any sort of thing. :O
<saadq> I think he wants to make something that isn't just terminal-based
<pontiki> i read the "but" in the back half of that initial query, havenwood
<havenwood> pontiki: ahhh
<havenwood> Yeah, I'm probably the one who read it wrong.
<havenwood> BStheHD: Clarify?!
<BStheHD> sorry was afk
<BStheHD> that was a lot of confusing vocab there
bruno- has joined #ruby
<BStheHD> I'm just asking like how you can create a window/interface for a program.. not just so that it runs in the console
<havenwood> BStheHD: So GUI?
<BStheHD> yes exactly
freerobby has quit [Quit: Leaving.]
<havenwood> BStheHD: Then ignore my recommendations, I fail at reading.
<toretore> BStheHD: which os?
marr has quit [Ping timeout: 244 seconds]
<BStheHD> no worries lol
<BStheHD> windows
freerobby has joined #ruby
Igorshp has joined #ruby
Igorshp has quit [Remote host closed the connection]
bricker has quit [Ping timeout: 255 seconds]
<BStheHD> this is an example.. I have this script here http://pastebin.com/W5V4CN9V
<ruboto> BStheHD, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/76bb6f9d13d4bda30e07
<ruboto> pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
<BStheHD> When I run it it executes in the console perfectly, but I want a GUI for it
bruno- has quit [Ping timeout: 255 seconds]
<pontiki> BStheHD: maybe this: http://shoesrb.com/ ?
<pontiki> caveat: i hate GUIs
<havenwood> BStheHD: Yeah, give Shoes4 a try: https://github.com/shoes/shoes4#readme
Igorshp has joined #ruby
<BStheHD> okay thanks, I'll check it out
Igorshp has quit [Remote host closed the connection]
<havenwood> BStheHD: If you go that route you'll want to install JRuby if you haven't already: http://jruby.org/
weemsledeux has joined #ruby
niemcu has quit [Ping timeout: 250 seconds]
CloCkWeRX has left #ruby [#ruby]
<BStheHD> Is JRuby an alternative to http://rubyinstaller.org/ --because I have that installed
<toretore> it's an alternative that is required to run shoes
<havenwood> carpeliam: Uhg, I always forget #squeeze doesn't default to " ", so: delete('0-9').squeeze(' ')
<havenwood> Just remembered.
y0da has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<BStheHD> Should I uninstall the other one then? If they do the same thing that should be fine
Igorshp has joined #ruby
josh2 has quit [Ping timeout: 256 seconds]
<havenwood> BStheHD: You might want both. Dunno, you should be able to use Shoes3 with the former but JRuby is required at the moment for Shoes4.
s00pcan has quit [Ping timeout: 256 seconds]
<saadq> BStheHD: You could also go the web route to create UI's
<BStheHD> ohh okay
s00pcan has joined #ruby
jeramyRR has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
meph has quit [Quit: Leaving.]
EllisTAA has joined #ruby
oo_ has joined #ruby
sarkyniin has quit [Quit: Quit]
fullofcaffeine has quit [Remote host closed the connection]
Igorshp has quit [Remote host closed the connection]
zacstewart has joined #ruby
fullofcaffeine has joined #ruby
chipotle has joined #ruby
baweaver has joined #ruby
fullofcaffeine has quit [Remote host closed the connection]
baweaver_ has joined #ruby
fullofcaffeine has joined #ruby
hashrocket has quit [Quit: Connection closed for inactivity]
eGGshke has quit [Quit: Textual IRC Client: www.textualapp.com]
serivich has joined #ruby
Igorshp has joined #ruby
nfk has joined #ruby
chipotle has quit [Ping timeout: 250 seconds]
baweaver has quit [Ping timeout: 264 seconds]
carpeliam has quit [Quit: carpeliam]
djbkd has joined #ruby
nateberkopec has quit [Quit: Leaving...]
jeramyRR has joined #ruby
EllisTAA has quit [Quit: EllisTAA]
Thomas-0725 has joined #ruby
Igorshp has quit [Remote host closed the connection]
freerobby has quit [Quit: Leaving.]
FernandoBasso has quit [Quit: WeeChat 1.2]
djbkd has quit [Ping timeout: 246 seconds]
simplyianm has joined #ruby
WeiJunLi has quit []
zacstewart has quit [Ping timeout: 256 seconds]
davedev24 has joined #ruby
davedev2_ has quit [Ping timeout: 244 seconds]
Igorshp has joined #ruby
eggoez has quit [Ping timeout: 256 seconds]
Yzguy has quit [Ping timeout: 264 seconds]
Scroff has joined #ruby
simplyianm has quit [Ping timeout: 248 seconds]
simplyianm has joined #ruby
PeterHsieh has joined #ruby
aaeron has joined #ruby
eggoez has joined #ruby
oo_ has quit [Remote host closed the connection]
Scroff has quit [Ping timeout: 244 seconds]
simplyianm has quit [Ping timeout: 255 seconds]
Yzguy has joined #ruby
i8igmac has quit [Remote host closed the connection]
bungoman has joined #ruby
dseitz has quit [Quit: Textual IRC Client: www.textualapp.com]
Soda has quit [Remote host closed the connection]
unreal_ has joined #ruby
baweaver_ has quit [Read error: Connection reset by peer]
baweaver has joined #ruby
Yzguy has quit [Quit: Zzz...]
unreal has quit [Ping timeout: 244 seconds]
Missphoenix has quit [Quit: Leaving]
Yzguy has joined #ruby
cytoskeletor has joined #ruby
serivich has quit [Ping timeout: 265 seconds]
baweaver has quit [Ping timeout: 244 seconds]
quimrstorres has quit [Remote host closed the connection]
Yzguy has quit [Ping timeout: 256 seconds]
danielpclark has quit [Remote host closed the connection]
serivich has joined #ruby
blackmes1 has quit [Ping timeout: 255 seconds]
carpeliam has joined #ruby
nateberkopec has joined #ruby
surs2 has joined #ruby
surs1 has quit [Ping timeout: 256 seconds]
GriffinHeart has joined #ruby
nathanstitt has joined #ruby
atomi has quit [Ping timeout: 246 seconds]
Synthbread has quit [Remote host closed the connection]
arooni-mobile__ has quit [Ping timeout: 248 seconds]
tkuchiki has joined #ruby
znn has joined #ruby
znn has quit [Client Quit]
bruno- has joined #ruby
Spami has joined #ruby
Vile` has quit [Ping timeout: 246 seconds]
baweaver has joined #ruby
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Spami has quit [Client Quit]
Igorshp has quit [Remote host closed the connection]
Vile` has joined #ruby
bruno- has quit [Ping timeout: 252 seconds]
atomical has joined #ruby
shinnya has quit [Ping timeout: 264 seconds]
dgutierrez1287 has quit [Remote host closed the connection]
aaeron has quit [Quit: Leaving.]
Stratege_ has joined #ruby
Synthbread has joined #ruby
zacstewart has joined #ruby
Xoro has quit [Read error: Connection reset by peer]
Stratege has quit [Ping timeout: 240 seconds]
strmpnk has left #ruby [#ruby]
podman has joined #ruby
Xoro has joined #ruby
luriv_ has quit [Ping timeout: 244 seconds]
icebourg has joined #ruby
icebourg has quit [Max SendQ exceeded]
icebourg has joined #ruby
Sehryn has joined #ruby
Guest26398 has joined #ruby
<Guest26398> suuuuuppp
Guest26398 is now known as jimmythehat
<Aeyrix> h
dopie has joined #ruby
Channel6 has quit [Quit: Leaving]
<jimmythehat> how should I mock a block? e.g. array.map { |v| v.some_method } How should I mock v and its some_method method? I'm using rspec
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
oo_ has joined #ruby
TheHodge has quit [Quit: Connection closed for inactivity]
scripore has quit [Quit: This computer has gone to sleep]
pengin has joined #ruby
<Radar> why
freerobby has joined #ruby
<Radar> would you want to do that?
<Radar> pray tell
scripore has joined #ruby
fullofcaffeine has quit [Remote host closed the connection]
freerobby has quit [Read error: Connection reset by peer]
freerobby1 has joined #ruby
Sehryn has quit [Ping timeout: 240 seconds]
<baweaver> pssst: mock the array
<baweaver> or the some_method
saadq has quit [Remote host closed the connection]
<jimmythehat> baweaver I feel mocking some_method would make more sense. Not sure hot to reference 'v' in a mock though?
fabrice31 has joined #ruby
<jimmythehat> Radar: I haven't created some_method yet
<Radar> jimmythehat: some us an example?
<Radar> show*
<jimmythehat> kk
<baweaver> allow_any_instance_of(YourObject).to receive(:some_method) { return_value } # probably
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
qiukun has joined #ruby
<jimmythehat> baweaver yeah thinking of that but the rspec team dont use allow_any_instance_of
<jimmythehat> tis buggy apparently
<baweaver> then what's their suggestion otherwise?
bungoman has quit [Remote host closed the connection]
<jimmythehat> baweaver yeah its why am i here :L
<baweaver> If their response is it's buggy, I'd tend to ignore it honestly, but that's just me
GriffinHeart has quit [Remote host closed the connection]
dopie has quit [Quit: This computer has gone to sleep]
<baweaver> you could do something more confounded by throwing stubbed doubles in as the array but that's worse
<baweaver> I've never actually had a problem with it
<baweaver> Radar: Am I talking crazy, or have you seen the "don't use allow_any_instance_of" train as well?
dopie has joined #ruby
fabrice31 has quit [Ping timeout: 240 seconds]
<Radar> baweaver: no you're right
<baweaver> speaking of which
<Radar> an example would help here to know what we're actually supposed to be testing
<baweaver> where's this statement? Looking for it.
<Radar> rather than making up shit
<baweaver> touche
GriffinHeart has joined #ruby
LMity has joined #ruby
* baweaver wanders back to agar.io
pengin has quit [Remote host closed the connection]
* baweaver thinks he might have a problem
nfk has quit [Remote host closed the connection]
yfeldblum has quit [Ping timeout: 264 seconds]
surs3 has joined #ruby
icebourg has quit []
serivich has quit [Ping timeout: 246 seconds]
balazs has joined #ruby
LMity has quit [Ping timeout: 256 seconds]
mary5030 has joined #ruby
surs2 has quit [Ping timeout: 246 seconds]
serivich has joined #ruby
surs4 has joined #ruby
dopie has quit [Quit: This computer has gone to sleep]
radialneon_ has quit [Ping timeout: 252 seconds]
jeramyRR has quit [Quit: Peace out!]
sharpmachine has joined #ruby
balazs has quit [Ping timeout: 246 seconds]
surs3 has quit [Ping timeout: 240 seconds]
prestorium has joined #ruby
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kies^ has joined #ruby
Musashi007 has joined #ruby
casadei_ has joined #ruby
radialneon has joined #ruby
serivich has quit [Ping timeout: 244 seconds]
mary5030 has quit [Remote host closed the connection]
serivich has joined #ruby
msnyon has joined #ruby
jottr has quit [Ping timeout: 250 seconds]
havenwood has quit [Quit: Textual IRC Client: www.textualapp.com]
kies^ has quit [Ping timeout: 246 seconds]
yfeldblum has joined #ruby
GriffinHeart has quit [Remote host closed the connection]
bruno- has joined #ruby
GriffinHeart has joined #ruby
frem has joined #ruby
darkf has joined #ruby
Spami has joined #ruby
bruno- has quit [Ping timeout: 244 seconds]
dopie has joined #ruby
pwnz0r_ has joined #ruby
bronson has joined #ruby
serivichi has joined #ruby
ledestin has joined #ruby
qiukun has quit [Quit: qiukun]
kkeuning has joined #ruby
nateberkopec has quit [Quit: Leaving...]
hoofed has joined #ruby
Channel6 has joined #ruby
iateadonut has joined #ruby
josh2 has joined #ruby
hashrocket has joined #ruby
hoofed has left #ruby [#ruby]
pwnz0r_ is now known as pwnz0r
<Antiarc> any_instance_of is generally a code smell
serivich has quit [Ping timeout: 255 seconds]
<Antiarc> You should only use it if you have no other option
<Antiarc> v.some_method should be done by passing an array of mocks that behave like whatever v will be
<Antiarc> array of doubles rather
bronson has quit [Ping timeout: 265 seconds]
kkeuning has quit [Ping timeout: 264 seconds]
jenrzzz has joined #ruby
eggoez has quit [Ping timeout: 252 seconds]
kkeuning has joined #ruby
kkeuning has quit [Client Quit]
annihilannic has joined #ruby
arooni-mobile has joined #ruby
arooni-mobile__ has joined #ruby
kkeuning has joined #ruby
cytoskeletor has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pico-pete has quit [Read error: No route to host]
al2o3-cr has quit [Ping timeout: 252 seconds]
kkeuning has quit [Max SendQ exceeded]
<annihilannic> hi, can anyone tell me which package/gem/whatever provides vm_core.h, please? I'm unable to install debugger-linecache due to the lack of this file.
davedev2_ has joined #ruby
<Aeyrix> if you paste "vm_core.h" into google
<Aeyrix> the first result will giev you a fix.
<Aeyrix> I just checked.
kkeuning has joined #ruby
<annihilannic> I tried, and it made no sense to me, let me double-check.
davedev24 has quit [Ping timeout: 265 seconds]
Musashi007 has quit [Quit: Musashi007]
krz has joined #ruby
Scroff has joined #ruby
kkeuning has quit [Max SendQ exceeded]
kkeuning has joined #ruby
nathanstitt has quit [Quit: I growing sleepy]
Guest24 has quit [Ping timeout: 248 seconds]
lele has joined #ruby
ecksit has joined #ruby
evanjs has joined #ruby
<annihilannic> Aeyrix: so I tried the 'gem install ruby-debug19 -- --with-ruby-include=$rvm_path/src/ruby-1.9.2-p290' command mentioned there, and it gave me the same error. I have installed ruby-2.1.2 though, do I need to adjust that path? and does it need to point to some ruby source that I may not have installed?
davedev2_ has quit [Read error: Connection reset by peer]
pwnz0r has quit [Remote host closed the connection]
eggoez has joined #ruby
davedev24 has joined #ruby
<annihilannic> Aeyrix: for e.g., if I 'locate src/ruby', I get no hits.
kkeuning has quit [Max SendQ exceeded]
pwnz0r has joined #ruby
kkeuning has joined #ruby
surs has joined #ruby
spuk has joined #ruby
<Antiarc> is ruby installed via your system package manager?
<Antiarc> you may need to install the -dev/-devel package if so
<Antiarc> (which will contain the ruby headers)
braincras has quit [Quit: bye bye]
kkeuning has quit [Max SendQ exceeded]
spuk has quit [Changing host]
spuk has joined #ruby
surs4 has quit [Ping timeout: 264 seconds]
kkeuning has joined #ruby
kkeuning has quit [Max SendQ exceeded]
<annihilannic> Antiarc: I had ruby-1.8.7 installed (RHEL6) via yum, but the package I'm trying to install (kandan) requires ruby-1.9.3 or higher. I located a 2.1.2 rpm via pbone.net and installed that. I couldn't find a source package initially, just found a ruby-devel which I'll try, although I'm not sure it matches the ruby- package exactly...
pwnz0r has quit [Ping timeout: 248 seconds]
<Antiarc> annihilannic: you will need a -devel package that matches the version of Ruby that you have installed
<Antiarc> Consider using something like rvm or rbenvm though - they may be a bit cleaner. Though I know some folks like to stick to rpms.
<Antiarc> rbenv*
<annihilannic> Antiarc: thanks, I'll read about what those are.
prestorium has quit [Ping timeout: 255 seconds]
<Antiarc> If you're familiar with python, they're similar in concept to virtualenv
<Antiarc> Though IMO are far better at the job
<annihilannic> I'm not, I come from perl
braincrash has joined #ruby
<annihilannic> Well, going backwards, I found a binary RPM corresponding to that source package.
<annihilannic> However examining the contents of the source I see no vm_core.h either.
jenrzzz has quit [Ping timeout: 264 seconds]
<Antiarc> vm_core is part of the Ruby source, FWIW
thiagovsk has joined #ruby
<Antiarc> Speaking as a fellow RHEL6 deployer, though, rvm will do quite nicely :)
eggoez has quit [Ping timeout: 248 seconds]
cytoskeletor has joined #ruby
radialneon has quit [Remote host closed the connection]
<Antiarc> (some folks don't like it because it messes with your shell, rbenv is less intrusive and slightly less full-featured, but does the job just as well)
scripore has quit [Quit: This computer has gone to sleep]
scripore has joined #ruby
Scroff has quit [Ping timeout: 256 seconds]
eggoez has joined #ruby
carpeliam has quit [Quit: carpeliam]
yh has quit [Ping timeout: 256 seconds]
zacstewart has quit [Remote host closed the connection]
scripore has quit [Ping timeout: 250 seconds]
<Thomas-0725> Integer.respond_to?(:+)
<Thomas-0725> > Integer.respond_to?(:+)
<Thomas-0725> Ok, that is evaluating to false for me. What am I doing wrong?
<jesterfraud> >> Integer.respond_to?(:+)
<ruboto> jesterfraud # => false (https://eval.in/397278)
bungoman has joined #ruby
<jesterfraud> >> Integer.new.respond_to?(:+)
<ruboto> jesterfraud # => undefined method `new' for Integer:Class (NoMethodError) ...check link for more (https://eval.in/397279)
icebourg has joined #ruby
<jesterfraud> ha, would have been too straightforward
<jesterfraud> >> 1.respond_to?(:+)
<ruboto> jesterfraud # => true (https://eval.in/397280)
<jesterfraud> so an instance of an integer responds to +, but the class itself does not
<Thomas-0725> OK, so without actually declaring an integer, how would I say "Instance of Integer".respond_to?(sym) ?
surs1 has joined #ruby
djbkd_ has quit [Quit: Leaving...]
<Thomas-0725> >> Integer.respond_to?(:+@)
<ruboto> Thomas-0725 # => false (https://eval.in/397281)
<Thomas-0725> >> Numeric.respond_to?(:+@)
<ruboto> Thomas-0725 # => false (https://eval.in/397282)
<Thomas-0725> ugh
<Thomas-0725> Ok, so in the ruby doc, what does :+@ mean?
<bnagy> >> 3.respond_to? :+
<ruboto> bnagy # => true (https://eval.in/397283)
tmtwd has quit [Remote host closed the connection]
veduardo has quit [Ping timeout: 256 seconds]
BStheHD has quit [Ping timeout: 246 seconds]
<bnagy> >> Integer.instance_methods.include? :+@
<ruboto> bnagy # => true (https://eval.in/397284)
surs has quit [Ping timeout: 244 seconds]
oo_ has quit [Remote host closed the connection]
<Thomas-0725> What does the @ mean here?
<bnagy> don't know :D
<bnagy> 19>> Integer.instance_methods.include? :+
<ruboto> bnagy # => false (https://eval.in/397285)
<bnagy> ?experiment
<ruboto> Please use your local irb or pry (see ?pry) to experiment, ruboto's eval functionality is for demonstration purposes only.
GriffinHeart has quit [Ping timeout: 256 seconds]
<Thomas-0725> oh, those are not add and subtract. Those are unary +/- for positive/negative
<bnagy> sorry
<Thomas-0725> So where are add/subtract? :-(
raenk has joined #ruby
dellavg has joined #ruby
<bnagy> oic
<bnagy> >> 3.methods.grep /\+/
<ruboto> bnagy # => [:+, :+@] (https://eval.in/397286)
GriffinHeart has joined #ruby
<bnagy> +other and +
Sehryn has joined #ruby
<annihilannic> Antiarc: fast getting out of my depth here. so I gather installing rvm under a single user would be the "light touch" approach. but then would I be able to install a "bundle" simply under that? and if so, how would my web server know about it?
<bnagy> nothing about rvm is "light" imo
_blizzy_ has quit [Ping timeout: 240 seconds]
<Antiarc> annihilannic: You would "rvm use 2.2.2" and rvm will adjust your paths to that particular ruby install
<Antiarc> Then you would "bundle install" and it would execute the ruby currently on path and install it into a gempath for that ruby install
<Thomas-0725> mmm, ok. I guess I'll just use instance_methods.include?(sym)
<annihilannic> And everything it installs would be under ~rvmuser/.rvm somewhere?
<bnagy> Thomas-0725: what's the actual question?
cytoskeletor has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
christiandsg has joined #ruby
<Thomas-0725> bnagy, the actual question is: if I have some arbitrary symbol, sym, how do I determine whether or not I can use it on a Float?
gix has quit [Ping timeout: 248 seconds]
<bnagy> ask an instance of Float if it minds
<bnagy> but don't ask Float
<Thomas-0725> And more usefully, how do I determine if, when used on Float, it accepts a Float as the argument?
<bnagy> uh.. dynamic typing
<bnagy> as in the answer won't be useful
<sevenseacat> 'can i use it on a float?' != 'does it make sense to use it on a flat in this circumstance'
<bnagy> what's the actual, actual question? ;)
<sevenseacat> *float
<Antiarc> annihilannic: What application server are you using? If it's passenger, then you'll just install passenger with your target ruby active. Otherwise, you'll just install your app server and invoke it from that environment
<Antiarc> Under rvm, that could be `rvm 2.2.2 do ruby whatever.rb`, which would execute whatever.rb under your 2.2.2 install
<Thomas-0725> The actual actual question is, I'm trying to make a parser for an RPN calculator, and I would like to parse the string into floats and symbols, and then error check to establish whether any of the symbols are invalid. My first idea was to just make an array of valid symbols and check against that, and that seems to be the most practical solution now.
<Antiarc> I haven't used rbenv/chruby in a while though, so I couldn't tell you the equivalents there
<bnagy> Thomas-0725: that is definitely how I would do it
<bnagy> tokenise, parse, do stuff
surs2 has joined #ruby
<annihilannic> Antiarc: I've installed nodejs and execjs as per the very undetailed kandan setup instructions. Is execjs the application server in this scenario?
<Thomas-0725> Cool. I just wasn't sure if there was some more handy way to ask Ruby "Does this method work on two floats?" Seems there is not. :D Thanks for the help!
<bnagy> imho ruby is too dynamic to be able to metaprogram your way to a sensible implementation in such a specific domain
<Antiarc> Oh, kandan. No, nodejs and execjs are almost certianly only used for asset compilation.
<Antiarc> Let me find the link you referenced
jesterfraud has quit [Quit: Textual IRC Client: www.textualapp.com]
surs1 has quit [Ping timeout: 255 seconds]
<Antiarc> annihilannic: sorry, I'm not seeing the install instructions referenced. Can you relink it?
<Thomas-0725> bnagy, yes, that makes sense. I'm still quite new at this, and the existence of repond_to? caused some overexcitement I suppose. :)
gix has joined #ruby
<bnagy> respond_to? is awesome, and the heart of duck typing, which is also awesome
NeverDie has joined #ruby
<bnagy> I just have ptsd from leaky parsers
cytoskeletor has joined #ruby
<Antiarc> annihilannic: `bundle exec thin start` - thin is the application server there. So really all you need to do is install rvm, `rvm install 2.2`, `rvm use 2.2`, and then follow the rest of the instructions
swgillespie has joined #ruby
M-Technic has joined #ruby
SylarRuby has joined #ruby
<annihilannic> Antiarc: thanks muchly, I'll give it a try.
<Antiarc> (also, as a tip - if you ever feel that rvm has screwed stuff up, `rvm implode` will remove everything installed by RVM and return your system to a pre-rvm state)
<annihilannic> Antiarc: quaint!
<sevenseacat> run it once, then install something that doesnt screw stuff up
Ropeney has joined #ruby
sharpmachine has quit [Remote host closed the connection]
jesterfraud has joined #ruby
mercwithamouth has quit [Ping timeout: 246 seconds]
<Antiarc> (I'm personally a fan of RVM, but I don't mind its shell shenannigans. Others I respect are far less bullish on it!)
cytoskeletor has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<bnagy> *everything may not include actually everything
evanjs has quit [Remote host closed the connection]
Spami has quit [Quit: This computer has gone to sleep]
dellavg has quit [Ping timeout: 264 seconds]
saadq has joined #ruby
davedev24 has quit [Remote host closed the connection]
<annihilannic> Antiarc: yes, well, as long as I can ringfence it under a specific user I doubt they will bother me
mary5030 has joined #ruby
carpeliam has joined #ruby
carpeliam has quit [Client Quit]
Musashi007 has joined #ruby
Sehryn has quit [Quit: Leaving]
oo_ has joined #ruby
mary5030 has quit [Ping timeout: 264 seconds]
<Thomas-0725> bnagy (or anyone else), do you mind looking this over and providing any suggestions you might have? https://gist.github.com/thomasbcolley/a595294ef4e21a2f1833#file-gistfile1-rb -- rpn calculator
hakunin_ has quit [Remote host closed the connection]
lessless has joined #ruby
Caius has quit [Ping timeout: 256 seconds]
kobain has quit [Quit: KVIrc 4.1.3 Equilibrium http://www.kvirc.net/]
symm- has quit [Ping timeout: 264 seconds]
christiandsg has quit [Remote host closed the connection]
davedev24 has joined #ruby
crazydiamond has quit [Remote host closed the connection]
<bnagy> I only have minor comments... don't use brackets when they're not required by the parser
<bnagy> and imho don't use private like that
Caius has joined #ruby
dgutierrez1287 has joined #ruby
<bnagy> oh, wow, you have private and public, I see.. personally I find that confusing.
serivichi has quit [Ping timeout: 265 seconds]
<bnagy> most code has all the public methods, then private, the private ones
<bnagy> but private is less common in ruby than elsewhere
oo_ has quit [Remote host closed the connection]
Ox0dea has joined #ruby
<bnagy> initialize is usually in the public section.
<Ox0dea> >> '6 3 / 8 7 + + 3 * 9 -'.split.map { |t| Integer t rescue t }.each_with_object([]) { |t, o| o << (t[1] ? t : o.pop(2).reduce(t)) }
<ruboto> Ox0dea # => [42] (https://eval.in/397288)
oo_ has joined #ruby
allcentury has joined #ruby
<bnagy> cute :)
rbennacer has quit [Remote host closed the connection]
<Ox0dea> bnagy: Does the visibility of #initialize ever actually matter?
<bnagy> I don't know :)
<Ox0dea> Heh, fair enough.
super` has joined #ruby
<bnagy> but it's illogical to have it private, even if you can't really make it private
<bnagy> like.. creating instances is a public function of a class in my world
super` has left #ruby [#ruby]
<Ox0dea> Right, it certainly shouldn't be private, I just wondered whether it had any actual effect.
<bnagy> I guess not because Klass#new magic?
dgutierrez1287 has quit [Ping timeout: 252 seconds]
<Thomas-0725> Ox0dea:(
<Ox0dea> Thomas-0725: Pardon?
<Thomas-0725> So basically you just did in 1 line what I did in 80? :O
<Ox0dea> Yay, Ruby?
<bnagy> but uglier :)
<bnagy> and with less checking
peter_paule has joined #ruby
<Thomas-0725> so what does rescue do there?
<bnagy> Thomas-0725: it abuses the way reduce works, because it has a very liberal to_proc or something in there
<Ox0dea> bnagy: Nah, #reduce with a String "just works".
mercwithamouth has joined #ruby
allcentury has quit [Ping timeout: 240 seconds]
davedev24 has quit [Remote host closed the connection]
<Ox0dea> Thomas-0725: Kernel.Integer will fail given non-numeric input; in this case, I'm catching that error and assuming it means the token was an operator.
xkickflip has joined #ruby
jenrzzz has joined #ruby
<Thomas-0725> Ox0dea does it fail on a 1.1 or does it simply truncate?
<Thomas-0725> >> Integer "r"
<ruboto> Thomas-0725 # => invalid value for Integer(): "r" (ArgumentError) ...check link for more (https://eval.in/397289)
<Thomas-0725> >> Inteer "1.2"
<ruboto> Thomas-0725 # => undefined method `Inteer' for main:Object (NoMethodError) ...check link for more (https://eval.in/397290)
<Thomas-0725> erg
<Thomas-0725> anyway, IRB I know.
<Thomas-0725> ok, so your cool little trick fails for floating input
<Ox0dea> No?
<Ox0dea> Ah, it does, but there's also Kernel.Float. :)
<Thomas-0725> >> '6 3.0 / 8 7 + + 3 * 9 -'.split.map { |t| Integer t rescue t }.each_with_object([]) { |t, o| o << (t[1] ? t : o.pop(2).reduce(t)) }
<ruboto> Thomas-0725 # => String can't be coerced into Fixnum (TypeError) ...check link for more (https://eval.in/397291)
<Thomas-0725> Ah, ok. So just bad class choice
<Ox0dea> No, it's a method.
<sphex> Ox0dea: hey.. are you working on somekind of parser?
<Thomas-0725> Yes, sorry.
<Ox0dea> sphex: It's charitable to call it a "parser", but I'm working on converting any Ruby code to a non-alphanumeric "equivalent". :)
spuk has quit [Ping timeout: 264 seconds]
pwnz0r has joined #ruby
<Thomas-0725> OK, well thank you both for the input. I'm sure I'll be pestering often over the next few weeks.
<sphex> haha.. whoa..
fabrice31 has joined #ruby
davedev24 has joined #ruby
Musashi007 has quit [Quit: Musashi007]
<Ox0dea> sphex: It was technically possible to write any conceivable program using non-alphanumerics, but Mon_Ouie showed me how to invoke #send, so now it's possible to write real, heavy-duty Ruby with no numbers or letters.
<Ox0dea> I figured I'd try to automate that process for giggles.
Thomas-0725 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Channel6 has quit [Quit: Leaving]
arescorpio has quit [Quit: Leaving.]
fabrice31 has quit [Ping timeout: 244 seconds]
<Ox0dea> bnagy: rb_class_new_instance() calls rb_obj_call_init(), which (after jumping through quite a few hoops) calls vm_call0_body(), which does lots of checks, but none for visibility.
<sphex> Ox0dea: wow. man.. I don't even want to think about it. :p
casadei_ has quit [Remote host closed the connection]
<Ox0dea> sphex: It's actually kinda fun.
<Ox0dea> In an admittedly warped sort of way.
msnyon has quit [Ping timeout: 255 seconds]
ecksit has quit [Read error: Connection reset by peer]
xkickfl-1 has joined #ruby
xkickfl-1 has left #ruby [#ruby]
xkickflip_ has joined #ruby
<bnagy> Ox0dea: hm.. I guess in theory initialize is actually always private
<bnagy> it just freaks me out to see it declared as such
<sphex> Ox0dea: I've been working on a ruby parser too. mostly to practice metaprogramming. I made a small DSL to help with operator precedence parsing... which I think works correctly. but there's a lot of stuff missing. I may be able to get it complete-ish in a few days.
zacstewart has joined #ruby
xkickflip_ has quit [Client Quit]
davedev24 has quit [Remote host closed the connection]
PeterHsieh has quit [Quit: Connection closed for inactivity]
shock_one has joined #ruby
peter_paule has quit [Ping timeout: 248 seconds]
freerobby1 has quit [Quit: Leaving.]
arooni-mobile has quit [Ping timeout: 248 seconds]
arooni-mobile__ has quit [Ping timeout: 248 seconds]
<Ox0dea> >> Class.new { public def initialize; end }.public_methods.include?(:initialize)
<ruboto> Ox0dea # => false (https://eval.in/397309)
<Ox0dea> bnagy: In practice, as well. I wonder what that's about.
davedev24 has joined #ruby
mercwithamouth has quit [Ping timeout: 240 seconds]
verto has quit [Ping timeout: 240 seconds]
<bnagy> cause you're supposed to call new
shock_one has quit [Ping timeout: 265 seconds]
<Ox0dea> sphex: I trust you're not cheating by looking into how seattlerb and/or Rubinius are doing it?
s2013 has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
<sphex> I was going to try to make a small "meta-circular interpreter" after to see if I can get the class semantics right, but looks like this is going to be way too hard. I guess I would have to override *all* the introspection features of Object for the objects that get into the interpreter...
tmtwd has joined #ruby
<sphex> Ox0dea: no. mine is a pure recursive-descent "pratt" parser. will prolly be no more than 2000 lines of code when finished.
<ght> Question: if I want to halt execution but I want it to return a normal exit code, which I believe is 0, what should I use?
<ght> Normally I use abort but I believe that's an exit code 1, indicating error
verto has joined #ruby
<Ox0dea> ~ $ ruby -e 'exit 42'
<Ox0dea> ~ $ echo $?
<Ox0dea> 42
<Antiarc> re: private initialize, you'd do that for a singleton class
<ght> Thank you 0x0dea. My question is, this SO article: http://stackoverflow.com/questions/4432506/stop-execution-of-ruby-script
<ght> Isn't clear as to whether or not exit exits cleanly.
<Ox0dea> Antiarc: It's just been demonstrated that privatizing #initialize is redundant.
<ght> Saying it raises a "SystemExit" exception, does exit also return a normal 0 error code?
<ght> I mean, exit code.
<ght> Like in bash, if I want to indicate an error, I exit 1
<Antiarc> Ox0dea: I'm gonna have to go look at how the singleton mixin does it!
<ght> If I simply call exit, that will exit cleanly?
<Antiarc> Oh, singleton undef's intialize, IIRC
<Ox0dea> ght: Do you not have a Ruby interpreter close at hand?
<ght> I'm surrounded by terminals, yes.
d0lph1n98 has joined #ruby
<ght> How would I confirm whether or not a 0 exit code is returned?
<ght> In irb?
<Ox0dea> ght: I demonstrated that above.
<Ox0dea> Don't use irb for something like this.
<ght> Ahh, I see, so specify the number after exit.
<ght> Got it.
<ght> Thank you sir, appreciated.
<Ox0dea> Right, and print $? at the shell to check the value.
<Ox0dea> Happy to help.
xkickflip has quit [Quit: leaving]
Spami has joined #ruby
arooni-mobile__ has joined #ruby
arooni-mobile has joined #ruby
saadq has quit [Remote host closed the connection]
<Ox0dea> >> Class.new.singleton_class.methods.include?(:initialize)
<ruboto> Ox0dea # => false (https://eval.in/397322)
i8igmac has joined #ruby
<Antiarc> I was wrong, Singleton changes the visibility on new, not initialize
<Ox0dea> I wonder what's going on that sclass.send(:initialize) raises a TypeError rather than a NoMethodError.
charliesome has joined #ruby
saadq has joined #ruby
peter_paule has joined #ruby
devbug has joined #ruby
brianpWins has joined #ruby
al2o3-cr has joined #ruby
d0lph1n98 has quit [Quit: leaving]
krz has quit [Ping timeout: 252 seconds]
bruno- has joined #ruby
peter_paule has quit [Ping timeout: 264 seconds]
GnuYawk has quit [Remote host closed the connection]
bruno- has quit [Ping timeout: 256 seconds]
havenwood has joined #ruby
fullofcaffeine has joined #ruby
djbkd has joined #ruby
balazs has joined #ruby
balazs has quit [Remote host closed the connection]
balazs has joined #ruby
zacstewart has quit [Ping timeout: 246 seconds]
Gnubie_ has quit [Remote host closed the connection]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
luriv_ has joined #ruby
bungoman has quit [Remote host closed the connection]
jamesaxl has quit [Ping timeout: 246 seconds]
djbkd has quit [Ping timeout: 248 seconds]
oo_ has quit [Remote host closed the connection]
zack6849 has quit [Ping timeout: 246 seconds]
oo_ has joined #ruby
jamesaxl has joined #ruby
surs3 has joined #ruby
Gnubie_ has joined #ruby
Dwarf has quit [Ping timeout: 246 seconds]
surs2 has quit [Ping timeout: 256 seconds]
roolo has joined #ruby
allomov has joined #ruby
Dwarf has joined #ruby
simplyianm has joined #ruby
Scroff has joined #ruby
roolo_ has quit [Ping timeout: 244 seconds]
simplyianm has quit [Client Quit]
zack6849 has joined #ruby
zack6849 has quit [Changing host]
zack6849 has joined #ruby
simplyianm has joined #ruby
podman has quit [Quit: Connection closed for inactivity]
haraoka has joined #ruby
Scroff has quit [Ping timeout: 256 seconds]
riotjones has joined #ruby
simplyia_ has joined #ruby
nahtnam has joined #ruby
simplyianm has quit [Ping timeout: 265 seconds]
balazs has quit [Remote host closed the connection]
sharpmachine has joined #ruby
riotjones has quit [Ping timeout: 248 seconds]
Brainling has quit [Remote host closed the connection]
Synthbread has quit [Ping timeout: 244 seconds]
Brainling has joined #ruby
michaeldeol has joined #ruby
sharpmachine has quit [Ping timeout: 250 seconds]
GriffinHeart has quit [Remote host closed the connection]
dhjondoh has joined #ruby
zacstewart has joined #ruby
shock_one has joined #ruby
bashusr has joined #ruby
aryaching has joined #ruby
allomov has quit [Remote host closed the connection]
lampd1 has quit [Remote host closed the connection]
DoubleMalt has joined #ruby
fumihiro has joined #ruby
aganov has joined #ruby
revath has joined #ruby
chrissonar has joined #ruby
revath has quit [Client Quit]
lampd1 has joined #ruby
Oog has joined #ruby
lampd1 has quit [Read error: Connection reset by peer]
<Oog> i have decimal numbers with 3 decimal places - how can i cut the last one off without rounding?
<Oog> i guess (x * 100).to_i / 100 - ?
GitGud has joined #ruby
<Radar> example input + output plz
<sevenseacat> Oog: what?
<sevenseacat> what Radar said
mleung has joined #ruby
fullofcaffeine has quit [Remote host closed the connection]
<Oog> input 3.5999 i want 3.59
mleung has quit [Client Quit]
<Radar> why without rounding?
lampd1 has joined #ruby
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Radar> >> require 'bigdecimal'; BigDecimal.new("3.5999").round(2, BigDecimal::ROUND_FLOOR).to_f
<ruboto> Radar # => 3.59 (https://eval.in/397394)
zacstewart has quit [Ping timeout: 256 seconds]
<Radar> Maybe you don't want the kind of rounding that you found firsdt?
<sevenseacat> or just round(2)
<Oog> good question - its like gas prices 3.599 - i actually dont knwo if gas stations round or not
jamesaxl has quit [Remote host closed the connection]
<sevenseacat> i dont know why you would ever want 3.59 from 3.59999999
<Aeyrix> They round up.
<Oog> yeah i guess ill round up lol
<Aeyrix> >> "%3.3f" % 3.14159265358
<ruboto> Aeyrix # => "3.142" (https://eval.in/397395)
GriffinHeart has joined #ruby
tagrudev has joined #ruby
arooni-mobile has quit [Ping timeout: 248 seconds]
arooni-mobile__ has quit [Ping timeout: 248 seconds]
xkickflip has joined #ruby
astrobun_ has joined #ruby
<Oog> all good with rounding thanks
surs4 has joined #ruby
yardenbar has joined #ruby
<jesterfraud> good to see we're all helpful round here
surs3 has quit [Ping timeout: 265 seconds]
icebourg has quit []
* sevenseacat pokes sarcasm detector
revath has joined #ruby
<sevenseacat> not sure if faulty
<jesterfraud> less sarcastic, more fun
<jesterfraud> * pun
<sevenseacat> :)
eggoez has quit [Ping timeout: 252 seconds]
timonv has joined #ruby
djbkd has joined #ruby
shock_one has quit [Remote host closed the connection]
shock_one has joined #ruby
matp has quit [Ping timeout: 250 seconds]
Gadgetoid has quit [Ping timeout: 252 seconds]
howdoi has joined #ruby
jpfuentes2 has joined #ruby
djbkd has quit [Ping timeout: 256 seconds]
eggoez has joined #ruby
revath has quit [Read error: Connection reset by peer]
revath has joined #ruby
MarkTurner has joined #ruby
MarkTurner has quit [Remote host closed the connection]
MarkTurner has joined #ruby
slucx has joined #ruby
araujo_ has quit [Quit: Leaving]
KrzaQ has quit [Quit: :(]
araujo has joined #ruby
araujo has joined #ruby
KrzaQ has joined #ruby
Scroff has joined #ruby
charliesome has quit [Quit: zzz]
zacstewart has joined #ruby
krz has joined #ruby
theery has joined #ruby
djbkd has joined #ruby
revath has quit [Ping timeout: 256 seconds]
codecop has joined #ruby
t0rrieri__ has quit [Quit: Be back later ...]
bluOxigen has joined #ruby
<certainty> moin
dopieee has joined #ruby
fabrice31 has joined #ruby
timonv has quit [Ping timeout: 250 seconds]
oo_ has quit [Remote host closed the connection]
oo_ has joined #ruby
philtr_ has quit [Remote host closed the connection]
sweeper has quit [Read error: Connection reset by peer]
fumihiro has quit [Quit: leaving]
dopie has quit [Ping timeout: 273 seconds]
stan has joined #ruby
olistik has joined #ruby
havenwood has quit [Ping timeout: 256 seconds]
aryaching has quit [Ping timeout: 244 seconds]
weemsledeux has quit [Quit: Textual IRC Client: www.textualapp.com]
atomi has joined #ruby
fabrice31 has quit [Ping timeout: 246 seconds]
Scroff has quit [Ping timeout: 244 seconds]
yh has joined #ruby
davedev24 has quit [Remote host closed the connection]
olistik has quit [Remote host closed the connection]
shock_one has quit [Remote host closed the connection]
lessless has quit [Read error: Connection reset by peer]
yh has quit [Ping timeout: 248 seconds]
leat has joined #ruby
krz has quit [Quit: WeeChat 1.0.1]
revath has joined #ruby
revath has left #ruby [#ruby]
ndrei has joined #ruby
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<leat> can anyone help with oop? (:
<certainty> *shrug*
aryaching has joined #ruby
<leat> okay, here is the question: how do you access core classes from a subclass? is it passible at all?
skade has joined #ruby
<certainty> what is a core class?
<certainty> a class of ruby core?
<leat> yeah, yeah
_blizzy_ has joined #ruby
<certainty> what does access mean?
<leat> e.g. I'm trying to use File.exist inside a class and I get the nil error
<sevenseacat> code?
<certainty> ok, so generally this is not a problem so you must be doing something weired. Show us the code please
msgodf has joined #ruby
_blizzy_ has quit [Ping timeout: 248 seconds]
theery has quit [Remote host closed the connection]
surs4 has quit [Read error: Connection reset by peer]
<leat> something like this https://bpaste.net/show/104e69c7dd88
riotjones has joined #ruby
<leat> I see I'm doing something wrong
blue_deref has quit [Quit: bbn]
<leat> but how do I do it right?
<certainty> leat: alright, you have to make clear that you mean the ruby's file class. ::File.exist?
surs1 has joined #ruby
<certainty> the problem is that the scope you're looking up the File constant has a different one from the core, but they share the name
fumihiro has joined #ruby
<certainty> hmm that was not helping i guess. Can someone please rephrase this xD
frem has quit [Quit: Connection closed for inactivity]
pwnz0r has quit [Remote host closed the connection]
<leat> aw, it works now
Oog has quit [Remote host closed the connection]
Gadgetoid has joined #ruby
pwnz0r has joined #ruby
<leat> where can I read up on this ::?
GriffinHeart has quit [Remote host closed the connection]
<certainty> in the pickaxe for example.
<certainty> That's the scope operator
<nofxx> leat, module A; module B == A::B
<nofxx> B is inside A... that error you had you fixed with ::File ?
zacstewart has quit [Ping timeout: 255 seconds]
hinbody has joined #ruby
fumihiro has quit [Client Quit]
fumihiro has joined #ruby
<leat> thanks everyone who helped! (:
Soda has joined #ruby
<toretore> ::File just means you mean the File constant in the top-level scope
<toretore> otherwise, if you have another File constant in a closer scope, it will use that
pwnz0r has quit [Ping timeout: 244 seconds]
abuzze has joined #ruby
_ht has joined #ruby
skade has quit [Read error: Connection reset by peer]
oo_ has quit [Remote host closed the connection]
skade has joined #ruby
amclain has quit [Quit: Leaving]
ryez has joined #ruby
abuzze has quit [Ping timeout: 250 seconds]
surs1 has quit [Ping timeout: 265 seconds]
skade has quit [Read error: Connection reset by peer]
fumihiro has quit [Quit: leaving]
oo_ has joined #ruby
Pupeno has joined #ruby
surs1 has joined #ruby
Emaker has joined #ruby
PaulCape_ has quit [Quit: .]
skade has joined #ruby
Pupeno_ has joined #ruby
abuzze has joined #ruby
aryaching has quit [Ping timeout: 250 seconds]
PaulCapestany has joined #ruby
thiagovsk has quit [Quit: Connection closed for inactivity]
aryaching has joined #ruby
tmtwd has quit [Remote host closed the connection]
fullofcaffeine has joined #ruby
GriffinHeart has joined #ruby
Pupeno has quit [Ping timeout: 256 seconds]
Musashi007 has joined #ruby
njection has joined #ruby
djbkd_ has joined #ruby
skade has quit [Read error: Connection reset by peer]
Musashi007 has quit [Client Quit]
fullofcaffeine has quit [Ping timeout: 264 seconds]
baweaver has quit [Remote host closed the connection]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
khebbie has joined #ruby
surs1 has quit [Ping timeout: 248 seconds]
surs1 has joined #ruby
djbkd_ has quit [Ping timeout: 248 seconds]
dopieee has quit [Quit: This computer has gone to sleep]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
skade has joined #ruby
baweaver_ has joined #ruby
dgutierrez1287 has joined #ruby
lxsameer has joined #ruby
lxsameer has joined #ruby
bosma has quit [Read error: Connection reset by peer]
bosma has joined #ruby
gagrio has quit [Remote host closed the connection]
wprice has joined #ruby
skade has quit [Client Quit]
MarkTurner has quit [Ping timeout: 256 seconds]
zacstewart has joined #ruby
gagrio has joined #ruby
arquebus has joined #ruby
gnudon` has quit [Ping timeout: 264 seconds]
eGGsha has joined #ruby
ohaibbq has quit [Quit: Leaving...]
fullofcaffeine has joined #ruby
dgutierrez1287 has quit [Ping timeout: 264 seconds]
dumdedum has joined #ruby
scripore has joined #ruby
MarkTurner has joined #ruby
yfeldblum has quit [Ping timeout: 264 seconds]
ndrei has quit [Ping timeout: 255 seconds]
arup_r has joined #ruby
Scroff has joined #ruby
gix has quit [Ping timeout: 255 seconds]
MarkTurner has quit [Quit: This is probably a wireless dropout]
MarkTurner has joined #ruby
toretore has quit [Quit: This computer has gone to sleep]
niemcu has joined #ruby
fumihiro has joined #ruby
djbkd_ has joined #ruby
Scroff has quit [Ping timeout: 264 seconds]
khebbie_ has joined #ruby
Soda has quit [Remote host closed the connection]
AlphaAtom has joined #ruby
keen__________17 has joined #ruby
dfockler has joined #ruby
astrobun_ has quit [Remote host closed the connection]
roolo has quit [Remote host closed the connection]
MarkTurner has quit [Quit: This is probably a wireless dropout]
MarkTurner has joined #ruby
khebbie has quit [Ping timeout: 250 seconds]
keen__________16 has quit [Ping timeout: 256 seconds]
ruby-lang166 has joined #ruby
foooobear has joined #ruby
ruby-lang166 has left #ruby [#ruby]
dfockler has quit [Ping timeout: 256 seconds]
astrobun_ has joined #ruby
zacstewart has quit [Ping timeout: 252 seconds]
edwinvdg_ has quit [Remote host closed the connection]
Scroff has joined #ruby
arquebus has quit [Quit: konversation disconnects]
aryaching has quit [Ping timeout: 250 seconds]
revath has joined #ruby
haxrbyte has joined #ruby
MarkTurner has quit [Quit: This is probably a wireless dropout]
revath has quit [Read error: Connection reset by peer]
revath has joined #ruby
MarkTurner has joined #ruby
GriffinHeart has quit [Remote host closed the connection]
fullofcaffeine has quit [Remote host closed the connection]
allcentury has joined #ruby
GitGud is now known as CumehameHa
Musashi007 has joined #ruby
Burgestrand has joined #ruby
CumehameHa is now known as GitGod
RegulationD has joined #ruby
MarkTurner has quit [Ping timeout: 256 seconds]
solars has joined #ruby
tesuji has joined #ruby
bruno- has joined #ruby
lotherk has quit [Quit: leaving]
allcentury has quit [Ping timeout: 244 seconds]
lotherk has joined #ruby
<saadq> Is it seen as bad practice to explicitly declare `return` statements in Ruby?
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<sevenseacat> if they're un-necessary, then yeah
Timba-as has joined #ruby
lotherk has quit [Client Quit]
RegulationD has quit [Ping timeout: 244 seconds]
Pupeno_ has quit [Remote host closed the connection]
aspiers has joined #ruby
<apeiros> saadq: it's not bad practice but bad style
<apeiros> or disliked style
lotherk has joined #ruby
<saadq> I kind of liked what the first answer was talking about, but I don't really want to go against standard conventions in style
<apeiros> and when you have to use a return statement, then you've got an indicator for spaghetti
* sevenseacat downvotes top answer
GriffinHeart has joined #ruby
<saadq> :p
bruno- has quit [Ping timeout: 256 seconds]
* apeiros too
<apeiros> you don't write code for people who don't know the language.
<apeiros> that's silly and no other language does it either.
otzeloot has joined #ruby
otzeloot has left #ruby [#ruby]
jimmythe1at has joined #ruby
<apeiros> "let's not use >@> in haskell! it's not obvious to people who don't know haskell!"
<sevenseacat> (is that actually a haskell thing?)
<heftig> foo = (hash[bar] ||= baz)
<adaedra> Hello
<heftig> i surprisingly often forget [] ||= is possible
<apeiros> sevenseacat: yupp
<sevenseacat> nice :D
<sevenseacat> but yeah, ruby has perhaps the strongest style conventions out of any language I've worked with - is silly to flaunt those for the fun of it
* apeiros added a comment
jimmythehat has quit [Ping timeout: 244 seconds]
<pontiki> two clients ago, their style *required* returns
<apeiros> pontiki: that's fine
<pontiki> fine
<apeiros> *if* there is a styleguide, follow it. doesn't matter if it collides with your personal preferences. consistent style trumps personal preference.
<pontiki> F.I.N.E
yh has joined #ruby
<pontiki> in every case
<apeiros> weeeeeelll…
<apeiros> :D
<pontiki> well, they sign the checks
<apeiros> nah, when I can, I'll convince people of my style preferences
jenrzzz has joined #ruby
<apeiros> but if I fail, I go with the project's style
<pontiki> i did get them to give up on enforcing single quotes
blackmes1 has joined #ruby
zacstewart has joined #ruby
Pupeno has joined #ruby
Pupeno has joined #ruby
* apeiros uses heredocs for all string literals
<apeiros> j/k
<maloik> I quite like single quotes
<pontiki> you rebel
<maloik> it shows the intention of the string right away
<sevenseacat> i always use double quotes, because I find no-one else is consistent with them so I don't really care about following convention
<apeiros> I stopped using single quotes and use either " or %{}
<pontiki> i quite like using translation tokens.
<pontiki> they show the purpose of the string
<apeiros> what's a translation token?
<sevenseacat> its completely common in every codebase I've ever seen to use single quotes on one line and double quotes on the next, for no reason
arturaz has joined #ruby
<pontiki> generally symbol, or a string of dotted words
<apeiros> require "foo"; require 'bar' # yepp, to my shame, seen in my own code
white_bear has joined #ruby
yh has quit [Ping timeout: 244 seconds]
<pontiki> TAM: when you're shoulder surfing over the lead dev's shoulder and they're trying to figure out why '#{var} ..' isn't working
luriv_ has quit [Ping timeout: 256 seconds]
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Hounddog has joined #ruby
<ljarvis> oO
<ljarvis> "lead dev"
<apeiros> urban dict says: "Tam: extremely hot chick who is an animal in the sack and gives you a throbbing cock"
<apeiros> I'm now very confused as to what you said…
<pontiki> yikes
<maloik> I've found the same thing
<maloik> :D
<pontiki> that awkward moment
<maloik> looked it up as well
<maloik> right
jackjackdripper has joined #ruby
<pontiki> now i am super embarassed
jackjackdripper has quit [Client Quit]
vali has joined #ruby
<pontiki> and i may now be pretty pissed off, too
<vali> hi guys
<maloik> blame urban dictionary though
<maloik> that thing goes for the filthiest explanations first
baweaver_ has quit [Read error: Connection reset by peer]
<apeiros> so what does TAM mean?
<maloik> 13.09:57:08 < pontiki> that awkward moment
<maloik> :-)
<apeiros> aaah
Musashi007 has quit [Quit: Musashi007]
<sevenseacat> apeiros: thats the last thing I expected from you >_>
<apeiros> sevenseacat: that I didn't know TAM or that I use urban dict?
<vali> I'm trying to deploy some dnssec monitoring using the following plugin (https://github.com/opendnssec/dnssec-monitor). The problem is that I'm getting the following error -> (nagios_dnssec.rb:101:in `process_log': undefined method `each' for #<String:0x00000001b54bf8> (NoMethodError))
* sevenseacat is sitting here giggling
oo_ has quit [Remote host closed the connection]
<vali> using ruby 2.1.5p273 (2014-11-13) [x86_64-linux-gnu]
<apeiros> UD is relatively good at slang. for technical acronyms I use acronymfinder.com
<maloik> ?code vali
<ruboto> vali, We can't help you without your code, please post it to https://gist.github.com
<apeiros> but maloik is right. UD goes for the filthies explanation first :-/
<apeiros> +t
Emaker has quit []
<apeiros> pontiki: how does somebody become lead dev if they don't even know that? o0
aspiers has quit [Ping timeout: 256 seconds]
<apeiros> I can understand lead architect (still bad… at least if they don't at least code in a similar language), but lead dev?
<vali> maloik: it seems that the problem is related to ruby2.1, the code works ok on ruby1.8
<maloik> maybe they know why, but just didn't spot it right away
<apeiros> vali: 1.8 had String#each
djbkd_ has quit [Remote host closed the connection]
<apeiros> vali: 1.9+ no longer does. use String#each_line
oo_ has joined #ruby
<vali> apeiros: aaa, ok
<apeiros> (since that's what String#each in 1.8 did)
<vali> so, could I replace the method by some chance and work ?
<apeiros> o0
<apeiros> I don't understand what you mean "by some chance"
ndrei has joined #ruby
<vali> :)
<apeiros> you can just replace .each with .each_line, if the receiver is always a string. no chance involved.
<vali> If try to use the new method is it going to work ?
<vali> ok
<pontiki> apeiros: it's not that they didn't know it
<vali> than it should be ok
aspiers has joined #ruby
<vali> I'm going to try it in a min
<apeiros> pontiki: they didn't spot it?
jesterfraud has quit [Quit: Textual IRC Client: www.textualapp.com]
<pontiki> apeiros: more that, yeah
<apeiros> ah well…
* apeiros wonders what embarrassing mistakes he made during his lifetime
<pontiki> apeiros: but the awkward moment, do i point it out? in front of a room of devs?
<apeiros> pontiki: learn sign language
<adaedra> that can be useful
eGGsha has joined #ruby
<pontiki> i did finally lean in and say 'single quotes don't interpo..' "OH SHIT"
<pontiki> only if there's a recipient
<apeiros> poking is universally understood :)
<pontiki> i am not a physical person
<pontiki> you poke me i might scream
<apeiros> then just phrase it well
oo_ has quit [Remote host closed the connection]
* adaedra pokes pontiki
<apeiros> "oh, somebody used a single quote there, should be a double quote"
<pontiki> i thought i did
oo_ has joined #ruby
<apeiros> (probably still badly phrased - it's monday morning…)
<apeiros> and I think I should start to work :D
allomov has joined #ruby
<vali> apeiros: https://github.com/opendnssec/dnssec-monitor/blob/master/lib/nagios_dnssec.rb, replace each with each_line and it'S complaining that it cannot find method each_line.
bigkevmcd has joined #ruby
konsolebox has joined #ruby
<maloik> did you correctly go back to 2.1?
olistik has joined #ruby
<zenspider> vali: what is complaining? does it say the type or inspect it?
<apeiros> vali: "it'S complaining that it cannot find method each_line" is not useful
<apeiros> vali: gist the precise exception you get.
<vali> ok
<vali> one min
acke has joined #ruby
<zenspider> output is an array
<vali> zenspider: true
<apeiros> vali: 10:02 apeiros: you can just replace .each with .each_line, ****if the receiver is always a string*****. no chance involved.
<apeiros> emphasis added
<vali> :)
anisha has joined #ruby
<vali> ok, how can I make this work with rb2.1?
<vali> I don't want to downgrade just to use this script
<apeiros> did you just blindly replace all .each'es with .each_line?
matp has joined #ruby
<vali> yep, the noob way
<apeiros> because that seriously makes no sense and is totally not what I suggested.
aspiers has quit [Ping timeout: 250 seconds]
<vali> but I see I can do only the process_log
* apeiros sobs
<vali> and that should be a string all the time
<zenspider> there's only 2 each calls in that file
<apeiros> how you can make it work: read the code. understand where you'll have a string and call .each on it.
<zenspider> only one is relevant
<apeiros> replace *ONLY THOSE PLACES* with .each_line
<zenspider> and ONLY if it is always a string, which it isn't
fabrice31 has joined #ruby
<zenspider> so make it ALWAYS be an array
<zenspider> do something like: output = output.lines if output.is_a? String
<zenspider> (array or enumerable)
marr has joined #ruby
* apeiros prefers to put the onus to normalize on the caller
<zenspider> agreed
oo_ has quit [Remote host closed the connection]
<vali> zenspider: thank you for the hints, I'll assign some brain power to it. :)
<zenspider> thinking always helps. :P
lessless has joined #ruby
noname1 has joined #ruby
<vali> apeiros: thank you also for the help :)
fabrice31 has quit [Ping timeout: 265 seconds]
nahtnam has quit [Quit: Connection closed for inactivity]
LMity has joined #ruby
yardenbar has quit [Ping timeout: 248 seconds]
jenrzzz has quit [Ping timeout: 248 seconds]
astrobun_ has quit [Remote host closed the connection]
blackmes1 has quit [Quit: WeeChat 1.2]
blackmesa has joined #ruby
zacstewart has quit [Ping timeout: 248 seconds]
Musashi007 has joined #ruby
astrobun_ has joined #ruby
olistik has quit [Remote host closed the connection]
khebbie_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
_blizzy_ has joined #ruby
oo_ has joined #ruby
TheHodge has joined #ruby
chinmay_dd has joined #ruby
khebbie has joined #ruby
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Igorshp has joined #ruby
<Stratege_> can someone recommend a good tutorial for ruby? Or something of the like?
Stratege_ is now known as Stratege
bayed has joined #ruby
<apeiros> should probably add codeacademy
Zai00 has joined #ruby
_blizzy_ has quit [Read error: Connection reset by peer]
rdark has joined #ruby
revath has quit [Ping timeout: 246 seconds]
revath has joined #ruby
_blizzy_ has joined #ruby
Igorshp has quit [Remote host closed the connection]
oo_ has quit [Remote host closed the connection]
oo_ has joined #ruby
yardenbar has joined #ruby
oo_ has quit [Remote host closed the connection]
oo_ has joined #ruby
kj__ has joined #ruby
yfeldblum has joined #ruby
oo_ has quit [Client Quit]
LMity has quit [Ping timeout: 248 seconds]
revath1 has joined #ruby
<Stratege> apeiros thanks
revath has quit [Ping timeout: 256 seconds]
kj__ has quit [Ping timeout: 246 seconds]
lkba has quit [Ping timeout: 256 seconds]
haxrbyte_ has joined #ruby
<adaedra> apeiros: do a PR
<adaedra> :p
quazimodo has quit [Ping timeout: 252 seconds]
<apeiros> adaedra: I already added it
<apeiros> q:
quazimod1 has quit [Ping timeout: 252 seconds]
<adaedra> how did you do this reverse p
lapide_viridi has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
<apeiros> lol
einarj has joined #ruby
haxrbyte has quit [Ping timeout: 256 seconds]
<apeiros> unicode!
<maloik> Anyone here have some recommendations for api design documents/guidelines etc? Preferably
<apeiros> MIRROR_HORIZONTALLY_CHARACTER
<maloik> Preferably no books (for now, due to lack of time)
sevenseacat has quit [Quit: Me dun like you no more.]
<maloik> I've found https://github.com/interagent/http-api-design which has been helpful so far
arup_r has quit [Remote host closed the connection]
<apeiros> maloik: API as in JSON/REST API?
<maloik> yes
<apeiros> check steveklabnik's work
<apeiros> should be full of stuff wrt JSON/REST
<maloik> yes! I forgot about that
platzhirsch has joined #ruby
zacstewart has joined #ruby
george2 has quit [K-Lined]
sebbers_ has joined #ruby
Soda has joined #ruby
matcouto has joined #ruby
Feyn has joined #ruby
SylarRuby has quit [Remote host closed the connection]
<sebbers_> Can someone offer me advice on whether I should use Interfaces for this challenge or not? https://gist.github.com/anonymous/03ab2950cbbe9db17d70
<ljarvis> sebbers_: wrong channel
platzhirsch has quit [Ping timeout: 246 seconds]
dseitz has joined #ruby
arturmartins has joined #ruby
joonty has joined #ruby
SylarRuby has joined #ruby
shock_one has joined #ruby
mercwithamouth has joined #ruby
<flughafen> moin shevy certainty
auzty has joined #ruby
SylarRuby has quit [Remote host closed the connection]
jottr has joined #ruby
<yorickpeterse> morning
tomphp has joined #ruby
<apeiros> I would use an AbstractInterfaceFactory
<ljarvis> dont get that confused with an AbstractInterfaceFactoryBean
Igorshp has joined #ruby
baweaver has joined #ruby
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Igorshp has quit [Remote host closed the connection]
[k- has joined #ruby
platzhirsch has joined #ruby
platzhirsch has left #ruby [#ruby]
<[k-> Ox0dea existence confirmed
mercwithamouth has quit [Ping timeout: 252 seconds]
quimrstorres has joined #ruby
quimrstorres has quit [Remote host closed the connection]
revath1 has left #ruby [#ruby]
zacstewart has quit [Ping timeout: 246 seconds]
baweaver has quit [Ping timeout: 244 seconds]
edwinvdgraaf has joined #ruby
<TheBrayn> what's the standard way of reading a file if it exists? should I check with File.exist? and then read it or try to read it and then catch an exception?
<adaedra> check first
<[k-> if you want to be really sure, both ways
<adaedra> meh
quimrstorres has joined #ruby
<ljarvis> I would just try to read it, unless there's some other logic you'd need if the file did or did not exist (i.e create it)
<[k-> that is for critical apps, where errors are death
<[k-> but you wouldn't be writing critical apps in Ruby
<ljarvis> what?
<[k-> as in doing both
<ljarvis> why wouldn't you write critical apps in Ruby?
ryez has quit [Quit: Page closed]
<yorickpeterse> Yeah, you should be using Node.js for that
<maloik> it's not webscale
<maloik> duh...
<adaedra> webscale?
<maloik> before you turn this into a serious discussion, I was trolling :-) sorry
<adaedra> If /dev/null is webscale, I will use it
Scrofff has joined #ruby
serivich has joined #ruby
<ljarvis> you just need to fork the shards
olistik has joined #ruby
Brainling has quit [Quit: Leaving]
Brainling has joined #ruby
Scroff has quit [Ping timeout: 240 seconds]
startupality has joined #ruby
<yorickpeterse> That makes no sense
<yorickpeterse> You're not supposed to fork, you're supposed to be running a cluster from the start
<ljarvis> but if you forked the cluster you would have more shards
<maloik> that's premature scaling, you're not doing lean startup right
<adaedra> > webscale
sepp2k has joined #ruby
<adaedra> > sense
<ljarvis> needs more agile
tomphp has quit [Max SendQ exceeded]
Igorshp has joined #ruby
<yorickpeterse> I hear the terms "agile" and "lean" pretty much on a weekly basis here at the office
olistik has quit [Remote host closed the connection]
<yorickpeterse> "We have to do things the lean and agile way"
<yorickpeterse> "the what?"
Brainling has quit [Read error: Connection reset by peer]
<yorickpeterse> Unless it actually involves people doing backflips and what not it's not agile
<ljarvis> everyone in my office would lol all over the place if I said something like that
xkickflip has quit [Quit: xkickflip]
<yorickpeterse> did they not jump aboard the agile hype train?
<yorickpeterse> (hhehehehe)
<ljarvis> heuheuheu
xkickflip has joined #ruby
<adaedra> yorickpeterse: you need to invent a new buzzword and try to make them use it
arup_r has joined #ruby
<yorickpeterse> peterscale
<[k-> the Big O Scalation
<[k-> :>
<yorickpeterse> It has a scaling factor of P(Y)
<yorickpeterse> or Y(P)
<yorickpeterse> might be better
<yorickpeterse> or Y(log P)
<ljarvis> but is the app supersynchronous?
<maloik> why peter? (my mind immediately jumped to family guy)
<maloik> oh.
<maloik> ignore me
<ljarvis> ...
* ljarvis hands maloik some coffee
<adaedra> it's okay, it's monday
<maloik> there's so many letters in his name, I never make it past "yor"
<yorickpeterse> and my spin on agile would be Yagile
<maloik> it's been a long weekend
<yorickpeterse> you're just getting old
lkba has joined #ruby
<ljarvis> ^
<maloik> well sure, but I'm also fitter than I have ever been :D
<ljarvis> you'll gain a few more years after arrrcamp too
<ljarvis> +r
<adaedra> tbh, I read it with the e and r switched, yorickpetrese
<maloik> actually, I think I may take a break from organizing
<maloik> and I have a feeling the others might too
xkickflip has quit [Client Quit]
<[k-> yorickpeter-erse
<yorickpeterse> adaedra: that sounds incredibly feminine
<yorickpeterse> I like it
<ljarvis> you going to brighton, maloik?
xkickflip has joined #ruby
<maloik> nah, tomorrow is my last day at work, holiday time
<ljarvis> noice
GriffinHeart has quit [Remote host closed the connection]
CloCkWeRX has joined #ruby
CloCkWeRX has left #ruby [#ruby]
<maloik> I think my only conf until the end of the year may be rocketconf in amsterdam
scripore has quit [Quit: This computer has gone to sleep]
<yorickpeterse> rocketconf?
<yorickpeterse> man these conf names
<maloik> I know right
<maloik> they do have an astronaut in the lineup though
<maloik> so it's acceptable
<yorickpeterse> also why are all these conferences in November
codecop has quit [Remote host closed the connection]
<ljarvis> this year i will have gone to zero confs :/
dgutierrez1287 has joined #ruby
<yorickpeterse> wait, they have Kuipers?
<maloik> it's not too late to get an arrrrrcamp ticket :D
<yorickpeterse> That's both really cool and really out of places
<ljarvis> actually i went to a Google thing but it doesn't count
<yorickpeterse> * place
<adaedra> ljarvis: to zeroconf?
<maloik> I'll get you an early bird if you want
<ljarvis> maloik: yeah I can't really afford it with the house purchase :(
<yorickpeterse> you bought a house?
<ljarvis> I did
<yorickpeterse> So lets see the checklist:
<yorickpeterse> [x] got married
<yorickpeterse> [x] got house
<yorickpeterse> [ ] got a kid
<ljarvis> no no, got engaged
<yorickpeterse> [ ] got a dog
<ljarvis> still not married yet
<yorickpeterse> oh
<yorickpeterse> well close enough
<ljarvis> that's next year prolly
<yorickpeterse> might as well buy a motor bike while you still can
<ljarvis> :D
<adaedra> [ ] eat the dog
eGGsha has joined #ruby
<yorickpeterse> :<
<adaedra> [ ] eat the kid
<ljarvis> why am i eating everything
<yorickpeterse> not sure if baby fat is tasty
<adaedra> because you're hungry
devbug has quit [Ping timeout: 256 seconds]
RegulationD has joined #ruby
<yorickpeterse> shit that reminds me, I still need to submit a talk to RubyConf
<yorickpeterse> Yorick On Tour 2015
<adaedra> Tour de Ruby
dgutierrez1287 has quit [Ping timeout: 256 seconds]
tomphp has joined #ruby
noname1 has quit [Read error: Connection reset by peer]
<yorickpeterse> "Gender Identity"
<yorickpeterse> oooh I'm so filling that in with Airplane
<yorickpeterse> "Ethnicity" hmmm
<yorickpeterse> I'll go with "White and sexy"
<yorickpeterse> How to not get accepted
<yorickpeterse> in 2 easy steps
bodgix_wrk has joined #ruby
RegulationD has quit [Ping timeout: 255 seconds]
tomphp has quit [Max SendQ exceeded]
haneen has quit [Read error: Connection reset by peer]
haneen has joined #ruby
tomphp has joined #ruby
krz has joined #ruby
<apeiros> yorickpeterse: isn't the answer to all those questions "Oga"?
<maloik> ljarvis: loco2 can't sponsor? :(
<ljarvis> maloik: I've used my conf budget (I think, I need to check)
<yorickpeterse> apeiros: ha
<yorickpeterse> "Bio: Oga"
<maloik> but but but, you did 0 confs? :D
astrobun_ has quit [Remote host closed the connection]
<ljarvis> maloik: it didn't reset in jan :(
<yorickpeterse> I too already blew my budget on FOSDEM
<maloik> aha gotcha
<yorickpeterse> so I'm just going to apply everywhere as a speaker so I can get free tickets
<yorickpeterse> HoboConf 2015
<yorickpeterse> I really want a conference that's just 1 day, single track and only puns
<ljarvis> yoriconf
<yorickpeterse> so basically tenderlove giving all the talks
duderonomy has quit []
<maloik> your "white and sexy" line reminded me of aziz ansari
<yorickpeterse> maloik: who?
<maloik> the guy from Parks & Recreations (Tom Haverford), also a standup comedian
<yorickpeterse> oh that one
<maloik> started watching a show of his last night, pretty good stuff
<yorickpeterse> well he's not white though
<maloik> I know, but it's the kind of joke he'd make :D
meph has joined #ruby
<yorickpeterse> there's this one episode where he borrows Ron's racoon hat and tries to seduce women with it
<yorickpeterse> needless to say it doesn't work
<maloik> hahaha :D and then ron puts it on for one second and gets a compliment
<yorickpeterse> https://www.youtube.com/watch?v=foNxKbp9lOM here it is at 15 fps
<maloik> oh shit that was quick
<maloik> "my friend over here was digging through your trash"
<maloik> :D
slucx has quit [Ping timeout: 256 seconds]
sebbers_ has quit [Remote host closed the connection]
mduk has quit [Quit: WeeChat 0.3.7]
oo_ has joined #ruby
serivich has quit [Ping timeout: 264 seconds]
<yorickpeterse> "There's a racoon on my head, he knows how to *****"
platzhirsch has joined #ruby
<DefV> Hmz
tmtwd has joined #ruby
leat has quit [Remote host closed the connection]
leat has joined #ruby
<DefV> I love him in his P&R role, but don't like his show. ALSO: #ruby-offtopici
<DefV> I love him in his P&R role, but don't like his show. ALSO: #ruby-offtopic
<DefV> wow, this doesn't work like slack does :-)
bluOxigen has quit [Read error: No route to host]
withnale_ has joined #ruby
bluOxigen has joined #ruby
<adaedra> yeah, irc's not slack.
<ljarvis> i dunno, i see lots of slacking
<adaedra> :D
<DefV> It's become a habit that I can't seem to shake
<DefV> write smth with typo
<DefV> pointer up
<DefV> change
<DefV> enter
tvw has joined #ruby
VictorBjelkholm has joined #ruby
haraoka has quit [Ping timeout: 255 seconds]
Hounddog has quit [Read error: Connection reset by peer]
haxrbyte_ has quit [Ping timeout: 256 seconds]
Pathfinder has joined #ruby
txdv_ has joined #ruby
<txdv_> arr
poguez_ has quit [Quit: Connection closed for inactivity]
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Papierkorb has joined #ruby
shredding has joined #ruby
lkba_ has joined #ruby
surs2 has joined #ruby
Tritone has joined #ruby
surs1 has quit [Ping timeout: 252 seconds]
lkba has quit [Ping timeout: 256 seconds]
zacstewart has joined #ruby
nfk has joined #ruby
rfish2 has quit [Ping timeout: 264 seconds]
eGGsha has joined #ruby
oo_ has quit [Remote host closed the connection]
n008f4g_ has joined #ruby
ndrei has quit [Ping timeout: 255 seconds]
zacstewart has quit [Ping timeout: 246 seconds]
konsolebox has quit [Quit: Leaving]
<arup_r> As Array#compact don't remove empty string objects like "" .. I am using my own `[popular.state, popular.country].tap { |o| o.delete("") }.join(", ")` ... I am on Rails platform.. But I didn't find there also any helper.. What you guys use to do the same ?
ndrei has joined #ruby
<yorickpeterse> If you're using Rails you can probably do `[....].reject(&:blank?)`
haxrbyte has joined #ruby
koos303 has joined #ruby
serivich has joined #ruby
<jhass> or .select(&:present?) for some less negation
shredding has quit [Remote host closed the connection]
serivich has quit [Read error: Connection reset by peer]
shredding has joined #ruby
beef-wellington has joined #ruby
<jhass> but this really is a #RubyOnRails question
haxrbyte_ has joined #ruby
<arup_r> jhass: humm.. But more Rubyish
<arup_r> nothing specific to core Rails :)
<arup_r> yorickpeterse: didn't recall that..
xkef has joined #ruby
<arup_r> thanks to both of you
<yorickpeterse> for Ruby itself you'd need something like `[...].reject { |x| x.nil? || x.empty? }`
craysiii has quit [Quit: craysiii]
fabrice31 has joined #ruby
haxrbyte has quit [Ping timeout: 264 seconds]
oo_ has joined #ruby
<gregf_> arup_r: a state would always have a country :/
beef-wellington has quit [Ping timeout: 248 seconds]
<arup_r> gregf_: yes.. from UI we have a way to make it blank also.. The requirement is only US country need state(required).. for rest optional.. and that is causing problem :)
<arup_r> so managing it in presentation layer
<yorickpeterse> Just call it province already, darn Americanos thinking it's always called a state
<yorickpeterse> pet peeve: apps using "ZIP code" instead of "Postal code"
<adaedra> code.zip
<apeiros> d'oh
fabrice31 has quit [Ping timeout: 272 seconds]
* apeiros guilty of using zip code instead of postal code
<adaedra> that maybe why swiss post is so slow, they look for the wrong kind of code.
<adaedra> :p
auzty has quit [Quit: Leaving]
<apeiros> swiss post actually corrected their postal code file upon my feedback :D
<adaedra> cool
jaygen has joined #ruby
PpPyg has joined #ruby
Rickmasta has joined #ruby
<apeiros> I'm split on it. it's cool I found the broken data and they fixed it. it's not cool that data was broken in the first place.
<adaedra> now, fix all the other broken things
<ddv> postal_code ftw
jaygen_ has quit [Ping timeout: 264 seconds]
<neanias> apeiros: things slip through the net sometimes :P
jottr has quit [Ping timeout: 264 seconds]
knu has quit [Remote host closed the connection]
SylarRuby has joined #ruby
xkef_ has joined #ruby
xkef has quit [Ping timeout: 255 seconds]
zacstewart has joined #ruby
knu has joined #ruby
yardenbar has quit [Remote host closed the connection]
CatMartyn has joined #ruby
Blaguvest has joined #ruby
CatMartyn has quit [Max SendQ exceeded]
tmtwd has quit [Ping timeout: 256 seconds]
khebbie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
saadq has quit []
pwnz0r has joined #ruby
joshmyers has joined #ruby
<waxjar> What would be a nice interface to update a list of integers over an HTTP API? I can think two options: 1) a single endpoint that accepts some sort of delta object (POST /list?add=1,2&del=3,4) or 2) multiple endpoints for each action (POST /list/add?ids=1,2 and POST /list/del?ids=1,2). Is there a standard way to do this (or something a bit nicer perhaps)?
<joshmyers> hola, anyone know how to sudo using Net::SSH? SO posts don't seem to be cutting it.
<adaedra> waxjar: you know that there are other methods than GET and POST?
<waxjar> adaedra: yes, i am aware
jottr has joined #ruby
<waxjar> substitute POST for PATCH if you fancy ;)
<adaedra> Could be POST to add new, PATCH to replace all, DELETE to remove, or something like that
<waxjar> DELETE is meant to delete the full resource, no?
<adaedra> if you say so
pwnz0r has quit [Ping timeout: 248 seconds]
n008f4g_ has quit [Ping timeout: 246 seconds]
mos has joined #ruby
<jhass> PACTH /list with a {"ids": {"add": [], "remove": []}} payload probably makes the most sense
agent_white has joined #ruby
Musashi007 has quit [Quit: Musashi007]
nfk has quit [Remote host closed the connection]
startupality has quit [Quit: startupality]
startupality has joined #ruby
VictorBjelkholm has quit [Ping timeout: 264 seconds]
<jhass> that is if you have to save requests, of course the "true" (but inefficient) way would be POST /list with {"id": 1} (no array) and DELETE /list/1
<waxjar> yeah, this is not an option unfortutely, i need to be able to add/delete multiple IDs at a time :)
<waxjar> I'll go with the single PATCH endpoint, thx guys
jimmythe1at has quit [Ping timeout: 246 seconds]
serivich has joined #ruby
oo_ has quit [Remote host closed the connection]
<Stratege> say I got a function foo, how would I bind that function to a variable? Given that function invocation doesn't need () I'm not seeing an easy way to do so and search engines haven't been helpful
Tempesta has joined #ruby
<apeiros> Stratege: a method is always defined on an object. so you'd define the method on an object and assign that object to a variable.
<apeiros> Stratege: alternatively you use a proc object
ruby-lang709 has joined #ruby
<jhass> or describe your actual problem / show your code
<apeiros> Stratege: what are you trying to achieve? i.e. NOT your abstract goal. your concrete goal.
tuor has joined #ruby
<tuor> hi, i want to set a parameter to undef by default. I tried like this, but it's wrong (syntax error, unexpected keyword_undef): http://paste.debian.net/281881/
ruby-lang709 has quit [Client Quit]
<apeiros> tuor: there's no undef in ruby.
<jhass> tuor: you'll likely want nil
<apeiros> ^
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<tuor> apeiros, ah ok.
<Stratege> apeiros playing the ruby warrior game, decided "fuck trying to assemble clever logic" and now I'm just trying to create an array of instructions that it should go through one by one.
<adaedra> you can use method to get a callable object on which you can do .call()
<tuor> jhass, thx
<Stratege> okay, cool. thanks
<jhass> Stratege: or just use public_send and an array of symbols & parameters
<apeiros> or have an array of procs
<adaedra> if those are just method names, you can also just save the names as symbols and use send
<apeiros> adaedra: s/send/public_send/
<adaedra> the former is more useful if your method comes from different objects
<apeiros> always hone the good practices ;-)
<Stratege> hm, public_send sounds useful.
unshadow has joined #ruby
leat has quit [Remote host closed the connection]
<Stratege> a friend of mine just pointed out to me that in ruby methods are not values, is that really true?
leat has joined #ruby
<adaedra> they're not directly values as they are in some FP languages, no
<Stratege> is there a particular reason why they aren't?
<jhass> you can get an object representing one though
<adaedra> is there a particular reason why they should be? :)
olistik has joined #ruby
Zai00 has quit [Quit: Zai00]
<Stratege> adaedra yeah, because there is no fundamental difference between them.
<Stratege> it's like treating a string differently than an integer, on a fundamental level.
<adaedra> it is?
but3k4 has joined #ruby
PlasmaStar has quit [Ping timeout: 256 seconds]
Tempesta has quit [Quit: Going offline, see ya! (( www.adiirc.com )]
<Stratege> yes
oo_ has joined #ruby
surs3 has joined #ruby
<jhass> that's purely viewpoint ;)
PlasmaStar has joined #ruby
sdothum has joined #ruby
<Stratege> I am, of course, open to hearing about the benefits of treating methods as not-values.
<jhass> where you declare atomicity is arbitrary, you declare it at function level, ruby declares it at object level
meph has quit [Quit: Leaving.]
oo_ has quit [Remote host closed the connection]
<Stratege> so numbers in ruby are actually objects as well? No distinction between object types and value types?
<adaedra> yep, numbers are objects
<adaedra> >> 42.class
<ruboto> adaedra # => Fixnum (https://eval.in/397548)
<Stratege> huh, okay. Well I guess that's sorta one way to obtain consistency.
<adaedra> there's no primitives
<jhass> classes are objects too
olistik has quit [Remote host closed the connection]
surs2 has quit [Ping timeout: 246 seconds]
<Stratege> but methods aren't objects?
hinbody has quit [Quit: leaving]
CloCkWeRX has joined #ruby
<adaedra> not directly, they belong to an object
<jhass> yes, as said you can get an object representing one
<jhass> but they belong to a Class or Module instance
<adaedra> you can get an object representing one through different ways for manipulation
Zai00 has joined #ruby
<adaedra> procs are objects, too
<tuor> hi, this (http://paste.debian.net/281883/) is returning this error: `private': nil is not a symbol (TypeError)
<Stratege> well, I guess that's quite a principled way of doing OOP.
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ndrei has quit [Ping timeout: 240 seconds]
<tuor> Why?
foooobear has quit [Ping timeout: 252 seconds]
<apeiros> tuor: what's your ruby version?
<apeiros> (ruby -v)
<tuor> ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
<apeiros> too old for `private def foo`
<apeiros> in that version, def foo returns nil
<jhass> and that version is EOL, so upgrade
<apeiros> either upgrade your ruby, or use one of the other forms to mark the method as private
<apeiros> upgrading clearly preferred
<apeiros> if you're starting with ruby, there's no reason not to use the current version, 2.2.2
Zai00 has quit [Client Quit]
<ddv> lol debian has an ugly pastie
pfish has quit [Ping timeout: 246 seconds]
<adaedra> but it's stable at least
revath has joined #ruby
yardenbar has joined #ruby
<apeiros> there are unstable pastebins? o0
<ddv> apparantly....
<adaedra> debian stable joke
lessless has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<ddv> this is a serious channel adaedra
<apeiros> oh
<ddv> no jokes
<apeiros> it's monday! that's not a day for jokes!
<darkf> adaedra: I was going to make fun of arch not having one but they actually do. in french. http://pastebin.archlinux.fr/
<ddv> also im tired and cranky
shredding has quit [Ping timeout: 256 seconds]
<Stratege> I still don't see the benefit of methods requiring special treatment to be considered as objects. Something that not even php requires. What benefit does that provide?
<tuor> apeiros, I have to write it for debian wheezy ruby version. I'll use the "normal/old" way for "private"
<apeiros> Stratege: uh, what?
<adaedra> darkf: what an awful language, I wonder who even speaks it.
<apeiros> Stratege: how are methods first level objects in php?
<darkf> adaedra: Arch users! that's how they go fast, you know
<adaedra> Stratege: er, PHP has no method as values. You just store strings.
<apeiros> serious bullshit needs serious refuting…
chipotle has joined #ruby
_blizzy_ has quit [Ping timeout: 248 seconds]
<yorickpeterse> but PHP has type hinting!!!11
stnly has quit [Remote host closed the connection]
<yorickpeterse> and oh it doesn't work for scalars
eGGsha has joined #ruby
tkuchiki has quit [Remote host closed the connection]
<adaedra> they even differentiate internal functions from user functions
<adaedra> using PHP to prove your point? kek.
surs4 has joined #ruby
<ddv> lol
lessless has joined #ruby
<apeiros> adaedra: absolutely valid! "this is just as shitty as in php"
<apeiros> it's difficult to achieve that, though
<adaedra> php > function hello() { }; $a = hello;
<adaedra> PHP Notice: Use of undefined constant hello - assumed 'hello' in php shell code on line 1
<darkf> well it _is_ similar to PHP :p
<yorickpeterse> well, in Ruby that too would get you an error
<yorickpeterse> but at least it would be an error
<ddv> I feel sad for Stratege
<apeiros> Stratege: anyway - lets take a language where you actually can get at the function object without a special method call or syntax: javascript
<apeiros> Stratege: there it's like: x = some_obj.func_name
startupality has quit [Quit: startupality]
<apeiros> and you can do that because they require parens. so getting function vs. calling the function is unambiguous
startupality has joined #ruby
Zai00 has joined #ruby
surs3 has quit [Ping timeout: 255 seconds]
<apeiros> now ruby could either use special syntax to differ, e.g. reserve :: for the method object (x = obj::method_name), or it can do what it currently does: not introduce additional syntax but just provide a method
Asher has quit [Ping timeout: 248 seconds]
<apeiros> not using syntax has one big benefit: it's discoverable.
<apeiros> or rather: using methods has that benefit.
<apeiros> there are, of course, also downsides to it. but all in all it's a design decision.
Asher has joined #ruby
polyrob_ has joined #ruby
blueOxigen has joined #ruby
<darkf> apeiros: perhaps you could enlighten me as to why Ruby thinks non-existent indices/keys on arrays/hashes should be 'nil' and not an error?
yashinbasement has joined #ruby
startupality has quit [Read error: Connection reset by peer]
<adaedra> darkf: actually, they can be whatever you want to be
<apeiros> darkf: .fetch and it raises
<apeiros> darkf: it's a matter of which method you use
<apeiros> as for *why* they chose one over the other - ask the authors. I can only provide possible rationales.
<darkf> apeiros: well, most everyone is going to know about #[] which uses an IMO shitty-by-default 'return nil for default values'
<Stratege> ddv why feel sad for me?
<yashinbasement> hello rubishists , someone asked me what is the meaning of <%== %> , any idea , i have no idea
<darkf> I did not know about #fetch and it seems more heavyhanded than I'd want beyond just using #[] :/
bluOxigen has quit [Ping timeout: 255 seconds]
<adaedra> "Ton ptit nom" "Combien de temps doit-on garder ce superbe post " – Lol archlinuxfr
<canton7> yashinbasement, look up erb syntax
polyrob has quit [Ping timeout: 248 seconds]
polyrob_ is now known as polyrob
<apeiros> darkf: *shrug*
oo_ has joined #ruby
<apeiros> darkf: honestly, I haven't had an issue with [] returning nil
<apeiros> darkf: you can also create your hash with a default proc which raises
<yashinbasement> canton7: double equals
<apeiros> I do that in some rare places where I want to make sure neither I nor any co-developer accidentally fucks up
<adaedra> if you want to check for existance, they're .key?
<apeiros> (and where nil are valid values)
<darkf> apeiros: I do. nil is a value I would probably have as values, and if my code is buggy it will access some key/index that does not exist and I am erroneously getting a value I would expect :p
<canton7> ah
<darkf> and I would not know about it (much like JS' undefined, which is also shit)
bruno- has joined #ruby
<yorickpeterse> then use `if x.key?(...)`
<apeiros> darkf: as in all programming: use proper tools.
<yorickpeterse> problem solved
<apeiros> it's as simple as that
<apeiros> you can't blame the language for you not knowing the proper methods.
<darkf> apeiros: proper tools? so, not Ruby? /s
<apeiros> darkf: read again.
<ddv> just dont use programming languages I hate them all
<darkf> apeiros: I can blame the language for not doing things I'd expect, and when everyone uses #[] I cannot be expected to know that #fetch exists
<darkf> ddv: +1
<canton7> yashinbasement, read the erubis docs :P
startupality has joined #ruby
<darkf> believe it or not you can blame things for bad design
<apeiros> darkf: fine, don't use ruby. use mental-lang. it figures what you expect from it automatically.
<canton7> it's in there somewhere... trying to find where
<yorickpeterse> darkf: yes you can, it's called "Read the documentation"
<apeiros> sorry, but that's obtuse.
<yorickpeterse> Everybody using X is not an excuse for not knowing Y doesn't exist
<yorickpeterse> That's such bullshit it's not even funny
zz_Outlastsheep is now known as Outlastsheep
<yorickpeterse> "Everybody uses petrol powered cars, therefor I don't know electric cars exist"
<darkf> yorickpeterse: it's the most obvious way to access an item. why would i not expect that to do something sane?
<darkf> that is a bullshit cop-out
lessless has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<darkf> "you can just use this other method, just RTFM!"
<yorickpeterse> darkf: what's not sane about returning nil?
<apeiros> darkf: it does something perfectly sane
<apeiros> darkf: you're all "oh my use case must be everybody's use case"
<apeiros> darkf: you. are. not. everybody.
dgutierrez1287 has joined #ruby
<Stratege> also yeah sorry about the php comment, for some silly reason I thought lambdas and methods would be treated the same... I shouldn't have made that silly assumption ^^
<yorickpeterse> nil is a value yes, but so is an integer or a string or anything else
<ddv> he has a point tho, asking for something that doesn't exist is an error right
<apeiros> anyway, pointless to continue that discussion. entitlement never hears arguments.
<darkf> apeiros: nor are you. clearly nobody has this problem because a few of you don't, right; everybody just RTFMs and uses #fetch instead
<yorickpeterse> so by that argument #[] returning anything else is equally wrong
<adaedra> Stratege: never make assumptions in PHP. This language was designed with a dice.
<apeiros> darkf: correct. we read the manual and don't run into the problem. great you see that.
<darkf> great
<yorickpeterse> darkf: No, people use #fetch when they need to have custom behaviour or raise an error
<apeiros> darkf: we don't blindly expect the language to do whatever our imagination happens to come up with
<yorickpeterse> In the 10ks of LOC that I have #fetch is only used in a few places, #[] works fine everywhere else
<apeiros> darkf: we don't guess. we verify.
<adaedra> if you know how the tool work, you're better using it.
<darkf> I hope when you run into errors which cause you to lose hours of your time due to shitty default behavior you finally RTFM and find an obscure method which solves all of that by providing sane behavior ;)
c355E3B has joined #ruby
<yashinbasement> canton7: thankss
<yorickpeterse> #[] raising an error by default would be useful if a compiler could catch this prior to running the app
<Stratege> adaedra yeah ... my bad xD I normally don't xD
<yorickpeterse> darkf: is that not the core of programming?
<yorickpeterse> As in, find bug, find something better, use that?
but3k4 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<darkf> not when it's something the language could easily prevent, no
<apeiros> darkf: you refuse to accept that the language *does* easily prevent it.
<canton7> I think the lesson here is "don't try to use something you don't know how to use". If you say "I tried to drive a lorry but crashed it, that's the lorry's fault" people will laugh at you
<yorickpeterse> apeiros: yeah but imagine having to learn this new thing
<adaedra> I prefer having #[] returning nil rather than raising
<yorickpeterse> heavens forbid actually having to spend some time on your program
<Stratege> to me the core of programming is to think about what the problem requires and then express that in a way that captures the essence of the problem and takes care of the cornercases. And then go see if the compiler agrees with me or not.
<yorickpeterse> You know, that thing that might earn you lots of money
<canton7> ruby has a design philosophy that guides these sorts of decisions. they're consistent within that philosophy.
<darkf> well I am sorry if you get paid to learn ruby's flaws :)
krz has quit [Read error: Connection reset by peer]
<yorickpeterse> Here's a personal flow chart on how to solve this problem:
leat has quit [Remote host closed the connection]
<yorickpeterse> 1) Do you need to get a key and raise an error? Use #fetch
<darkf> and then try to defend the language's shit-by-default behavior with "there are alternates... just hidden away!"
<yorickpeterse> 2) Do you not care about errors, use #[]
<yorickpeterse> DONE
leat has joined #ruby
<yorickpeterse> problem solved
<apeiros> darkf: do us a favor. stop using ruby.
<agent_white> shevy: PING
<ddv> thats a pretty simple flowchart
<yorickpeterse> ddv: Yeah, I patented it
<ddv> lol
yashinbasement has left #ruby ["Leaving"]
<adaedra> darkf: be our guest, go use your better designed language if you're not able to adapt other languages with other ways of thinking
<darkf> apeiros: nah, I think I will continue terrorizing you by pointing out flaws in the design
<darkf> while you incessantly try to defend it and how dare I
<darkf> have a chill pill
<apeiros> darkf: all you did was point out that you're unable to read docs.
<adaedra> oh, people think differently, how dare they!
<yorickpeterse> darkf _does_ have a point that #[] raising errors is more common, at least in statically typed languages
<darkf> no, also in dynamic ones
<yorickpeterse> but Ruby isn't statically typed, nor does the language itself have a compiler
<yorickpeterse> (that can check for this)
<darkf> "JS does it" is not an excuse
<darkf> yorickpeterse: that ... is irrelevant
<adaedra> "X does it" is not an excuse, whatever X is
zacstewart has quit [Remote host closed the connection]
<darkf> python raises an error, and tells you what you fucked up
ndrei has joined #ruby
<darkf> Ruby silently passes nil, which is a reasonable value
<darkf> it's stupid as shit
<apeiros> darkf: oh, funny, same applies otherwise: "X does it that way" isn't an excuse for expecting that behavior from Y
<yorickpeterse> based on what?
<adaedra> because they think it's an error, while ruby thinks it's not, it's another way of seeing it
prestorium has joined #ruby
<yorickpeterse> How is it stupid?
<apeiros> darkf: anyway, stop the inflammatory tone.
<darkf> yorickpeterse: _it is a value I would expect_. _nil does not tell me what I did wrong_.
<yorickpeterse> darkf: sure it does
<darkf> apeiros: you are the one doing that
<adaedra> you have #key? and #fetch for force checking, and Hash.new to change default value.
<darkf> yorickpeterse: imagine I return x[i] from a possibly complex method
<adaedra> And accessing a non-existing element is not always an error.
<darkf> it returns nil instead of what I expect
<darkf> where do I know where this nil came from?
tmtwd has joined #ruby
Takumo has quit [Quit: ZNC is going down!]
<yorickpeterse> Why do you need to know the origin? You only need to know its presence or not
<darkf> wat.
<yorickpeterse> Why do you give a crap where the nil originates from?
<darkf> because I want to fix my code?
<canton7> darkf, again, this is "darkf doesn't know how ruby (or objective-c, or any other language which makes this decision) works", not "ruby is shit" :P
<darkf> or do you just not do that?
Zai00 has quit [Quit: Zai00]
Takumo has joined #ruby
Takumo has quit [Changing host]
Takumo has joined #ruby
<yorickpeterse> darkf: why is returning nil a problem?
<yorickpeterse> oh and btw you can track where nil originates from just fine if it weren't a singleton
<yorickpeterse> IIRC brixen and I have been talking about adding location information to NilClass
<darkf> yorickpeterse: how would I track that?
<apeiros> debugging… how does it work
<darkf> apeiros: who knows, you clearly don't do it
<apeiros> darkf: I don't have to
<adaedra> apeiros: you send the code to India and they fix everything
<yorickpeterse> nil being returned by accident is a problem yes, but #[] very clearly communicates it returns nil when a key is not found
<darkf> apeiros: right, you write a buggy mess ;)
<apeiros> !kick darkf told you
darkf was kicked from #ruby by ruboto [told you]
darkf has joined #ruby
<darkf> yorickpeterse: it also returns nil for [nil][0]
<adaedra> 1-0
<yorickpeterse> I'm pretty sure apeiros knows what he's doing Ruby wise
<darkf> am I just _not supposed to use nil_?
<yorickpeterse> darkf: Yeah....please actually read up on Ruby's documentation
<darkf> except as some magical sentinel value?
<yorickpeterse> because Array#[] says the exact same thing
<canton7> darkf, again, if you need a "sentinal" value, use #fetch
<yorickpeterse> From the rdoc
<yorickpeterse> "Returns nil if the index (or starting index) are out of range.
<yorickpeterse> boom there you have it
<darkf> yorickpeterse: you don't seem to understand what I find wrong so nevermind
<canton7> it's a debatable decision, but it is the way that it is.
<yorickpeterse> darkf: I do perfectly understand it and I heavily disagree
<canton7> given that, your place is to learn the langauge, not fight it :P
<yorickpeterse> There are plenty of cases where raising an error in #[] is super counter productive
Zai00 has joined #ruby
<adaedra> if the language is not for you because you don't like it, there are so many others to use
<darkf> fyi the inflammatory tone you all took before me is not conductive to anything
<yorickpeterse> Same as there might be cases where returning nil is
Takumo has quit [Client Quit]
<apeiros> darkf: wow
<yorickpeterse> The solution? Deal with it instead of trying to force one method over there other
* canton7 isn't sure how to tell darkf he's the inflammatory one here
axsuul has quit [Ping timeout: 256 seconds]
Takumo has joined #ruby
Takumo has joined #ruby
<yorickpeterse> darkf: You're the one here who's making false claims about people
<darkf> canton7: if you cannot see yourselves being inflammatory then that is the issue
<[k-> I just read a kick and a buggy mess ;)
<canton7> darkf, I somewhat sympathise with you in principle
<Stratege> I've kept out of the conversation since it took a bit of a hostile turn, but while darkf has definitly been hostile, he has also had other people be hostile towards him.
prestorium has quit [Quit: Konversation terminated!]
yfeldblum has quit [Ping timeout: 248 seconds]
<apeiros> !ban darkf !T 1h easy, we can calm the situation down for you.
darkf was banned on #ruby by ChanServ [darkf!*@*]
darkf was kicked from #ruby by ChanServ [Banned: easy, we can calm the situation down for you.]
<canton7> darkf, but your attitude means I won't argue your case :P
Takumo has quit [Remote host closed the connection]
<adaedra> 2-0
prestorium has joined #ruby
ldnunes has joined #ruby
<adaedra> Stratege: I guess that's what happens when an unstoppable force encounters an unmovable object.
fantazo has joined #ruby
<txdv_> boohoo
<yorickpeterse> but gais why does Ruby not let you do 1 + "1", PHP does that too
<yorickpeterse> it's so stupid
<adaedra> ikr
<apeiros> as I said, it's a case of entitlement
krz has joined #ruby
<yorickpeterse> Granted it would be nice if Ruby had an Option type and #[] returned an Option
<apeiros> "I'm entitled to the language behaving the way *I* expect"
* yorickpeterse might've written too much Rust
shock_one has quit []
<yorickpeterse> omg monads
<adaedra> rust <3
<yorickpeterse> meh, rust is ok
<yorickpeterse> it's really verbose and the tooling around it is _super_ basic (given it's still very young)
<adaedra> I was disapointed when I was reading rust guide and got a "To be written later" chapter.
Takumo has joined #ruby
Takumo has joined #ruby
<Stratege> yorickpeterse oi, if my claim about php's abilities hadn't been false the question would have ben decent. ^^
<txdv_> you can't coerce ruby to coerce an integer into a string
<yorickpeterse> Stratege: :P
<yorickpeterse> Stratege: well, your question isn't too bad to be honest
<Stratege> and apeiros has given a fairly nice answer to it.
<yorickpeterse> What I'm uncertain about is Ruby requiring #method and #instance_method to get a method object
ndrei has quit [Ping timeout: 248 seconds]
<yorickpeterse> instead of referring to the method without parenthesis, although I know why _that_ is (so you can call it without parenthesis)
<apeiros> Stratege: yay! at least somebody today appreciates my replies :D
<Stratege> still, personally I think just requiring () to be used for method calls and method objects being obtained via leaving the () out would have been more consistent and nice
<[k-> technically you can coerce
Aderium has joined #ruby
<yorickpeterse> Stratege: well, not requiring () allows you to write something like "foo if bar?" instead of "foo() if bar?()"
<yorickpeterse> which is a lot more pleasant on the fingers
tvw has quit [Read error: Connection reset by peer]
<[k-> and eyes
xkef_ has quit [Quit: leaving]
<apeiros> in my toy language I chose the path of different syntax for invocation vs. getting the method itself
xkef has joined #ruby
ndrei has joined #ruby
<[k-> aka python
<apeiros> but there I have more syntax anyway. the syntax you choose decides whether you get the method, the method's result, or the receiver as return value
<Stratege> personally I love the idea of doing function application via whitespace and assignment working via = and never having (), so a nullary function and a value would be indistinguishable, but that requires purity.
<Stratege> (which, is, ofc, not something every language wants or would benefit from. Atleast not radical purity like that)
<[k-> sounds abit like Nim :o
<agent_white> Where is shevy ?
but3k4 has joined #ruby
olistik has joined #ruby
y0da has joined #ruby
<Stratege> yorickpeterse yeah, guess that's a tradeoff. Personally I'm not comfortable with leaving () out yet, since I want to be able to see without a doubt wether what I'm doing is a method call or just accessing a value.
<yorickpeterse> Stratege: well, at least when using a receiver "foo.bar" is always a method call
<yorickpeterse> It gets a bit tricky when there's no receiver
<yorickpeterse> since you have to scan the surrounding code to see if there's a local variable with the same name
<yorickpeterse> also stuff such as "foo = foo" being valid and resulting in "foo" always being nil (even if there's a method called "foo") is stupid
<Stratege> foo = foo is valid and does not result in a non-terminating program? o.o
<[k-> nope
<yorickpeterse> Stratege: yup
<yorickpeterse> >> foo = foo
<ruboto> yorickpeterse # => nil (https://eval.in/397626)
<Stratege> wow.
<[k-> no recursive resolution here ;)
<Stratege> also, that sounds like it's impossible to access other objects values, only their methods?
<yorickpeterse> so you'd have to do "foo = self.foo" for that
but3k4 has quit [Ping timeout: 252 seconds]
<yorickpeterse> Stratege: correct
<yorickpeterse> You need getters for instance variables, that's actually a good thing
<adaedra> Encapsulation !
<Stratege> I did not expect ruby to be that hardcore OOP. Cool.
<yorickpeterse> It's pretty close to Smalltalk
<adaedra> (I thank the person bearing this nick so I can tab-complete this word.)
<yorickpeterse> except it botched a few things up
<Stratege> like?
<yorickpeterse> Tooling for example, Smalltalk had way better tools
<yorickpeterse> Also the total lack of concurrency in the language itself
<yorickpeterse> leaving it up to implementations
<yorickpeterse> IIRC Smalltalk's runtime inspection was also much better
zacstewart has joined #ruby
<yorickpeterse> But I never wrote Smalltalk professionally so I might be talking out of my arse
quazimodo has joined #ruby
quazimod1 has joined #ruby
<Stratege> huh okay, thanks
arup_r has quit [Remote host closed the connection]
PhantomSpank has joined #ruby
baweaver has joined #ruby
<shevy> yorickpeterse you are talking out your arse yay! \o/
<[k-> Ox0dea has been idle for 7h :(
programmerq has quit [Read error: Connection reset by peer]
<Stratege> yorickpeterse did ruby do something particularly better than smalltalk though? (genuine curiosity)
<yorickpeterse> Yes
<yorickpeterse> People actually used it
* yorickpeterse runs
<Stratege> xD
leat has quit [Remote host closed the connection]
<Stratege> apart from that? ^^
leat has joined #ruby
<[k-> a strong and prosperous community
<yorickpeterse> can't think of any from the top of my head, other than it being source based instead of using a VM image
<adaedra> we prefer big talks
* adaedra runs
baweaver has quit [Ping timeout: 246 seconds]
<Stratege> ^^ fair enough.
thiagovsk has joined #ruby
<[k-> let's talk obfuscation!
<jhass> no
<adaedra> no
<yorickpeterse> just use Base64
mercwithamouth has joined #ruby
<shevy> cool
<[k-> does anyone get my require problem from yesterday
<shevy> both jhass and adaedra say no
<adaedra> mmh?
<adaedra> ah.
oo_ has quit [Remote host closed the connection]
<[k-> everyone is frightened from the horrendousity of my code ;)
<[k-> hint that word doesn't exist
Zai00 has quit [Quit: Zai00]
<shevy> [k- yes you are on your path to evil
oo_ has joined #ruby
<[k-> I want to finish my library
<adaedra> # service [k- stop
<adaedra> hop, no more demonic [k- .
<shevy> adaedra wait
<shevy> is this systemd?
<jhass> worse, upstart
<adaedra> er, no.
<adaedra> bsd init.
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Aderium> aynone knows how to install a gem from a specific source ?
<Aderium> we have a fork on github and its driving me nuts
sp1rs has joined #ruby
<adaedra> bundler?
<jhass> didn't we answer this yesterday already?
<Aderium> this is a mnaual gem installation not via cap
<Aderium> did not work for me
<Aderium> the response was a script of sorts
<jhass> how about you elaborate on that
<adaedra> get the gem, build it, install the .gem, drink a cup of tea.
<jhass> else you'll just receive the same answer again
<Aderium> i though I could gem install name -s https://github.org/path
revath has quit [Ping timeout: 248 seconds]
<jhass> no
<[k-> I'll make sure adaedra sees it first!
<jhass> that's not what source is about
eggoez has quit [Ping timeout: 246 seconds]
mercwithamouth has quit [Ping timeout: 250 seconds]
<Aderium> ok.. so is there a simple way to specify a url for the fork ?
nateberkopec has joined #ruby
gagrio has quit [Ping timeout: 256 seconds]
<Aderium> from shell prompt obviously
<jhass> git clone url; cd foo; gem build foo.gemspec; gem install ./foo.gem
startupality has quit [Quit: startupality]
[k-_ has joined #ruby
<shevy> Aderium in the worst case, whenever you have the .gemspec file, you can build a .gem from that, and then install it
jamesaxl has joined #ruby
<shevy> what is the URL to the github project?
<jhass> Aderium: before you're confused, what shevy said is just the verbose version of my commands
<shevy> what I said is the human readable version
<Aderium> ok now I understand
<Aderium> that did infact work :)
<shevy> \o/
<jhass> Aderium: I made the exact same suggestion yesterday...
<Aderium> I may have missed it sorry
<[k-_> im getting the require problem again
rbennacer has joined #ruby
<shevy> require properly!
<Aderium> I cant seem to go back in history with Textual once I leave
<[k-_> so i tried require 'libobf'
<jhass> [k-_: you mean the problem that you don't understand $LOAD_PATH ?
<[k-_> require 'libobf.rb'
<[k-_> idc about $:
<[k-_> it should look in the current directory!
<adaedra> Aderium: there are public logs, see topic.
<shevy> well try either require './libofb.rb' or append Dir.pwd to $: I think it was, or even better, use everything relative to ruby site dir
<Aderium> ah
<Aderium> topic
<Aderium> ahahah
<[k-_> well appending worked
<Aderium> i
<adaedra> j
<[k-_> ridiculous, i say
<[k-_> after popping $:, require './libobf.rb' works too
<shevy> I think in the 1.8.x era this step was not necessary
<shevy> then came the 1.9.x era with screaming warnings of world writable dirs that made bnagy lose his last hair!
joonty has quit [Quit: joonty]
<jhass> . in the $LOAD_PATH proved error prone, so it was removed and require_relative was added instead
<[k-_> this is strange, require_relative works now too
<[k-_> yesterday it didnt
<shevy> \o/
quimrstorres has quit [Remote host closed the connection]
surs has joined #ruby
<[k-_> could it be that ruby requires you to require something from the stdlib before requires actually work
<jhass> no
<[k-_> mine was a new ruby from rbenv
arup_r has joined #ruby
<[k-_> i think
<ddv> [k-: lesson 1 there is no coincidence in programming
<shevy> perhaps you had an old copy installed
<[k-_> wait, no, i got it from homebrew
<shevy> AHA
<[k-_> w0t
sp1rs has quit [Read error: Connection reset by peer]
<shevy> do things finally work [k-_
fabrice31 has joined #ruby
<shevy> so that you can continue writing unreadable ruby code :)
<[k-_> yes they do work now
lapide_viridi has quit [Quit: Leaving]
<[k-_> its a one off problem
<[k-_> i dont want to get banned from eval.in
surs4 has quit [Ping timeout: 250 seconds]
<[k-_> i make so many pastes on my phone
<[k-_> >.>
<shevy> damn... you are typing on your phone?
<shevy> my fingers are too fat for smartphones
JMoir has joined #ruby
<Stratege> ddv doesn't said lesson 1 conflict with the existance of PHP? ^^
<jhass> that just means you haven't found a keyboard that works for you
<ddv> shevy: ur a fatty
<shevy> ddv yeah :(
<ddv> ok
<apeiros> note that require_relative and require './…' is NOT the same
<apeiros> require_relative works relatively from the file which uses it (__FILE__)
<apeiros> . in $LOAD_PATH / require './…' otoh work relative from the working directory
<shevy> Stratege php is weird... it is not really designed much, it's like a melting pot of things-for-the-www-put-together
bjornar has quit [Remote host closed the connection]
<ddv> php is one big hack or many big hacks
<shevy> yeah
<yorickpeterse> apeiros: you can extend that ban for darkf
<yorickpeterse> From the PM:
fabrice31 has quit [Ping timeout: 252 seconds]
<shevy> php is simply weird
Zai00 has joined #ruby
<shevy> >> 1 + '1'
<ruboto> shevy # => String can't be coerced into Fixnum (TypeError) ...check link for more (https://eval.in/397665)
cytoskeletor has joined #ruby
<[k-_> my __FILE__ is "(irb)"
<Stratege> mhm ^^
<shevy> [k-_ I guess irb overrules it?
<[k-_> but it still works
<shevy> normally a __FILE__ should end with a .rb part or?
<[k-_> im using irb to require
<[k-_> so i can test my code
<shevy> oh ... what is __FILE__ ... that is not a constant is it?
eGGsha has joined #ruby
iooner has quit [Quit: http://www.iooner.me]
<[k-_> _LALALA is not a constant as well
<apeiros> shevy: since constants start with an uppercase letter - no :)
<shevy> yeah
<apeiros> you could consider it a magical string literal
<shevy> it is indeed magical
eggoez has joined #ruby
<shevy> it pops up!
tsvenson has quit [Ping timeout: 252 seconds]
<shevy> I don't think I had a use case for reassigning to __FILE__ yet so that's fine by me
leonardoajim has joined #ruby
Rickmasta has joined #ruby
magical-imouto is now known as ninja-maid-robot
matcouto has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
revath has joined #ruby
PhantomSpank has quit []
gagrio has joined #ruby
nateberkopec has quit [Quit: Leaving...]
iooner has joined #ruby
blackmesa has quit [Ping timeout: 264 seconds]
<[k-_> i have a strong itch to show Ox0dea my code to receive praises :<
lessless has joined #ruby
bluOxigen has joined #ruby
leat has quit [Remote host closed the connection]
<livcd> #notruby does anybody have a clue how to set a default terminal's theme via cli ? :P
<jhass> ?ot livcd
<ruboto> livcd, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
Voker57 has joined #ruby
leat has joined #ruby
blueOxigen has quit [Ping timeout: 244 seconds]
<shevy> livcd via ruby? perhaps! you can call system()
<shevy> :)
<tuor> hi, my Method: http://paste.debian.net/281899/, I want to make it possible to give the rules as parameter (with a default) insteed of only harcoding them. Is this possible?
Musashi007 has joined #ruby
<shevy> I can use ruby for fbsetbg or something like that in fluxbox
_blizzy_ has joined #ruby
<jhass> ?gist tuor
<ruboto> tuor, https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
<livcd> jhass: sorry :-)
<livcd> shevy: yes it can be via ruby as well lol :-)
astrobun_ has joined #ruby
<shevy> \o/
<jhass> tuor: the standard strategy is to define the defaults hash and .merge the parameter into it
<livcd> shevy: though i would probably know how to do it with ruby if i would know what the hell should i do in the first place :S
<shevy> livcd what desktop is it?
<jhass> so foo(rules={}); default_rules = { ... }; default_rules.merge(rules) end
<jhass> however that's one dimensional
<livcd> shevy: standard yosemite :D
nateberkopec has joined #ruby
<shevy> I don't know what that means... is that gnome3? kde4?
<shevy> or is it the evil OSX
<jhass> if you want it to work for the nested hashes too, in this case you want to iterate over the defaults and .merge the subhashes
<livcd> shevy: evil OS X
<shevy> ah ok
tvw has joined #ruby
victortyau has joined #ruby
Kully3xf has joined #ruby
_blizzy_ has quit [Read error: Connection reset by peer]
<jhass> livcd: there's ##apple and ##mac
<adaedra> livcd: come to #ruby-offtopic
Kully3xf has quit [Remote host closed the connection]
<jhass> livcd: oh and #MacOSX
<tuor> I only need the "toplevel" hashes. So ex: :template. If the hash is not given as argument I need to take the default on. So if I right understood, I can do it with default_rules.merge(rules).
JoshL has joined #ruby
<livcd> jhass: ok ok i'll obey the rulez :-)
DoubleMalt has quit [Ping timeout: 256 seconds]
cytoskeletor has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
_blizzy_ has joined #ruby
ninja-maid-robot is now known as magica-imouto
MatrixBridge has quit [Ping timeout: 264 seconds]
joonty has joined #ruby
<[k-_> look, people come to the ruby-community for all sorts of things
<[k-_> this says very good of the community ;)
<shevy> I came for [k-_
<[k-_> lies
<[k-_> you were already here before I
eshy has quit [Max SendQ exceeded]
<[k-_> looooooooong ago
magica-imouto is now known as magical-imouto
george2 has joined #ruby
MatrixBridge has joined #ruby
evanjs has joined #ruby
tomaz_b has joined #ruby
eshy has joined #ruby
<adaedra> shevy: we don't care about your sexual life.
Outlastsheep is now known as zz_Outlastsheep
<shevy> now what was that
<[k-_> lel failed attempt at an insult
Musashi007 has quit [Quit: Musashi007]
gwendall has joined #ruby
<jhass> tuor: .merge returns a new hash
<jhass> it doesn't modify the receiver
jimmythehat has joined #ruby
<tuor> jhass, ah ok.
<jhass> (nor the argument)
Hounddog has joined #ruby
oo_ has quit [Remote host closed the connection]
<[k-_> to do that, you'd want merge!
blackmesa has joined #ruby
<jhass> or just pass along the return value
<jhass> up, like that
shredding has joined #ruby
<jhass> *yup
nfk has joined #ruby
stantonnet has joined #ruby
stamina has joined #ruby
varunwachaspati has joined #ruby
DoubleMalt has joined #ruby
neanderslob has joined #ruby
rbennacer has quit [Remote host closed the connection]
charliesome has joined #ruby
stantonnet has quit [Remote host closed the connection]
njs126 has quit [Ping timeout: 246 seconds]
blackmesa has quit [Ping timeout: 252 seconds]
dagda1 has joined #ruby
njs126 has joined #ruby
<apeiros> charliesome: ping. not important, but eval-in seems to have a race condition when creating paste id's. yesterday two people evaled at the same time and both got the same id, the latter overriding the former.
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
krz has quit [Quit: WeeChat 1.0.1]
<charliesome> wat really
<charliesome> it just uses mysql auto increment
<charliesome> it must be a bug in the bot
konsolebox has joined #ruby
<apeiros> :D
Scroff has joined #ruby
<yorickpeterse> you're not using BSON object IDs?
<yorickpeterse> Tssssk
<apeiros> but the bot uses the ID it gets from eval.in, no?
<apeiros> hm, I'll check the code
dh64 has quit [Quit: Konversation terminated!]
<apeiros> maybe it's indeed a bug there…
allcentury has joined #ruby
<charliesome> the fuck
<charliesome> the next one down didn't skip an id
evanjs has quit [Remote host closed the connection]
<charliesome> so it clearly looks like it duped the id on the app side? huh?
<jhass> just switch to postgresql ^.^
lapide_viridi has joined #ruby
<charliesome> i don't understand how this could be possible
<apeiros> maybe curl is not thread capable?
<apeiros> that'd be the bot-side explanation
<charliesome> hmm I don't think that's it
<charliesome> check the logs
<apeiros> one curl overrides state of another…
<charliesome> there's two pastes with the same id
<charliesome> and then the next paste has the next id, it doesn't skip the id
<charliesome> if it was a bot-side race then I think it'd have to skip an id
<charliesome> let me check the binlogs...
<apeiros> my suggestion is that the first eval is https://eval.in/397075
<apeiros> heh
<apeiros> seems like I'm right
<apeiros> check the link
Scrofff has quit [Ping timeout: 248 seconds]
<charliesome> ooooh
<charliesome> I see
<charliesome> might be a bot-side bug then
<charliesome> is the bot open source?
<apeiros> so what I think happened: first eval curls, gets 397075 returned, second curls, gets 397076 returned, mutates some global state in curl of the first
<charliesome> yeah
<apeiros> it's still your code ;-)
<charliesome> that would explain it
DoubleMalt has quit [Ping timeout: 246 seconds]
<jhass> but wouldn't have that mutated the result too?
<apeiros> the bot isn't opensource atm. I aim to release non-critical parts until end of year.
neanderslob has quit [Read error: Connection reset by peer]
<jhass> oh, right, we scrape Location, mmh
<apeiros> jhass: timing
<apeiros> we read the body first, header later
<charliesome> apeiros: yeah maybe just toss a mutex around the whole thing
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tkuchiki has joined #ruby
<apeiros> ok, anyway. sorry for the noise. could have checked for bot-side bug first.
<JMoir> Does anyone know what I can't acces the sinatra session variable here? https://gist.github.com/jamalmoir/c3384a264fbdb2bb9ee7 I can access it fine in my routes file...
n008f4g_ has joined #ruby
<apeiros> and yeah, just tossing a mutex around it. collisions will be rare.
<bougyman> i'm confused.
<apeiros> but it's a bit sad to see that curl isn't thread-safe.
rwilcox has joined #ruby
devdazed has quit [Quit: Computer has gone to sleep.]
<jhass> apeiros: though I always thought the only thread unsafe thing in curl is the resolver and that got fixed with AsyncDNS support
atomical has joined #ruby
<bougyman> why would you use curl, though?
dgutierrez1287 has quit [Remote host closed the connection]
tkuchiki has quit [Remote host closed the connection]
<jhass> I mean why would the bother to fix that part if the rest is unsafe anyhow
<apeiros> bougyman: don't blame me! I only copied that code :D
neanderslob has joined #ruby
<bougyman> i used cinch-evalso in my bot, which uses https://github.com/eval-so/ruby-evalso/blob/master/lib/evalso.rb underneath.
<bougyman> no thread probs.
<apeiros> charliesome: wrt open sourcing ruboto: I remember correctly that you said the eval code was fine to release?
<charliesome> yeah that's fine
<charliesome> also that bot's code goes back to like 2012
<charliesome> at the time I just went with curl but it's probably not necessary
evanjs has joined #ruby
gagrio has quit [Ping timeout: 246 seconds]
<ujjain> is this ruby? <% scope['hazelcast::extra_libraries'].each do |extra_library| %><%= scope.function_template(<%= extra_library.template %>) %><% end %>
<shevy> ujjain the part inside the <% and %>
<apeiros> ujjain: looks like erb
<apeiros> ujjain: which is a template language embedding ruby
<ujjain> oh, I didn't know that was a seperate thing
<apeiros> it's part of ruby. not separate.
<ujjain> ah ok, interesting. It does not accept <%= inside of <%= though
<shevy> it's a bit like embedding php/html
<bougyman> i've not seen hazelcast used in ruby before
<ujjain> it's Puppet to deploy Hazelcast
<bougyman> gotcha
<ujjain> <%= scope.function_template(<%= extra_library.template %>) %> - Complains about this syntax.
umgrosscol has joined #ruby
<bougyman> it should
<apeiros> because it's not valid
<bougyman> you don'e need the <%= in the function call
<bougyman> <%= scope.function_template(extra_library.template) %>
<bougyman> do that instead
tkuchiki has joined #ruby
<ujjain> thanks, that looks a bit better, extra_library.template doesn't seem the way how to handle a named array though
vyorkin has joined #ruby
vyorkin has quit [Client Quit]
<ujjain> hazelcast::extra_libraries:
<ujjain> - template: "hazelcast_local_listeners.xml.j2"
<ujjain> let me google that one
vyorkin has joined #ruby
freerobby has joined #ruby
<JMoir> Apparently sinatra can only see the session object within a request, is there anyway to get around this and pass it to a function?
DoubleMalt has joined #ruby
<apeiros> JMoir: what stops you from passing the request object as an argument to a method?
quimrstorres has joined #ruby
bruno- has quit [Ping timeout: 240 seconds]
<JMoir> Outside of requests it throws out an error saying session is undefined
<apeiros> …
njs126 has quit [Ping timeout: 264 seconds]
<jhass> JMoir: how about passing the session along?
<JMoir> ?
dhjondoh has quit [Quit: dhjondoh]
<ujjain> what is the name of the type of array I posted above?
<apeiros> what do you mean by "outside of a request"?
<apeiros> do you mean you invoke code when no request is happening?
Igorshp has quit [Ping timeout: 246 seconds]
<JMoir> outside of a get/post etc
<apeiros> JMoir: but that code outside of get/post is invoked from within a get/post, right?
<JMoir> https://gist.github.com/jamalmoir/c3384a264fbdb2bb9ee7 this is what I'm trying to do
<yorickpeterse> ffs, why are country names usually "Foobar, democratic republic of" instead of just "Democratic republic of Foobar"
<Voker57> because sorting
dhjondoh has joined #ruby
<adaedra> ^
<apeiros> also note how the more a nation claims democracy in its name, the more suppressing it is…
<adaedra> You want East and West Germany to be together in your list
abuzze has quit []
<yorickpeterse> Because the E and W are so close right
<yorickpeterse> oh wait
<yorickpeterse> heh
<yorickpeterse> I fail
nateberkopec has quit [Quit: Leaving...]
<jhass> >> require "yaml"; YAML.load %(hazelcast::extra_libraries:\n - template: "hazelcast_local_listeners.xml.j2") # ujjain
<ruboto> jhass # => {"hazelcast::extra_libraries"=>[{"template"=>"hazelcast_local_listeners.xml.j2"}]} (https://eval.in/397697)
leat1 has joined #ruby
<jhass> hash -> array -> hash
bungoman has joined #ruby
quimrstorres has quit [Ping timeout: 252 seconds]
<yorickpeterse> oh great, there's apparently Congo and Democratic Republic of the Congo
<yorickpeterse> which have different ISO codes
<yorickpeterse> YAY
<apeiros> ^^
_blizzy_ has quit [Ping timeout: 265 seconds]
<apeiros> different numeric codes or also different alpha2 codes?
<yorickpeterse> Different alpha 2 codes
<yorickpeterse> and alpha 3 codes
Igorshp has joined #ruby
abuzze has joined #ruby
<yorickpeterse> and even numeric one
<yorickpeterse> * ones
<jhass> JMoir: you can't do that. period
<yorickpeterse> fuck me
<adaedra> There are also two koreas, yorickpeterse
<apeiros> well, the numeric ones change when a country is not considered to be the same
<shevy> unite now!
<yorickpeterse> adaedra: Yeah, except those are actually different countries
<JMoir> jhass: Sigh, I see. Thanks anyway
chouhoulis has quit [Remote host closed the connection]
njs126 has joined #ruby
<yorickpeterse> wait what the fuck
<adaedra> and it's not the case for congo?
<yorickpeterse> these are different countries?
leat has quit [Ping timeout: 250 seconds]
<adaedra> To wikipedia!
<yorickpeterse> apparently they are
<yorickpeterse> wtf
tomphp_ has joined #ruby
<adaedra> Yep, two congos (one is ex-Zaire)
<yorickpeterse> prrrfft
<yorickpeterse> people and naming, still hard
stnly has joined #ruby
<jhass> people and living together
<adaedra> The non-democratic is smaller
dcarmich has joined #ruby
<yorickpeterse> Hm that would be interesting, what if a website just says "Person X is from Congo", which one do you pick
whippythellama has joined #ruby
<adaedra> The pitchfork
<yorickpeterse> Though I've yet to actually see a review coming from somebody in one of the congos
Steve_Jobs has quit [Ping timeout: 250 seconds]
<jhass> the one with the bigger population?
<yorickpeterse> Yeah that's completely meaningless
tomphp has quit [Ping timeout: 250 seconds]
tagrudev has quit [Ping timeout: 250 seconds]
<yorickpeterse> that's like saying "Alex" is a male name because reasons
<ujjain> http://pastebin.com/JceZ7rih - I was expecting the value of the template to be printed, not a comment inside my loop.
<ruboto> ujjain, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/4c8c8887b77d699c8bdf
<ruboto> pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
Steve_Jobs has joined #ruby
<neanias> He's alive!
tagrudev has joined #ruby
<neanias> It's a Christmas mircale
<ddv> lol
<jhass> ujjain: <% %> doesn't print, <%= %> does
<ujjain> ahhhh
<ddv> another devops guy who doesn't know programming?
<ujjain> thanks a lot jhass
<ujjain> haha true
<ujjain> I used ansible for 2 years though
mercwithamouth has joined #ruby
<bougyman> i wish devops people would stop writing devops tools.
<bougyman> they get worse every week.
<yorickpeterse> bougyman: you don't like your Gulp with your Docker and Ansible?
<bougyman> hahahah
<bougyman> believe it or not we're still on chef.
malconis has joined #ruby
<bougyman> they all suck in many ways. we've wrestled our way around most of chef's suck by now, though.
lele|w has joined #ruby
leat1 has quit [Remote host closed the connection]
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
leat1 has joined #ruby
<yorickpeterse> oh fuck me, I also have to deal with people using "Belgie" for "Belgium"
presto has joined #ruby
<yorickpeterse> Instead of "België"
<adaedra> België
<adaedra> Don't forget Belgique
<shevy> cheese and chocolate
<shevy> just like switzerland
prestorium has quit [Ping timeout: 256 seconds]
<bougyman> I don't differentiate between europeans.
<adaedra> I thought it were beer and fries
<adaedra> bougyman: too bad
mesamoo has joined #ruby
julieeharshaw has quit [Ping timeout: 246 seconds]
<shevy> beer and fries - isn't this the UK
<ujjain> then I guess it's also obvious why <%= scope.function_template(extra_library['template']) %> returns custom functions must be called with a single array that contains the arguments. For example, function_example([1]) instead of function_example(1) - Evaluation Error: Error while evaluating a Function Call
y0da has quit [Ping timeout: 252 seconds]
vt102 has joined #ruby
abuzze has quit []
vt102 has quit [Remote host closed the connection]
dhjondoh has quit [Quit: dhjondoh]
<yorickpeterse> gah also the French of course calling it Pays-bas instead of The Netherlands
<jimmythehat> how do I mock an in-block variable using rspec? In this example, I want to mock the variable 'letter'. https://gist.github.com/anonymous/9e59b52c48dc3b6a15d3 how would I do this? Also, this is an rspec question and a learning excercsize so I'm not interested in how I'd change by codebase, only my testbase. Finally, allow_any_instance_of is discouraged https://relishapp.com/rspec/rspec-mocks/docs/working-with-legacy-code/any-instance and I do pers
dcarmich has quit [Quit: Textual IRC Client: www.textualapp.com]
<yorickpeterse> (╯°□°)╯︵ multi-lingual support
but3k4 has joined #ruby
blackmesa has joined #ruby
centrx has joined #ruby
abuzze has joined #ruby
scripore has joined #ruby
<yorickpeterse> lol, I apparently have a review with the origin set to "71" by the reviewer
jerius has joined #ruby
Igorshp has quit [Remote host closed the connection]
djbkd_ has joined #ruby
crowell has quit [Read error: Connection reset by peer]
tsvenson has joined #ruby
<ujjain> I have no idea how to write the ë on my keyboard, so it tricky
<shevy> haha
vt102 has joined #ruby
<yorickpeterse> compose-key + shift + " then press e
<shevy> phone a cat for help
<yorickpeterse> at least on Linux
quimrstorres has joined #ruby
crowell has joined #ruby
crowell has quit [Changing host]
crowell has joined #ruby
Kully3xf has joined #ruby
<ddv> just google it
<ddv> and copy/paste
bmurt has joined #ruby
eGGsha has joined #ruby
<ddv> think of word that uses it
<ddv> :P
neanderslob has quit [Remote host closed the connection]
calleerlandsson has joined #ruby
<shevy> "cat"
rbennacer has joined #ruby
neanderslob has joined #ruby
hakunin has joined #ruby
leat1 has quit [Remote host closed the connection]
ljt has joined #ruby
leat1 has joined #ruby
mos has quit [Ping timeout: 240 seconds]
bungoman has quit [Remote host closed the connection]
<jimmythehat> how do I mock an in-block variable using rspec? In this example, I want to mock the variable 'letter'. https://gist.github.com/anonymous/9e59b52c48dc3b6a15d3 how would I do this? Also, this is an rspec question and a learning excersize so I'm not interested in how I'd change by codebase, only my testbase. Finally, allow_any_instance_of is discouraged https://relishapp.com/rspec/rspec-mocks/docs/working-with-legacy-code/any-instance and I do perso
<jimmythehat> *my codebase
<[k-_> i want to share my code with all of #ruby!
<shevy> [k-_ share your code and share your love!
<[k-_> im almost done
millerti has joined #ruby
devdazed has joined #ruby
bungoman has joined #ruby
sgambino has joined #ruby
dblessing has joined #ruby
varunwachaspati has quit [Ping timeout: 240 seconds]
mercwithamouth has quit [Ping timeout: 246 seconds]
<jimmythehat> awh, peopllee...
<jimmythehat> ive googled hard
Feyn has quit [Quit: Leaving]
nateberkopec has joined #ruby
<jhass> jimmythehat: why you monkey patch String :(
Kully3xf_ has joined #ruby
<jhass> anyway, just string.method_2
<jhass> well, or method_1 even
Kully3xf has quit [Ping timeout: 256 seconds]
gagrio has joined #ruby
aspiers has joined #ruby
<[k-_> << just bit me :(
<yorickpeterse> well shit, http://geocoder.opencagedata.com/demo.html is actually pretty solid
<yorickpeterse> plus it's supported by geocoder
<yorickpeterse> ᕕ(ᐛ)ᕗ time to get the boss' credit card
<yorickpeterse> because those 2500 reqs/day will be blown away in a few minutes
Kully3xf_ has quit [Ping timeout: 240 seconds]
mleung has joined #ruby
mleung has quit [Client Quit]
<[k-_> A geocoder turns a geographic reference, such as an address, a place name or locality into geographic coordinates as latitude and longitude. The good folks at Wikipedia explain this far better than we can.
bjornar has joined #ruby
<yorickpeterse> I need more like, 20k/day
davedev24 has joined #ruby
<[k-_> thats a lot
<[k-_> you have 20k customers per day? :o
<[k-_> noice
mos has joined #ruby
<shevy> all dutch!
otisZart has joined #ruby
<shevy> [k-_ don't mess with them, they are the asians in europe, watch at their muay thai fighters
Igorshp has joined #ruby
bronson has joined #ruby
<yorickpeterse> [k-_: No, 20k reviews coming in on a daily basis
<yorickpeterse> though we've had peaks of 100k
segfalt has joined #ruby
evanjs has quit [Remote host closed the connection]
Blaguvest has quit []
Igorshp has quit [Remote host closed the connection]
bronson has quit [Ping timeout: 246 seconds]
arup_r has quit [Remote host closed the connection]
tvw has quit [Ping timeout: 264 seconds]
<[k-_> time to freeze some values
gambl0re has quit [Ping timeout: 255 seconds]
<[k-_> so they dont get changed
Kully3xf has joined #ruby
beef-wellington has joined #ruby
lessless has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
varunwachaspati has joined #ruby
hal_9000_ has joined #ruby
devdazed has quit [Quit: Bye]
julieeharshaw has joined #ruby
tvw has joined #ruby
pothibo has joined #ruby
codecop has joined #ruby
davedev24 has quit [Remote host closed the connection]
lxsameer has quit [Quit: Leaving]
lapide_viridi has quit [Quit: Leaving]
mos has quit [Read error: Connection reset by peer]
cpruitt has joined #ruby
paulcsmith has joined #ruby
stantonnet has joined #ruby
SylarRuby has quit [Remote host closed the connection]
<yorickpeterse> hrmpf, based on our current dataset this would take weeks to reprocess our data
<yorickpeterse> e.g. at 200k max per day this would take about 50 days
<yorickpeterse> That assumes an instant response from the server, if it takes 2-3 seconds that would be even longer
<yorickpeterse> :/
casadei_ has joined #ruby
djbkd_ has quit [Remote host closed the connection]
jpfuentes2 has joined #ruby
<apeiros> parallelize!!!
jschoolcraft has joined #ruby
* apeiros goes back under his rock
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
chipotle has quit [Quit: cheerio]
whippythellama has quit [Ping timeout: 256 seconds]
JakFrist has joined #ruby
<yorickpeterse> apeiros: well yeah, that we already do
<yorickpeterse> but even then I can still only request per day whatever the rate limit is
<ddv> pay more
<ddv> moarrr
whippythellama has joined #ruby
nathanstitt has joined #ruby
<apeiros> oh yorickpeterse - since you're all into xpath atm - if I have <foo><bar><baz>text</baz></bar></foo>, how would I write an xpath selecting <bar>, based on it having the child <baz> with text "text"?
charliesome has quit [Quit: zzz]
<apeiros> yorickpeterse: get multiple accounts!
<apeiros> or yes, in essence: pay more :D
<apeiros> xpath is one of those technologies I re-learn every ~15 months.
scripore has quit [Quit: This computer has gone to sleep]
aganov has quit [Remote host closed the connection]
scripore has joined #ruby
<shevy> so powerful is it
<ddv> money?
chouhoulis has joined #ruby
<ddv> pretty
<yorickpeterse> apeiros: foo/bar[baz[.="test"]]
<ddv> the invisible hand that guides us all
<shevy> imagine which other technology requires you to relearn it every some months!
<yorickpeterse> errr "text"
Soda has quit [Remote host closed the connection]
<[k-_> more powerful than than my library ;-;
<[k-_> ...java
charliesome has joined #ruby
<[k-_> pretty soon my library will be on that list
<[k-_> assuming if people touch it
phutchins has joined #ruby
chouhoulis has quit [Remote host closed the connection]
<shevy> you are poking fun at java ddv!
chouhoulis has joined #ruby
Igorshp has joined #ruby
<apeiros> yorickpeterse: nice. thanks. now on to figure out how to tell the xmlns…
<adaedra> you would prefer that we poke fun at you, shevy ?
bahar has quit [Ping timeout: 256 seconds]
<ddv> apeiros: didnt work huh?
<apeiros> ddv: hm? it did work
<ddv> apeiros: ohohoh
<yorickpeterse> apeiros: you just smack it in front of the name
<[k-_> adaedra: you are being awful :(
<apeiros> but my real example has namespaces, so I have to figure out how to properly use them in the xpath
<yorickpeterse> e.g. for "<foo:bar />" that would be "foo:bar"
<adaedra> [k-_: I am?
<[k-_> yes
<yorickpeterse> assuming the xmlns is registered
<apeiros> yorickpeterse: ah, k. in CSS it's | not :
<yorickpeterse> Yeah
<apeiros> (and I only remembered it was different)
<apeiros> thanks :D
fabrice31 has joined #ruby
<adaedra> [k-_: what did I do again?
dopie has joined #ruby
<neanias> What didn't you do?
fgo has joined #ruby
<[k-_> 22:12:22 adaedra: you would prefer that we poke fun at you, shevy ?
<ddv> apeiros: i'm always screwing around with namespaces and nokogiri
<adaedra> neanias: coding in java. I never coded in Java.
vyorkin has quit [Read error: Connection reset by peer]
<neanias> adaedra: probably for the best
tesuji has quit [Ping timeout: 255 seconds]
vyorkin1 has joined #ruby
lavros has joined #ruby
tomaz_b has quit [Quit: Leaving]
<adaedra> [k-_: it was an honest proposition.
<[k-_> therefore, awful
eggoez has quit [Ping timeout: 246 seconds]
<neanias> [k-_: that gist is giving me headaches
<[k-_> awful as in mean
<[k-_> neanias: :>
<adaedra> right [k-_, let's say I'm awful.
<adaedra> what now?
pfish has joined #ruby
<shevy> don't poke me
<apeiros> ddv: you just have to pass them in on .css/.xpath
<Aderium> is there a way to tell gem install which compiler to use ?
chrissonar has quit [Remote host closed the connection]
* adaedra pokes shevy with [k-_
<Aderium> I am down to one gem that will not compile
<shevy> ouch!
<apeiros> e.g. .css("ns|tag", "ns" => "fully qualified namespace")
Xiti has quit [Ping timeout: 246 seconds]
<ddv> apeiros: I once had a xml file littered with dozens of namespaces
<pfish> is there a single c function that called when an object is edited?
<[k-_> if you are mean you should stop :c
<ddv> apeiros: and I registered all namespaces but still it wouldn't work
<shevy> Aderium hmm I think there is a way, but remember, you can always extract a .gem and enter the directory and then manually compile or modify anything there
<yorickpeterse> well sent these peeps an Email, lets see how they respond to my "can we do 30k on average with a burst of 100k and oh we also need 10 million initially" Email
<shevy> Aderium what gem is it?
<yorickpeterse> because I cbf writing city/country matchers myself
<Aderium> Its one we have created
<shevy> aha
<adaedra> [k-_: okay, I'll stop being what you call mean and be what I call evil, is that ok? >:]
fabrice31 has quit [Ping timeout: 252 seconds]
<Aderium> I cloned it locally but it seems to always call cc instead of gcc during gem install
mos has joined #ruby
<shevy> RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC']
<shevy> can that work?
<[k-_> as long as you are not mean
RegulationD has joined #ruby
<shevy> probably some settings in RbConfig altogether
peter_paule has joined #ruby
<Aderium> do I need to irb gor that ?
<Aderium> or just go to RbConfig file ?
<[k-_> i need to collect sentiments, eg what i should add (common practices of people) so my library wont cause them too much boilerplate
eggoez has joined #ruby
<shevy> Aderium hmm the above is ruby code
vyorkin1 has quit [Ping timeout: 264 seconds]
<shevy> Aderium there should be an extconf.rb yes?
<shevy> I actually never wrote a .gem that requires compiling C code
<Aderium> let me check
<shevy> you should be able to check for lots of things... have a head ... have_header('linux/inotify.h')
<Aderium> there is
<Aderium> should I add something there ?
<Aderium> I have require 'mkmf'
<Aderium> create_makefile("dirscanner_ext/dirscanner_ext")
SylarRuby has joined #ruby
<shevy> hmm not entirely sure how they use it
<shevy> problem is I also don't know how to compile on solaris sorry
tagrudev has quit [Remote host closed the connection]
evanjs has joined #ruby
havenwood has joined #ruby
<[k-_> im sure shevy has learnt to ignore my code
eggoez has quit [Ping timeout: 252 seconds]
<[k-_> shevy, there is a nicer translation of the code at the end!
<ddv> not just your code, [k-_
<[k-_> and what?
dudedudeman has quit [Ping timeout: 256 seconds]
<[k-_> there is errata in square_root and cube_root. Should be (1/2r) and (1/3r)
kies^ has joined #ruby
iooner has quit [Ping timeout: 246 seconds]
eggoez has joined #ruby
Hobbyboy has quit [Ping timeout: 246 seconds]
<shevy> [k-_ I still don't quite understand how you manage to surpass Ox0dea
<[k-_> i also used and, thats a first
<[k-_> i needed the lower precendence
<[k-_> i didnt surpass him, he wrote concise non-alphanum code
<shevy> Aderium oh that reminds me. if you have a autogenerated Makefile, can you not just modify the part where it grabs the C compiler?
<Aderium> we use cmake
<[k-_> i write ugly and unconcise mostly non-alphanum code
<Aderium> not sure how to tell cmake to use gcc
Hobbyboy has joined #ruby
jonathanwallace has joined #ruby
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
t0rrieri__ has joined #ruby
<JMoir> I'm reading some code and I came across this: @now = session || Hash.new Am I right in thinking that this line sets @now to session if it is set, but if it is nil or false, it creates a new Hash?
<jimmythehat> jhass no its still undefined
DaniG2k has joined #ruby
startupality has joined #ruby
iooner has joined #ruby
dudedudeman has joined #ruby
<jhass> jimmythehat: paste some actual code and the error output
stamina has quit [Remote host closed the connection]
<ljarvis> JMoir: yes
dudedudeman has quit [Changing host]
dudedudeman has joined #ruby
<JMoir> ljarvis: Thank you! I just wanted to check, I've never seen it before
vyorkin1 has joined #ruby
<jimmythehat> its not a method on the original string but a method on a different string. The inblock variable 'letter' is a new string for each loop (I think). It becomes a new string containing one letter of the original string
<jimmythehat> jhass: okies
Xiti has joined #ruby
iooner has quit [Max SendQ exceeded]
mos has quit [Quit: Leaving]
yardenbar has quit [Quit: Leaving]
iooner has joined #ruby
LMity has joined #ruby
_blizzy_ has joined #ruby
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
t0rrieri__ has quit [Quit: Be back later ...]
frem has joined #ruby
tmtwd has quit [Ping timeout: 246 seconds]
theery has joined #ruby
eGGsha has joined #ruby
werelivinginthef has joined #ruby
presto has quit [Read error: Connection reset by peer]
presto has joined #ruby
lapide_viridi has joined #ruby
rsty1 has joined #ruby
theery has quit [Remote host closed the connection]
decoponio has joined #ruby
victortyau has quit [Quit: Leaving]
sharpmachine has joined #ruby
_blizzy_ has quit [Read error: Connection reset by peer]
riotjones has quit [Remote host closed the connection]
<Aderium> ok adding extconf the ruby config worked
aspiers has quit [Ping timeout: 246 seconds]
<Aderium> yone knows this error ? gcc: error: unrecognized command line option ‘-KPIC’
<rsty1> a JSON object that has many sets of {:notes=>"value", :key=>"value", :value=>"value}... how would i display the :value value, when :keys value = "ExpectedKey"
<shevy> Aderium I only know of -fPIC
<jhass> rsty1: you mean an array of hashes or?
<rsty1> i have JSON output
Zamyatin has joined #ruby
<[k-_> shevy: quick, throw me something easy to write in ruby (eg Run-length encoder)
theery has joined #ruby
_blizzy_ has joined #ruby
<jhass> rsty1: no, what you posted is the inspect of a hash
<rsty1> and i have an object called :custom_fields, with the above 3 values in each
<jhass> ?code rsty1
<ruboto> rsty1, We can't help you without your code, please post it to https://gist.github.com
Dreamer3 has joined #ruby
<shevy> [k-_ a random word insulter
tkuchiki has quit [Remote host closed the connection]
sharpmachine has quit [Ping timeout: 265 seconds]
pietr0 has joined #ruby
<[k-_> no that would be too easy
tkuchiki has joined #ruby
<[k-_> something around the difficulty of rle
mary5030 has joined #ruby
felixr has joined #ruby
pabs has quit [Ping timeout: 265 seconds]
<ruboto> rsty1, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/4d4a9e3d76bd8ea229b2
<ruboto> pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
<rsty1> that is whta object looks like
<jhass> rsty1: that is an array of hashes, the answer to my question is yes
LMity has quit [Ping timeout: 256 seconds]
<rsty1> how would i return the color, which is purple in that example
<jhass> json_c[:custom_fields].find {|field| field[:key] == "ExpectedKey" }[:value]
<jhass> json_c[:custom_fields].find {|field| field[:key] == "Color" }[:value]
<rsty1> ahh, awesome!
<rsty1> thanks
pabs has joined #ruby
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<ljarvis> better yet build your own objects from that hash
aspiers has joined #ruby
<ljarvis> tune in for more unscalable tips and tricks
dblessing has quit [Ping timeout: 256 seconds]
<jhass> or at least .map {|field| [field[:key], field] }.to_h
acke has quit [Quit: Leaving...]
<apeiros> adding ?jsonobject next…
MagePsycho_ has joined #ruby
rippa has joined #ruby
<jhass> yes please
<apeiros> so common
<ljarvis> aye
charliesome has quit [Ping timeout: 246 seconds]
unshadow has quit [Quit: leaving]
pfish has quit [Quit: Page closed]
<apeiros> !fact add jsonobject there is no such thing as a JSON object. You either have a String containing serialized JSON, or you have ruby objects (usually Hashes/Arrays/Strings). Which is it?
<ruboto> apeiros, I will remember that jsonobject is there is no such thing as a JSON object. You either have a String containing serialized JSON, or you have ruby objects (usually Hashes/Arrays/Strings). Which is it?
<apeiros> good to go?
<[k-_> wait, he wants the key and the hash?
jimmythehat has quit [Ping timeout: 248 seconds]
jottr has quit [Ping timeout: 244 seconds]
TomyWork has joined #ruby
<TomyWork> hi
<rsty1> thank you all, i have a solution now :)
<ljarvis> hi
symm- has joined #ruby
* apeiros still ponders creating a JsonObject gem which would provide XML DOM like access to json data :D
agent_white has quit [Read error: Connection reset by peer]
<TomyWork> how can i pass a {} block on to another function?
<ljarvis> apeiros: jpath!
<jhass> TomyWork: def foo(&block) other(&block)
<TomyWork> ah
<jhass> TomyWork: where block is an arbitrary name
tmtwd has joined #ruby
<TomyWork> i'll stick with block though :)
msnyon has joined #ruby
<TomyWork> i tried various variations of that, but &block on both ends i didnt try
<TomyWork> thanks
dudo has joined #ruby
mary5030 has quit [Remote host closed the connection]
dudo has quit [Remote host closed the connection]
jottr has joined #ruby
mdarby has joined #ruby
Zai00 has quit [Quit: Zai00]
mary5030 has joined #ruby
silverdust is now known as bl4ckdu5t
agent_white has joined #ruby
allomov has quit [Remote host closed the connection]
davedev24 has joined #ruby
bruno- has joined #ruby
wprice has quit [Quit: wprice]
presto has quit [Quit: Konversation terminated!]
presto has joined #ruby
presto has quit [Client Quit]
bl4ckdu5t is now known as silverdust
presto has joined #ruby
sharpmachine has joined #ruby
gwendall has quit [Read error: Connection timed out]
theery has quit [Remote host closed the connection]
sarkyniin has joined #ruby
aspiers has quit [Ping timeout: 256 seconds]
programmerq has joined #ruby
gwendall has joined #ruby
fullofcaffeine has joined #ruby
ItSANgo__ has quit [Quit: Leaving...]
mary5030 has quit [Remote host closed the connection]
werelivinginthef has quit [Remote host closed the connection]
mary5030 has joined #ruby
charliesome has joined #ruby
varunwachaspati has quit [Ping timeout: 264 seconds]
pothibo has quit [Quit: pothibo]
presto has quit [Read error: Connection reset by peer]
Aswebb_ has joined #ruby
presto has joined #ruby
snockerton has joined #ruby
symbol has joined #ruby
startupality has quit [Quit: startupality]
msgodf has quit [Ping timeout: 240 seconds]
eGGsha has quit [Quit: Textual IRC Client: www.textualapp.com]
theery has joined #ruby
Mojo_Nixon has joined #ruby
swills has joined #ruby
theery has quit [Remote host closed the connection]
jschoolcraft has quit [Quit: peace]
IanV0rn2341 has joined #ruby
bruno- has quit [Quit: Lost terminal]
blackmesa has quit [Ping timeout: 256 seconds]
njs126 has quit [Quit: Leaving]
gamename has joined #ruby
<[k-_> im going to do this with my library, :>
fullofcaffeine has quit [Remote host closed the connection]
dgutierrez1287 has joined #ruby
dhjondoh has joined #ruby
startupality has joined #ruby
dhjondoh has quit [Client Quit]
werelivinginthef has joined #ruby
gambl0re has joined #ruby
noobda has joined #ruby
bhorn1 has quit [Quit: Leaving]
ItSANgo has joined #ruby
<noobda> Hi guys! So I read a POST request to a website, from the Chrome's network tab. How to replicate it and send using Ruby?
jottr_ has joined #ruby
<jhass> by using a http client, the one shipped with ruby is called net/http
jottr has quit [Ping timeout: 252 seconds]
<noobda> postData = Net::HTTP.post_form(URI.parse(uriAdd), {'i' => 100})
<noobda> this is what I'm trying... but doesn't work
dgutierrez1287 has quit [Ping timeout: 252 seconds]
<jhass> did you try turning it off and on again?
aalhamad has joined #ruby
<noobda> :|
<jhass> (that's my default response to "doesn't work")
<noobda> Okay how do I include the request header? it's looking confusing....
<neanias> This is why I normally use httparty...
<jhass> you can't via the post_form method, you'll have to use one of the longer examples or a different client library
<jhass> neanias: I hate that include HTTParty recommendation though
revath has quit [Ping timeout: 264 seconds]
<neanias> Yeah
<neanias> I normally just do HTTParty.blah
scripore has quit [Quit: This computer has gone to sleep]
vyorkin1 has quit [Quit: WeeChat 1.2]
<noobda> http://pastebin.com/uQ9yjTC2 this is the header....
<ruboto> noobda, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/4f81f87fb8d3d4f10b53
<ruboto> pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
<ljarvis> but it gives you a false sense of encapsulation!
pfish has joined #ruby
strixd has joined #ruby
<pfish> is there a c function that is used to set the value of an object?
aalhamad has left #ruby [#ruby]
jpfuentes2 has joined #ruby
<jhass> noobda: won't change my answer
<shevy> pfish everything in ruby is C behind the scene isn't it :D
<ljarvis> ?context pfish
<ruboto> pfish, Please add more context to your question, what are you doing, why are you doing it, which libraries are involved. Post some code to gist if it clarifies your question.
brianpWins has quit [Ping timeout: 256 seconds]
white_bear has quit [Quit: leaving]
fantazo has quit [Quit: Verlassend]
<shevy> to set a hash, one would use rb_hash_aset()
<noobda> know any good client library that I can check out?
CatMartyn has joined #ruby
<adaedra> neanias told you about httpparty, I usually use curb, there are others, check ruby-toolbox
<jhass> noobda: http looks pretty neat, faraday hasn't failed on me either
<neanias> I didn't like that curb needed to step out of ruby
<noobda> okay thanks!!
<havenwood> neanias: just libcurl
<ljarvis> D:
<neanias> True, but HTTParty is all ruby
<havenwood> neanias: HTTPClient and Excon are two more pure-Ruby honorable mentions.
<neanias> And wraps Net::HTTP
<ljarvis> libvomit
<havenwood> neanias: It's actually a wrapper around Net::, yeah
<neanias> Close enough
JakFrist has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<havenwood> neanias: Not so for HTTPClient and Excon
jespada has joined #ruby
<neanias> Are they independent solutions?
<havenwood> neanias: If you might want to switch your adapter, Faraday. I do like HTTP's chaining syntax personally.
<ljarvis> faraday is http.rb are my favs too
ledestin has joined #ruby
<ljarvis> s/is/and/
<neanias> I don't use Faraday
<neanias> I just use HTTParty
treehug88 has joined #ruby
JakFrist has joined #ruby
<adaedra> When you HTTPParty, you must party hard!
<havenwood> neanias: Maybe give HTTP.rb a try.
<havenwood> If the partying gets to be too much.
<neanias> Might have a look
arup_r has joined #ruby
Soda has joined #ruby
gizmore has joined #ruby
presto has quit [Ping timeout: 248 seconds]
a346 has joined #ruby
<neanias> havenwood: looks p nice
DoubleMalt has quit [Remote host closed the connection]
ljt has quit [Read error: Connection reset by peer]
ledestin has quit [Client Quit]
arturaz has quit [Ping timeout: 255 seconds]
NeverDie has joined #ruby
rcvalle has joined #ruby
NeverDie has quit [Max SendQ exceeded]
baweaver has joined #ruby
Pathfinder has quit [Ping timeout: 265 seconds]
Cache_Money has joined #ruby
Pathfinder_ has joined #ruby
scripore has joined #ruby
NeverDie has joined #ruby
ljt has joined #ruby
lessless has joined #ruby
ljt has quit [Read error: Connection reset by peer]
JakFrist has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<apeiros> hm, didn't I ask today "debugging… how does it work?"? and right now this: http://www.rubyflow.com/p/j0j7lf-debugging-ruby-5-tips-to-help-you-fix-your-code
<apeiros> somebody is spying on me!
icebourg has joined #ruby
NeverDie has quit [Max SendQ exceeded]
wprice has joined #ruby
baweaver has quit [Ping timeout: 248 seconds]
sdothum has joined #ruby
gwendall has quit [Remote host closed the connection]
sdothum has quit [Read error: Connection reset by peer]
gwendall has joined #ruby
DexterLB has quit [*.net *.split]
hectortrope has quit [*.net *.split]
AlexRussia has quit [*.net *.split]
Riking has quit [*.net *.split]
mozzarella has quit [*.net *.split]
AustinMatherne has quit [*.net *.split]
thang has quit [*.net *.split]
angelixd has quit [*.net *.split]
justinmcp has quit [*.net *.split]
Ankhers has quit [*.net *.split]
jzigmund has quit [*.net *.split]
raenk has quit [*.net *.split]
Ray` has quit [*.net *.split]
quarcu has quit [*.net *.split]
frankS2 has quit [*.net *.split]
ex0ns has quit [*.net *.split]
dabradley has quit [*.net *.split]
segv has quit [*.net *.split]
diego_k has quit [*.net *.split]
queequeg2 has quit [*.net *.split]
Silex has quit [*.net *.split]
Kovensky has quit [*.net *.split]
lguardiola has quit [*.net *.split]
zonetti has quit [*.net *.split]
tommylommykins has quit [*.net *.split]
Lloyd has quit [*.net *.split]
jimbeaudoin has quit [*.net *.split]
nomadic has quit [*.net *.split]
olblak has quit [*.net *.split]
kitallis has quit [*.net *.split]
cout has quit [*.net *.split]
nirix has quit [*.net *.split]
neanias has quit [*.net *.split]
ujjain has quit [*.net *.split]
zzak has quit [*.net *.split]
ebarrett has quit [*.net *.split]
SirCmpwn has quit [*.net *.split]
luluapple has quit [*.net *.split]
cgrieger^away has quit [*.net *.split]
Biohazard has quit [*.net *.split]
dostoyevsky has quit [*.net *.split]
joevandyk has quit [*.net *.split]
coffeeju1 has quit [*.net *.split]
skyjumper has quit [*.net *.split]
sash_ has quit [*.net *.split]
Guest85414______ has quit [*.net *.split]
iamdevnul has quit [*.net *.split]
duckson_ has quit [*.net *.split]
braidn has quit [*.net *.split]
ptierno_ has quit [*.net *.split]
deavidsedice has quit [*.net *.split]
annihilannic has quit [*.net *.split]
madhatter has quit [*.net *.split]
aytch has quit [*.net *.split]
zz_Outlastsheep has quit [*.net *.split]
redondos has quit [*.net *.split]
cappsio has quit [*.net *.split]
icedp has quit [*.net *.split]
destruct1re has quit [*.net *.split]
TheMoonMaster has quit [*.net *.split]
im0b has quit [*.net *.split]
cardoni_ has quit [*.net *.split]
bove has quit [*.net *.split]
dmoe has quit [*.net *.split]
Derasi has quit [*.net *.split]
angelixd has joined #ruby
jmcc has quit [*.net *.split]
Adran has quit [*.net *.split]
benatkin_ has quit [*.net *.split]
ggherdov has quit [*.net *.split]
Esya has quit [*.net *.split]
neersighted has quit [*.net *.split]
skakri has quit [*.net *.split]
go|dfish has quit [*.net *.split]
Senjai has quit [*.net *.split]
PierreRambaud has quit [*.net *.split]
aninaki has quit [*.net *.split]
Sp4rKy has quit [*.net *.split]
swistak35_ has quit [*.net *.split]
ezra_ has quit [*.net *.split]
maxmanders has quit [*.net *.split]
jeaye has quit [*.net *.split]
eregon has quit [*.net *.split]
mosez has quit [*.net *.split]
pingveno has quit [*.net *.split]
jxie_ has quit [*.net *.split]
yo61 has quit [*.net *.split]
bihi has quit [*.net *.split]
dhruvasagar has quit [*.net *.split]
mroth has quit [*.net *.split]
apeiros has quit [*.net *.split]
yorickpeterse has quit [*.net *.split]
exceion has quit [*.net *.split]
neektza has quit [*.net *.split]
cbetta has quit [*.net *.split]
nitrix has quit [*.net *.split]
dfoolz has quit [*.net *.split]
ght has quit [*.net *.split]
oddmunds has quit [*.net *.split]
EvanGuru has quit [*.net *.split]
moredhel- has quit [*.net *.split]
_Tristan-Speccy_ has quit [*.net *.split]
ss_ss has quit [*.net *.split]
finges has quit [*.net *.split]
THEahindle has quit [*.net *.split]
DefV has quit [*.net *.split]
Meeh has quit [*.net *.split]
Nowaker has quit [*.net *.split]
preller_ has quit [*.net *.split]
flori has quit [*.net *.split]
ByronJohnson has quit [*.net *.split]
thang has joined #ruby
AustinMatherne has joined #ruby
SirCmpwn has joined #ruby
bhorn1 has joined #ruby
olblak has joined #ruby
nomadic has joined #ruby
ex0ns has joined #ruby
Ray` has joined #ruby
tommylommykins has joined #ruby
cgrieger^away has joined #ruby
THEahindle has joined #ruby
sdothum has joined #ruby
cout has joined #ruby
pingveno has joined #ruby
queequeg1 has joined #ruby
ptierno has joined #ruby
madhatter has joined #ruby
swistak35 has joined #ruby
Biohazard has joined #ruby
mosez has joined #ruby
skyjumper has joined #ruby
Nowaker has joined #ruby
DefV has joined #ruby
aninaki has joined #ruby
dostoyevsky has joined #ruby
Sp4rKy has joined #ruby
sash_ has joined #ruby
raenk has joined #ruby
skakri has joined #ruby
Ankhers has joined #ruby
flori has joined #ruby
nirix has joined #ruby
annihila1nic has joined #ruby
benatkin has joined #ruby
cappsio has joined #ruby
ebarrett has joined #ruby
quarcu has joined #ruby
exceion has joined #ruby
duckson has joined #ruby
ezra has joined #ruby
redondos has joined #ruby
destructure has joined #ruby
redondos has quit [Changing host]
redondos has joined #ruby
PierreRambaud has joined #ruby
ss_ss has joined #ruby
joevandyk has joined #ruby
ByronJohnson has joined #ruby
jzigmund has joined #ruby
hectortrope has joined #ruby
jzigmund has quit [Changing host]
jzigmund has joined #ruby
mozzarella has joined #ruby
bihi has joined #ruby
pietr0 has quit [Ping timeout: 248 seconds]
AccordLTN has joined #ruby
Senjai has joined #ruby
dfoolz has joined #ruby
dhruvasagar has joined #ruby
yorickpeterse has joined #ruby
Kovensky has joined #ruby
finges has joined #ruby
preller_ has joined #ruby
coffeeju1 has joined #ruby
kitallis has joined #ruby
oddmunds has joined #ruby
AlexRussia has joined #ruby
ght has joined #ruby
moredhel has joined #ruby
Silex has joined #ruby
aytch has joined #ruby
ezra is now known as Guest60181
diegok has joined #ruby
dabradley has joined #ruby
Riking has joined #ruby
njs126 has joined #ruby
zonetti has joined #ruby
segv has joined #ruby
go|dfish has joined #ruby
maxmanders has joined #ruby
jeaye has joined #ruby
justinmcp has joined #ruby
eregon has joined #ruby
jxie has joined #ruby
Meeh has joined #ruby
deavid has joined #ruby
asi_ has joined #ruby
apeiros has joined #ruby
icedp has joined #ruby
rindolf has joined #ruby
<rindolf> Hi all.
noobda has quit [Ping timeout: 246 seconds]
Esya- has joined #ruby
ujjain has joined #ruby
ujjain has quit [Changing host]
ujjain has joined #ruby
g3funk has joined #ruby
sharpmachine has quit [Remote host closed the connection]
Adran has joined #ruby
[H]unt3r has joined #ruby
lguardiola has joined #ruby
Tristan-Speccy has joined #ruby
n008f4g_ has quit [Ping timeout: 246 seconds]
neanias has joined #ruby
sharpmachine has joined #ruby
sdothum has quit [Client Quit]
sharpmac_ has joined #ruby
sharpmachine has quit [Read error: Connection reset by peer]
riotjones has joined #ruby
jwaldrip has joined #ruby
gwendall has quit [Ping timeout: 246 seconds]
TheMoonMaster has joined #ruby
sdothum has joined #ruby
t0rrieri__ has joined #ruby
niemcu has quit [Ping timeout: 256 seconds]
djbkd_ has joined #ruby
zzak has joined #ruby
MagePsycho_ has quit [Quit: MagePsycho_]
NeverDie has joined #ruby
Guest74302 has joined #ruby
cardoni_ has joined #ruby
Scrofff has joined #ruby
arup_r has quit [Ping timeout: 244 seconds]
riotjones has quit [Ping timeout: 256 seconds]
bruno- has joined #ruby
<[k-_> awwwww submission timed out
arup_r has joined #ruby
<[k-_> looks like it takes too long
<[k-_> :(
NeverDie has quit [Max SendQ exceeded]
<[k-_> maybe i shouldn't obscure it
amclain has joined #ruby
pietr0 has joined #ruby
cpruitt has quit [Read error: Connection reset by peer]
<[k-_> eh?
NeverDie has joined #ruby
<apeiros> [k-_: you could apply at zenspider to maintain his ruby obfuscator
<[k-_> i think it was my connection, it works now :)
sshuff has joined #ruby
Evan_ has joined #ruby
<apeiros> seems you're accruing great knowledge for that :D
<[k-_> he has one?
Scroff has quit [Ping timeout: 250 seconds]
cpruitt has joined #ruby
<apeiros> commercial even, yes
<[k-_> gimmegimme
iamse7en has joined #ruby
varunwachaspati has joined #ruby
NeverDie has quit [Client Quit]
<iamse7en> I have a button that adds a filter: <%= link_to 'NFL', request.original_url + '&league[]=nfl', class: 'btn btn-default' %>, but how do I do the exact opposite, removing the filter or removes '&league[]=nfl' from the url?
NeverDie has joined #ruby
<apeiros> odd, I remembered it doing something else
<apeiros> maybe I'm confusing stuff again…
niko has quit [Ping timeout: 615 seconds]
<apeiros> iamse7en: rails?
neektza has joined #ruby
<jhass> ?crosspost iamse7en
<ruboto> iamse7en, Please do not crosspost without at least telling so and mentioning provided suggestions and their outcome in all channels. Experience shows that people don't do either, and not doing so is considered rude.
<iamse7en> ok i'll check it out thanks
<apeiros> oh, crosspost and unresponsive. good riddance.
allomov has joined #ruby
mroth has joined #ruby
<apeiros> !kick iamse7en crosspost
iamse7en was kicked from #ruby by ruboto [crosspost]
iamse7en has joined #ruby
<jhass> heh
<[k-_> lel, that looks too complex for me
iamse7en has left #ruby ["I'm out like a black kid in a spelling bee."]
<[k-_> i force people to write obfuscated code!
frankS2 has joined #ruby
fullofcaffeine has joined #ruby
Guest74302 has quit [Changing host]
Guest74302 has joined #ruby
jimbeaudoin has joined #ruby
Guest74302 is now known as nitrix
Marc_Aldrich has joined #ruby
Lloyd has joined #ruby
shinnya has joined #ruby
kedare has joined #ruby
SylarRuby has quit [Remote host closed the connection]
<Marc_Aldrich> I've got a quick question about RubyInstaller: IRB is broken on setup, Ruby -v works. Path doesn't seem to be an issue. Win7-x64 machine. Anybody have a hint or advice on where to point my question?
fgo has quit [Quit: WeeChat 1.1.1]
mary5030 has quit [Ping timeout: 255 seconds]
quimrstorres has quit [Ping timeout: 246 seconds]
mary5030 has joined #ruby
k3asd` has joined #ruby
kedare has quit [Client Quit]
jmcc has joined #ruby
kedare has joined #ruby
mary5030 has quit [Remote host closed the connection]
niko has joined #ruby
dmoe has joined #ruby
mary5030 has joined #ruby
rehat_ has joined #ruby
kedare has quit [Client Quit]
<havenwood> Marc_Aldrich: How is it broken?
kedare has joined #ruby
<Marc_Aldrich> A cascading error: "rbreadline.rb:1097:in `<module:RbReadline>': HOME environment variable (or HOMEDRIVE and HOMEPATH)
<Marc_Aldrich> must be set and point to a directory (RuntimeError)"
<Marc_Aldrich> That is top error though
<Marc_Aldrich> Also thank you for your time
bove has joined #ruby
cbetta has joined #ruby
<shevy> try to set that var?
nathanstitt has quit [Quit: Laters]
<Marc_Aldrich> I'm not entirely sure what var it wants to have set or where it want it to point. HOME is currently undefined. I could set it, just not sure what to point at and readme doesn't seem to list it
im0b has joined #ruby
Guest85414______ has joined #ruby
mleung has joined #ruby
* Marc_Aldrich is a Linux user stuck on windows for work
quimrstorres has joined #ruby
Lucky___ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
chouhoulis has quit []
<shevy> well set it anyway to your home dir, perhaps it won't help but if it helps that would have solved that quite quickly
<shevy> I am also a Linux user :)
Ilyas has joined #ruby
t0rrieri__ has quit [Quit: Be back later ...]
theery has joined #ruby
<Marc_Aldrich> A fair recommendation. I'll give it a shot
snockerton has quit [Quit: Leaving.]
iamdevnul has joined #ruby
Igorshp has quit [Remote host closed the connection]
t0rrieri__ has joined #ruby
<Marc_Aldrich> Did not work when setting HOME or HOMEPATH to ruby install direction or ruby/lib
<Marc_Aldrich> Same error
yo61 has joined #ruby
<Antiarc> You probably want to set it to c:\Users\YourUsername
<Antiarc> or something like that
neersighted has joined #ruby
yo61 has quit [Client Quit]
snockerton has joined #ruby
<Antiarc> Also if you're setting it via the env vars manager in advanced system settings, be sure to relaunch any command prompts so they'll pick up the change
<Marc_Aldrich> Thank you for the suggestion. Result-> Same error
<shevy> yeah let me look at that strange rbreadline.rb file ...
shredding has quit [Ping timeout: 248 seconds]
allomov has quit [Remote host closed the connection]
<shevy> btw on a sidenote, is Readline required on windows?
<Marc_Aldrich> Current procedure is using: setx HOME ..., then cmd, then irb
lordkryss has joined #ruby
<Marc_Aldrich> I added it with gem install rb-readline just in case
djbkd_ has quit [Remote host closed the connection]
<Marc_Aldrich> But I honestly do not know.
Agoldfish has joined #ruby
<shevy> hmm
polpak has joined #ruby
<Marc_Aldrich> wait got it!
<shevy> when I installed ruby on my windows machine downstairs, it worked fine, irb too. I did not install readline though
joonty has quit [Quit: joonty]
ggherdov has joined #ruby
<shevy> guess it is this strange gem https://rubygems.org/gems/rb-readline
<Antiarc> (speaking as a windows user, if you can at all help it, avoid Ruby on Windows)
<shevy> hehehe
DaniG2k has quit [Quit: leaving]
<Antiarc> Spin up a Linux VM and SSH into it/mount a samba share :P
strixd has quit [Quit: 500]
<Marc_Aldrich> lol, the thought has crossed my mind
IanV0rn2341 has quit [Read error: Connection reset by peer]
<Marc_Aldrich> Already have an overly complicated build system with multiple targets, tools and more
blackmesa has joined #ruby
joshmyers has quit [Remote host closed the connection]
towski_ has joined #ruby
<Marc_Aldrich> The irony is that I only need ruby, because it is used heavily in the make system.
IanV0rn2341 has joined #ruby
niko has quit [Ping timeout: 615 seconds]
<Antiarc> If you aren't dependent specifically on MRI, you might consider jruby
lampd1 has quit [Remote host closed the connection]
<Antiarc> It tends to deploy well on Windows
<Antiarc> It starts up more slowly which would be a bummer in a make system with lots of Ru0by 0
<Antiarc> invocations
<Antiarc> sorry, toddler on lap hammering keys
<shevy> yeah yeah yeah
<Antiarc> But it should work without a ton of fiddling
<shevy> it was ALL YOU man :D
gizmore has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
sofija has joined #ruby
<shevy> cat... toddles... earthquakes... we know those kind of excuses
towski_ has quit [Remote host closed the connection]
<Antiarc> man typing while fending off a toddler who loves keyboards is IRC hardmode
hololeap has joined #ruby
<Marc_Aldrich> Pro tip: get a second keyboard and give it to the kid
<Marc_Aldrich> Has worked for me in the past
MarkTurner has joined #ruby
JulienTa_ has quit [Read error: Connection reset by peer]
<shevy> all the dirty secrets get out to light now \o/
_blizzy_ has quit [Ping timeout: 248 seconds]
yo61 has joined #ruby
symm- has quit [Ping timeout: 256 seconds]
Hounddog has quit [Remote host closed the connection]
TomyWork has quit [Ping timeout: 264 seconds]
Mojo_Nixon has quit [Quit: Textual IRC Client: www.textualapp.com]
bricker has joined #ruby
revath has joined #ruby
zz_Outlastsheep has joined #ruby
CloCkWeRX has quit [Quit: Leaving.]
niko has joined #ruby
Spami has joined #ruby
<Marc_Aldrich> Thanks for the help gents! For the record, it seems simply arbitrary setting HOME made IRB happy along with the other tools.
Marc_Aldrich has quit [Quit: Leaving]
Rollabunna has joined #ruby
quimrstorres has quit [Remote host closed the connection]
lapide_viridi has quit [Quit: Leaving]
stan has quit [Ping timeout: 256 seconds]
fabrice31 has joined #ruby
simplyia_ has quit [Remote host closed the connection]
simplyianm has joined #ruby
lampd1 has joined #ruby
t0rrieri__ has quit [Quit: Be back later ...]
quimrstorres has joined #ruby
t0rrieri__ has joined #ruby
t0rrieri__ has quit [Client Quit]
allcentury has quit [Ping timeout: 255 seconds]
fabrice31 has quit [Ping timeout: 246 seconds]
simplyianm has quit [Ping timeout: 255 seconds]
mercwithamouth has joined #ruby
Torrieri has joined #ruby
Pathfinder_ has quit [Ping timeout: 265 seconds]
<shevy> aha!
quimrstorres has quit [Remote host closed the connection]
<shevy> the simple way worked!
quimrstorres has joined #ruby
solars has quit [Ping timeout: 244 seconds]
<shevy> now you can fully appreciate the power of the awesomeness that is windows
CorySimmons has joined #ruby
<adaedra> wow shevy
nfk has quit [Read error: Connection reset by peer]
<adaedra> you can't associate awesomeness and windows like that
MarkTurner has quit [Quit: This is probably a wireless dropout]
pengin has joined #ruby
quimrstorres has quit [Remote host closed the connection]
werelivinginthef has quit [Remote host closed the connection]
<shevy> awindowsness
<shevy> awesomeness
<shevy> see! almost same amount of characters
anisha has quit [Quit: Leaving]
devbug has joined #ruby
werelivinginthef has joined #ruby
dfockler has joined #ruby
<arup_r> In Ruby how can I get a unix timestamps from a DateTime object ?
<arup_r> any direct method ?
<adaedra> isn't it to_i?
lavros has quit [Quit: leaving]
CorySimmons has quit [Client Quit]
nfk has joined #ruby
cabreraM516 has joined #ruby
douglasssss has joined #ruby
<jhass> >> require "datetime"; DateTime.now.to_i
<ruboto> jhass # => cannot load such file -- datetime (LoadError) ...check link for more (https://eval.in/397918)
<jhass> wat
<jhass> >> require "date"; DateTime.now.to_i
<ruboto> jhass # => undefined method `to_i' for #<DateTime:0x42125498> (NoMethodError) ...check link for more (https://eval.in/397920)
<jhass> :o
<arup_r> hehehe
<jhass> >> require "date"; DateTime.now.to_time.to_i
<ruboto> jhass # => 1436804848 (https://eval.in/397921)
[Butch] has joined #ruby
aryaching has joined #ruby
dfockler has quit [Ping timeout: 246 seconds]
<rsty1> i thought it was just Time.new.to_i
<adaedra> arup_r asked from a DateTime
RobertBirnie has joined #ruby
<jhass> it is, if you're asking for the current
<rsty1> ah :)
lolmaus has joined #ruby
Notte has joined #ruby
dfockler has joined #ruby
luluapple has joined #ruby
DexterLB has joined #ruby
troulouliou_dev has joined #ruby
n008f4g_ has joined #ruby
mercwithamouth has quit [Ping timeout: 264 seconds]
withnale_ has quit [Ping timeout: 244 seconds]
allomov has joined #ruby
<Senjai> Good morning ruby
lavros has joined #ruby
[H]unt3r has quit [Ping timeout: 248 seconds]
B1n4r10 has quit [Ping timeout: 252 seconds]
<shevy> Good morning Vietjai!
Igorshp has joined #ruby
dojobo has joined #ruby
<dojobo> hi guys
<jhass> hey girl
<dojobo> anyone have trouble getting cron and nokogiri to work together?
lavros has quit [Client Quit]
<jhass> nope, you're alone
<centrx> cron and nokogiri together? what?
arturmartins has quit [Quit: Leaving...]
<dojobo> yeah i've got a script that uses nokogiri to do some transformations on an rss feed and save it as a new file
lavros has joined #ruby
<dojobo> and i want to run it in cron so that it does it every few hours
<dojobo> (since the rss is continually updating of course)
JimmyNeutron has quit [Read error: Connection reset by peer]
Alayde has joined #ruby
<centrx> Good idea
<dojobo> i'm using rvm and i've done another script using the wrappers, so i don't think that's the problem
<dojobo> thanks
solars has joined #ruby
<dojobo> i'm getting the 'cannot load such file' error even though doing `rvm use 2.1.5` and `require 'nokogiri'` => true
pengin has quit [Remote host closed the connection]
<dojobo> (and i'm using the 2.1.5 wrapper obviously)
<arup_r> what should I do ?
<Senjai> dojobo: cron doesn't run as your user, or in your environment
<Senjai> You can use chruby, install rubies into a proper system wide folder, and use absolute paths to ruby in cron instead.
<Senjai> Or do something weird to get rvm to work system wide, which I can't remember
havenwood has quit [Quit: Textual IRC Client: www.textualapp.com]
Burgestrand has quit [Quit: Burgestrand]
werelivinginthef has quit [Remote host closed the connection]
<dojobo> thanks Senjai, i'll look into this :)
<dojobo> i'm guessing having both rvm and chruby will cause problems?
Pupeno has quit [Quit: Leaving...]
<Senjai> No, but you should just get rid of rvm
<arup_r> jhass: little shorter http://stackoverflow.com/a/19754440/2767755
<arup_r> but thanks
evanjs has quit [Remote host closed the connection]
<jhass> arup_r: not the same though
<Senjai> arup_r: No, just no
bhorn1 is now known as bhorn1|away
<arup_r> same
<Senjai> arup_r: Time.now.to_i
<jhass> arup_r: I mean, look at the votes
<Senjai> arup_r: That is just bad, don't do that
nofxx has quit [Ping timeout: 246 seconds]
allomov has quit [Remote host closed the connection]
nofxx has joined #ruby
<arup_r> ok.. Senjai which one is better? tell me I'll use that..
treehug88 has quit [Quit: Textual IRC Client: www.textualapp.com]
<Senjai> irb(main):001:0> Spree::Order.first.created_at.to_i
<Senjai> Spree::Order Load (0.4ms) SELECT "spree_orders".* FROM "spree_orders" ORDER BY "spree_orders"."id" ASC LIMIT 1
<Senjai> => 1436546329
<Senjai> arup_r: ^
pengin has joined #ruby
<arup_r> ok
HakN99 has joined #ruby
Senjai has quit [Changing host]
Senjai has joined #ruby
bronson has joined #ruby
Senjai has quit [Quit: WeeChat 0.4.2]
Senjai`work has joined #ruby
olistik has quit [Remote host closed the connection]
Senjai`work has quit [Changing host]
Senjai`work has joined #ruby
Senjai`work is now known as Senjai
mary5030_ has joined #ruby
mary5030 has quit [Ping timeout: 248 seconds]
gambl0re has quit [Ping timeout: 252 seconds]
mary5030_ has quit [Remote host closed the connection]
tkuchiki has quit [Remote host closed the connection]
mary5030 has joined #ruby
sshuff is now known as sshuff|lunch
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
pietr0 has quit [Ping timeout: 246 seconds]
towski_ has joined #ruby
fullofcaffeine has quit [Remote host closed the connection]
Voker57 has quit [Read error: Connection reset by peer]
NeverDie has joined #ruby
edwinvdgraaf has quit [Ping timeout: 244 seconds]
AlphaAtom has joined #ruby
<[k-_> i did it!
PhantomSpank has joined #ruby
fantazo has joined #ruby
baweaver has joined #ruby
niemcu has joined #ruby
NeverDie has quit [Max SendQ exceeded]
acke has joined #ruby
NeverDie has joined #ruby
NeverDie has quit [Max SendQ exceeded]
NeverDie has joined #ruby
MarkTurner has joined #ruby
quimrstorres has joined #ruby
fullofcaffeine has joined #ruby
Igorshp has quit [Remote host closed the connection]
Lucky___ has joined #ruby
lavros_ has joined #ruby
baweaver has quit [Ping timeout: 248 seconds]
quimrstorres has quit [Remote host closed the connection]
charliesome has quit [Ping timeout: 250 seconds]
JimmyNeutron has joined #ruby
symm- has joined #ruby
lavros has quit [Ping timeout: 264 seconds]
bungoman has quit [Remote host closed the connection]
zacstewart has quit [Remote host closed the connection]
eGGsha has joined #ruby
thiagovsk has quit [Quit: Connection closed for inactivity]
<shevy> "You need to sign in or sign up before continuing."
<shevy> how can you [k-_ !
charliesome has joined #ruby
<[k-_> i need a ruby minifier :(
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Igorshp has joined #ruby
sharpmac_ has quit [Remote host closed the connection]
ascarter has joined #ruby
lkba_ has quit [Read error: Connection reset by peer]
<jhass> oh, let me downvote that
lkba has joined #ruby
iateadonut has left #ruby [#ruby]
lkba_ has joined #ruby
jottr_ has quit [Ping timeout: 256 seconds]
dumdedum has quit [Quit: foo]
<shevy> lol
bruno- has quit [Ping timeout: 256 seconds]
_blizzy_ has joined #ruby
charliesome has quit [Quit: zzz]
lkba has quit [Ping timeout: 256 seconds]
simplyianm has joined #ruby
coderkevin has quit [Quit: Connection closed for inactivity]
amargherio has joined #ruby
nettoweb has joined #ruby
<[k-_> manual minification did not work so well....
<[k-_> you must upvote for cleverness!
postmodern has joined #ruby
MatrixBridge has quit [Remote host closed the connection]
postmodern has quit [Changing host]
postmodern has joined #ruby
MatrixBridge has joined #ruby
<[k-_> ok minified
jpfuente_ has joined #ruby
Torrieri has quit [Quit: Be back later ...]
MatrixBridge has quit [Remote host closed the connection]
mrconfused has joined #ruby
IanV0rn2341 has quit []
* shevy downvotes [k-_
MatrixBridge has joined #ruby
simplyianm has quit [Ping timeout: 246 seconds]
* Senjai downvotes whatever shevy downvoted
Spami has quit [Quit: This computer has gone to sleep]
<[k-_> :(
Igorshp has quit [Remote host closed the connection]
douglasssss has quit [Quit: Leaving]
<[k-_> the very last one is the one you want to read
<Senjai> [k-_: BSD License man...
<[k-_> wait, let me change the order
<[k-_> why do you favour BSD over Apache
mercwithamouth has joined #ruby
jpfuentes2 has quit [Ping timeout: 265 seconds]
Tritone has quit [Remote host closed the connection]
solars has quit [Ping timeout: 264 seconds]
<shevy> ok
<shevy> from this day on
Jackneill_ has joined #ruby
<shevy> you are the most obfuscating rubyist here [k-_
<[k-_> notice how $-o={};->{;_m works
<shevy> much more than hanmac and Ox0dea combined
nfk has quit [Read error: Connection reset by peer]
<[k-_> :>
<shevy> $© = {} # The root of all evil
JakFrist has joined #ruby
<shevy> what is this
agent_white has quit [Quit: bai]
troulouliou_dev has quit [Quit: Leaving]
jottr_ has joined #ruby
<[k-_> the thing that causes obfuscation to be possible!
fantazo has quit [Ping timeout: 246 seconds]
<shevy> why is © even legal
<shevy> -> { # No Namespace Pollution
<shevy> and no surprise
<shevy> here is my old nemesis the ->
<Senjai> [k-_: You're labors only make lives terrible for open source purists :P
<Senjai> Your**
tomphp_ has quit [Ping timeout: 264 seconds]
<Senjai> how2grammer
<Senjai> grammar
<Senjai> ffs
roolo has joined #ruby
<shevy> hehe
HakN99 has quit [Ping timeout: 255 seconds]
nfk has joined #ruby
aryaching has quit [Read error: No route to host]
sharpmachine has joined #ruby
<[k-_> no one will actually use it ;-;
<[k-_> it is too difficult to learn and code in
<dfockler> until we get pure emoji keyboards
<[k-_> shevy: if you can read the minified example, you are an expert
<[k-_> a true expert
postmodern has quit [Quit: Leaving]
dopie has quit [Quit: This computer has gone to sleep]
<[k-_> anyone who does that is a true expert!
jmhmccr has joined #ruby
aryaching has joined #ruby
lessless has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<[k-_> im going to bed now after a fruitful day :)
[k-_ has quit [Quit: Lingo: www.lingoirc.com]
SilentEcho has quit [Quit: WeeChat 1.0.1]
AlphaAtom has joined #ruby
vdamewood has joined #ruby
bronson has quit [Remote host closed the connection]
jespada has quit [Ping timeout: 248 seconds]
jimmythehat has joined #ruby
Jackneill_ has quit [Remote host closed the connection]
presto has joined #ruby
yokel has quit [Ping timeout: 256 seconds]
maletor has joined #ruby
Spami has joined #ruby
BTRE has quit [Ping timeout: 256 seconds]
Scrofff has quit [Ping timeout: 256 seconds]
MagePsycho_ has joined #ruby
fantazo has joined #ruby
Spami has quit [Client Quit]
yokel has joined #ruby
Scrofff has joined #ruby
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
bodgix_wrk has quit [Quit: Leaving.]
quimrstorres has joined #ruby
Rollabunna has quit [Remote host closed the connection]
zacstewart has joined #ruby
Rollabunna has joined #ruby
jottr_ has quit [Ping timeout: 255 seconds]
sdothum has joined #ruby
Rollabun_ has joined #ruby
Rollabun_ has quit [Remote host closed the connection]
Spami has joined #ruby
dling` is now known as dling
Rollabunna has quit [Read error: Connection reset by peer]
Rollabunna has joined #ruby
txdv_ has quit [Remote host closed the connection]
dopie has joined #ruby
txdv has joined #ruby
Rollabun_ has joined #ruby
werelivinginthef has joined #ruby
peter_paule has quit [Ping timeout: 246 seconds]
Rollabunna has quit [Ping timeout: 246 seconds]
quimrstorres has quit [Ping timeout: 255 seconds]
blaines has joined #ruby
lolmaus has quit [Quit: Konversation terminated!]
BTRE has joined #ruby
_djbkd has joined #ruby
presto has quit [Ping timeout: 255 seconds]
quimrstorres has joined #ruby
<Aderium> fixed it
<Aderium> I have a lot of docs to write .....
podman has joined #ruby
Mojo_Nixon has joined #ruby
dling` has joined #ruby
Pathfinder has joined #ruby
<arup_r> Is this the correct approach of writing own custom exceptions ? https://gist.github.com/aruprakshit/99a0a085f77c9936df20#file-error-rb-L3 Or there is better ideas of doing it ?
sonOfRa has quit [Quit: Bye!]
scripore has quit [Quit: Leaving]
sonOfRa has joined #ruby
zacstewart has quit [Remote host closed the connection]
dling has quit [Ping timeout: 252 seconds]
allcentury has joined #ruby
sarkyniin has quit [Remote host closed the connection]
Mojo_Nixon has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sarkyniin has joined #ruby
<dfockler> arup_r: when you raise an error you can just pass a message to it
peter_paule has joined #ruby
<arup_r> In the line where am I raising... if I pass message it is becoming a long like.. so I push it there.. But I was not sure about my idea,,, thus asked
MarkTurner has quit [Quit: This is probably a wireless dropout]
lkba has joined #ruby
MarkTurner has joined #ruby
<dfockler> You probably want to make each type of error you throw subclass from Standard error then you can raise it like
<arup_r> I deleted the gist by mistake.. here is the one again https://gist.github.com/aruprakshit/a00bb03f6d8b217dcd27
_djbkd has quit [Remote host closed the connection]
yardenbar has joined #ruby
<dfockler> raise NoPostDataError, "There was no data to post"
malconis_ has joined #ruby
Soda has quit [Remote host closed the connection]
einarj has quit [Remote host closed the connection]
<dfockler> or raise ConnectionFailureError, "Failed to make connection"
rdark has quit [Quit: leaving]
malconis has quit [Ping timeout: 248 seconds]
<dfockler> for the most part they can just subclass StandardError unless you need custom behavior
bungoman has joined #ruby
quimrstorres has quit [Remote host closed the connection]
yfeldblum has joined #ruby
<arup_r> ok
darkf has quit [Quit: Leaving]
lkba_ has quit [Ping timeout: 256 seconds]
toretore has joined #ruby
genpaku has quit [Ping timeout: 256 seconds]
jerius_ has joined #ruby
<dfockler> and you don't really even need to subclass if you just want to display a message like how you had it
tomphp has joined #ruby
<dfockler> just raise "Simple error here"
genpaku has joined #ruby
quimrstorres has joined #ruby
_djbkd has joined #ruby
pfish has quit [Quit: Page closed]
_djbkd has joined #ruby
<arup_r> No.. I Need to do subclass because, I'll rescue those from my different controller and redirec to different urls as per the exceptions..
quimrstorres has quit [Remote host closed the connection]
jerius has quit [Ping timeout: 246 seconds]
veduardo_ has joined #ruby
<dfockler> arup_r: yeah if you want to catch those error types then you'll want to give them a class
<arup_r> that's why I am buliding custom exception classes
veduardo_ has quit [Client Quit]
mary5030 has quit [Remote host closed the connection]
<arup_r> humm
<arup_r> shevy: I am still porting :p
werelivinginthef has quit [Ping timeout: 255 seconds]
<adaedra> You could also, in your subclass, set the message there
mary5030 has joined #ruby
marr has quit [Ping timeout: 255 seconds]
mary5030 has quit [Remote host closed the connection]
sp4rrow has joined #ruby
mary5030 has joined #ruby
jhack has joined #ruby
<arup_r> adaedra: didn't get you
axsuul has joined #ruby
axsuul has quit [Excess Flood]
reset has joined #ruby
werelivinginthef has joined #ruby
jottr_ has joined #ruby
dgutierrez1287 has joined #ruby
a346 has quit [Quit: a346]
bronson has joined #ruby
jpfuente_ has quit [Ping timeout: 244 seconds]
koos303 has quit [Quit: Connection closed for inactivity]
platzhirsch has quit [Ping timeout: 264 seconds]
fumihiro has quit [Ping timeout: 252 seconds]
aaeron has joined #ruby
Aswebb__ has joined #ruby
fabrice31 has joined #ruby
Aswebb_ has quit [Ping timeout: 252 seconds]
jobewan has joined #ruby
bklane has joined #ruby
jottr_ has quit [Ping timeout: 250 seconds]
hololeap has quit [Ping timeout: 264 seconds]
dgutierrez1287 has quit [Ping timeout: 246 seconds]
Eiam has quit [Quit: ╯°□°)╯︵ǝpouǝǝɹɟ]
<dfockler> arup_r: when you subclass you can set the message in the class definition so you don't have to write the same message everytime
s00pcan has quit [Ping timeout: 256 seconds]
fabrice31 has quit [Ping timeout: 246 seconds]
HakN99 has joined #ruby
bungoman has quit [Remote host closed the connection]
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
aaeron has quit [Quit: Leaving.]
_djbkd has quit [Remote host closed the connection]
icebourg has quit []
s00pcan has joined #ruby
_djbkd has joined #ruby
aaeron has joined #ruby
mbeasley has joined #ruby
evanjs has joined #ruby
aaeron has quit [Client Quit]
mbeasley has left #ruby [#ruby]
bungoman has joined #ruby
saadq has joined #ruby
bklane has quit [Read error: Connection reset by peer]
guest000014 has joined #ruby
danzilio has joined #ruby
simplyianm has joined #ruby
tomphp has joined #ruby
kadoppe has quit [Ping timeout: 264 seconds]
marr has joined #ruby
zacstewart has joined #ruby
DLSteve has joined #ruby
riotjones has joined #ruby
kadoppe has joined #ruby
<guest000014> Good day. I have some simple code in Ruby stored on web. Is there a way to use it offline, if I have only a flash-driver? Would you recommend me to use some addon for portable google-chome or find a portable compiler?
aaeron has joined #ruby
<jhass> wat
Xaitec has joined #ruby
<jhass> "stored in the web"? what does that even mean?
_djbkd has quit [Remote host closed the connection]
vickleton has joined #ruby
simplyianm has quit [Ping timeout: 246 seconds]
<jimmythehat> ?pastebin
<ruboto> I don't know anything about pastebin
fantazo has quit [Ping timeout: 244 seconds]
simplyianm has joined #ruby
<jhass> ?gist jimmythehat
<ruboto> jimmythehat, https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
<guest000014> compileonline, codepad. But they compile only with internet
<jimmythehat> jhass haha thats it thanks
<jhass> guest000014: install ruby?
_djbkd has joined #ruby
casadei_ has quit [Remote host closed the connection]
presto has joined #ruby
<guest000014> Is there a portable compilier? Which would you recommend?
casadei_ has joined #ruby
<jhass> guest000014: see my link
luriv has joined #ruby
baweaver has joined #ruby
riotjones has quit [Ping timeout: 264 seconds]
bklane has joined #ruby
vickleton_ has joined #ruby
spider-mario has joined #ruby
mrconfused_ has joined #ruby
startupality has quit [Quit: startupality]
<dudedudeman> when setting an instance variable to @variable = Class.new, do you have to call .new on it? or can you just go @variable = Class
gix has joined #ruby
bklane has quit [Read error: Connection reset by peer]
lavros_ has quit [Quit: leaving]
Soda has joined #ruby
mrconfused has quit [Ping timeout: 264 seconds]
<jhass> dudedudeman: you can do both and they do rather different things
<jhass> class Foo is basically Foo = Class.new
radialneon has joined #ruby
djbkd_ has joined #ruby
<jhass> so Class is just a class too, or in other words a constant that has an instance of the class Class assigned
cabreraM516 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nfk has quit [Remote host closed the connection]
bklane has joined #ruby
Papierkorb has quit [Quit: ArchLinux completes an endless loop faster than any other distro!]
_djbkd has quit [Ping timeout: 255 seconds]
fantazo has joined #ruby
thiagovsk has joined #ruby
nfk has joined #ruby
<arup_r> dfockler: You mean using `@message = '...some messages..'` inside the initialize ?
<dfockler> arup_r: yeah
<arup_r> ok
cabreraM516 has joined #ruby
pietr0 has joined #ruby
Violent has joined #ruby
sp4rrow has quit [Quit: Textual IRC Client: www.textualapp.com]
tcrypt has joined #ruby
Eiam has joined #ruby
g3funk is now known as braidn
Violent is now known as VT
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
bklane has quit [Read error: Connection reset by peer]
VT is now known as Violent
Violent has quit [Client Quit]
werelivinginthef has quit [Remote host closed the connection]
blaines has quit [Ping timeout: 244 seconds]
poguez_ has joined #ruby
m8 has joined #ruby
olistik has joined #ruby
guest000014 has left #ruby [#ruby]
jenrzzz has joined #ruby
felltir has joined #ruby
Tritone has joined #ruby
phutchins has quit [Quit: WeeChat 1.1.1]
Rollabun_ has quit [Quit: Leaving...]
blaines has joined #ruby
Pathfinder has quit [Remote host closed the connection]
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
NeverDie has joined #ruby
ivanf has quit [Ping timeout: 244 seconds]
davedev2_ has joined #ruby
Sypheren has quit [Ping timeout: 256 seconds]
davedev24 has quit [Read error: Connection reset by peer]
jackjackdripper has joined #ruby
NeverDie has quit [Max SendQ exceeded]
Sypheren has joined #ruby
Tritone has quit [Ping timeout: 265 seconds]
ivanf has joined #ruby
symbol has quit [Quit: WeeChat 1.1]
baweaver has quit [Remote host closed the connection]
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bklane has joined #ruby
werelivinginthef has joined #ruby
Violentr has joined #ruby
radialneon has quit [Remote host closed the connection]
NeverDie has joined #ruby
kirun has joined #ruby
radialneon has joined #ruby
dblessing has joined #ruby
a346 has joined #ruby
TheHodge has quit [Quit: Connection closed for inactivity]
<dudedudeman> jhass: thank you
<arup_r> Ruby is cute........... I like it very much, :)
pullphinger has joined #ruby
pullphinger has quit [Client Quit]
pullphinger has joined #ruby
dagda1 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bklane has quit [Read error: Connection reset by peer]
loc22 has joined #ruby
serivich has quit [Ping timeout: 255 seconds]
dopie has quit [Quit: This computer has gone to sleep]
Aswebb__ has quit [Ping timeout: 264 seconds]
<ght> Question: With a Ruby date object, when calling mydate.month, if the month is < 10, it prints with a single digit, as in month 7 is simply 7, instead of 07.
mrconfused_ has quit [Remote host closed the connection]
<ght> Without having to convert it to an integer and check if it's less than 10, then add a leading zero as a string, is there any way
<ght> to get date objects to return .month or .day with leading zeros?
<ght> I've been reading the documentation and haven't seen anything.
<ght> Just curious if anyone here knew.
<jhass> ght: your problem is representation
davedev24 has joined #ruby
werelivinginthef has quit [Remote host closed the connection]
dagda1 has joined #ruby
<jhass> 07 and 7 is the same number, the same Fixnum (Integer) object
<loc22> ght: Use strftime to print them
<jhass> you care about its String representation though
<ght> loc22: Thank you
jottr_ has joined #ruby
<jhass> so yeah ^, use strftime
<loc22> ght: You are welcome
davedev2_ has quit [Ping timeout: 256 seconds]
<jhass> it helps to get clear on what representation and what value is though
radialneon has quit [Remote host closed the connection]
radialneon has joined #ruby
sarkyniin has quit [Remote host closed the connection]
Torrieri has joined #ruby
Torrieri has joined #ruby
Aswebb_ has joined #ruby
bklane has joined #ruby
k3asd` has quit [Ping timeout: 256 seconds]
Notte has quit [Remote host closed the connection]
bklane has quit [Remote host closed the connection]
jottr_ has quit [Ping timeout: 256 seconds]
zz_Outlastsheep is now known as Outlastsheep
RandyT has quit [Quit: ZNC - http://znc.in]
RandyT has joined #ruby
leonardoajim has quit [Quit: Be back later ...]
syraxes has joined #ruby
ledestin has joined #ruby
werelivinginthef has joined #ruby
jaycee has joined #ruby
jerius_ has quit [Quit: /quit]
keen__________18 has joined #ruby
keen__________17 has quit [Ping timeout: 246 seconds]
schov has joined #ruby
konsolebox has quit [Remote host closed the connection]
jerius has joined #ruby
curses has joined #ruby
jpfuentes2 has joined #ruby
syraxes has left #ruby ["Leaving"]
arup_ has joined #ruby
arup_ has quit [Client Quit]
<Senjai> Who wants to see scary code
Narzew has joined #ruby
pothibo has joined #ruby
davedev2_ has joined #ruby
revath has quit [Ping timeout: 255 seconds]
davedev24 has quit [Ping timeout: 256 seconds]
jwaldrip has quit [Ping timeout: 244 seconds]
jwaldrip has joined #ruby
<apeiros> txt?
<apeiros> must be scary if it can't be highlighted! :-p
allcentury has quit [Ping timeout: 246 seconds]
<apeiros> oh. wow.
<apeiros> O-KAY…
<schov> hmm, I'm wondering why the following code doesn't work " if arr[i] > arr[i].downcase then puts "working" end " - when i type ABC then it should respond with "working" three times, but i get nothing?
allcentury has joined #ruby
<apeiros> >> "A" > "a"
<ruboto> apeiros # => false (https://eval.in/397981)
<apeiros> schov: ^
<apeiros> that's why
cabreraM516 has quit [Quit: Textual IRC Client: www.textualapp.com]
<apeiros> uppercase is not "bigger than" lower case.
<schov> no?
<schov> hmm
<apeiros> no.
bklane has joined #ruby
<apeiros> >> ["A".ord, "a".ord]
<ruboto> apeiros # => [65, 97] (https://eval.in/397983)
arup_ has joined #ruby
<apeiros> string comparison is based on binary value. see above the values for A and a
<schov> but when you use the sort method it will treat "B" as bigger than "a"
<apeiros> >> ["a", "B"].sort
<ruboto> apeiros # => ["B", "a"] (https://eval.in/397984)
<apeiros> ^ no, it won't. how do you get that idea?
<schov> there u go
<apeiros> uuuuh, you do realize that *smallest* goes first, right?
<apeiros> you don't count from Infinity back to 0 either…
<felltir> >> [ 3, 2, 1].sort
<ruboto> felltir # => [1, 2, 3] (https://eval.in/397985)
<slash_nick> >> %w{ a b c d A B C D }.sort
<ruboto> slash_nick # => ["A", "B", "C", "D", "a", "b", "c", "d"] (https://eval.in/397986)
MagePsycho__ has joined #ruby
MagePsycho_ has quit [Ping timeout: 252 seconds]
arup_ has quit [Quit: Leaving]
<slash_nick> schov: were you epxecting something more like %w{ A a B b C c D d } ?
arup_ has joined #ruby
<schov> no, that is correct
<schov> ["A", "B", "C", "D", "a", "b", "c", "d"]
<apeiros> schov: as said, smallest first. so B coming before a means it is smaller.
<apeiros> cf numbers, as felltir wrote
<jhass> >> "abcABC".map {|c| [c, c.ord] }.sort
<ruboto> jhass # => undefined method `map' for "abcABC":String (NoMethodError) ...check link for more (https://eval.in/397988)
<jhass> blerg
<jhass> >> "abcABC".chars.map {|c| [c, c.ord] }.sort
<ruboto> jhass # => [["A", 65], ["B", 66], ["C", 67], ["a", 97], ["b", 98], ["c", 99]] (https://eval.in/397989)
<schov> right i see
<schov> yeah i get it..sorry my fault
<jhass> no worries, yw
jerius has quit [Quit: /quit]
rindolf has quit [Quit: http://www.shlomifish.org/ ; Yay! I'm a llama again.]
rikkipitt has joined #ruby
eggoez has quit [Ping timeout: 246 seconds]
bklane has quit [Ping timeout: 256 seconds]
rikkipitt has quit [Client Quit]
NeverDie_ has joined #ruby
chinmay_dd has quit [Ping timeout: 248 seconds]
snockerton1 has joined #ruby
arup_r has quit [Quit: ChatZilla 0.9.91.1 [Firefox 38.0.1/2015051400]]
snockerton has quit [Ping timeout: 250 seconds]
radialneon has quit [Remote host closed the connection]
pothibo has quit [Quit: pothibo]
radialneon has joined #ruby
NeverDie has quit [Ping timeout: 246 seconds]
bronson has quit [Remote host closed the connection]
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
radialneon has quit [Remote host closed the connection]
<arup_> I am using new client.. wohoooooooo
RandyT has quit [Quit: ZNC - http://znc.in]
bklane has joined #ruby
radialneon has joined #ruby
radialneon has quit [Remote host closed the connection]
RandyT has joined #ruby
radialneon has joined #ruby
nettoweb has joined #ruby
Musashi007 has joined #ruby
evanjs has quit [Remote host closed the connection]
presto is now known as prestorium
n008f4g_ has quit [Ping timeout: 256 seconds]
pengin has quit [Remote host closed the connection]
maletor has quit [Quit: Textual IRC Client: www.textualapp.com]
snockerton1 has quit [Ping timeout: 250 seconds]
snockerton has joined #ruby
Musashi007 has quit [Client Quit]
Aswebb_ has quit [Ping timeout: 255 seconds]
Aswebb__ has joined #ruby
_blizzy_ has quit [Ping timeout: 240 seconds]
a346 has quit [Quit: a346]
nfk has quit [Remote host closed the connection]
Notte has joined #ruby
edwinvdgraaf has joined #ruby
jerius has joined #ruby
Darkwater has quit [Ping timeout: 256 seconds]
edwinvdgraaf has quit [Client Quit]
Darkwater has joined #ruby
Darkwater has quit [Changing host]
Darkwater has joined #ruby
radialneon_ has joined #ruby
v0n has quit [Ping timeout: 264 seconds]
aaeron has quit [Quit: Leaving.]
fullofcaffeine has quit [Remote host closed the connection]
radialneon has quit [Ping timeout: 246 seconds]
edwinvdgraaf has joined #ruby
DexterLB has quit [Ping timeout: 260 seconds]
evanjs has joined #ruby
n008f4g_ has joined #ruby
DexterLB has joined #ruby
nettoweb has quit [Ping timeout: 264 seconds]
fantazo has quit [Ping timeout: 246 seconds]
bungoman has quit [Remote host closed the connection]
dopie has joined #ruby
Jarboe has joined #ruby
ivanf has quit [Ping timeout: 264 seconds]
aaeron has joined #ruby
ivanf has joined #ruby
Marsupermammal has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
Aswebb__ has quit []
Marsupermammal has quit [Client Quit]
bklane has quit [Ping timeout: 256 seconds]
bungoman has joined #ruby
spuk has joined #ruby
bklane has joined #ruby
nfk has joined #ruby
pengin has joined #ruby
AlphaAtom has joined #ruby
linuxboytoo has joined #ruby
Zackio has quit [Read error: Connection reset by peer]
tvw has quit [Ping timeout: 246 seconds]
RandyT has quit [Quit: ZNC - http://znc.in]
baweaver has joined #ruby
Pumpkin- has quit [Ping timeout: 240 seconds]
RandyT has joined #ruby
radialneon_ has quit [Remote host closed the connection]
bklane has quit [Read error: Connection reset by peer]
radialneon has joined #ruby
Pumpkin- has joined #ruby
allomov has joined #ruby
acke has quit [Quit: Leaving...]
pietr0 has quit [Quit: pietr0]
_blizzy_ has joined #ruby
djbkd_ has quit [Remote host closed the connection]
mhib has joined #ruby
Anthony__ has joined #ruby
MarkTurner has quit [Ping timeout: 256 seconds]
fullofcaffeine has joined #ruby
bklane has joined #ruby
baweaver has quit [Ping timeout: 240 seconds]
eggoez has joined #ruby
DoubleMalt has joined #ruby
<jimmythehat> How do I mock an in-block variable? In this case, I would want to mock match.contains_a_number? Also, this is a learning excercize, I am aware of the dangers of monkey patching I just want to know how you're meant to mock an in-block variable. Thanksies!!
qhartman has joined #ruby
AyeDubyew has quit [Ping timeout: 246 seconds]
<jimmythehat> hold on I wasn't thinking, let me finish that gist...
* apeiros has some weird déjà vu
_blizzy_ has quit [Ping timeout: 246 seconds]
* apeiros waits for jhass to reply
<adaedra> apeiros: calm down neo
werelivinginthef has quit [Remote host closed the connection]
vt102 has quit [Remote host closed the connection]
<apeiros> adaedra: why? it's rare enough to observe an error in the matrix
<jhass> apeiros: there's some useless abstraction gone at least!
bklane has quit [Remote host closed the connection]
<jhass> jimmythehat: whenever you're ready...
otisZart has quit [Read error: Connection reset by peer]
sepp2k has quit [Quit: Leaving.]
baweaver has joined #ruby
<adaedra> apeiros: that's reasonable, I go back bending spoons.
<jimmythehat> jhass thanks :P btw I've been playing fallout 3 all day not spending all day on this haha https://gist.github.com/anonymous/d4abda87a8af366b5953
mhib has quit [Quit: Leaving]
JakFrist has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
JakFrist has joined #ruby
arup_ has quit [Quit: Leaving]
<toretore> class String; def do_certain_parts_contain_a_number?
<jhass> jimmythehat: alright, two approaches. Either you stub out the return value of String#match there and return a stub
<jhass> or you stub it for any instance of MatchData
<toretore> )`:
ndrei has quit [Ping timeout: 255 seconds]
<jhass> toretore: well, doubt this is anything real world ;)
but3k4_ has joined #ruby
bklane has joined #ruby
iamse7en has joined #ruby
tmtwd has quit [Ping timeout: 256 seconds]
<jhass> so, I'd favor the former: string = "foo"; allow(string).to receive(:match).and_return(stub(:contains_a_number? => true)); expect { string.do_certain_... }...
ndrei has joined #ruby
fullofcaffeine has quit [Remote host closed the connection]
but3k4 has quit [Ping timeout: 240 seconds]
<jhass> jimmythehat: but I'd also consider to not stub at all here, the external dependency on MatchData is small enough to just let it fall through
v0n has joined #ruby
jottr_ has joined #ruby
<jhass> and chose testcases with the desired results for it
ValicekB has joined #ruby
<toretore> jimmythehat: what's the purpose of this code?
werelivinginthef has joined #ruby
fabrice31 has joined #ruby
<jimmythehat> toretore I'm just leaning how to mock, it's pretty useless :P
<toretore> ok
Outlastsheep is now known as zz_Outlastsheep
jonathanwallace has quit [Quit: Leaving.]
jottr_ has quit [Ping timeout: 252 seconds]
<iamse7en> hello, I have a simple #gsub question to anyone willing to help. thank you. https://gist.github.com/austinarchibald/906be9f1874a7977e516
_djbkd has joined #ruby
quimrstorres has joined #ruby
_djbkd has quit [Remote host closed the connection]
Notte has quit [Remote host closed the connection]
_djbkd has joined #ruby
<jimmythehat> jhass thanks, great responses. If I follow your advice and mock what match returns, how should I spec the regex? I liked seeing that the regex was working before and would lose that if I was mocking match. any_instance_of makes the most sense to me, but it's discouraged by the rspec team (note how its placed under the heading 'Working with legacy code'. Worrying - could be depricated. https://relishapp.com/rspec/rspec-mocks/docs/working-with-lega
quimrstorres has quit [Remote host closed the connection]
fabrice31 has quit [Ping timeout: 244 seconds]
<jimmythehat> so I guess...how should I test the regex? Or is it okay to use allow_any_instance_of() ?
<jhass> jimmythehat: well, you're assuming too much about the implementation either way I guess
<jhass> the example is pretty much one you want to observe only with input & return values
<toretore> iamse7en: gsub(/.foo/, '') will remove 'foo' preceded by 1 character
<jhass> since it's side effect free
quimrstorres has joined #ruby
loc22 has quit [Quit: Be back later ...]
arturmartins has joined #ruby
but3k4_ has quit [Read error: Connection reset by peer]
GitGud has joined #ruby
rapha has quit [Ping timeout: 246 seconds]
<jimmythehat> jhass I'm feeling allow_any_instance_of but it would suck if they drop it in future. Oh well :/
GitGod has quit [Ping timeout: 256 seconds]
suffice has quit [Ping timeout: 256 seconds]
<jimmythehat> just cross that bridge if and when it does get dropped
but3k4 has joined #ruby
maletor has joined #ruby
<jhass> I doubt it'll be dropped, but it's true that you should avoid it as long as you can
mleung has quit [Quit: mleung]
<jhass> again, what troubles you is that it's a bad example for mocking and stubbing
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
t_ has quit [Ping timeout: 256 seconds]
<jhass> it's so much much better speced without
codecop has quit [Remote host closed the connection]
peter_paule has quit [Ping timeout: 255 seconds]
xkef has quit [Ping timeout: 255 seconds]
JakFrist has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
DLSteve has quit [Quit: Leaving]
<jimmythehat> jhass Yeah I do see why. I wouldn't have this trouble if I was sending the string to another class of analysis. then I could mock that class easily. You should only mock other classes I guess?
xkef has joined #ruby
<jimmythehat> *for analysis
jespada has joined #ruby
<jhass> no, the real issue is that you assert implementation instead of behavior
_ht has quit [Remote host closed the connection]
<jhass> mocking & stubbing is for replacing expensive or impossible to run code in tests
rsty1 has quit [Read error: Connection reset by peer]
<jhass> or recreating conditions that are otherwise hard to achieve
_ht has joined #ruby
triangles2 has quit [Ping timeout: 248 seconds]
maletor has quit [Max SendQ exceeded]
<jhass> you attempt to use it as a tool for asserting the method is implemented in certain manner
<jhass> you do not care of "it returns/causes X when Y" but "it does X when Y"
maletor has joined #ruby
<jhass> but you shouldn't care about the how, just that it happens
baweaver has quit [Remote host closed the connection]
dopie has quit [Quit: This computer has gone to sleep]
suffice has joined #ruby
t_ has joined #ruby
yfeldblum has quit [Ping timeout: 264 seconds]
<jimmythehat> doesn't it give you better feedback if you isolate and then break something? only the code that's failing would turn up red. if I mocked less-so, wouldn't I get a whole set of red specs rather than justt the one that's actually failing? shouldn't behaviour and the end result only be tested in an integration spec?
quimrstorres has quit [Remote host closed the connection]
felltir has quit []
dopie has joined #ruby
arturmartins has quit [Quit: Leaving...]
Papierkorb has joined #ruby
<jhass> not if your mocks go to the point of asserting a special implementation
<jhass> er, *specific
aaeron has quit [Quit: Leaving.]
aryaching has quit [Ping timeout: 246 seconds]
MarkTurner has joined #ruby
MarkTurner has quit [Remote host closed the connection]
<jimmythehat> jhass not sure I follow :P
<jimmythehat> specific implementation?
<jhass> yes
El3ktra has quit [Quit: Leaving]
MarkTurner has joined #ruby
<jimmythehat> I suppose I could just 'allow' rather than expect? That would be less brittle. is that what you mean?
<jhass> basically if your specs becomes a recipe of "this call with these parameters should happen and then on the return value this call should happen and then this call should happen" you're doing it wrong
but3k4 has quit [Ping timeout: 248 seconds]
<jhass> allow just changes the should to a may
JakFrist has joined #ruby
pietr0 has joined #ruby
hanmac has quit [Ping timeout: 246 seconds]
werelivinginthef has quit [Remote host closed the connection]
postmodern has joined #ruby
jerius has quit [Quit: /quit]
sepp2k has joined #ruby
mleung has joined #ruby
m8 has quit [Quit: Sto andando via]
MarkTurner has quit [Client Quit]
MarkTurner has joined #ruby
rsiqueira has quit [Ping timeout: 246 seconds]
<jhass> after all a big part of your specs is to make refactoring easier. I've written specs like ^ and can tell you that they break with the slightest changes that don't actually change behavior as viewed from the outside
peter_paule has joined #ruby
<jhass> a small cascade in failures is less annoying and usually easily identified anyway
tmtwd has joined #ruby
bb010g has joined #ruby
dgutierrez1287 has joined #ruby
bronson has joined #ruby
leonardoajim has joined #ruby
_ht has quit [Quit: Konversation terminated!]
sofija has quit [Ping timeout: 256 seconds]
<jimmythehat> jhass you're right about a small cascade being easy to fix. I don't follow you 100% but mocking too much does make specs brittle. So I am not going to mock other methods of the same class, however I am going to mock other classes and their methods, and then have some integration specs that contain no mocks at all. I don't think I'll go too wrong doing that :P
t_ has quit [Ping timeout: 256 seconds]
peter_paule has quit [Ping timeout: 264 seconds]
charliesome has joined #ruby
<jhass> probably not, but following such rules religiously is often impractical
LMity has joined #ruby
<iamse7en> toretore, thanks. what about a string that has [] in it? how do I escape those? https://gist.github.com/austinarchibald/906be9f1874a7977e516
dgutierrez1287 has quit [Ping timeout: 244 seconds]
MagePsycho__ has quit [Quit: MagePsycho__]
<toretore> a lot of the time mocking is a code smell - well-structured code is usually easy to test and doesn't need mocking of hard coded dependencies
<toretore> iamse7en: you should learn regular expressions
<iamse7en> k
<toretore> regularexpressions.info
howdoicomputer has joined #ruby
bronson has quit [Ping timeout: 264 seconds]
jerius has joined #ruby
Violentr has quit [Remote host closed the connection]
baweaver has joined #ruby
rwilcox has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
t_ has joined #ruby
<jimmythehat> toretore awh this is sort of going in the face everything ive learned...to test classes in isolation and then test in integration. Or is that more of a rails thing?
fullofcaffeine has joined #ruby
devbug has quit [Ping timeout: 250 seconds]
<toretore> jimmythehat: those are also true, and the two aren't mutually exclusive
spuk has quit [Quit: Human beings were created by water to transport it uphill.]
hanmac has joined #ruby
<toretore> but you can achieve those things without mocking
varunwachaspati has quit [Quit: Leaving]
JakFrist has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<toretore> mocking is more of a last resort
centrx has quit [Quit: Shutting down, Please wait...]
<toretore> or if you're lazy
sharpmachine has quit [Remote host closed the connection]
davedev2_ has quit []
<olistik> one question related to ssl: https://gist.github.com/olistik/40e3ada4172610500357
<olistik> isn't it weird?
DoubleMalt has quit [Remote host closed the connection]
<olistik> google and filepicker.io fail, but facebook and another one don't
<jimmythehat> toretore haha okay. I'll just not go crazy with mocks basically :P
<olistik> I'm on osx
vickleton has quit [Remote host closed the connection]
vickleton_ has quit [Remote host closed the connection]
<Senjai> olistik: First of all, dont use SSLv3
Kully3xf has quit [Ping timeout: 246 seconds]
davedev24 has joined #ruby
<jhass> Senjai: SSLv3 is just OpenSSL being odd
<jhass> it includes TLS
<Senjai> Oh
<toretore> jimmythehat: don't focus too much on tools - focus more on improving your code
<Senjai> jhass: That's annoying
casadei_ has quit [Remote host closed the connection]
<toretore> people often get carried away with tools, and people are always pushing their favorite tools on beginners
nateberkopec has quit [Quit: Leaving...]
<toretore> like rspec and mocking in your case
ndrei has quit [Ping timeout: 264 seconds]
evanjs_ has joined #ruby
Notte has joined #ruby
but3k4 has joined #ruby
<olistik> Senjai: I've just brew install openssl and then used rvm
evanjs has quit [Ping timeout: 244 seconds]
graydot has joined #ruby
<jhass> olistik: google.com and filepicker.io both use the GeoTrust root
<toretore> goddamn rusty again
<Senjai> I'm not on OSX, sorry, I thought it might have been w/ the sslv3
<jhass> maybe that's somehow missing in your CA bundle?
ndrei has joined #ruby
LMity has quit [Ping timeout: 264 seconds]
platzhirsch has joined #ruby
umgrosscol has quit [Remote host closed the connection]
<jimmythehat> toretore good plan :) Can I ask about name spacing? I fail to see the benefit of this https://github.com/thoughtbot/shoulda-matchers/blob/master/lib/shoulda/matchers/action_controller.rb putting every matcher in a separate file than then requiring them all into one big file? Why not just have them in one big file to start with and do away with the requiring?
<Senjai> olistik: You can use s_client --connect sitename:port
<olistik> jhass: shouldn't rvm osx-ssl-certs update take care of everything?
<Senjai> olistik: It will help you debug the things
schov has quit [Quit: Leaving]
<jhass> no idea, I'm on linux and don't need such stuff
<Senjai> openssl s_client **
<Senjai> olistik: If the above command works for google.com:443, the problem is with ruby and not your computer
baweaver has quit [Remote host closed the connection]
<jimmythehat> I think you call that name spacing anyway, they're all inside a ActionController module. But I fail to see the benefit. It would be easier if they were all in one file, searching for methods ect...
<raenk> I'm in the process of learning ruby (and rails). I'm excited about it and in a couple of weeks I'm going to start a project that basically would be a simple API that serves JSON data. I'm not sure if I should hold my excitement about ruby and just develop it with PHP considering it might be overkill going with ruby. What do you think?
<toretore> jimmythehat: yeah, i tend to see that as a smell too - when you have too much in one class/module that you have split it into several files
<toretore> jimmythehat: it's not actually namespacing
bungoman has quit [Remote host closed the connection]
<olistik> it looks like it's working
<olistik> I'll try reinstalling ruby with rvm
<Senjai> olistik: Or use chruby
<Senjai> :/
MarkTurner has quit [Ping timeout: 256 seconds]
<Senjai> instead of rvm
<olistik> or rbenv :-)
bmurt has quit []
<toretore> jimmythehat: it's just a way to make it look cleaner - cheating, if you will
<jhass> raenk: Ruby offers a ton of lightweight solutions for this that aren't rails
<Senjai> olistik: or... chruby :P
<olistik> ^_^
pengin has quit [Remote host closed the connection]
<Senjai> But yeah, any SSL issues, run that command before debugging, it helps you point out if its a system issue or a software one.
RegulationD has quit [Remote host closed the connection]
<jimmythehat> toretore Yeah I get that. Think I'll just have one file per module. If it gets to big, create another module entirely. It's funny how lenient ruby is an how restrictive(not a bad thing) rails is
decoponio has quit [Quit: Leaving...]
bungoman has joined #ruby
allcentury has quit [Ping timeout: 265 seconds]
<dfockler> rails RAILS!
<jimmythehat> dfockler indeed
quimrstorres has joined #ruby
<toretore> jimmythehat: though in the example you linked to i don't know of any better way to do it
MagePsycho_ has joined #ruby
davedev24 has quit [Remote host closed the connection]
MagePsycho_ has quit [Client Quit]
<toretore> sometimes you just need a whole lot of methods
<raenk> jhass: what would you recommend? Obviously I need something with a smooth learning curve considering It will be my first project
<dfockler> ruby never specified convention, and went for programmer happiness, which means lots of ways of doing the same thing
HakN99 has quit [Ping timeout: 240 seconds]
<toretore> "What make Programmer Brain Happy is What I Make To Ruby" - matz
leonardoajim has quit [Ping timeout: 252 seconds]
riotjones has joined #ruby
<jhass> raenk: I know nothing about your requirements, my recommendation would be as good as rolling a dice
blaines has quit [Ping timeout: 264 seconds]
bodgix has joined #ruby
<jimmythehat> toretore just wondering, what would be wrong with one big (i.e. not split over multiple files) ActionController module in the example I linked you? Is it purely organizational?
prestorium has quit [Quit: Konversation terminated!]
malconis_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
aaeron has joined #ruby
<toretore> jimmythehat: yes in that case it's purely organizational
werelivinginthef has joined #ruby
<toretore> it's the same module in every file
<toretore> (afaicg)
FernandoBasso has joined #ruby
leat1 has quit [Remote host closed the connection]
leat1 has joined #ruby
<jimmythehat> toretore what I thought, thanks for your help :)
<jimmythehat> jhass thanks as well
aaeron has quit [Client Quit]
Scroff has joined #ruby
blaines has joined #ruby
platzhirsch has left #ruby [#ruby]
pullphinger has quit []
hololeap has joined #ruby
stantonnet has quit [Ping timeout: 252 seconds]
riotjones has quit [Ping timeout: 256 seconds]
Musashi007 has joined #ruby
casadei_ has joined #ruby
danielpclark has joined #ruby
Notte has quit [Remote host closed the connection]
nfk has quit [Remote host closed the connection]
Scrofff has quit [Ping timeout: 246 seconds]
aaeron has joined #ruby
NeverDie_ is now known as NeverDie
MarkTurner has joined #ruby
<ytti> meh
<ytti> el'capitan still has 2.0.0
but3k4 has quit [Read error: Connection reset by peer]
but3k4 has joined #ruby
ljt has joined #ruby
<adaedra> for now
malconis has joined #ruby
<adaedra> ytti: you're under El Capitan?
nfk has joined #ruby
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
Narzew has quit [Quit: Leaving]
mjuszczak has joined #ruby
mjuszczak has quit [Client Quit]
dagda1 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
thiagovsk has quit [Quit: Connection closed for inactivity]
jonathanwallace has joined #ruby
ldnunes has quit [Quit: Leaving]
sshuff|lunch has quit [Quit: Leaving]
davedev24 has joined #ruby
chipotle has joined #ruby
<ytti> adaedra, ye
MarkTurner has quit [Ping timeout: 256 seconds]
<adaedra> ytti: can you check emacs version?
<ytti> got my mbp from shop today (display barfed)
<ytti> and went balls deep
<ytti> ios9, el'capitan, office2016
charliesome has quit [Ping timeout: 256 seconds]
charliesome_ has joined #ruby
bungoman has quit [Remote host closed the connection]
devbug has joined #ruby
<ytti> adaedra, 22.1.1 of 2015-07-01 on osx002.apple.com
<adaedra> lol
bungoman has joined #ruby
<adaedra> there are things which doesn't change
<ytti> 7.4 vim
<dfockler> doesn't OSX ship with it's own version of MRI?
poguez_ has quit [Quit: Connection closed for inactivity]
axsuul has joined #ruby
sharpmachine has joined #ruby
axsuul has quit [Excess Flood]
solars has joined #ruby
drewo has quit [Ping timeout: 256 seconds]
axsuul has joined #ruby
xkickflip has quit [Quit: xkickflip]
ljt has quit []
paulcsmith has quit [Quit: Be back later ...]
werelivinginthef has quit [Remote host closed the connection]
SylarRub_ has joined #ruby
bronson has joined #ruby
loc22 has joined #ruby
paulcsmith has joined #ruby
bklane has quit [Read error: Connection reset by peer]
bungoman has quit [Ping timeout: 248 seconds]
<adaedra> not anymore
ascarter has joined #ruby
<adaedra> ytti: patch level?
phutchins has joined #ruby
jottr_ has joined #ruby
<adaedra> Yosemite: VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Nov 5 2014 21:00:28)
ljt has joined #ruby
ascarter has quit [Max SendQ exceeded]
ascarter has joined #ruby
<ytti> adaedra, included patches 1-712
<ytti> so pretty new
mjuszczak has joined #ruby
<ytti> same as debian unstable
dagda1 has joined #ruby
<adaedra> seems normal
freerobby has quit [Quit: Leaving.]
beef-wellington has quit [Ping timeout: 255 seconds]
ruurd has joined #ruby
loc22 has quit [Ping timeout: 246 seconds]
<adaedra> I wonder if they stopped caring about emacs just because "LOL GNU" or for other reasons
waseem_ has left #ruby ["WeeChat 1.2"]
zacstewart has quit [Remote host closed the connection]
scripore has joined #ruby
<wasamasa> gplv3
NeverDie has joined #ruby
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
allcentury has joined #ruby
<saadq> Can someone help me understand this basic code? https://gist.github.com/anonymous/663724fc10283daee3c7
<adaedra> So both? :p
<saadq> Having a bit of trouble understanding the attributes = {} in the parameter
<adaedra> you know what is {}, saadq ?
<saadq> a hash right
<adaedra> yes
<shevy> \o/
<adaedra> and you know what it means, when you do parameter = value in the arguments of a method?
<saadq> Just not used to seeing an expression inside the parameter
icebourg has joined #ruby
<adaedra> not really an expression
<saadq> adaedra: I guess my answer to that question is no lol
<wasamasa> adaedra: gplv3 scares the shit out of lawyers
<shevy> saadq well, if you omit an argument, it will default to an "empty hash" - that is {}
<adaedra> it's a default value
<wasamasa> adaedra: so apple is careful not bundling anything licensed that way with os x
<saadq> oh interesting
<adaedra> so if you do just new, without parameters, it will use {} as value
<adaedra> wasamasa: yeah ok
paulcsmith has quit [Quit: Lingo: www.lingoirc.com]
Ilyas has quit [Read error: Connection reset by peer]
yfeldblum has joined #ruby
<shevy> adaedra france should buy apple so we get french-named products
Zackio has joined #ruby
<shevy> le iphoeeene
<wasamasa> fun fact: they're not alone
<jimmythehat> quit
<jimmythehat> fail
<wasamasa> though, linux doesn't really count :P
<shevy> jimmythehat rescue!
<adaedra> shevy: you'll earn le coup de pied au cul soon
<wasamasa> it's just that linus doesn't see any reason in upgrading to gplv3
<shevy> yum... cordon bleu
<jimmythehat> shevy :P been a long day
<Ox0dea> >> def foo _ = _; end
<ruboto> Ox0dea # => /tmp/execpad-2fdd0e44001d/source-2fdd0e44001d:2: warning: circular argument reference - _ ...check link for more (https://eval.in/398014)
jimmythehat has quit [Quit: leaving]
<adaedra> yeah, FreeBSD also tried to remove everything GPL
ljt has quit []
<shevy> gpl3 and gpl2 are not that much different except that gpl3 also fights an ideological fight at the same time
arturmartins has joined #ruby
<wasamasa> and there you go
jokke has quit [Ping timeout: 252 seconds]
<wasamasa> the anti-tivoization clause is probably the reason
t_ has quit [Read error: Connection reset by peer]
<adaedra> the what now
Anthony__ has quit [Ping timeout: 246 seconds]
RegulationD has joined #ruby
<Ox0dea> Which is the best license, and why is it the WTFPL?
<wasamasa> the wtfpl is just a bad joke
<adaedra> it's not
<wasamasa> use unlicense or better even cc0
<wasamasa> oh and listen to debian-legal or the fsf when it comes to license questions
<wasamasa> kthxbai
Tritone has joined #ruby
<jhass> Ox0dea: because we have CC0 if you want to do it proper
<jhass> aw, too slow
jokke has joined #ruby
pengin has joined #ruby
<jhass> but I guess we should move this to -offtopic
<wasamasa> yes
baweaver has joined #ruby
<Ox0dea> wasamasa: You're not there...
Igorshp has joined #ruby
<wasamasa> Ox0dea: I'm on three offtopic channels already :P
<wasamasa> Ox0dea: no need for another one to idle on
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shevy> oh the french variant is so great... Faites ce que vous voulez, j?en ai RIEN À BRANLER.
<jhass> but we got hangman!
<Ox0dea> wasamasa: But then where do I chastise you for favoring the Unlicense to the WTFPL?
<wasamasa> don't
aaeron has left #ruby [#ruby]
<Ox0dea> But you're wrong on the Internet.
ascarter has joined #ruby
Rickmasta has joined #ruby
<adaedra> shevy: that's vulgar and not really the place.
bubbys has quit [Ping timeout: 256 seconds]
<shevy> I read it as a love letter!
<adaedra> welll...
<adaedra> you know what it means, right?
<shevy> I shall loudly chant it with a german-speaking accent
bubbys has joined #ruby
<shevy> I have absolutely no idea, you think I'd speak a single word of french :)
zacstewart has joined #ruby
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
drewo has joined #ruby
<adaedra> shevy: off topic
<shevy> \o/
MarkTurner has joined #ruby
graydot has quit [Remote host closed the connection]
graydot has joined #ruby
[Butch] has quit [Quit: Linkinus - http://linkinus.com]
allomov has quit [Remote host closed the connection]
GnuYawk has joined #ruby
Musashi007 has quit [Quit: Musashi007]
rbennacer has quit [Read error: Connection reset by peer]
rbennace_ has joined #ruby
edwinvdgraaf has quit [Remote host closed the connection]
<shevy> ok I have here code written by someone else
shadoi has joined #ruby
hj2007 has joined #ruby
edwinvdgraaf has joined #ruby
<shevy> class Error < StandardError; end
<shevy> class InvalidBla < Error; end
<shevy> is that here common??
<Ox0dea> Very.
<adaedra> I already saw that many times, yes
Musashi007 has joined #ruby
<Ox0dea> I think Error = Class.new(StandardError) is better.
<adaedra> so you have a common root error to all your errors
GitGud has quit [Ping timeout: 248 seconds]
<shevy> hmm
<hj2007> I'm getting "Your Ruby version is 2.0.0, but your Gemfile specified 2.1.2" while bundle install even though rbenv version returns 2.1.2.
<postmodern> hj2007, rbenv rehash?
bklane has joined #ruby
<postmodern> hj2007, also make sure you have bundler installed under that ruby
<jhass> Ox0dea: I disagree, it raises the barrier of entry to your code without reason
<hj2007> postmodern: rehash doesn't help, already did that.
<jhass> not that you would care...
_ixti_ has joined #ruby
<Ox0dea> jhass: How, exactly?
juanpablo_ has joined #ruby
<Ox0dea> I think the average Rubyist should know that Class.new takes an optional base class argument.
mjuszczak has quit []
<jhass> Ox0dea: it requires some deeper knowledge about rubys object model to understand
Xaitec has quit [Quit: Leaving]
<jhass> the average intermediate Rubyist, yes
<Ox0dea> Pfft.
eggoez has quit [Ping timeout: 248 seconds]
<hj2007> postmodern: installed bundler, same issue :(
<jhass> but you'd be surprised of how many are unaware that class Foo is Foo = Class.new, and how long it takes to explain
<yorickpeterse> who wants to see fantastic Ruby code?
<jhass> and how confusing it is to many, especially coming from other programming backgrounds
<jhass> yorickpeterse: nobody
<adaedra> yorickpeterse: nobody
<shevy> wait
<shevy> someone here is nobody
<yorickpeterse> :<
<shevy> I learned that from a discussion between apeiros and jhass
<yorickpeterse> stop ruining my fun
* adaedra steals yorickpeterse's fun
<shevy> ewww XML
<adaedra> aaaah, it looks like PHP
jerius has quit [Ping timeout: 250 seconds]
<shevy> hahaha
<yorickpeterse> that's auto generated btw
<yorickpeterse> normally it comes minus indentation too
<yorickpeterse> so even better
<shevy> I also have to deal with XML stuff right now :( doc = Nokogiri::HTML(open(uri)); path = doc.xpath("//link[@rel='shortcut icon' or @rel='icon']/@href").first
jonathanwallace has quit [Quit: Leaving.]
but3k4 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jhass> waah, throw
dfockler has quit [Remote host closed the connection]
<jhass> the hidden goto
<yorickpeterse> jhass: it actually makes perfect sense here
<yorickpeterse> I'm not even kidding
mjuszczak has joined #ruby
<yorickpeterse> It has to break out of potentially infinitely nested recursion
<yorickpeterse> and since it's in a lambda it can't use "return" at this point
<yorickpeterse> so yay throw/catch
<adaedra> next?
baweaver has quit [Remote host closed the connection]
<yorickpeterse> That only deals with the inner most recursion
<adaedra> ah yes
jespada has quit [Ping timeout: 246 seconds]
<yorickpeterse> here the "node.children.each do |node|" bit could be repeated a lot of times
eggoez has joined #ruby
<adaedra> indent is misleading af
<yorickpeterse> Yeah it's a bit messed up
duderonomy has joined #ruby
_ixti_ has quit [Ping timeout: 264 seconds]
<adaedra> but throw could have been avoided tbh
bluOxigen has quit [Ping timeout: 256 seconds]
<yorickpeterse> https://gist.github.com/YorickPeterse/313501dc4713f861bfbb#file-predicate_without_indent-rb this is what it looks like as spat out by the compiler
<adaedra> what you're doing looks like a #find
<yorickpeterse> nop
mary5030 has quit [Remote host closed the connection]
<yorickpeterse> Any form of find/select/whatever only runs at most N times where N is the outer most values in the array
<shevy> we found a legit use case for throw!
<yorickpeterse> this also saves me from having to nest dozens of #find calls potentially
<yorickpeterse> Remember this is actually meant to be webscale
<yorickpeterse> as in, this will be faster than Nokogiri's xpath engine
<yorickpeterse> which is written in C
baweaver has joined #ruby
<adaedra> mh
Notte has joined #ruby
<Ox0dea> >> (1..Float::INFINITY).find(&:zero?)
<ruboto> Ox0dea # => (https://eval.in/398019)
<Ox0dea> Come on! It's gotta be in there somewhere.
<adaedra> shevy: there is a legit use for throw: exceptional error cases.
<jhass> wat
<shevy> rescue TheWorld
<yorickpeterse> adaedra: No
MarkTurner has quit [Ping timeout: 256 seconds]
<yorickpeterse> throw is not meant for exception handling
<shevy> lol
<yorickpeterse> not at all
rbennace_ has quit [Ping timeout: 265 seconds]
<jhass> adaedra: the fireworks made you all dizzy
<yorickpeterse> fuck yeah, this code is 5,5x faster than Nokogiri
<adaedra> no
<shevy> nokogiri is slower than a snail
<adaedra> so exceptions are not for errors now?
<yorickpeterse> shevy: tell that to all the nerds going "OMMGMGMG BUT C IS WEBSCALE"
<jhass> adaedra: you're confusing throw for raise
<yorickpeterse> adaedra: "raise" is for exception handling, "throw" is for recursion/flow-control
<shevy> there used to be .cgi written in C!
<adaedra> that's not the same now? o_O
<yorickpeterse> adaedra: correct
<jhass> no
<yorickpeterse> they're different
<yorickpeterse> throw/catch is basically a goto
<shevy> throw is when you wanna throw someone out of the club
<yorickpeterse> raise is "fuck shit broke"
<yorickpeterse> plus an oxford comma
wallerdev has joined #ruby
<adaedra> oh wait
<yorickpeterse> so "fuck, shit broke"
<adaedra> guess I'm mixing languages
<shevy> how descriptive
<yorickpeterse> adaedra: yeah, it doesn't help that pretty much every other language uses throw/try/catch
<jhass> raise Fuck, "shit broke"
ruurd_ has joined #ruby
<jhass> gotta stick that somewhere
ruurd has quit [Quit: Be back later]
<yorickpeterse> rescue Exception => error
<yorickpeterse> # lol
arooni-mobile has joined #ruby
<yorickpeterse> end
arooni-mobile__ has joined #ruby
<yorickpeterse> I think I actually have something like that somewhere
<jhass> s/lol/I'm an idiot/
<hj2007> I'm getting "Your Ruby version is 2.0.0, but your Gemfile specified 2.1.2" while bundle install even though rbenv version returns 2.1.2. Any help?
dblessing has quit [Quit: Textual IRC Client: www.textualapp.com]
<yorickpeterse> oh hm no, we actually do something with the error
<jhass> hj2007: what exact command are you running?
<hj2007> jhass: bundle install in a directory with a Gemfile
ruurd_ has quit [Client Quit]
<jhass> hj2007: command -v bundle returns what?
<Ox0dea> yorickpeterse: That wasn't an Oxford comma, for what that's worth.
ruurd has joined #ruby
<hj2007> jhass: /usr/bin/bundle
<yorickpeterse> Ox0dea: close, enough
ruurd has quit [Client Quit]
<jhass> hj2007: there you go, your Rbenv install doesn't have bundler installed
edwinvdgraaf has quit [Remote host closed the connection]
ruurd has joined #ruby
<hj2007> jhass: did gem install bundler, same issue
<jhass> rbenv rehash?
<jhass> command -v bundle changed?
<hj2007> jhass: no, command -v bundle still returns the same, did rehash as well.
<jhass> well, your rbenv install is borked then or whatever
<jhass> I don't use it, so *shrug*
podman has quit [Quit: Connection closed for inactivity]
<hj2007> jhass: I see, thanks anyway, let me reinstall and try
bodgix has quit [Ping timeout: 256 seconds]
Casty has joined #ruby
edwinvdgraaf has joined #ruby
ruurd_ has joined #ruby
ruurd_ has quit [Client Quit]
beef-wellington has joined #ruby
ruurd has quit [Client Quit]
<Casty> i'm pretty new, but can someone help me figure out a way to see how much memory a .rb file is using? on ubuntu
<shevy> Casty probably first way would be via htop
JoshL_ has joined #ruby
felixr has quit [Ping timeout: 246 seconds]
ruurd has joined #ruby
duoi has quit [Read error: Connection reset by peer]
c355E3B has quit [Quit: Connection closed for inactivity]
<jhass> a modern /usr/bin/time shows that
<jhass> /usr/bin/time ruby foo.rb
<al2o3-cr> probablt need to install with `sudo apt-get install htop`
lordkryss has quit [Quit: Connection closed for inactivity]
<al2o3-cr> *probably
<adaedra> ^T does i– ah no, Linux, nvm.
Scroff has joined #ruby
bungoman has joined #ruby
<shevy> adaedra ack! you are not on linux?
victortyau has joined #ruby
JoshL has quit [Ping timeout: 265 seconds]
<al2o3-cr> adaedra: is this true?
<Casty> ok thanks i'll start with that. i appreciate the quick answers
<adaedra> shevy: not all the time. I also use Mac OS and FreeBSD
<adaedra> al2o3-cr: what is true?
victortyau has quit [Read error: Connection reset by peer]
bklane has quit [Read error: Connection reset by peer]
scripore has quit [Quit: This computer has gone to sleep]
<al2o3-cr> thought you may be using windows :p
scripore has joined #ruby
<al2o3-cr> but everyone to their own
olistik has quit [Remote host closed the connection]
<Ox0dea> Except Windows users.
<al2o3-cr> :p
<adaedra> Come on, I'm mad, not insane.
<shevy> you use everything
<al2o3-cr> it's good to be both sometimes
beef-wellington has quit [Ping timeout: 252 seconds]
tmtwd has quit [Ping timeout: 246 seconds]
Igorshp has quit [Remote host closed the connection]
<adaedra> shevy: noo, far from it.
kies^ has quit [Ping timeout: 255 seconds]
<shevy> Linux share: 1.61%; OSX 4.54% - guess ruby runs on more machines that have OSX in total
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Soda has quit [Read error: Connection reset by peer]
shadoi has quit [Quit: Leaving.]
quimrstorres has quit [Remote host closed the connection]
<al2o3-cr> windows 7 needs to die!
Scroff has quit [Ping timeout: 264 seconds]
<adaedra> er
havenwood has joined #ruby
astrobun_ has quit [Remote host closed the connection]
<al2o3-cr> all microsoft shit
<adaedra> let Windows XP and Vista die first, we will talk about 7 after that.
duderonomy has quit []
olistik has joined #ruby
<al2o3-cr> traitor
duderonomy has joined #ruby
<shevy> https://en.wikipedia.org/wiki/Usage_share_of_operating_systems reports an even higher share of OSX
<shevy> linux - same lowness :(
ascarter has joined #ruby
bungoman has quit [Remote host closed the connection]
<al2o3-cr> now check web server OS's :p
olistik has quit [Remote host closed the connection]
<Ox0dea> al2o3-cr: Or supercomputers.
roolo has quit [Remote host closed the connection]
quimrstorres has joined #ruby
<al2o3-cr> or that :p
jespada has joined #ruby
ascarter has quit [Max SendQ exceeded]
<Ox0dea> It's 94% of the top 500, apparently.
olistik has joined #ruby
bklane has joined #ruby
ascarter has joined #ruby
<shevy> \o/
fabrice31 has joined #ruby
<al2o3-cr> wouldn't trust ms on a cray :D
ascarter has quit [Client Quit]
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shevy> or google to drive your car
danzilio has quit [Quit: Baiii!]
<al2o3-cr> not to sure i would :p
charliesome_ has quit [Quit: zzz]
<yorickpeterse> well, 318 failing tests to fix
<yorickpeterse> before I can ship this new xpath compiler
tomphp has joined #ruby
<al2o3-cr> probably better than most drivers :)
edwinvdgraaf has quit [Remote host closed the connection]
<shevy> dunno
edwinvdgraaf has joined #ruby
freerobby has joined #ruby
evanjs_ has quit [Remote host closed the connection]
<al2o3-cr> i'd place a bet :p
<shevy> 99% use cases perhaps - but what if someone else drives into your car
<al2o3-cr> then it's not you fault
evanjs has joined #ruby
jespada_ has joined #ruby
<shevy> I am sure I'll be very relieved of that upon impact time :P
<al2o3-cr> :D
fabrice31 has quit [Ping timeout: 246 seconds]
<Darkwater> why does `bundle gem foo-bar` create Foo::Bar? Why not just FooBar?
<Ox0dea> > Chris Urmson, the head of Google's self-driving initiative, says 11 accidents in 1.7 million miles is a lot better record than most humans achieve.
jespada has quit [Ping timeout: 244 seconds]
<al2o3-cr> agreed!
Notte has quit []
baweaver has quit [Remote host closed the connection]
whippythellama has quit [Quit: WeeChat 1.2]
<jhass> it's simply the convention
t_ has joined #ruby
bklane has quit [Read error: Connection reset by peer]
charliesome has joined #ruby
<Darkwater> I see
loc22 has joined #ruby
niemcu has quit [Ping timeout: 246 seconds]
havenwood has quit [Ping timeout: 256 seconds]
bodgix has joined #ruby
moredhel has left #ruby ["Textual IRC Client: www.textualapp.com"]
<adaedra> Ox0dea: iirc, all of these accidents were 3rd party fault
triangles2 has joined #ruby
ndrei has quit [Ping timeout: 250 seconds]
bodgix has quit [Client Quit]
<Ox0dea> Indeed.
<Ox0dea> I, for one, welcome a road full of "drivers" who've been properly instructed in how to use a fucking on ramp.
evanjs has quit [Ping timeout: 244 seconds]
duderonomy has quit []
<al2o3-cr> bhahaha lol
Igorshp has joined #ruby
olistik has quit [Remote host closed the connection]
hj2007 has quit [Quit: This computer has gone to sleep]
edwinvdgraaf has quit [Remote host closed the connection]
solars has quit [Ping timeout: 264 seconds]
<adaedra> I work in Paris, I guess driving correctly is a concept
olistik has joined #ruby
quimrstorres has quit [Remote host closed the connection]
amargherio has quit [Remote host closed the connection]
astrobun_ has joined #ruby
<Ox0dea> Y'all Yurop fellers got it so good in that regard.
<yorickpeterse> "Yurop fellers"?
<Ox0dea> Oui.
blue_deref has joined #ruby
<al2o3-cr> sure that's meant to mean "Europe fellows" :p
loc22 has quit [Ping timeout: 264 seconds]
nfk has quit [Read error: Connection reset by peer]
nateberkopec has joined #ruby
<adaedra> what is gotten so good? Driving correctly?
<Ox0dea> The phrasing was intended as a self-deprecation of the American south.
radialneon is now known as _ZomB
<Ox0dea> adaedra: Yes. Floridian drivers are, on average, a shit.
quimrstorres has joined #ruby
_ZomB is now known as Zom-B
xkickflip has joined #ruby
<al2o3-cr> taxi in england are the worst :(
bklane has joined #ruby
Igorshp has quit [Ping timeout: 246 seconds]
Zom-B is now known as radialneon
<adaedra> don't know how they compete with us, we have quite a bad driving habit here.
<adaedra> al2o3-cr: don't talk about taxis, thanks.
<al2o3-cr> they don't give a s***
iamninja has joined #ruby
quimrstorres has quit [Remote host closed the connection]
olistik has quit [Ping timeout: 240 seconds]
<adaedra> but I guess the worst here are cyclists
mjuszczak has quit []
<al2o3-cr> adaedra: ok sir!
xkickflip has quit [Client Quit]
<adaedra> "Red lamp? Stop? Curb? Pedestran crossing? Priority? Lanes? What are those?"
SylarRub_ has quit [Remote host closed the connection]
<al2o3-cr> adaedra: what are they?
mjuszczak has joined #ruby
lkba has quit [Remote host closed the connection]
<al2o3-cr> :p
quazimodo has quit [Ping timeout: 240 seconds]
quazimod1 has quit [Ping timeout: 246 seconds]
<ruurd> adaedra where are you? Netherlands I guess :-)
<adaedra> not exactly.
bklane has quit [Read error: Connection reset by peer]
<adaedra> I actally told it above.
quimrsto_ has joined #ruby
chadrien_ has quit [Remote host closed the connection]
maknz has joined #ruby
duderonomy has joined #ruby
quimrsto_ has quit [Remote host closed the connection]
<ruurd> adaedra ah well amsterdam bikers...
<ruurd> maybe paris is heaven compared to that in that respect. :-)
alicanyilmaz has joined #ruby
<alicanyilmaz> hello guys
<alicanyilmaz> I need to write a code to calculating nth term of PI number in ruby
kies^ has joined #ruby
<adaedra> ruurd: tbh, I really wished I could kick bikes in Paris sometimes
<alicanyilmaz> can someone help me for this ?
<adaedra> alicanyilmaz: you need an allgorithm to calculate PI if you want to go deep down, first.
<adaedra> *-l
ndrei has joined #ruby
bklane has joined #ruby
<ruurd> plus doing your homework for you costs $150
GPrime has joined #ruby
<alicanyilmaz> ruurd: its not a homework, sorry its an challenge for me to implement rest api. I need to solve the challenge for enter the company as an employee
kirun has quit [Quit: Client exiting]
<alicanyilmaz> adaedra: can you suggest me some docs ?
<jhass> alicanyilmaz: that's not any better than doing homework for you
<adaedra> google has all of that, I'm not really good at maths.
<jhass> if you can't do that without external help you probably should question why you apply
<jhass> after all the challenge is there to find candidates who can
<alicanyilmaz> jhass: you are totally right. This is the last part of the challenge but my math is not that good..
<jhass> as said, google
<alicanyilmaz> jhass: ok thank you..
<jhass> there will be algorithms for that you just have to implement
<Ox0dea> alicanyilmaz: There was an IOCCC winner that calculated pi using the "surface area" of the program itself. I think reading its source would be most instructive.
<jhass> Ox0dea: stop trolling :P
kies^ has quit [Ping timeout: 250 seconds]
bklane has quit [Read error: Connection reset by peer]
<alicanyilmaz> Ox0dea: :)
<Ox0dea> alicanyilmaz: I wasn't *completely* trolling, for what that's worth. I suspect being able to decipher that program really would teach you quite a bit about how to calculate pi.
<alicanyilmaz> Ox0dea: got it
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
[k- has quit [Ping timeout: 246 seconds]
duderonomy has quit []
jhack has quit [Ping timeout: 256 seconds]
<al2o3-cr> i am an ape man
<alicanyilmaz> Ox0dea: found an algorithm Gauss–Legendre algorithm
<Ox0dea> Yay!
saadq has quit [Remote host closed the connection]
<alicanyilmaz> Ox0dea: its time to implement! :) thank you
bklane has joined #ruby
<Ox0dea> alicanyilmaz: http://bellard.org/pi/
curses has quit [Remote host closed the connection]
<Ox0dea> Fabrice held the world record for most calculated digits of pi for quite some time, and he did it with a single machine.
<Ox0dea> There is much to learn from him on the matter.
lkba has joined #ruby
<alicanyilmaz> Ox0dea: absolutely
duderonomy has joined #ruby
<alicanyilmaz> Ox0dea: omg the algorithm is improved to find with o(n^2) complexity its amazing
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<shevy> jhass perhaps both are :P
dfockler has joined #ruby
bruno- has joined #ruby
freerobby has quit [Quit: Leaving.]
Goldfish has joined #ruby
baweaver has joined #ruby
Goldfish is now known as Guest75390
mjuszczak has quit []
bklane has quit [Read error: Connection reset by peer]
webguynow has quit [Ping timeout: 272 seconds]
<Encapsulation> this is where I'm talked about the most
<jhass> compared to?
iamse7en has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Tritone has quit [Remote host closed the connection]
saadq has joined #ruby
<shevy> Encapsulation oh you are here! encapsulate all of us!!!
bklane has joined #ruby
<ruurd> Gregory-Leibniz series
jeramyRR has joined #ruby
<ruurd> Just increase the number of terms until the n-th term stabilizes
spider-mario has quit [Ping timeout: 256 seconds]
bklane has quit [Read error: Connection reset by peer]
baweaver has quit [Remote host closed the connection]
Zamyatin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ndrei has quit [Ping timeout: 264 seconds]
dojobo has quit [Quit: Leaving]
duoi has joined #ruby
duoi has quit [Changing host]
duoi has joined #ruby
mary5030 has joined #ruby
nfk has joined #ruby
Torrieri has quit [Quit: Be back later ...]
rushed has joined #ruby
dgutierrez1287 has joined #ruby
mikefulcher has joined #ruby
NeverDie has joined #ruby
bklane has joined #ruby
devbug has quit [Ping timeout: 246 seconds]
jhack has joined #ruby
hj2007 has joined #ruby
Igorshp has joined #ruby
bklane has quit [Read error: Connection reset by peer]
mary5030 has quit [Ping timeout: 265 seconds]
nateberkopec has quit [Quit: Leaving...]
Guest75390 has quit [Quit: G'Bye]
dgutierrez1287 has quit [Ping timeout: 256 seconds]
gambl0re has joined #ruby
jottr_ has quit [Ping timeout: 264 seconds]
gamename has quit [Remote host closed the connection]
gamename has joined #ruby
devbug has joined #ruby
juanpablo_ has quit [Quit: (null)]
bungoman has joined #ruby
jobewan has quit [Quit: Leaving]
juanpablo_ has joined #ruby
ndrei has joined #ruby
juanpablo_ has quit [Remote host closed the connection]
jhack has quit [Remote host closed the connection]
gamename has quit [Ping timeout: 246 seconds]
devyn has quit [Remote host closed the connection]
eGGsha has quit [Quit: Textual IRC Client: www.textualapp.com]
Hobogrammer_ has quit [Ping timeout: 246 seconds]
bklane has joined #ruby
Ropeney has joined #ruby
grimly has joined #ruby
GPrime has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jespada_ has quit [Ping timeout: 256 seconds]
bungoman has quit [Ping timeout: 244 seconds]
rushed has quit [Quit: rushed]
cpruitt has quit [Quit: cpruitt]
frem has quit [Quit: Connection closed for inactivity]
CloCkWeRX has joined #ruby
blue_deref has quit [Quit: bbn]
i8igmac has quit [Ping timeout: 244 seconds]
mandarinkin has quit [Ping timeout: 264 seconds]
Lucky___ has quit [Read error: Connection reset by peer]
alicanyilmaz has quit [Quit: alicanyilmaz]
devbug has quit [Ping timeout: 264 seconds]
rushed has joined #ruby
JoshL_ has quit []
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
iateadonut has joined #ruby
dopie has quit [Quit: This computer has gone to sleep]
danielpclark has quit [Ping timeout: 246 seconds]
bklane has quit [Read error: Connection reset by peer]
Musashi007 has quit [Quit: Musashi007]
howdoicomputer has quit [Quit: WeeChat 1.2]
jhack has joined #ruby
jhack has quit [Changing host]
jhack has joined #ruby
arooni-mobile__ has quit [Quit: Leaving]
xkickflip has joined #ruby
sarkyniin has joined #ruby
arescorpio has joined #ruby
xkickflip has quit [Client Quit]
havenwood has joined #ruby
xkickflip has joined #ruby
fullofcaffeine has quit [Remote host closed the connection]
charliesome has quit [Quit: zzz]
jwaldrip has quit [Quit: Lingo: www.lingoirc.com]
bklane has joined #ruby
Renich has joined #ruby
Papierkorb has quit [Quit: ArchLinux completes an endless loop faster than any other distro!]
eggoez has quit [Ping timeout: 256 seconds]
mdarby has quit [Quit: Textual IRC Client: www.textualapp.com]
baweaver has joined #ruby
evo2020 has joined #ruby
rcvalle has quit [Quit: rcvalle]
fullofcaffeine has joined #ruby
eggoez has joined #ruby
atomical has joined #ruby
TheNet has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
scripore has quit [Ping timeout: 248 seconds]
Alayde has quit [Ping timeout: 246 seconds]
danielpclark has joined #ruby
havenwood has quit [Read error: Connection reset by peer]
drewo has quit [Ping timeout: 248 seconds]
JMoir has quit [Ping timeout: 264 seconds]
theery has quit [Remote host closed the connection]
d1n has joined #ruby
gamename has joined #ruby
arooni-mobile has quit [Ping timeout: 248 seconds]
quazimodo has joined #ruby
quazimod1 has joined #ruby
Voker57 has joined #ruby
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bungoman has joined #ruby
devbug has joined #ruby
baweaver has quit [Remote host closed the connection]
nb_bez___ has joined #ruby
hj2007 has quit [Quit: This computer has gone to sleep]
RegulationD has quit [Remote host closed the connection]
RegulationD has joined #ruby
RegulationD has quit [Remote host closed the connection]
icebourg has quit []
<shevy> ruby ruby ruby
bklane has quit [Read error: Connection reset by peer]
gamename has quit [Remote host closed the connection]
<Ox0dea> Which is the most sensible base class for named tuples: Hash, Struct, or BasicObject?
rushed has quit [Quit: rushed]
bklane has joined #ruby
hj2007 has joined #ruby