apeiros changed the topic of #ruby to: 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, other public logging is prohibited
narcan has joined #ruby
apurcell has quit [Quit: Be back later ...]
cjim_ has joined #ruby
<Eiam> split is defined on String, not Array
sevenseacat has joined #ruby
<Musashi007> this works: exercise_models.select { |model| model.type == 'floor' }.map { |model| model.duration }.inject { |accumulator, duration| accumulator + duration } and this doesn’t : exercise_models.select { |model| (model.type == 'floor' || mode.type == ‘inverted’) }.map { |model| model.duration }.inject { |accumulator, duration| accumulator + duration } What gives?
GaryOak_ has quit [Remote host closed the connection]
<Eiam> mode.type vs model.type?
mrmargolis has joined #ruby
<Eiam> Musashi007: ^
Eiam has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Pupeno has quit [Remote host closed the connection]
Sawbones has joined #ruby
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dstarh has joined #ruby
paradisaeidae has joined #ruby
dstarh has quit [Client Quit]
xcyclist has joined #ruby
x1337807x has joined #ruby
f3lp has quit [Ping timeout: 255 seconds]
robustus has quit [Ping timeout: 264 seconds]
avahey has quit [Quit: Connection closed for inactivity]
baweaver has quit [Remote host closed the connection]
Sawbones has quit [Remote host closed the connection]
mrmargolis has quit [Remote host closed the connection]
snockerton has quit [Quit: Leaving.]
<Musashi007> that does not appear to be so
mjuszczak has quit []
robustus|Off has joined #ruby
robustus|Off is now known as robustus
duderonomy has joined #ruby
yfeldblu_ has joined #ruby
Akagi201 has quit [Remote host closed the connection]
chipotle has joined #ruby
baweaver has joined #ruby
Fingel has quit [Ping timeout: 276 seconds]
x1337807x has quit [Ping timeout: 255 seconds]
<baweaver> So why don't ruby hashes let us use set methods?
fr0de has joined #ruby
<baweaver> based on keys, that could be one thing
<baweaver> still, dang handy for certain applications
<Radar> Musashi007: Gist your code so we can see it properly please. IRC isn't good for lines of code > 50 chars
wallerdev has quit [Quit: wallerdev]
<Musashi007> sorry. alright
<weaksauce> baweaver what do you mean?
yfeldblum has quit [Ping timeout: 256 seconds]
<baweaver> {a: 1, b: 2} - {a: 2} == {b: 2}
<baweaver> problem is what to do on values.
<weaksauce> ah. yeah.
<baweaver> Honestly I'm tempted to say keys are sufficient, and you'd merge if it wasn't
MatthewsFace has joined #ruby
<baweaver> that, and something like this:
<baweaver> >> class String; def to_bool; self.downcase == 'true' end end; 'true'.to_bool
<ruboto> baweaver # => true (https://eval.in/325156)
<baweaver> mainly because rails and json are a thing
juanpablo__ has joined #ruby
<baweaver> To a degree I think there's a lot of borderline religious dogma against monkeypatching things, when some things are truly of ubiquitous use.
kblake has quit [Remote host closed the connection]
<fr0de> any minitest users here? How do you stub more than one method without getting an awful mess of nested blocks? I want to avoid this mess: https://gist.github.com/anonymous/7406b7f27ef17442cf3f
<baweaver> though it comes back to the point of being able to blow off your foot pretty dang fast.
Mon_Ouie has quit [Ping timeout: 256 seconds]
<weaksauce> baweaver I think the dogma is when you change existing behavior
<baweaver> Ah
mrmargolis has joined #ruby
<baweaver> If I notice that I have something littered in my code, I won't hesitate to patch core classes.
<weaksauce> if you add to a class like hash it's less likely to cause problems (not sure that it's usually the best way)
Musashi007 has quit [Quit: Musashi007]
<baweaver> but that requires a ton of use.
DerisiveLogic has joined #ruby
<weaksauce> but changing how to_s works on a fundamental class can break existing applications in non trivial ways
<baweaver> and requires that it add significant value of clarity to your apps
<baweaver> indeed.
cjim_ has quit [Quit: (null)]
DerisiveLogic has quit [Remote host closed the connection]
DerisiveLogic has joined #ruby
f3lp has joined #ruby
juanpablo__ has quit [Ping timeout: 246 seconds]
jtdowney has quit []
cjim_ has joined #ruby
swgillespie has joined #ruby
mrmargolis has quit [Remote host closed the connection]
Cat_1 has quit []
cjim_ has quit [Client Quit]
DynamicMetaFlow has joined #ruby
michaeldeol has quit [Ping timeout: 265 seconds]
jbc has joined #ruby
scripore has quit [Quit: This computer has gone to sleep]
<jbc> heyas
scripore has joined #ruby
j_mcnally has joined #ruby
iotouch has joined #ruby
j_mcnally has quit [Read error: No route to host]
fabrice31 has joined #ruby
j_mcnally has joined #ruby
j_mcnally has quit [Max SendQ exceeded]
<bricker> baweaver: If people monkey-patch willy-nilly, then your methods also have to compete with every other possible method nam
j_mcnally has joined #ruby
<bricker> baweaver: so, you better hope two libs don't define the same method on the same class
diegoviola has quit [Remote host closed the connection]
j_mcnally has quit [Max SendQ exceeded]
<baweaver> hence the shoot your foot off bit
<bricker> indeed
<jbc> is there a nicer idiom for if (! foo.nil? && foo.match(...)) ?
Pupeno has joined #ruby
j_mcnally has joined #ruby
j_mcnally has quit [Max SendQ exceeded]
<baweaver> foo && foo.match ?
workmad3 has joined #ruby
<baweaver> but there are cases in which you're at the app layer where some functionality is ubiquitous enough to warrant discussion of a patch
<baweaver> however rare they may be
moeabdol has quit [Ping timeout: 240 seconds]
<baweaver> such as one thing I kept doing for some analytics, count_by
Pupeno has quit [Remote host closed the connection]
someguy has quit [Quit: This computer has gone to sleep]
<apeiros> jbc: since you don't use matchdata - just if foo =~ /regex/
<apeiros> >> nil =~ /blubb/
<ruboto> apeiros # => nil (https://eval.in/325187)
Pupeno has joined #ruby
<baweaver> >> module Enumerable; def count_by(&:block) group_by(&:block).map{|k,v|[k,v.length]}.to_h end end; (1..10).count_by(&:even?)
<ruboto> baweaver # => /tmp/execpad-88e2886cc346/source-88e2886cc346:2: syntax error, unexpected tSYMBEG, expecting tIDENTI ...check link for more (https://eval.in/325188)
<jbc> oooh
<baweaver> >> module Enumerable; def count_by(&:block) group_by(&:block).map{|k,v|[k,v.length]}.to_h; end; end; (1..10).count_by(&:even?)
<ruboto> baweaver # => /tmp/execpad-bb98cbe8f4d5/source-bb98cbe8f4d5:2: syntax error, unexpected tSYMBEG, expecting tIDENTI ...check link for more (https://eval.in/325189)
<jbc> thanks
<baweaver> >> module Enumerable; def count_by(&:block); group_by(&:block).map{|k,v| [k,v.length] }.to_h; end; end; (1..10).count_by(&:even?)
<ruboto> baweaver # => /tmp/execpad-f273d68ca22c/source-f273d68ca22c:2: syntax error, unexpected tSYMBEG, expecting tIDENTI ...check link for more (https://eval.in/325190)
cjim_ has joined #ruby
<apeiros> baweaver: def count_by(&:block) is not valid
<apeiros> def count_by(&block)
<baweaver> derp
<baweaver> >> module Enumerable; def count_by(&block); group_by(&:block).map{|k,v| [k,v.length] }.to_h; end; end; (1..10).count_by(&:even?)
<ruboto> baweaver # => undefined method `block' for 1:Fixnum (NoMethodError) ...check link for more (https://eval.in/325191)
<apeiros> and to pass it on, group_by(&block), not &:block)
<baweaver> >> module Enumerable; def count_by(&block); group_by(&block).map{|k,v| [k,v.length] }.to_h; end; end; (1..10).count_by(&:even?)
<ruboto> baweaver # => {false=>5, true=>5} (https://eval.in/325192)
iotouch has quit [Ping timeout: 264 seconds]
RegulationD has quit [Remote host closed the connection]
<apeiros> getting there… slowly :-p
<baweaver> I'm just going to chalk this to Monday....
Pupeno has quit [Remote host closed the connection]
<baweaver> Anyways, that's a common enough idiom that I'd consider patching it.
yqt has quit [Quit: KVIrc 4.0.4 Insomnia http://www.kvirc.net/]
Pupeno has joined #ruby
<havenwood> >> 1.upto(10).count &:even?
<ruboto> havenwood # => 5 (https://eval.in/325193)
cjim_ has quit [Client Quit]
iotouch has joined #ruby
<baweaver> mainly because the name is a lot more intention revealing
workmad3 has quit [Ping timeout: 272 seconds]
nii236 has joined #ruby
<havenwood> >> 1.upto(10).partition(&:even?).map &:size
<ruboto> havenwood # => [5, 5] (https://eval.in/325194)
<baweaver> That assumes a binary condition
marr has quit [Ping timeout: 256 seconds]
<baweaver> >> module Enumerable; def count_by(&block); group_by(&block).map{|k,v| [k,v.length] }.to_h; end; end; (1..100).count_by { |n| n.to_s.length }
<ruboto> baweaver # => {1=>9, 2=>90, 3=>1} (https://eval.in/325195)
<baweaver> can be a lot more useful with collections of objects
<baweaver> group_by just gives you the objects back indexed by the value
Pupeno has quit [Remote host closed the connection]
<havenwood> baweaver: >> 1.upto(100).count_by { |n| n.to_s.size }
<havenwood> >> 1.upto(100).count_by { |n| n.to_s.size }
<ruboto> havenwood # => undefined method `count_by' for #<Enumerator: 1:upto(100)> (NoMethodError) ...check link for more (https://eval.in/325196)
<havenwood> baweaver: yup, nice
bruno- has joined #ruby
iotouch has quit [Read error: Connection reset by peer]
<havenwood> didn't mean to paste the same example >.>
<baweaver> I avoid it in general, but that one is common enough for me that I consider it
Pupeno has joined #ruby
<baweaver> Already going to push an upstream to rails later for a better count method
iotouch has joined #ruby
soul11201 has joined #ruby
<baweaver> considering this is how it works now: People.group(:age).count
FernandoBasso has quit [Quit: leaving]
<baweaver> suggested: People.count(:age)
ismaelga has quit [Remote host closed the connection]
<baweaver> fun that rails allows multipart indexes in there, try it: People.group(:age, :last_name).count
thiagovsk has quit [Quit: Connection closed for inactivity]
<baweaver> they also have an index_by method which was a good deal of the inspiration there.
Deele has joined #ruby
mostlybadfly has quit [Quit: Connection closed for inactivity]
<apeiros> baweaver: afaik Enumerable#count_by will be in 2.3
Pupeno has quit [Ping timeout: 272 seconds]
jeramy_s has joined #ruby
soul11201 has left #ruby [#ruby]
<baweaver> well go figure.
bruno- has quit [Ping timeout: 250 seconds]
<baweaver> Now I don't feel as bad about patching it :P
<baweaver> Now if we can get the block form itself
<baweaver> >> class Object; def itself2; yield self end end; 1.itself2 { |v| v + 10 }
<ruboto> baweaver # => 11 (https://eval.in/325229)
<apeiros> baweaver: just don't forget the `unless Enumerable.method_defined?(:count_by)` test in your monkey patch ;-)
<baweaver> there're threads open on it
<baweaver> Yeah
fabrice31_ has joined #ruby
edwinvdgraaf has quit [Remote host closed the connection]
iotouch has quit [Read error: Connection reset by peer]
iotouch has joined #ruby
iasoon has quit [Ping timeout: 272 seconds]
fabrice31 has quit [Ping timeout: 250 seconds]
jtdowney has joined #ruby
CloCkWeRX has quit [Quit: Leaving.]
Rickmasta has joined #ruby
funburn has joined #ruby
hewenhong has joined #ruby
_djbkd has quit [Quit: My people need me...]
baweaver has quit [Remote host closed the connection]
JoshGlzBrk has quit [Quit: Textual IRC Client: www.textualapp.com]
hewenhong has quit [Read error: Connection reset by peer]
CloCkWeRX has joined #ruby
hewenhong has joined #ruby
charliesome has joined #ruby
thatslif_ has quit [Remote host closed the connection]
endash has quit [Quit: endash]
ismaelga has joined #ruby
jeramy_s has quit [Quit: Peace out!]
Matachines has joined #ruby
Matachines has quit [Max SendQ exceeded]
hewenhong has quit [Read error: Connection reset by peer]
fabrice31_ has quit [Read error: Connection reset by peer]
Matachines has joined #ruby
fabrice31 has joined #ruby
duderonomy has quit [Ping timeout: 256 seconds]
diegoviola has joined #ruby
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
vdamewood has joined #ruby
baweaver has joined #ruby
bintelli has joined #ruby
fabrice31_ has joined #ruby
fabrice31 has quit [Read error: Connection reset by peer]
iotouch has quit [Read error: Connection reset by peer]
iotouch has joined #ruby
iotouch has quit [Client Quit]
iamninja has quit [Read error: Connection reset by peer]
iamninja has joined #ruby
tjohnson has quit [Quit: Connection closed for inactivity]
paradisaeidae has quit [Ping timeout: 245 seconds]
nobitanobi has quit [Remote host closed the connection]
tvw has quit [Ping timeout: 244 seconds]
icarus has quit [Ping timeout: 272 seconds]
Spami has quit [Quit: Leaving]
nux443 has joined #ruby
lidenskap has quit [Remote host closed the connection]
havenwood has quit [Remote host closed the connection]
zzing_ has quit [Read error: Connection reset by peer]
paradisaeidae has joined #ruby
iotouch has joined #ruby
paradisaeidae has quit [Client Quit]
zzing has joined #ruby
Akagi201 has joined #ruby
Hijiri has joined #ruby
bricker has quit [Quit: leaving]
jokester has quit [Quit: WeeChat 1.0.1]
Joufflu has joined #ruby
icarus has joined #ruby
claptor has joined #ruby
simpyll has quit [Ping timeout: 264 seconds]
<Ikri> does ruby not have type coercion? I'm having trouble adding two integers in a string together.
MatthewsFace is now known as MatthewsFace[SEA
xcyclist has quit [Ping timeout: 246 seconds]
chrishough has quit [Quit: Textual IRC Client: www.textualapp.com]
<mozzarella> uh?
<mozzarella> just show your code
<Ikri> mozzarella: '5' + '5' is turning out 55, not 10
fabrice31 has joined #ruby
mjuszczak has joined #ruby
<mozzarella> yeah, because that's how you concatenate strings
Guest1421 has joined #ruby
mrmargolis has joined #ruby
wldcordeiro__ has quit [Remote host closed the connection]
drocsid has joined #ruby
<jhass> Ikri: yes, Ruby is a sane language and thus has strong typing
<mozzarella> this is no php
<jhass> convert explicitly, .to_i
<Ikri> sorry, new to ruby! so '5'.to_i?
<Ikri> '5'.to_i + '5'.to_i would return 10? okay. thank you!
<jhass> well, x.to_i, if you have literally '5' just write 5 directly
wldcordeiro__ has joined #ruby
<aewffwea> jhass: Although it has dynamic typing too
<Ikri> it's name.length :P
fabrice31_ has quit [Read error: Connection reset by peer]
<drocsid> I'm trying to send an email with my exception / error string captured, using rescue Exception => e
<mozzarella> should be an integer
<mozzarella> already
<jhass> aewffwea: strong/weak typing and dynamic/static typing are orthogonal, though implementing weak typing in a strongly typed language would be hard
<drocsid> but when I use #{e} or #{e.to_s} I get getaddrinfo: Name or service not known
<jhass> Ikri: yeah, .length (or its shorter alias .size) return int already
<aewffwea> jhass: I know
Pupeno has joined #ruby
Pupeno has joined #ruby
<drocsid> but not the error E.G. SocketError
<aewffwea> jhass: But I personally like Strong and static typing :)
<drocsid> and I don't get the stack trace either.
<drocsid> anybody know how I can get that information?
ismael has joined #ruby
ghr has joined #ruby
<jhass> drocsid: e.backtrace (returns an array). Btw don't rescue Exception, rescue StandardError more more specific
ismael is now known as Guest91219
<jhass> (or RuntimeError? I can never remember. The one you get if you specify none)
<Ikri> mozzarella: "There are " first_name.length + last_name.length + " characters in your name!"
<apeiros> weak typing in a strongly typed language would be a paradoxon jhass :-D
<jhass> not really, you could have union types
towski__ has quit [Remote host closed the connection]
jokester has joined #ruby
fabrice31_ has joined #ruby
fabrice31 has quit [Read error: Connection reset by peer]
<apeiros> jhass: it'd still be either a strongly or a weakly typed language
<jhass> oh, bah, I meant statically typed of course
<apeiros> :o)
<apeiros> why are you up at this time anyway?!?
<jhass> Ikri: "There are #{first_name.size + last_name.size} characters in your name!"
ismaelga has quit [Ping timeout: 240 seconds]
<Ikri> jhass: thank you! that really helps.
<jhass> apeiros: look who's talking
vdamewood has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
swgillespie has joined #ruby
<apeiros> aewffwea: sounds like jhass should tell you about crystal then :D
<al2o3-cr> why what time is it?
fabrice31 has joined #ruby
<apeiros> al2o3-cr: it's late-night-o-clock
Perdomo_ has quit [Ping timeout: 240 seconds]
<al2o3-cr> :D
ghr has quit [Ping timeout: 245 seconds]
doodlehaus has quit []
Pupeno has quit [Remote host closed the connection]
<apeiros> it also seems to be "can't find excuses to still stay up"-o'clock
Pupeno has joined #ruby
iotouch has quit [Ping timeout: 272 seconds]
doodlehaus has joined #ruby
<al2o3-cr> ;p
iotouch has joined #ruby
Matachines has quit [Quit: Textual IRC Client: www.textualapp.com]
fabrice31_ has quit [Ping timeout: 264 seconds]
<apeiros> whoops, wrong. new arena play by trump :D
wolflee__ has quit [Remote host closed the connection]
wolflee__ has joined #ruby
Dopagod has joined #ruby
RegulationD has joined #ruby
havenwood has joined #ruby
lidenskap has joined #ruby
Pupeno has quit [Ping timeout: 276 seconds]
yh has quit [Ping timeout: 240 seconds]
lidenskap has quit [Remote host closed the connection]
idealexit has quit [Remote host closed the connection]
ShortCode has quit [Quit: Leaving]
RegulationD has quit [Ping timeout: 240 seconds]
TheHodge has quit [Quit: Connection closed for inactivity]
fabrice31_ has joined #ruby
fabrice31 has quit [Read error: Connection reset by peer]
doodlehaus has quit [Remote host closed the connection]
zacts has joined #ruby
cryptarium has joined #ruby
laurentide has joined #ruby
Sawbones has joined #ruby
amclain has joined #ruby
fabrice31_ has quit [Read error: Connection reset by peer]
AlphaAtom has quit [Quit: AlphaAtom]
fabrice31 has joined #ruby
SleepDeprived has joined #ruby
umby24|offline is now known as umby24
jenrzzz has quit [Ping timeout: 240 seconds]
fabrice31 has quit [Read error: Connection reset by peer]
fabrice31 has joined #ruby
shadoi has joined #ruby
shadoi has quit [Client Quit]
i8igmac has joined #ruby
mitchellhenke has quit [Quit: Computer has gone to sleep.]
Papierkorb has quit [Ping timeout: 255 seconds]
jtdowney has quit []
<al2o3-cr> >> p RUBY_VERSION
<ruboto> al2o3-cr # => "2.2.0" ...check link for more (https://eval.in/325391)
<al2o3-cr> >> p RUBY_COPYRIGHT
<ruboto> al2o3-cr # => "ruby - Copyright (C) 1993-2014 Yukihiro Matsumoto" ...check link for more (https://eval.in/325392)
fabrice31 has quit [Read error: Connection reset by peer]
fabrice31 has joined #ruby
greenbagels has joined #ruby
nateberkopec has quit [Quit: Leaving...]
Pupeno has joined #ruby
Pupeno has joined #ruby
pontiki has joined #ruby
<pontiki> hallo/
<havenwood> \hallo
fabrice31_ has joined #ruby
Soda has quit [Remote host closed the connection]
Ropeney has joined #ruby
fabrice3_ has joined #ruby
fabrice31_ has quit [Read error: Connection reset by peer]
slackbotgz has joined #ruby
fabrice31 has quit [Ping timeout: 256 seconds]
duderonomy has joined #ruby
wolflee___ has joined #ruby
doodlehaus has joined #ruby
baweaver has quit [Remote host closed the connection]
juanpablo__ has joined #ruby
wolflee__ has quit [Ping timeout: 245 seconds]
n008f4g_ has quit [Ping timeout: 264 seconds]
mjuszczak has quit []
thatslifeson has joined #ruby
psy_ has joined #ruby
fabrice3_ has quit [Read error: Connection reset by peer]
juanpablo__ has quit [Ping timeout: 246 seconds]
fabrice31 has joined #ruby
zacts has quit [Quit: leaving]
thatslifeson has quit [Read error: Connection reset by peer]
thatslifeson has joined #ruby
icarus has quit [Ping timeout: 250 seconds]
icebourg has joined #ruby
fabrice31_ has joined #ruby
Pupeno_ has joined #ruby
<bintelli> can someone help me with a nested loop issue i'm having: https://gist.github.com/anonymous/f790dc227ba508e297ad
PhantomSpank has quit [Remote host closed the connection]
fabrice31 has quit [Ping timeout: 264 seconds]
nii236 has quit [Ping timeout: 252 seconds]
Pupeno has quit [Ping timeout: 272 seconds]
<pontiki> what's the issue?
felixjet has joined #ruby
platosha has quit [Ping timeout: 252 seconds]
gambl0re has joined #ruby
zorak8 has quit [Remote host closed the connection]
nii236 has joined #ruby
mitchellhenke has joined #ruby
felixjet__ has quit [Ping timeout: 252 seconds]
workmad3 has joined #ruby
zorak8 has joined #ruby
<bintelli> it's substituting the full array instead of by index
Rollabun_ has joined #ruby
havenwood has quit []
rgb-one has quit [Ping timeout: 252 seconds]
Rollabunna has quit [Read error: No route to host]
<bintelli> the array of records for the Product class is being substituted, instead of one record at a time.
<bintelli> so 9 new records are created, instead of 3
hackeron_ has quit [Ping timeout: 272 seconds]
<pontiki> you told it to use all the products
<pontiki> Product.all
<bintelli> yes
<sevenseacat> well yes, 3xproducts x 3x data = 9 records
<bintelli> I just need to substitute all the product ids
<bintelli> I used Product.all as a way to access those records.
<pontiki> yes?
<pontiki> and?
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<sevenseacat> what are you actually trying to do
funburn has quit [Quit: funburn]
diegoaguilar has joined #ruby
<bintelli> well, I only want to access one record at a time from Product
<sevenseacat> you are
<sevenseacat> Product.all.each
workmad3 has quit [Ping timeout: 255 seconds]
<bintelli> I want my product array index[0] to be substituted with data[0]; product[1] with data[1]; product[2] with data[2]
jenrzzz has joined #ruby
<sevenseacat> so you dont want a nested loop
<sevenseacat> you want a single loop over products
rgb-one has joined #ruby
<sevenseacat> while keeping track of the array index
CloCkWeRX has quit [Ping timeout: 256 seconds]
Sawbones has quit [Remote host closed the connection]
penzur has joined #ruby
rgb-one has quit [Remote host closed the connection]
dorei has quit []
Sawbones has joined #ruby
sargas has quit [Quit: This computer has gone to sleep]
musashi has quit [Quit: Connection closed for inactivity]
mordocai has joined #ruby
ghr has joined #ruby
davedev24_ has quit []
phutchins1 has quit [Ping timeout: 240 seconds]
stirfryad has joined #ruby
<bintelli> how do I substitute the 2nd array dynamically if it's only 1 loop
fabrice31 has joined #ruby
bruno- has joined #ruby
ducklobster has joined #ruby
mitchellhenke has quit [Quit: Computer has gone to sleep.]
<sevenseacat> look into each_with_index
Zenon has joined #ruby
fabrice31_ has quit [Read error: Connection reset by peer]
Zenon has quit [Client Quit]
Sawbones has quit [Remote host closed the connection]
fabrice31_ has joined #ruby
<sevenseacat> that will give you the index of the product in the Product.all relation, and then you can just access data[index]
Zenon has joined #ruby
ghr has quit [Ping timeout: 264 seconds]
<bintelli> ok, great, thanks for the help
fr0de has quit [Remote host closed the connection]
arescorpio has joined #ruby
Sawbones has joined #ruby
fabrice31 has quit [Read error: Connection reset by peer]
bruno- has quit [Ping timeout: 272 seconds]
ramfjord has quit [Ping timeout: 272 seconds]
mistermo_ has joined #ruby
yh has joined #ruby
jbc has quit [Quit: Page closed]
mistermocha has quit [Ping timeout: 264 seconds]
zorak8 has quit [Quit: Leaving]
zorak8 has joined #ruby
fabrice31_ has quit [Ping timeout: 256 seconds]
Guest91219 has quit [Remote host closed the connection]
mistermo_ has quit [Ping timeout: 252 seconds]
felixjet_ has joined #ruby
ElusiveNinJay has joined #ruby
felixjet has quit [Ping timeout: 244 seconds]
Kricir has quit [Remote host closed the connection]
yosafbridge has quit [Ping timeout: 265 seconds]
slash_nick has joined #ruby
<ElusiveNinJay> I've done a tiny bit of java and some stuff in this game coding engine called byond, but I want to get really good at some language. Currently a total newb. Pros and cons of that language being ruby? My other idea was python.
<ElusiveNinJay> My name is Freenode. Huh.
MrSamuel has joined #ruby
hippyphysicist has joined #ruby
mordocai has quit [Quit: to lvm!]
hippyphysicist has quit [Client Quit]
thatslif_ has joined #ruby
tuelz has quit [Ping timeout: 265 seconds]
psy_ has quit [Quit: Leaving]
psy_ has joined #ruby
A124 has quit [Quit: Luke's IRC Client v0.94 build 682]
Akagi201 has quit [Remote host closed the connection]
thatslifeson has quit [Ping timeout: 244 seconds]
Akagi201 has joined #ruby
ramfjord has joined #ruby
yosafbridge has joined #ruby
doodlehaus has quit [Remote host closed the connection]
stirfryad has quit [Remote host closed the connection]
Akagi201 has quit [Ping timeout: 250 seconds]
Akagi201 has joined #ruby
braincrash has quit [Quit: bye bye]
Pupeno has joined #ruby
yfeldblu_ has quit [Remote host closed the connection]
Oka has quit [Quit: さようなら]
juanpablo__ has joined #ruby
yfeldblum has joined #ruby
penzur has quit [Quit: dc]
Pupeno_ has quit [Ping timeout: 264 seconds]
narcan has quit [Quit: -[AppDelegate installMalware]: unrecognized selector sent to instance 0x156109c0]
apurcell has joined #ruby
bintelli has quit [Quit: Page closed]
slackbotgz has quit [Remote host closed the connection]
braincrash has joined #ruby
ElusiveNinJay has left #ruby [#ruby]
narcan has joined #ruby
juanpablo__ has quit [Ping timeout: 264 seconds]
multi_io has quit [Ping timeout: 264 seconds]
penzur has joined #ruby
penzur has quit [Read error: Connection reset by peer]
multi_io has joined #ruby
konsolebox has joined #ruby
konsolebox has quit [Read error: Connection reset by peer]
mrmargolis has quit [Remote host closed the connection]
crdpink has quit [Quit: q term]
nettoweb has joined #ruby
diegoaguilar has quit [Remote host closed the connection]
nii236 has quit [Read error: Connection reset by peer]
nettoweb has quit [Client Quit]
hgl- has joined #ruby
hgl has quit [Read error: Connection reset by peer]
hgl- is now known as hgl
quazimod1 has joined #ruby
<quazimod1> how do I make a Pathname like "images/whatever" into "/images/whatever" ?
crdpink has joined #ruby
<quazimod1> nvm
Rollabun_ has quit [Ping timeout: 256 seconds]
towski_ has joined #ruby
barhum2013 has joined #ruby
Channel6 has joined #ruby
nii236 has joined #ruby
gizmore has joined #ruby
duderonomy has quit [Read error: No route to host]
konsolebox has joined #ruby
balazs has joined #ruby
cryptarium has quit [Ping timeout: 264 seconds]
psy_ has quit [Ping timeout: 240 seconds]
towski_ has quit [Remote host closed the connection]
thalesribeiro has joined #ruby
bluOxigen has joined #ruby
diegoaguilar has joined #ruby
diegoaguilar has quit [Read error: Connection reset by peer]
SleepDeprived has quit [Quit: SleepDeprived]
narcan has quit [Quit: -[AppDelegate installMalware]: unrecognized selector sent to instance 0x156109c0]
someguy has joined #ruby
kobain has quit [Quit: KVIrc 4.1.3 Equilibrium http://www.kvirc.net/]
i8igmac has quit [Ping timeout: 246 seconds]
Sawbones has quit [Remote host closed the connection]
i8igmac has joined #ruby
Sawbones has joined #ruby
slash_nick has quit [Ping timeout: 272 seconds]
alvaro_o has joined #ruby
Pupeno_ has joined #ruby
Musashi007 has joined #ruby
ramenboy_ has joined #ruby
edwinvdgraaf has joined #ruby
Pupeno has quit [Ping timeout: 265 seconds]
ramenboy__ has joined #ruby
baweaver has joined #ruby
ramenboy__ is now known as ramenboy
ramenboy has quit [Client Quit]
ramenboy has joined #ruby
Guest1421 has quit [Ping timeout: 255 seconds]
beneggett has joined #ruby
nettoweb has joined #ruby
icebourg has quit []
ramenboy_ has quit [Ping timeout: 252 seconds]
edwinvdgraaf has quit [Ping timeout: 265 seconds]
greenbagels has quit [Read error: Connection reset by peer]
lidenskap has joined #ruby
mostlybadfly has joined #ruby
ramenboy_ has joined #ruby
ramenboy_ has quit [Remote host closed the connection]
nettoweb has quit [Client Quit]
cgrieger^away is now known as cgrieger
hmsimha_ has joined #ruby
Sawbones has quit [Remote host closed the connection]
ramenboy has quit [Ping timeout: 252 seconds]
hmsimha_ has quit [Read error: Connection reset by peer]
Sawbones has joined #ruby
DynamicMetaFlow has quit [Quit: Leaving]
ramenboy has joined #ruby
PhantomSpank has joined #ruby
towski_ has joined #ruby
mitchellhenke has joined #ruby
Eiam has joined #ruby
swgillespie has joined #ruby
poguez_ has quit [Quit: Connection closed for inactivity]
PhantomSpank has quit [Ping timeout: 245 seconds]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
slash_nick has joined #ruby
mordocai has joined #ruby
workmad3 has joined #ruby
ramenboy_ has joined #ruby
Joufflu has quit [Read error: Connection reset by peer]
ramenboy has quit [Ping timeout: 250 seconds]
ramenboy_ is now known as ramenboy
lkba_ has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
Fingel has joined #ruby
tuelz has joined #ruby
CloCkWeRX has joined #ruby
lkba has quit [Ping timeout: 265 seconds]
jeromelanteri has joined #ruby
thalesribeiro_ has joined #ruby
thalesribeiro has quit [Read error: Connection reset by peer]
ramenboy has quit [Quit: Bye]
CaptainCibai has quit [Ping timeout: 240 seconds]
mistermocha has joined #ruby
tuelz has quit [Ping timeout: 250 seconds]
icebourg has joined #ruby
slash_nick has quit [Ping timeout: 245 seconds]
lessless has joined #ruby
<lessless> Hey folks, help me please to get on track with floating point calculations: everything is correct with literals - `6.0 / 100 / 12` => 0.005, but it's rounded when variable is used: int_p = 6.0 and int_p / 100 / 2 => 0.03
yfeldblum has quit [Ping timeout: 256 seconds]
<Radar> lessless: what is int_p?
<Radar> Oops, sorry. I can't read.
<Radar> lessless: Your second example divides by 2, whereas your first divides by 12.
<Radar> The calculations are working exactly as you are telling them to.
beneggett has quit [Quit: ...zzz ¯\_(ツ)_/¯ zzz...]
<lessless> Ha ha, omg :D
<lessless> those are my favorite type of mistakes - apparently I can't see ;)
i8igmac has quit [Ping timeout: 276 seconds]
scripore has quit [Quit: This computer has gone to sleep]
nahtnam has joined #ruby
konsolebox has quit [Read error: Connection reset by peer]
kalleth has quit [Remote host closed the connection]
kalleth has joined #ruby
badhatter has quit [Remote host closed the connection]
someguy has quit [Quit: This computer has gone to sleep]
barhum2013 has quit [Quit: barhum2013]
that1guy has joined #ruby
chrissonar has joined #ruby
mordocai has quit [Quit: trying new user config]
scripore has joined #ruby
balazs has quit [Remote host closed the connection]
moretti has joined #ruby
chimche has quit [Quit: Leaving.]
fabrice31 has joined #ruby
moretti has quit [Client Quit]
Rollabunna has joined #ruby
amclain has quit [Quit: Leaving]
konsolebox has joined #ruby
Fingel has quit [Ping timeout: 255 seconds]
arescorpio has quit [Read error: Connection reset by peer]
konsolebox has quit [Read error: Connection reset by peer]
that1guy has quit [Quit: This computer has gone to sleep]
michael_mbp has quit [Excess Flood]
that1guy has joined #ruby
wldcordeiro__ has quit [Ping timeout: 246 seconds]
<Eiam> grr
<Eiam> hate when someone elses code seems to work fine and mine does not when it looks the same =/
fabrice31_ has joined #ruby
fabrice31 has quit [Read error: Connection reset by peer]
michael_mbp has joined #ruby
<Eiam> jenrzzz: oh, look, its you =)
<Eiam> somehow I suspected I'd find you in here
turtil has quit [Ping timeout: 246 seconds]
mordocai has joined #ruby
juanpablo__ has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
kp666 has joined #ruby
<Eiam> he ran!
poguez_ has joined #ruby
<Radar> Wouldn't you? ;)
that1guy has quit [Quit: This computer has gone to sleep]
pontiki has quit [Ping timeout: 240 seconds]
juanpablo__ has quit [Ping timeout: 256 seconds]
<Eiam> Radar: cmon now, I'm not that bad... https://www.youtube.com/watch?v=mgvHsON_ud4
_whitelogger has joined #ruby
barhum2013 has quit [Client Quit]
someguy has joined #ruby
dseitz_ has joined #ruby
barhum2013 has joined #ruby
aganov has joined #ruby
zzing has joined #ruby
MrSamuel has quit [Quit: MrSamuel]
barhum2013 has quit [Client Quit]
juanca_ has quit [Remote host closed the connection]
barhum2013 has joined #ruby
towski_ has quit [Remote host closed the connection]
dseitz__ has joined #ruby
juanca__ has joined #ruby
dseitz has quit [Ping timeout: 252 seconds]
barhum2013 has quit [Client Quit]
barhum2013 has joined #ruby
someguy has quit [Client Quit]
atom3 has quit [Ping timeout: 276 seconds]
someguy has joined #ruby
barhum2013 has quit [Client Quit]
dseitz_ has quit [Ping timeout: 256 seconds]
barhum2013 has joined #ruby
Akagi201 has quit [Ping timeout: 264 seconds]
barhum2013 has quit [Client Quit]
ndrei has quit [Ping timeout: 240 seconds]
barhum2013 has joined #ruby
atom3 has joined #ruby
Akagi201 has joined #ruby
barhum2013 has quit [Client Quit]
ndrei has joined #ruby
barhum2013 has joined #ruby
_whitelogger has joined #ruby
fabrice31 has quit [Read error: Connection reset by peer]
barhum2013 has joined #ruby
barhum2013 has quit [Client Quit]
ramenboy has joined #ruby
someguy has quit [Quit: This computer has gone to sleep]
barhum2013 has joined #ruby
someguy has joined #ruby
barhum2013 has quit [Client Quit]
barhum2013 has joined #ruby
iotouch has joined #ruby
ramenboy has quit [Client Quit]
someguy has quit [Client Quit]
barhum2013 has quit [Client Quit]
REGGIN has quit [Ping timeout: 264 seconds]
barhum2013 has joined #ruby
fabrice31 has joined #ruby
fabrice31_ has quit [Read error: Connection reset by peer]
barhum2013 has quit [Client Quit]
that1guy has joined #ruby
that1guy has quit [Client Quit]
towski_ has joined #ruby
lidenskap has quit [Remote host closed the connection]
barhum2013 has joined #ruby
someguy has joined #ruby
lidenskap has joined #ruby
barhum2013 has quit [Client Quit]
someguy has quit [Client Quit]
fabrice31_ has joined #ruby
fabrice31 has quit [Read error: Connection reset by peer]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
92AAA5OSI has joined #ruby
icarus has joined #ruby
ohaibbq has joined #ruby
fabrice31_ has quit [Read error: Connection reset by peer]
fabrice31 has joined #ruby
92AAA5OSI has quit [Client Quit]
that1guy has joined #ruby
yoni has joined #ruby
yoni is now known as Guest98626
PhantomSpank has joined #ruby
fabrice31 has quit [Read error: Connection reset by peer]
fabrice31_ has joined #ruby
LJT has quit [Quit: Sleeping...]
PhantomSpank has quit [Ping timeout: 252 seconds]
that1guy has quit [Quit: This computer has gone to sleep]
that1guy has joined #ruby
nii236 has quit [Ping timeout: 265 seconds]
thatslif_ has quit [Remote host closed the connection]
workmad3 has joined #ruby
fabrice31 has joined #ruby
fabrice31_ has quit [Read error: Connection reset by peer]
roshanavand has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
tuelz has joined #ruby
kyrylo has joined #ruby
yfeldblum has joined #ruby
hanmac1 has joined #ruby
<flughafen> hey certainty sevenseacat shevy
bruno- has joined #ruby
<flughafen> how was your weekend/
<flughafen> we had a 3 day weekned, and I was sick yeterday
<sevenseacat> guten Tag flughafen
<shevy> yo flughafen
<flughafen> sevenseacat: did you level your magic cat to leve 9 in eso?
<flughafen> yo shevy
Mon_Ouie has quit [Ping timeout: 252 seconds]
<shevy> hmm I don't remember how my weekend was
tuelz has quit [Ping timeout: 276 seconds]
<sevenseacat> mine was quiet
<sevenseacat> apart from my FOOTBALL TEAM BEING AWESOME and winning.
BTRE has quit [Ping timeout: 240 seconds]
<flughafen> sevenseacat: what team is yours? bayern-muenchen?
mordocai has quit [Quit: Must sleep... cya.]
snockerton has quit [Quit: Leaving.]
Stalkr has joined #ruby
<sevenseacat> no, *real* football. australian rules football.
<sevenseacat> not this soccer crap
wolflee____ has joined #ruby
bruno- has quit [Ping timeout: 272 seconds]
yfeldblum has quit [Read error: Connection reset by peer]
<flughafen> haha
that1guy has quit [Quit: This computer has gone to sleep]
fabrice31 has quit [Read error: Connection reset by peer]
wolflee___ has quit [Ping timeout: 244 seconds]
yfeldblum has joined #ruby
<flughafen> you're not a fan of cahill sevenseacat ?
icarus has quit [Ping timeout: 264 seconds]
that1guy has joined #ruby
fabrice31 has joined #ruby
<sevenseacat> not a fan of soccer in general
icarus has joined #ruby
<flughafen> you mean football sevenseacat ;)
<sevenseacat> no. football is australian rules football.
fabrice31_ has joined #ruby
that1guy has quit [Client Quit]
SouL_|_ has joined #ruby
i8igmac has joined #ruby
that1guy has joined #ruby
ahmetkapikiran has joined #ruby
fabrice31 has quit [Ping timeout: 256 seconds]
that1guy has quit [Client Quit]
krz has joined #ruby
that1guy has joined #ruby
diegoviola has quit [Quit: WeeChat 1.1.1]
bebijlya has quit [Ping timeout: 252 seconds]
BTRE has joined #ruby
<baweaver> I swear if only baseball season could end over here....
<flughafen> ugh, baseball is so boring
<baweaver> parking jumps to $50 a spot, BART is jammed, and there are a bunch of drunks screaming outside at all hours of the night
rmoriz has quit [Quit: ZNC - http://znc.in]
<hanmac1> in my country (germany) soccer is annoying too ...
<flughafen> in my country (germany) we don't have soccer
<flughafen> get out of here you traitor!
icarus has quit [Ping timeout: 250 seconds]
bebijlya has joined #ruby
RegulationD has joined #ruby
icarus has joined #ruby
that1guy has quit [Quit: This computer has gone to sleep]
keen________ has joined #ruby
that1guy has joined #ruby
that1guy has quit [Client Quit]
fabrice31 has joined #ruby
CloCkWeRX1 has joined #ruby
<baweaver> Bay Area for me
gluten_hell has joined #ruby
<baweaver> So Giants baseball all the tie
<baweaver> time*
fabrice31_ has quit [Ping timeout: 245 seconds]
<shevy> australian rules football
<shevy> hmm
jeromelanteri has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
keen_______ has quit [Ping timeout: 272 seconds]
fabrice31_ has joined #ruby
<shevy> they are dressed in funny costumes
RegulationD has quit [Ping timeout: 244 seconds]
CloCkWeRX has quit [Ping timeout: 245 seconds]
<shevy> Austria's only purpose in soccer is to defeat the German team
<shevy> last time that this has happened was some 60 years ago
<flughafen> don't mess with the world champs shevy !
fabrice31_ has quit [Read error: Connection reset by peer]
<shevy> yeah that was also annoying
<shevy> I was cheering for the other teams and they all lost :(
fabrice31_ has joined #ruby
fabrice31 has quit [Read error: Connection reset by peer]
fabrice31_ has quit [Remote host closed the connection]
fabrice31 has joined #ruby
<flughafen> it was a weird world cup
ahmetkapikiran has quit [Quit: ahmetkapikiran]
gagrio_ has joined #ruby
CloCkWeRX1 has quit [Ping timeout: 250 seconds]
ntln has joined #ruby
iotouch has quit [Ping timeout: 256 seconds]
<al2o3-cr> germany 5/1 for world cup 2018 ;P
iotouch has joined #ruby
<al2o3-cr> austria 150/1 lol
vire has joined #ruby
fabrice31 has quit [Remote host closed the connection]
ahmetkapikiran has joined #ruby
fabrice31 has joined #ruby
konsolebox has joined #ruby
fabrice31_ has joined #ruby
Stalkr has quit [Quit: Leaving...]
beneggett has joined #ruby
haxrbyte has joined #ruby
vire has quit [Client Quit]
juanpablo__ has joined #ruby
vire has joined #ruby
<shevy> well, that's a way to get rich
pontiki has joined #ruby
fabrice31 has quit [Ping timeout: 272 seconds]
Musashi007 has quit [Read error: Connection reset by peer]
juanpablo__ has quit [Ping timeout: 246 seconds]
zotherstupidguy has quit [Ping timeout: 256 seconds]
haxrbyte_ has joined #ruby
iotouch has quit [Ping timeout: 246 seconds]
zotherstupidguy has joined #ruby
beneggett has quit [Quit: ...zzz ¯\_(ツ)_/¯ zzz...]
pontiki has quit [Ping timeout: 276 seconds]
konsolebox has quit [Read error: Connection reset by peer]
thekodols_ has joined #ruby
fella5s has joined #ruby
haxrbyte has quit [Ping timeout: 264 seconds]
thekodols_ has quit [Max SendQ exceeded]
thekodols_ has joined #ruby
iotouch has joined #ruby
Olipro_ has joined #ruby
Olipro_ is now known as Guest87507
fella6s has quit [Ping timeout: 256 seconds]
thekodols has quit [Ping timeout: 250 seconds]
ponga has joined #ruby
ta has quit [Remote host closed the connection]
Musashi007 has joined #ruby
vire has quit [Ping timeout: 272 seconds]
MatthewsFace[SEA has quit [Remote host closed the connection]
juanca__ has quit []
Guest62271 has quit [Ping timeout: 252 seconds]
<certainty> moin
zorak8 has quit [Ping timeout: 264 seconds]
thatslifeson has joined #ruby
jakolehm has joined #ruby
nahtnam has quit [Quit: Connection closed for inactivity]
haxrbyte has joined #ruby
<shevy> clever people
<shevy> we need more of these type in ruby
barhum2013 has joined #ruby
asmodlol has quit [Ping timeout: 256 seconds]
barhum2013 has quit [Client Quit]
asmodlol has joined #ruby
decoponio has joined #ruby
haxrbyte_ has quit [Ping timeout: 255 seconds]
thatslifeson has quit [Ping timeout: 256 seconds]
<certainty> erm, why?
bigkevmcd has joined #ruby
bigkevmcd has quit [Client Quit]
CloCkWeRX has joined #ruby
SOLDIERz has joined #ruby
konsolebox has joined #ruby
Musashi007 has quit [Read error: Connection reset by peer]
Azure|dc has joined #ruby
gluten_hell has quit [Quit: Computer has gone to sleep.]
vire has joined #ruby
konsolebox has quit [Read error: Connection reset by peer]
ypasmk has joined #ruby
towski_ has quit [Remote host closed the connection]
kaspernj has joined #ruby
<shevy> to raise our collective pool intelligence
nuck has quit [Ping timeout: 264 seconds]
<certainty> ok i thought you were talking about binary size
Azure has quit [Read error: Connection reset by peer]
<agent_white> Size matters \o/
nuck has joined #ruby
asmodlol has quit [Ping timeout: 276 seconds]
asmodlol has joined #ruby
barhum2013 has joined #ruby
<shevy> it can't be small enough
anisha has joined #ruby
ta has joined #ruby
SouL_|__ has joined #ruby
jeromelanteri has joined #ruby
SouL_|_ has quit [Read error: No route to host]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sohrab has quit [Quit: leaving]
Musashi007 has joined #ruby
alex88 has joined #ruby
narcan has joined #ruby
hanmac has quit [Ping timeout: 256 seconds]
Juanchito has joined #ruby
amundj has joined #ruby
Musashi007 has quit [Client Quit]
agent_white has quit [Quit: brb]
livathinos has joined #ruby
marr has joined #ruby
agent_white has joined #ruby
Ropeney has quit [Quit: Leaving...]
barhum2013 has quit [Quit: barhum2013]
DerisiveLogic has quit [Ping timeout: 276 seconds]
i8igmac has quit [Ping timeout: 256 seconds]
Perdomo has joined #ruby
ahmetkapikiran has quit [Quit: ahmetkapikiran]
Azure|dc has quit [Read error: Connection reset by peer]
Azure has joined #ruby
jph98 has joined #ruby
doertedev has joined #ruby
ndrei has quit [Ping timeout: 240 seconds]
CloCkWeRX has quit [Ping timeout: 264 seconds]
lkba_ has quit [Ping timeout: 264 seconds]
terlar has joined #ruby
ndrei has joined #ruby
Perdomo has quit [Ping timeout: 256 seconds]
ahmetkapikiran has joined #ruby
antgel has joined #ruby
arturaz has joined #ruby
jph98 has quit [Client Quit]
hanmac has joined #ruby
terlar has quit [Quit: WeeChat 1.1.1]
jph98 has joined #ruby
quazimod1 has quit [Ping timeout: 245 seconds]
gsd has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mtakkman has joined #ruby
PhantomSpank has joined #ruby
govg has quit [Quit: leaving]
gluten_hell has joined #ruby
seako has joined #ruby
PhantomSpank has quit [Ping timeout: 272 seconds]
ohaibbq has quit [Quit: Leaving...]
Hounddog has joined #ruby
workmad3 has joined #ruby
Rollabunna has quit [Quit: Leaving...]
TheHodge has joined #ruby
quimrstorres has joined #ruby
PhantomSpank has joined #ruby
workmad3 has quit [Ping timeout: 256 seconds]
quimrstorres has quit [Remote host closed the connection]
Hounddog_ has joined #ruby
MrSamuel has joined #ruby
tuelz has joined #ruby
Hounddog__ has joined #ruby
yh has quit [Ping timeout: 272 seconds]
Hounddog___ has joined #ruby
luriv has quit [Read error: Connection timed out]
carlmo has joined #ruby
MatthewsFace[SEA has joined #ruby
luriv has joined #ruby
chthon has joined #ruby
turtil has joined #ruby
lessless has quit [Ping timeout: 264 seconds]
Hounddog____ has joined #ruby
jenrzzz has joined #ruby
Hounddog has quit [Read error: Connection reset by peer]
Hounddog_ has quit [Read error: Connection reset by peer]
joonty has joined #ruby
Hounddog__ has quit [Read error: Connection reset by peer]
Hounddog___ has quit [Read error: Connection reset by peer]
Hounddog_____ has joined #ruby
Hounddog____ has quit [Remote host closed the connection]
Hounddog_____ has quit [Read error: Connection reset by peer]
tuelz has quit [Ping timeout: 240 seconds]
haxrbyte has quit [Ping timeout: 272 seconds]
thatslifeson has joined #ruby
Pisuke has joined #ruby
Hounddog has joined #ruby
MatthewsFace[SEA has quit [Ping timeout: 256 seconds]
MyMind has quit [Ping timeout: 245 seconds]
Hounddog has quit [Read error: Connection reset by peer]
SOLDIERz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
thatslifeson has quit [Ping timeout: 244 seconds]
ghr has joined #ruby
Hounddog has joined #ruby
ahmetkapikiran has quit [Quit: ahmetkapikiran]
Hounddog_ has joined #ruby
granthatcher has joined #ruby
edwinvdgraaf has joined #ruby
jottr has joined #ruby
ferr has joined #ruby
narcan has quit [Quit: -[AppDelegate installMalware]: unrecognized selector sent to instance 0x156109c0]
andikr has joined #ruby
apurcell has joined #ruby
granthatcher has quit [Read error: No route to host]
workmad3 has joined #ruby
bruno- has joined #ruby
granthatcher has joined #ruby
icarus has quit [Ping timeout: 240 seconds]
charliesome has quit [Quit: zzz]
jph98 has quit [Quit: jph98]
ramfjord has quit [Ping timeout: 272 seconds]
RegulationD has joined #ruby
SOLDIERz has joined #ruby
apurcell has quit [Ping timeout: 255 seconds]
Hounddog has quit [Read error: Connection reset by peer]
Hounddog_ has quit [Read error: Connection reset by peer]
jottr has quit [Ping timeout: 264 seconds]
Hounddog has joined #ruby
thalesribeiro_ has quit [Quit: thalesribeiro_]
einarj has joined #ruby
RegulationD has quit [Ping timeout: 240 seconds]
arup_r has joined #ruby
<arup_r> Hi all!
Zai00 has joined #ruby
Hounddog has quit [Read error: Connection reset by peer]
Motoservo has quit [Quit: Over & out.]
arup_r has quit [Remote host closed the connection]
<certainty> o/
c0m0 has joined #ruby
ahmetkapikiran has joined #ruby
Hounddog has joined #ruby
joonty has quit [Quit: joonty]
jph98 has joined #ruby
arup_r has joined #ruby
juanpablo__ has joined #ruby
msgodf has joined #ruby
asmodlol has quit [Ping timeout: 276 seconds]
joonty has joined #ruby
asmodlol has joined #ruby
juanpablo__ has quit [Ping timeout: 255 seconds]
Hounddog has quit [Remote host closed the connection]
Hounddog has joined #ruby
Peetooshock has joined #ruby
Peetooshock has joined #ruby
Hounddog has quit [Remote host closed the connection]
Igorshp has joined #ruby
Hounddog has joined #ruby
Pumukel has joined #ruby
lidenskap has quit [Remote host closed the connection]
konsolebox has joined #ruby
jph98 has quit [Quit: jph98]
charliesome has joined #ruby
jenrzzz has quit [Ping timeout: 250 seconds]
lessless has joined #ruby
leafybasil has quit [Remote host closed the connection]
zotherstupidguy has quit [Quit: Lost terminal]
ahmetkapikiran has quit [Quit: ahmetkapikiran]
redlegion has quit [Read error: error:1408F119:SSL routines:SSL3_GET_RECORD:decryption failed or bad record mac]
codecop has joined #ruby
ypasmk_ has joined #ruby
Pumukel has quit [Remote host closed the connection]
redlegion has joined #ruby
ypasmk has quit [Ping timeout: 265 seconds]
ypasmk_ is now known as ypasmk
lordkryss has joined #ruby
tvw has joined #ruby
_blizzy_ has quit [Ping timeout: 256 seconds]
jeromelanteri has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
antgel has quit [Ping timeout: 272 seconds]
Pumukel has joined #ruby
MatthewsFace[SEA has joined #ruby
ahmetkapikiran has joined #ruby
platzhirsch has joined #ruby
sevenseacat has quit [Quit: Me dun like you no more.]
n008f4g_ has joined #ruby
ahmetkapikiran has quit [Client Quit]
MatthewsFace[SEA has quit [Ping timeout: 256 seconds]
bigkevmcd has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
bigkevmcd has quit [Quit: Outta here...]
colorados has joined #ruby
bigkevmcd has joined #ruby
Cust0sL1men has joined #ruby
matcouto has joined #ruby
yosafbridge has quit [Ping timeout: 248 seconds]
lele is now known as Guest24
selu has joined #ruby
vtunka has joined #ruby
ypasmk_ has joined #ruby
ypasmk has quit [Ping timeout: 246 seconds]
ypasmk_ is now known as ypasmk
mtakkman has quit [Ping timeout: 264 seconds]
leafybasil has joined #ruby
yh has joined #ruby
leafybasil has quit [Remote host closed the connection]
iotouch has quit [Quit: This computer has gone to sleep]
leafybasil has joined #ruby
konsolebox has quit [Read error: Connection reset by peer]
zzing has quit [Ping timeout: 256 seconds]
iotouch has joined #ruby
railsForDaiz has joined #ruby
vadviktor has quit [Remote host closed the connection]
vadviktor has joined #ruby
shellfu_afk has quit [Read error: Connection reset by peer]
zzing has joined #ruby
railsForDaiz has quit [Client Quit]
antgel has joined #ruby
quimrstorres has joined #ruby
dseitz has quit [Quit: Textual IRC Client: www.textualapp.com]
ypasmk has quit [Quit: ypasmk]
A205B064 has quit [Ping timeout: 265 seconds]
rohit has joined #ruby
workmad3 has joined #ruby
dANO has joined #ruby
v0n has quit [Read error: Connection reset by peer]
sent1nel has quit [Remote host closed the connection]
n008f4g_ has quit [Ping timeout: 272 seconds]
scripore has joined #ruby
tuelz has joined #ruby
railsForDaiz has joined #ruby
scripore has quit [Client Quit]
leafybas_ has joined #ruby
lidenskap has joined #ruby
thatslifeson has joined #ruby
scripore has joined #ruby
LJT has joined #ruby
moeabdol has joined #ruby
tuelz has quit [Ping timeout: 240 seconds]
scripore has quit [Client Quit]
leafybasil has quit [Ping timeout: 240 seconds]
selu has quit [Ping timeout: 264 seconds]
lidenskap has quit [Ping timeout: 265 seconds]
thatslifeson has quit [Read error: Connection reset by peer]
yosafbridge has joined #ruby
ahmetkapikiran has joined #ruby
haxrbyte has joined #ruby
SOLDIERz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
lessless has quit [Read error: Connection reset by peer]
lessless has joined #ruby
blackmesa has joined #ruby
rohit has quit [Ping timeout: 240 seconds]
zzing has quit [Read error: Connection reset by peer]
LJT has quit [Quit: Sleeping...]
jtdowney has joined #ruby
yosafbridge has quit [Ping timeout: 248 seconds]
chthon has quit [Ping timeout: 244 seconds]
ypasmk has joined #ruby
Leef_ has joined #ruby
platzhirsch has left #ruby [#ruby]
doodlehaus has joined #ruby
MrSamuel has quit [Quit: MrSamuel]
DefV_ is now known as DefV
RegulationD has joined #ruby
luriv has quit [Read error: Connection reset by peer]
allcentury has joined #ruby
LJT has joined #ruby
LJT has quit [Remote host closed the connection]
doodlehaus has quit [Remote host closed the connection]
rohit has joined #ruby
blueOxigen has joined #ruby
bluOxigen has quit [Ping timeout: 264 seconds]
RegulationD has quit [Ping timeout: 272 seconds]
Hounddog has quit [Ping timeout: 245 seconds]
coderhs has joined #ruby
coderhs has quit [Client Quit]
Hirzu has joined #ruby
fabrice31_ has quit [Remote host closed the connection]
yosafbridge has joined #ruby
chthon has joined #ruby
pandaant has joined #ruby
zzing has joined #ruby
haxrbyte_ has joined #ruby
postmodern has quit [Quit: Leaving]
Rickmasta has joined #ruby
doodlehaus has joined #ruby
haxrbyte has quit [Ping timeout: 276 seconds]
juanpablo__ has joined #ruby
pontiki has joined #ruby
fabrice31 has joined #ruby
bluOxigen has joined #ruby
Doow has joined #ruby
blueOxigen has quit [Ping timeout: 256 seconds]
Zai00 has quit [Quit: Zai00]
juanpablo__ has quit [Ping timeout: 240 seconds]
wolflee____ has quit [Remote host closed the connection]
Hirzu_ has joined #ruby
wolflee____ has joined #ruby
iwishiwerearobot has joined #ruby
pontiki has quit [Ping timeout: 276 seconds]
mooe has joined #ruby
sdothum has joined #ruby
Hirzu has quit [Ping timeout: 264 seconds]
mathie has quit [Quit: Quitting...]
mathie has joined #ruby
colorados has quit [Quit: Leaving]
pokui has joined #ruby
colorados has joined #ruby
vikaton has joined #ruby
ItSANg___ has quit [Ping timeout: 265 seconds]
iamninja has quit [Read error: Connection reset by peer]
alex88 has quit [Ping timeout: 245 seconds]
serivich has joined #ruby
iamninja has joined #ruby
NinjaOps has joined #ruby
ascarter_ has joined #ruby
rohit has quit [Ping timeout: 256 seconds]
decoponyo has joined #ruby
decoponio has quit [Ping timeout: 250 seconds]
wolflee_____ has joined #ruby
leafybas_ has quit [Remote host closed the connection]
wolflee_____ has quit [Remote host closed the connection]
wolflee____ has quit [Read error: Connection reset by peer]
leafybasil has joined #ruby
wolflee_____ has joined #ruby
wolflee______ has joined #ruby
edwinvdgraaf has quit [Remote host closed the connection]
iotouch has quit [Quit: This computer has gone to sleep]
edwinvdgraaf has joined #ruby
icebourg has quit [Ping timeout: 240 seconds]
shredding has joined #ruby
moeabdol has quit [Ping timeout: 245 seconds]
wolflee_____ has quit [Ping timeout: 240 seconds]
SOLDIERz has joined #ruby
MatthewsFace[SEA has joined #ruby
bruno- has quit [Read error: Connection reset by peer]
vtunka has quit [Quit: Leaving]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
decoponyo has quit [Ping timeout: 256 seconds]
iotouch has joined #ruby
bruno- has joined #ruby
MatthewsFace[SEA has quit [Ping timeout: 264 seconds]
jimms has joined #ruby
icebourg has joined #ruby
jtdowney has quit []
Perdomo has joined #ruby
vudew has joined #ruby
rodfersou has joined #ruby
<adaedra> Mmmh, better_errors seems not very active
jtdowney has joined #ruby
shredding has quit [Ping timeout: 264 seconds]
edwinvdg_ has joined #ruby
ItSANgo has joined #ruby
KnownSyntax has joined #ruby
vudew has quit [Read error: Connection reset by peer]
vudew has joined #ruby
<DefV> still awesome project
<adaedra> Yeah, but I'm having a weird bug with it, which seems to have been reported already, without answers... :x
edwinvdgraaf has quit [Ping timeout: 244 seconds]
Cust0sL1men has quit [Ping timeout: 246 seconds]
krz has quit [Quit: WeeChat 1.0.1]
blackmesa has quit [Ping timeout: 256 seconds]
craigp has joined #ruby
lidenskap has joined #ruby
gregf_ has joined #ruby
yosafbridge has quit [Ping timeout: 248 seconds]
jtdowney_ has joined #ruby
jtdowney has quit [Read error: Connection reset by peer]
lidenskap has quit [Ping timeout: 256 seconds]
scripore has joined #ruby
diegoaguilar has joined #ruby
chinmay_dd has quit [Quit: Leaving]
Papierkorb has joined #ruby
jtdowney_ has quit [Read error: Connection reset by peer]
chthon has quit [Ping timeout: 244 seconds]
jtdowney has joined #ruby
jimms has quit [Ping timeout: 272 seconds]
quimrstorres has quit [Remote host closed the connection]
moeabdol has joined #ruby
claptor has quit [Quit: this channel is bakas]
craigp has quit [Ping timeout: 245 seconds]
decoponio has joined #ruby
fabrice31 has quit [Remote host closed the connection]
fabrice31 has joined #ruby
DEA7TH has joined #ruby
Cust0sL1men has joined #ruby
DEA7TH has quit [Changing host]
DEA7TH has joined #ruby
Mon_Ouie has joined #ruby
Mon_Ouie has joined #ruby
Doow has left #ruby ["Leaving"]
ahmetkapikiran has quit [Quit: ahmetkapikiran]
quimrstorres has joined #ruby
yosafbridge has joined #ruby
scripore has quit [Quit: This computer has gone to sleep]
jtdowney has quit [Read error: Connection reset by peer]
ascarter_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jtdowney has joined #ruby
Soda has joined #ruby
stoffus has joined #ruby
tuelz has joined #ruby
quimrstorres has quit [Remote host closed the connection]
chthon has joined #ruby
quimrstorres has joined #ruby
serivich has quit [Ping timeout: 244 seconds]
scripore has joined #ruby
jtdowney_ has joined #ruby
jtdowney has quit [Read error: Connection reset by peer]
jehannimoh has joined #ruby
<shevy> code fuels our life!
<shevy> adaedra go take over that project :)
jehannimoh has quit [Quit: ChatZilla 0.9.91.1 [Firefox 37.0.2/20150415140819]]
<adaedra> shevy: If only I had time to manage such a big thing
arup_r has quit [Remote host closed the connection]
phutchins1 has joined #ruby
quimrstorres has quit [Remote host closed the connection]
OddJob has joined #ruby
arup_r has joined #ruby
SouL_|__ has quit [Ping timeout: 272 seconds]
<shevy> maaaan
<shevy> what are you doing!
<shevy> you work until it rains
thatslifeson has joined #ruby
<shevy> work less, and sit more in the sun
<shevy> then you have plenty of more time as well
scripore has quit [Quit: This computer has gone to sleep]
<OddJob> hey all. I am very new to ruby, and programming in general. can someone help me out with this? https://gist.github.com/anonymous/87fb96c8529603c5c4a0 It finds the entry just fine, but when the entry doesnt exist it should be set back to nil.
barkerd427 is now known as zz_barkerd427
last_staff has joined #ruby
yosafbridge has quit [Ping timeout: 248 seconds]
arup_r has quit [Remote host closed the connection]
<shevy> and where do so set to nil
<apeiros> shevy: which sun?
<shevy> apeiros the sun is shining here!
<apeiros> not here :(
thatslifeson has quit [Ping timeout: 250 seconds]
<shevy> yeah you guys are in the far west... I hope your bad weather does not come over here, please keep it!
allcentury has quit [Ping timeout: 240 seconds]
<shevy> OddJob the code should do fine right?
jimms has joined #ruby
<shevy> can regvalue become nil?
<shevy> as your if checks don't handle that case; I have no idea what the above method returns or does, that is highly domain-specific code
yosafbridge has joined #ruby
arup_r has joined #ruby
jtdowney has joined #ruby
pwattste has joined #ruby
davedev24_ has joined #ruby
jtdowney_ has quit [Read error: Connection reset by peer]
<jhass> OddJob: just notepadpp = regvalue if regvalue && !regvalue.empty?, it defaults to nil
chimche has joined #ruby
quazimodo has joined #ruby
Zai00 has joined #ruby
jtdowney_ has joined #ruby
jtdowney has quit [Read error: Connection reset by peer]
serivich has joined #ruby
doodlehaus has quit [Remote host closed the connection]
<adaedra> better_errors is generating more problems than it solves :x
<OddJob> shevy: this is the return I get if there is no entry. Is this saying it is a nil value? - Could not retrieve fact='notepadpp', resolution='<anonymous>': The system cannot find the file specified.
<OddJob> shevy: i just worry that would break in the rest of my code elsewhere. Not used to knowing what a successful (yet empty/nil) return looks like
asmodlol has quit [Ping timeout: 240 seconds]
dramagods has joined #ruby
<OddJob> jhass: are you saying to replace lines 10 - 13 with that single line?
Rickmasta has joined #ruby
asmodlol has joined #ruby
<adaedra> better_errors is returning Session Expired for every requests, any ideas?
<adaedra> every except the initial one*
shevy has quit [Ping timeout: 276 seconds]
<adaedra> duh, I think I know why
<OddJob> jhass: even with that change I get - Could not retrieve fact='notepadpp', resolution='<anonymous>': The system cannot find the file specified. - I would expect to get nothing in return (or am expecting)
Dopagod has quit [Ping timeout: 264 seconds]
<adaedra> Stupid browser and his /favicon.ico -_-
chinmay_dd has joined #ruby
tuelz has quit [Ping timeout: 256 seconds]
marr has quit [Ping timeout: 264 seconds]
RegulationD has joined #ruby
ldnunes has joined #ruby
quimrstorres has joined #ruby
<jhass> OddJob: you want to consult the facter people
narcan has joined #ruby
zzing has quit [Read error: Connection reset by peer]
<OddJob> jhass: isnt there a simple way to just tell the code to not do anything if regvalue returns nothing?
<jhass> OddJob: the code you showed doesn't do anything then
<OddJob> jhass: i guess i dont know what "doesnt do anything" means
jtdowney has joined #ruby
jtdowney_ has quit [Read error: Connection reset by peer]
<OddJob> it does everything, except for not doing anything when there is no entry for the regvalue
<jhass> and I guess what you want it to mean is specific to Facter
shevy has joined #ruby
<OddJob> hmm. facter is just based of ruby code, so how could it not be a ruby question? or are you saying, the code is correct (as in it should return nil if that regvalue doesnt exist) but my expectation of what the code is doing is wrong
RegulationD has quit [Ping timeout: 240 seconds]
laurentide has quit [Read error: Connection reset by peer]
<OddJob> i guess i thought there would be a much simpler and straight forward way to just return nil
laurentide has joined #ruby
Akagi201_ has quit [Remote host closed the connection]
avat has joined #ruby
jtdowney_ has joined #ruby
<jhass> you return nil
jtdowney has quit [Read error: Connection reset by peer]
badlands has joined #ruby
zzing has joined #ruby
<avat> Hello guys, I have a question. I am receiving data, how can I parse it to some readable format? It looks like this: type=profile&fired_at=2015-05-05+11%3A52%3A55&data%5Bid%5D=dc4dc5c3ba&data%5Bemail%5D=jussi.hyvarinen%40mbnet.fi&data%5Bemail_type%5D=html&data%5Bip_opt%5D=195.116.209.87&data%5Bweb_id%5D=71393301&data%5Bmerges%5D%5BFNAME%5D=&data%5Bmerges%5D%5BLNAME%5D=&data%5Bmerges%5D%5BCOMPANY%5D=Suomen+EkoKuppi+Oy&data%5Bmerges%5D%5BEM
<jhass> OddJob: the return value of the block passed to setcode is in my version and in your version nil if regvalue is either nil or an empty string
<jhass> avat: looks like formencoded HTTP POST data?
<OddJob> jhass: i got the answer - else nil end
<badlands> I'm writing an open source app that uses a database and therefore needs different configuration to run on different machines, what's the best way to configure a gem that is hosted in a public git repo?
<avat> Yes, it is. Whats the function to encode? I'm not really sure what should i write in google :)
roshanavand_ has joined #ruby
roshanavand has quit [Ping timeout: 264 seconds]
<jhass> avat: cgi should have something
<jhass> avat: try if CGI.parse eats it
<avat> jhass: thank you, I'll look into it
arup_r has quit [Remote host closed the connection]
terlar has joined #ruby
jtdowney_ has quit [Read error: Connection reset by peer]
<badlands> for example, I have the app configured to run on my computer and a server, the file is config/database.yml, which for obvious reasons I don't publish to git, how then, after running rake install and running an executable command, should me gem read configuration?
<hanmac1> avat: URI.decode also works
tus has joined #ruby
<avat> CGI parse did well, thanks a lot
jtdowney has joined #ruby
jtdowney has quit [Max SendQ exceeded]
jtdowney has joined #ruby
GreyHands has joined #ruby
<jhass> badlands: so it's a CLI tool?
<badlands> yes
alex88 has joined #ruby
<badlands> jhass yes
jtdowney has quit [Read error: Connection reset by peer]
juanca_ has joined #ruby
juanpablo__ has joined #ruby
jtdowney has joined #ruby
zz_barkerd427 is now known as barkerd427
<jhass> badlands: CONFIG_PATH = File.join (ENV["XDG_CONFIG_HOME"] || File.expand_path("~/.config")), "mytool"; create_config unless File.exist? CONFIG_PATH; CONFIG = read_config
<jhass> might need additional shenigans for windows and perhaps OS X
codecop has quit [Remote host closed the connection]
doodlehaus has joined #ruby
nateberkopec has joined #ruby
<badlands> thanks jhass, what are the key concepts here that will help me understand what this code is doing?
<apeiros> OSX could test for File.directory?(File.expand_path("~/Library/Application Support")
<apeiros> that's where *theoretically* config files should go on osx
<apeiros> that said, most CLI tools simply don't bother and spam ~
airdisa has joined #ruby
iotouch has quit [Quit: This computer has gone to sleep]
<badlands> Where is this set?
<apeiros> this?
<badlands> CONFIG_PATH
<jhass> XDG_CONFIG_HOME is system configuration, freedesktop.org standard
<jhass> in your code
<apeiros> badlands: you set that
<apeiros> and where - as early as you need it
juanpablo__ has quit [Ping timeout: 276 seconds]
blackmesa has joined #ruby
MatthewsFace[SEA has joined #ruby
<badlands> Ok I see, and if someone else installs my gem, do they need to follow any particular instructions to setup a configuration file?
<jhass> that's up to you
<jhass> you have to code setting it up
doodlehaus has quit [Remote host closed the connection]
<jhass> at very least you should create any necessary folders and copy examples over
<jhass> but you could also interactively query the values etc
<apeiros> personally I like transparency in where an app puts stuff
<jhass> that's what I tried to suggest with create_config unless File.exist?
<jhass> I find following standards like freedesktop.org fairly transparent
MatthewsFace[SEA has quit [Ping timeout: 240 seconds]
yosafbridge has quit [Ping timeout: 248 seconds]
jtdowney has quit [Read error: Connection reset by peer]
jtdowney_ has joined #ruby
tuelz has joined #ruby
chthon has quit [Remote host closed the connection]
giuseppesolinas has joined #ruby
konsolebox has joined #ruby
jimms has quit [Remote host closed the connection]
konsolebox has quit [Read error: Connection reset by peer]
iotouch has joined #ruby
yosafbridge has joined #ruby
<badlands> if I want to do a bit more reaearch on these concepts what should I be searching for?
livathinos has quit [Ping timeout: 272 seconds]
quimrstorres has quit [Remote host closed the connection]
<badlands> I'm looking for tutorials but search for gem configuration and related terms isn't bringing me much luck
yh has quit [Ping timeout: 240 seconds]
mikecmpbll has joined #ruby
AlphaAtom has joined #ruby
matcouto has quit [Quit: gone!]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mdarby has joined #ruby
blackmesa has quit [Ping timeout: 244 seconds]
alex88 has quit []
jtdowney has joined #ruby
jtdowney_ has quit [Read error: Connection reset by peer]
<jhass> that's because gems are usually libraries configured with code by the user of the library
<jhass> search for CLI tool configuration
tesuji has quit [Ping timeout: 272 seconds]
juanca__ has joined #ruby
yfeldblum has quit [Ping timeout: 265 seconds]
iotouch has quit [Quit: This computer has gone to sleep]
sankaber has joined #ruby
G has quit [Remote host closed the connection]
roshanavand_ has quit [Quit: Konversation terminated!]
juanca_ has quit [Ping timeout: 272 seconds]
jtdowney_ has joined #ruby
jtdowney has quit [Read error: Connection reset by peer]
<badlands> cool thanks guys
segfalt has quit [Read error: Connection reset by peer]
jimms has joined #ruby
juanca_ has joined #ruby
segfalt has joined #ruby
yosafbridge has quit [Ping timeout: 256 seconds]
sgambino has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
arup_r has joined #ruby
jtdowney has joined #ruby
jtdowney_ has quit [Read error: Connection reset by peer]
juanca__ has quit [Ping timeout: 264 seconds]
yosafbridge has joined #ruby
Rapier- has joined #ruby
jtdowney_ has joined #ruby
jtdowney has quit [Read error: Connection reset by peer]
livathinos has joined #ruby
vtunka has joined #ruby
but3k4 has joined #ruby
quimrstorres has joined #ruby
moeabdol has quit [Ping timeout: 276 seconds]
jtdowney_ has quit [Read error: Connection reset by peer]
jtdowney has joined #ruby
PhantomSpank has quit []
lidenskap has joined #ruby
ferr has quit [Read error: Connection reset by peer]
ValicekB has quit [Read error: No route to host]
iotouch has joined #ruby
jtdowney_ has joined #ruby
jtdowney has quit [Read error: Connection reset by peer]
RegulationD has joined #ruby
lidenskap has quit [Ping timeout: 256 seconds]
lolmaus has joined #ruby
poguez_ has quit [Quit: Connection closed for inactivity]
mrdmi has quit [Ping timeout: 264 seconds]
scripore has joined #ruby
jtdowney has joined #ruby
jtdowney_ has quit [Read error: Connection reset by peer]
RegulationD has quit [Ping timeout: 276 seconds]
ismaelga has joined #ruby
v0n has joined #ruby
jtdowney_ has joined #ruby
thatslifeson has joined #ruby
moeabdol has joined #ruby
jerius has joined #ruby
jtdowney has quit [Read error: Connection reset by peer]
ValicekB has joined #ruby
mrdmi has joined #ruby
lavros has joined #ruby
jimms has quit [Remote host closed the connection]
lolmaus has quit [Ping timeout: 256 seconds]
ki0 has joined #ruby
rgb-one has joined #ruby
iotouch has quit [Quit: This computer has gone to sleep]
Leef_ has quit [Quit: Leaving]
juanca__ has joined #ruby
jtdowney has joined #ruby
Mezjin has joined #ruby
jtdowney_ has quit [Read error: Connection reset by peer]
thatslifeson has quit [Ping timeout: 246 seconds]
moeabdol has quit [Ping timeout: 250 seconds]
sankaber has quit [Read error: Connection reset by peer]
sankaber has joined #ruby
badlands has quit [Quit: ChatZilla 0.9.91.1 [Firefox 37.0.2/20150415140819]]
tongcx has left #ruby ["WeeChat 1.1.1"]
jtdowney_ has joined #ruby
dblessing has joined #ruby
jtdowney_ has quit [Client Quit]
enebo has joined #ruby
juanca_ has quit [Ping timeout: 240 seconds]
davedev2_ has joined #ruby
SOLDIERz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ahmetkapikiran has joined #ruby
avat has quit [Quit: Page closed]
quimrstorres has quit [Remote host closed the connection]
allcentury has joined #ruby
davedev24_ has quit [Ping timeout: 246 seconds]
iotouch has joined #ruby
juanpablo__ has joined #ruby
jtdowney has quit [Ping timeout: 256 seconds]
SOLDIERz has joined #ruby
fabrice31_ has joined #ruby
quimrstorres has joined #ruby
bigmac has joined #ruby
Pisuke has quit [Read error: Connection reset by peer]
sanguisdex has quit [Remote host closed the connection]
doodlehaus has joined #ruby
ascarter has joined #ruby
last_staff has quit [Read error: Connection reset by peer]
mrdmi has quit [Ping timeout: 256 seconds]
Pisuke has joined #ruby
sevenseacat has joined #ruby
havenwood has joined #ruby
fabrice31 has quit [Ping timeout: 246 seconds]
juanpablo__ has quit [Ping timeout: 256 seconds]
sanguisdex has joined #ruby
cassianoleal has joined #ruby
workmad3 has joined #ruby
woodruffw has quit [Ping timeout: 264 seconds]
mrdmi has joined #ruby
yh has joined #ruby
barhum2013 has joined #ruby
<shevy> object.some_method(ARGV.first) if ARGV.first
vtunka has quit [Quit: Leaving]
<shevy> hmm any better variant?
<shevy> I guess I could do nothing in this method if nil is passed
konsolebox has joined #ruby
railsFor_ has joined #ruby
railsForDaiz has quit [Ping timeout: 256 seconds]
scripore has quit [Quit: This computer has gone to sleep]
lessless has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Akagi201 has joined #ruby
<adaedra> if ARGV.count > 0 seems clearer no?
Sawbones has joined #ruby
<certainty> ARGV.any?
scripore has joined #ruby
<adaedra> ^
<shevy> hmm let me think about that
<shevy> that would be shorter at least
<shevy> does .any? work?
vtunka has joined #ruby
<havenwood> >> [].any?
<ruboto> havenwood # => false (https://eval.in/327169)
<adaedra> >> [ [].any?, [ 1 ].any? ]
<ruboto> adaedra # => [false, true] (https://eval.in/327174)
<shevy> yeah it works
<shevy> \o/
Sawbones has quit [Remote host closed the connection]
<omegahm> You could also consider that `some_method` just works for `nil` as well.
<gregf_> if val = ARGV.shift; Obj.call(val);end <= could be more readable
barhum2013 has quit [Quit: barhum2013]
<omegahm> Maybe doing nothing.
<omegahm> Let it be the responsibility of the callee instead of caller.
juanca_ has joined #ruby
<shevy> omegahm yeah I wondered about that too
narcan has quit [Quit: -[AppDelegate installMalware]: unrecognized selector sent to instance 0x156109c0]
<adaedra> Depends on the method
juanca___ has joined #ruby
kp666 has quit [Quit: Leaving]
thatslifeson has joined #ruby
mrdmi has quit [Ping timeout: 252 seconds]
Guest15 has joined #ruby
mrmargolis has joined #ruby
mrdmi has joined #ruby
juanca__ has quit [Ping timeout: 240 seconds]
juanca_ has quit [Ping timeout: 256 seconds]
unreal has joined #ruby
juanca_ has joined #ruby
asmodlol has quit [Ping timeout: 265 seconds]
paulcsmith has joined #ruby
juanca__ has joined #ruby
nettoweb has joined #ruby
_ixti_ has joined #ruby
premera has joined #ruby
segfalt has quit [Ping timeout: 276 seconds]
asmodlol has joined #ruby
juanca___ has quit [Ping timeout: 276 seconds]
juanca_ has quit [Ping timeout: 240 seconds]
ixti has quit [Ping timeout: 276 seconds]
kaspernj has quit [Ping timeout: 272 seconds]
failshell has joined #ruby
kaleido has joined #ruby
Bira has joined #ruby
fabrice31_ has quit []
scripore has quit [Quit: This computer has gone to sleep]
scripore has joined #ruby
<Raverix> Hello, I'm having a problem deploying a rails site to a new server that passenger appears to be ignoring. From what I can tell, passenger is installed properly, and apache is loading the module, but the site is just serving the default page. Any suggestions?
endash has joined #ruby
vudew has quit [Read error: Connection reset by peer]
umgrosscol has joined #ruby
ponga has quit [Quit: Leaving...]
ponga has joined #ruby
airdisa has quit [Remote host closed the connection]
chthon has joined #ruby
JDiPierro has joined #ruby
pandaant has quit [Remote host closed the connection]
<adaedra> Raverix: see #RubyOnRails for specific Rails questions. Don't forget to inform if you cross-post though.
fabrice31 has joined #ruby
riotjone_ has quit [Remote host closed the connection]
nszceta has joined #ruby
blueOxigen has joined #ruby
iwishiwerearobot has quit [Quit: >:(]
bluOxigen has quit [Ping timeout: 276 seconds]
Dopagod has joined #ruby
scripore has quit [Quit: This computer has gone to sleep]
Xiti` has quit [Ping timeout: 250 seconds]
iasoon has joined #ruby
scripore has joined #ruby
fabrice31 has quit [Remote host closed the connection]
<Raverix> adaedra: Sorry for not specifying it was a cross post, I wasn't getting much help in #RubyOnRails, so I thought I'd try here. The issue IMO is not related to rails, but rather with Passenger.
kaspernj has joined #ruby
nszceta has quit [Client Quit]
jsrn has quit [Ping timeout: 256 seconds]
fabrice31 has joined #ruby
<adaedra> ah
arup_r has quit []
kaleido has quit [Ping timeout: 265 seconds]
shellfu_afk has joined #ruby
Matachines has joined #ruby
shellfu_afk is now known as shellfu
RegulationD has joined #ruby
EagleDelta has joined #ruby
Xiti has joined #ruby
fabrice31_ has joined #ruby
yosafbridge has quit [Ping timeout: 248 seconds]
juanca__ has quit [Remote host closed the connection]
Stalkr has joined #ruby
fabrice31 has quit [Ping timeout: 240 seconds]
senayar has joined #ruby
leafybas_ has joined #ruby
moeabdol has joined #ruby
marr has joined #ruby
werelivinginthef has joined #ruby
airdisa has joined #ruby
normalra has joined #ruby
leafybasil has quit [Ping timeout: 264 seconds]
tvw has quit []
zzing has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dorei has joined #ruby
OddJob has quit [Quit: Page closed]
zzing has joined #ruby
rbennacer has joined #ruby
lessless has joined #ruby
asmodlol has quit [Ping timeout: 272 seconds]
yosafbridge has joined #ruby
blueOxigen has quit [Ping timeout: 246 seconds]
rrichardsr3 has joined #ruby
juanca_ has joined #ruby
bluOxigen has joined #ruby
MatthewsFace[SEA has joined #ruby
mitchellhenke has joined #ruby
rgb-one has quit [Read error: Connection reset by peer]
asmodlol has joined #ruby
zzing has quit [Ping timeout: 256 seconds]
<waxjar> does someone have a good article (or talk) on caching headers bookmarked by any chance?
<shevy> this is cool
<shevy> speed tricks!
<shevy> I never even had the idea of using .respond_to? rather than begin/rescue
Kricir has joined #ruby
MatthewsFace[SEA has quit [Ping timeout: 255 seconds]
icebourg has quit []
emilkarl has joined #ruby
<dudedudeman> how's the world going today
<dudedudeman> shevy: doing good?
<shevy> not sure
<shevy> finished one exam today, 3 more to come and I'd rather write ruby code
<waxjar> shevy: i'd prefer begin rescue actually, if it's unlikely you'll get bad data passed
<shevy> dudedudeman your nick just inspired me to go out and buy a beer though
<waxjar> saves a call to respond_to?
cryptarium has joined #ruby
beneggett has joined #ruby
<shevy> got a question: https://github.com/JuanitoFatas
<shevy> how does he add those cut icons?
<shevy> like those oogly eyes
cryptarium has quit [Remote host closed the connection]
bollullera has joined #ruby
<shevy> ohh
<shevy> I think it is: <%= emojify "I like chocolate :heart_eyes:!", image_size: "36x36" %>
<shevy> damn
<shevy> Array#first is slower than Array#[0]
<shevy> and here I was replacing all [0] with .first .... :(
<dudedudeman> shevy: where are you located? because beer for me right now would mean beer at 9:15 in the morning. lol
<shevy> central europe! \o/
chrissonar has quit [Remote host closed the connection]
<shevy> and the sun is shining too, unlike ~500 km to the west of here haha
<shevy> though I hate drinking beer when it is hot....
<dudedudeman> oh oh. that's right, that cool country
* dudedudeman wishes he was in not america
<shevy> "Enumerable#each vs for loop"
mary5030 has joined #ruby
<shevy> for loop is slower, haha
<shevy> Array#reverse_each is faster than Array#reverse.each ... makes sense
<axisys> m = Mechanize.new; m.get('https://www.google.com') gives nice output.. but m.get('https://www.companysite.com') gives OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed .. how to get around it?
<shevy> Enumerable#sort_by code is faster than Enumerable#sort strangely enough
Xoro has quit [Ping timeout: 256 seconds]
GreyHands has quit [Quit: Textual IRC Client: www.textualapp.com]
zenguy_pc has joined #ruby
<axisys> I tried this to add certificate .. https://github.com/sparklemotion/mechanize/issues/265#issuecomment-9237719 and still same error
<jhass> shevy: why's that strange?
<shevy> because sort_by sounds more intelligent
<jhass> sort with a block has to make at least one transition more between Ruby and C land after all
<shevy> sort_by has a block too or?
stoffus has quit [Ping timeout: 265 seconds]
<jhass> yes, but the block content of .sort_by is usually less expensive
<shevy> hmm
Parker0 has joined #ruby
<jhass> a.something <=> b.something
<jhass> vs x.something
<jhass> method call dispatch Ruby<->C for <=>
<jhass> and potentially additional recomputations of .something
asmodlol has quit [Ping timeout: 244 seconds]
ki0 has quit [Remote host closed the connection]
asmodlol has joined #ruby
<axisys> m.get('https://www.cnn.com') gives same openssl cert verification error
andikr has quit [Remote host closed the connection]
<shevy> hmm
ki0 has joined #ruby
<axisys> I am testing it from within pry>
Guest15 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ndrei has quit [Ping timeout: 252 seconds]
<shevy> axisys I am still trying to figure out openssl myself; I wanted to add a SSL certification to my ancient IRC bot and gave up when I could not find documentation
bluOxigen has quit [Ping timeout: 250 seconds]
<axisys> may be some debug option will disclose the problem? I downloaded the ca cert from http://curl.haxx.se/
<axisys> I am using ubuntu
Guest1421 has joined #ruby
juanpablo__ has joined #ruby
mengu has joined #ruby
moeabdol has quit [Ping timeout: 264 seconds]
jakolehm has quit [Ping timeout: 240 seconds]
Xoro has joined #ruby
yalue has joined #ruby
bluOxigen has joined #ruby
slash_nick has joined #ruby
Fingel has joined #ruby
mooe has quit [Quit: Connection closed for inactivity]
leafybas_ has quit [Read error: Connection reset by peer]
leafybasil has joined #ruby
jimms has joined #ruby
Oka has joined #ruby
lkba has joined #ruby
icebourg has joined #ruby
icebourg has quit [Max SendQ exceeded]
<axisys> now getting little different error hostname 'www.cnn.com' does not match the server certificate
<axisys> I changed the store.add_file to store.add_path
jordanm has joined #ruby
hanmac1 has quit [Quit: Leaving.]
antgel has quit [Ping timeout: 246 seconds]
pdoherty has joined #ruby
kaspernj has quit [Ping timeout: 246 seconds]
vtunka has quit [Quit: Leaving]
juanpablo__ has quit [Ping timeout: 272 seconds]
vikaton has quit []
senayar has quit [Remote host closed the connection]
aganov has quit [Read error: Connection reset by peer]
redlegion has quit [Read error: Connection reset by peer]
AlphaAtom has left #ruby [#ruby]
redlegion has joined #ruby
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
cassianoleal has quit [Quit: Textual IRC Client: www.textualapp.com]
AlphaAtom has joined #ruby
juanpablo__ has joined #ruby
thatslifeson has quit [Remote host closed the connection]
mengu has quit []
sevenseacat has quit [Quit: Me dun like you no more.]
senayar has joined #ruby
senayar has joined #ruby
The_Phoenix has joined #ruby
The_Phoenix has quit [Read error: Connection reset by peer]
nfk has joined #ruby
The_Phoenix has joined #ruby
The_Phoenix has quit [Changing host]
The_Phoenix has joined #ruby
The_Phoenix has quit [Read error: Connection reset by peer]
blueOxigen has joined #ruby
rhllor has joined #ruby
bluOxigen has quit [Ping timeout: 272 seconds]
segfalt has joined #ruby
The_Phoenix has joined #ruby
railsFor_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rbennacer has quit [Remote host closed the connection]
riotjones has joined #ruby
kaspernj has joined #ruby
The_Phoenix has quit [Read error: Connection reset by peer]
chipotles has joined #ruby
Stalkr has quit [Quit: Leaving...]
paulcsmith has quit [Quit: Be back later ...]
Akagi201_ has joined #ruby
tjohnson has joined #ruby
rbennacer has joined #ruby
The_Phoenix has joined #ruby
riotjones has quit [Ping timeout: 272 seconds]
codecop has joined #ruby
The_Phoenix has quit [Max SendQ exceeded]
The_Phoenix has joined #ruby
woodruffw has joined #ruby
Rollabunna has joined #ruby
paulcsmith has joined #ruby
The_Phoenix has quit [Max SendQ exceeded]
workmad3 has quit [Ping timeout: 276 seconds]
The_Phoenix has joined #ruby
uri_ has joined #ruby
The_Phoenix has quit [Max SendQ exceeded]
vtunka has joined #ruby
Akagi201 has quit [Ping timeout: 264 seconds]
The_Phoenix has joined #ruby
ypasmk has quit [Quit: ypasmk]
The_Phoenix has quit [Read error: Connection reset by peer]
The_Phoenix has joined #ruby
Channel6 has joined #ruby
ixti has joined #ruby
claw_ has joined #ruby
claw has quit [Ping timeout: 272 seconds]
riotjones has joined #ruby
ypasmk has joined #ruby
__main__ has quit [Read error: Connection reset by peer]
_ixti_ has quit [Ping timeout: 272 seconds]
riotjones has quit [Read error: Connection reset by peer]
mistermocha has joined #ruby
riotjones has joined #ruby
rbennacer has quit [Remote host closed the connection]
fabrice31_ has quit [Remote host closed the connection]
fabrice31 has joined #ruby
that1guy has joined #ruby
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
lidenskap has joined #ruby
phreakocious has quit [Ping timeout: 264 seconds]
ixti has quit [Ping timeout: 252 seconds]
__main__ has joined #ruby
thatslifeson has joined #ruby
casadei_ has joined #ruby
jobewan has joined #ruby
normalra has left #ruby ["WeeChat 1.1.1"]
lidenskap has quit [Ping timeout: 245 seconds]
phreakocious has joined #ruby
mistermocha has quit [Ping timeout: 250 seconds]
segfalt_ has joined #ruby
fabrice31 has quit [Remote host closed the connection]
Igorshp has quit [Remote host closed the connection]
segfalt has quit [Ping timeout: 240 seconds]
segfalt_ is now known as segfalt
<shevy> no real clue
<shevy> one day I hope ruby will have awesome documentation!
jakolehm has joined #ruby
<ericwood> idk the ruby docs are pretty good
<ericwood> it varies a lot, though, but the common stuff has tons of examples
<adaedra> shevy: ruby documentation is not so bad
airdisa has quit []
<adaedra> some gems, yes, but that's another story
nettoweb has joined #ruby
beneggett has quit [Quit: ...zzz ¯\_(ツ)_/¯ zzz...]
emilkarl has quit [Quit: emilkarl]
nettoweb has quit [Max SendQ exceeded]
andikr has joined #ruby
airdisa has joined #ruby
The_Phoenix has quit [Read error: Connection reset by peer]
nettoweb has joined #ruby
gagrio_ has quit [Ping timeout: 265 seconds]
icebourg has joined #ruby
The_Phoenix has joined #ruby
<shevy> axisys I guess they want you to go to http://ruby-doc.org/stdlib-2.2.2/libdoc/openssl/rdoc/OpenSSL.html :P
ndrei has joined #ruby
SOLDIERz has quit [Ping timeout: 256 seconds]
jakolehm has quit []
moeabdol has joined #ruby
Fingel has quit [Quit: Leaving]
asmodlol has quit [Ping timeout: 252 seconds]
Igorshp has joined #ruby
normalra has joined #ruby
blackmesa has joined #ruby
ixti has joined #ruby
Igorshp_ has joined #ruby
Igorshp has quit [Read error: Connection reset by peer]
paulcsmith has quit [Quit: Be back later ...]
soc42 has joined #ruby
asmodlol has joined #ruby
The_Phoenix has quit [Read error: Connection reset by peer]
paulcsmith has joined #ruby
jordanm has quit [Ping timeout: 276 seconds]
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
moeabdol has quit [Ping timeout: 240 seconds]
huddy has joined #ruby
The_Phoenix has joined #ruby
The_Phoenix has quit [Max SendQ exceeded]
<axisys> shevy: thanks.. currently I am doing a not recommended approach and by passing the verification.. I need to scrub the web page for some other testing.. I will go back and try to make it secure later..
<axisys> shevy: after all all these are accessible from intranet only
Igorshp_ has quit [Ping timeout: 252 seconds]
The_Phoenix has joined #ruby
The_Phoenix has quit [Max SendQ exceeded]
snockerton has joined #ruby
The_Phoenix has joined #ruby
The_Phoenix has quit [Max SendQ exceeded]
The_Phoenix has joined #ruby
The_Phoenix has quit [Max SendQ exceeded]
Kricir has quit [Remote host closed the connection]
The_Phoenix has joined #ruby
rhllor has quit [Ping timeout: 264 seconds]
tjbiddle has joined #ruby
chrishough has joined #ruby
leafybasil has quit [Remote host closed the connection]
leafybasil has joined #ruby
charliesome has quit [Quit: zzz]
orionstein has quit [Quit: ZNC - http://znc.in]
KeroroGunsou has joined #ruby
orionstein has joined #ruby
jobewan has quit [Quit: Leaving]
iotouch has quit [Quit: This computer has gone to sleep]
The_Phoenix has quit [Read error: Connection reset by peer]
Igorshp has joined #ruby
jhass has left #ruby ["WeeChat 1.1.1"]
jhass has joined #ruby
vtunka has quit [Quit: Leaving]
jobewan has joined #ruby
The_Phoenix has joined #ruby
The_Phoenix has quit [Max SendQ exceeded]
The_Phoenix has joined #ruby
iasoon has quit [Ping timeout: 240 seconds]
loechel has joined #ruby
chipotle has quit [Quit: cheerio]
rhllor has joined #ruby
failshell has quit [Remote host closed the connection]
that1guy has quit [Quit: This computer has gone to sleep]
momomomomo has joined #ruby
KeroroGunsou is now known as d0lph1n98
Igorshp has quit [Ping timeout: 264 seconds]
scripore has quit [Quit: This computer has gone to sleep]
anisha has quit [Quit: Leaving]
kraljev11 has joined #ruby
hackeron has joined #ruby
_tpavel has joined #ruby
alex88 has joined #ruby
mistermocha has joined #ruby
seako has left #ruby [#ruby]
JimmyNeutron has quit [Ping timeout: 256 seconds]
gsd has joined #ruby
mwlang has joined #ruby
JimmyNeutron has joined #ruby
<mwlang> what’s the modern day approach to profiling ruby code? I haven’t done this since Ruby 1.8.6 and have an app I need to optimize. I have fully covering test specs in rspec if that helps.
_tpavel has quit [Client Quit]
symbol has joined #ruby
Igorshp has joined #ruby
The_Phoenix has quit [Read error: Connection reset by peer]
kraljev11 has quit [Read error: Connection reset by peer]
moeabdol has joined #ruby
GaryOak_ has joined #ruby
juanca_ has quit [Remote host closed the connection]
nettoweb has joined #ruby
Eiam has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
The_Phoenix has joined #ruby
moeabdol has quit [Client Quit]
Guest1421 has quit [Ping timeout: 256 seconds]
The_Phoenix has quit [Max SendQ exceeded]
The_Phoenix has joined #ruby
The_Phoenix has quit [Max SendQ exceeded]
The_Phoenix has joined #ruby
The_Phoenix has quit [Max SendQ exceeded]
workmad3 has joined #ruby
The_Phoenix has joined #ruby
The_Phoenix has quit [Max SendQ exceeded]
The_Phoenix has joined #ruby
The_Phoenix has quit [Max SendQ exceeded]
airdisa has quit []
<gambl0re> def titleize (x)
<gambl0re> "David Copperfield".split.collect(&:capitalize).join(' ')
<gambl0re> end
The_Phoenix has joined #ruby
<gambl0re> why do we need to put the &:capitalize?
The_Phoenix has quit [Max SendQ exceeded]
kblake has joined #ruby
<gambl0re> cant we just put "David Copperfield".split.capitalize.join(' ') instead?
<mwlang> gambl0re: that’s what’s calling #capitalize on each part of the string that you just split into an array of strings [“David”, “Copperfield”]
<adaedra> because once you did split, it's an array
The_Phoenix has joined #ruby
kraljev11 has joined #ruby
<adaedra> you have to call capitalize on strings
Igorshp has quit [Remote host closed the connection]
ixti has quit [Ping timeout: 272 seconds]
livathinos has quit []
<gambl0re> so we use the & to conver the array into string in order to capitalize?
<adaedra> no
rdark has joined #ruby
<adaedra> .collect(&:capitalize) will return a new array, where capitalize will be applied on all elements
<adaedra> >> [ 'aaa', 'bbb', 'ccc' ].collect(&:capitalize)
<ruboto> adaedra # => ["Aaa", "Bbb", "Ccc"] (https://eval.in/327529)
senayar has quit []
flou has joined #ruby
<adaedra> Then, you join again with join(' ') and get a string
dANO has quit []
SouL_|_ has joined #ruby
Igorshp has joined #ruby
<gambl0re> what if we did the code without the &: and just(capitalize)
<mwlang> gambl0re: &:capitalize is short-hand for .collect{|str| str.capitalize}
barhum2013 has joined #ruby
<adaedra> capitalize is not a variable
The_Phoenix has quit [Read error: Connection reset by peer]
<adaedra> &: is just syntax sugar
pokui has quit [Remote host closed the connection]
<ericwood> & converts it to a proc basically
jackjackdripper has joined #ruby
msgodf has quit [Remote host closed the connection]
<ericwood> but only when used in a method arg it's kinda weird
<kenichi> every question in here is symbol.to_proc lately
<adaedra> *dunno face*
<kenichi> mwlang: does not include '.collect', just the proc
<gambl0re> whats the difference between .collect and .map and .each?
<mwlang> kenichi: I was unclear about that.
<adaedra> #collect and #map are the same
<adaedra> #each just iterates other each element, not returning a new array, iirc
<kenichi> collect/map are aliases, both creating new arrays with results; each just interates
freerobby has joined #ruby
<adaedra> s/other/over/
The_Phoenix has joined #ruby
joonty has quit [Quit: joonty]
<adaedra> English iz hard
<kenichi> adaedra++ ;)
that1guy has joined #ruby
rbennacer has joined #ruby
<gambl0re> we can only use .each with an array or hash?
moretti has joined #ruby
<adaedra> With any Enumerable
slash_nick has quit [Changing host]
slash_nick has joined #ruby
<mwlang> adaedra: only because it’s a mashup of every other language in the world. If we like something in another language, we adopt it and toss the accents. :-p
<adaedra> mwlang: "café"
The_Phoenix has quit [Read error: Connection reset by peer]
colorados has quit [Ping timeout: 246 seconds]
alex88 has quit []
juanca_ has joined #ruby
barhum2013 has quit [Ping timeout: 265 seconds]
<mwlang> adaedra: some are slower than others to drop…”cafe” and "café" are common.
<adaedra> so you write deja-vu?
konsolebox has quit [Remote host closed the connection]
<adaedra> eh, it's still better than swedish that just keeps the word but rewrites it
The_Phoenix has joined #ruby
<mwlang> adaedra: yeah…we write deja vu (no hyphen)
<adaedra> :|
<adaedra> déjà-vu
<mwlang> who’s got time to type accents on a keyboard anyhow? :-)
chipotle has joined #ruby
The_Phoenix has quit [Read error: Connection reset by peer]
<adaedra> Like it's hard
rbennacer has quit [Ping timeout: 252 seconds]
<thatslifeson> it's harder than it should be
<gambl0re> "David Copperfield".split.collect(&:capitalize).join(' ') =====>.split (splits strings into array) .collect (collects string elements) &:capitalize (& used to conver array into proce in order to capitalize array elements) .join(' ') used to convert array to string?
<thatslifeson> we should have UTF-16 keyboards
<thatslifeson> with every possible key
<thatslifeson> should work great
<thatslifeson> wouldn't take up much room
asmodlol has quit [Ping timeout: 272 seconds]
<mwlang> thatslifeson: that sounds like a fun keyboard to put on Kickstarter
<adaedra> gambl0re: collect doesn't really collects... it will take each element, pass it in the given block (here &:capitalize which just calls capitalize) and return a new array containing the result
<thatslifeson> lol
<thatslifeson> it would be ridiculously huge
<thatslifeson> and if it wasn't, it'd be overcomplicated
konsolebox has joined #ruby
<adaedra> but otherwise, seems right
<thatslifeson> there is no easy solution except to unify languages :P
<thatslifeson> (not CS languages)
Zekka has quit [Ping timeout: 250 seconds]
<adaedra> thatslifeson: 102 keys are enough already
asmodlol has joined #ruby
Sawbones_ has joined #ruby
<thatslifeson> lol
<adaedra> Compose-key system is great
<thatslifeson> for english
<thatslifeson> thank god for pinyin
kraljev11 has quit [Read error: Connection reset by peer]
<adaedra> why don't they use letters like anybody else >_>
bricker has joined #ruby
<mwlang> thatslifeson: sounds like you just described English, to me. :-D
scripore has joined #ruby
kraljev11 has joined #ruby
Sawbones_ has quit [Remote host closed the connection]
vire has quit [Ping timeout: 252 seconds]
<gambl0re> and becaues capitalize is not a variable with need to put the : in front of it?
Mezjin has quit [Ping timeout: 264 seconds]
<adaedra> :capitalize is a symbol
<thatslifeson> ^
<adaedra> you put & before to transform it as a proc and pass it to capitalize
<symbol> I chose a terrible name :)
<adaedra> yeah, I saw your name colored, and told myself "oops"
<thatslifeson> lol
<adaedra> but at least, typing "symbol" is easy with completion :p
<symbol> heh, yeah. I still like it despite the occasional ping
<symbol> It makes me feel like I have friends.
<symbol> bahaha.
* adaedra pats symbol
* symbol sniff
<symbol> Thanks.
<apeiros> adaedra: actually you transform it to a block, not a proc
<gambl0re> so i can do &:upcase , &:downcase &:swapcase ?
<Peetooshock> >>:a.class
<ruboto> Peetooshock # => Symbol (https://eval.in/327565)
<adaedra> gambl0re: yes
<apeiros> it will call to_proc in the process if the argument is not already a Proc
<adaedra> &:xxx => { |e| e.xxx }
<adaedra> Aaaaaaaaaand another unwated highlight.
pdoherty has quit [Ping timeout: 272 seconds]
<gambl0re> ok thanks...
Sawbones_ has joined #ruby
<adaedra> apeiros: but it's a proc that is passed to collect?
<adaedra> a block's not a proc?
<apeiros> adaedra: no. it's a block. and blocks are not procs :)
<adaedra> ok
<adaedra> I thought so D:
<apeiros> and e.g. foo.map(&(proc {})) will not invoke to_proc, since the argument is already a proc. it will "only" convert that proc to a block.
<apeiros> whereas foo.map(&(:sym)) will first call :sym.to_proc, and then convert the resulting proc to a block
coderkevin has joined #ruby
jimms has quit [Remote host closed the connection]
allcentury has quit [Ping timeout: 272 seconds]
<gambl0re> how comes theres not &:
<apeiros> gambl0re: because it's not &:
<apeiros> it's & + symbol
<apeiros> and symbol is the thing which has :
ki0 has quit [Ping timeout: 244 seconds]
<apeiros> gambl0re: see my explanation above to adaedra
<mwlang> gambl0re: because you’re prefixing a variable with & there.
MatthewsFace[SEA has joined #ruby
chipotles has quit [Read error: No route to host]
<gambl0re> if you're using a varible with & then you dont need the : ?
Matthews_ has joined #ruby
<apeiros> gambl0re: what is `:foo`?
<mwlang> gambl0re: yes, and it works there because that variable was assigned a proc.
<gambl0re> a symbol..
<adaedra> becuase multiples_of_3 is a proc
<adaedra> & takes either a symbol or a proc
<adaedra> (sorry :p)
<apeiros> gambl0re: correct. and symbols are objects. the & is unrelated to the :
<apeiros> >> x = :upcase; ["hi", "there"].map(&x)
<ruboto> apeiros # => ["HI", "THERE"] (https://eval.in/327570)
kraljev11 has quit [Ping timeout: 272 seconds]
<apeiros> >> ["hi", "there"].map(&:upcase)
<ruboto> apeiros # => ["HI", "THERE"] (https://eval.in/327571)
loechel has quit [Ping timeout: 265 seconds]
<apeiros> gambl0re: ^ those two do the same thing.
rbennacer has joined #ruby
<adaedra> >> [ 1, 2, 3 ].map(&proc { |e| e * e })
<ruboto> adaedra # => [1, 4, 9] (https://eval.in/327572)
<adaedra> & is just a way of saying "Pass it to the function as if I wrote a block"
<gambl0re> ok i see...
loechel has joined #ruby
<gambl0re> i always ready that everything in ruby is a block...i dont even know what that means..but i'll find out later.
<gambl0re> read
<gambl0re> i mean object
<adaedra> yes
<apeiros> gambl0re: everything which you can assign to a variable or call a method on is an object.
MatthewsFace[SEA has quit [Ping timeout: 276 seconds]
<adaedra> it means that you can take anything and call methods on it
sohrab has joined #ruby
<gambl0re> " blah blah blah".capitalize ==== " blah blah blah " is an object?
Sawbones_ has quit [Remote host closed the connection]
<apeiros> and actually only almost everything in ruby is an object. not everything.
<adaedra> that's an expression
<apeiros> gambl0re: yes
Matachines has quit [Quit: Textual IRC Client: www.textualapp.com]
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Guest98626 has quit [Ping timeout: 240 seconds]
<apeiros> it's a string literal, which is an object
<adaedra> actually, the line you wrote is just invalid
kraljev11 has joined #ruby
juanca_ has quit [Ping timeout: 246 seconds]
<adaedra> there's no ====
n008f4g_ has joined #ruby
Sawbones_ has joined #ruby
<gambl0re> i know...
<adaedra> but that means that for a valid example: "blah".capitalize == "Blah"
<gambl0re> :symbol symbol: is the same?
<adaedra> "blah" and "Blah" are strings, and therefore objects
failshell has joined #ruby
<adaedra> no, only :symbol is a symbol
<apeiros> gambl0re: no, symbols are not delimited on both ends
<adaedra> symbol: is a sugar for hashes
<apeiros> :foo, or :"foo"
symbol has quit [Quit: WeeChat 1.1]
<apeiros> and in hashes or method calls, also foo: or "foo":
<apeiros> (the former in 1.9+, the latter in 2.2+)
<adaedra> writing { foo: "bar" } is the same as { :foo => "bar" }
mikecmpbll has quit [Ping timeout: 246 seconds]
Zekka has joined #ruby
pietr0 has joined #ruby
AlphaAtom has joined #ruby
<gambl0re> a method in ruby is a function in javascript?
d0lph1n98 has quit [Quit: leaving]
<adaedra> a method is a function called on an object
<claw_> gambl0re: more or less
diegoviola has joined #ruby
<gambl0re> i was getting confused about methods until i realised its almost exactly like a function..
<gambl0re> which it really is..
<apeiros> there's a difference
<apeiros> methods have a self, functions do not. js mixes those two concepts.
<gambl0re> and the @ in ruby = .this in javascript?
soc42 has quit [Remote host closed the connection]
<adaedra> it denotes an instance variable
<apeiros> close
<apeiros> @ is part of the variable name
<adaedra> so in a sense, yes, but not really
<adaedra> it's being "saved" in the current object
<apeiros> and as adaedra said, it denotes an instance variable. and instance variables belong to/are scope to a self
moeabdol has joined #ruby
<baweaver> JS Scope is notoriously finicky.
<adaedra> JS is a mess :x
<claw_> i am receiving some deflated data from a server as a string. I can tell the server how much data i want (number of lines) . sometimes i get "incorrect header check" by zlib. if i reduce the number of lines the exception is not raised.
<baweaver> you're going to want to read through a few articles on it.
michaeldeol has joined #ruby
<claw_> http://paste.triple6.org/qRk6Rw < heres my deflating methid
<claw_> *method
<claw_> anybody knows how i could debug that ?
<claw_> i realy looks like a bug in zlib
<eam> claw_: what do you mean number of lines? There aren't any lines in a compressed stream
granthatcher has quit []
EagleDelta has quit [Remote host closed the connection]
<claw_> eam: i tell the server i want 50 lines and it deflates them an sends them as a stream terminated by ".\r\n"
<claw_> where line is a formatted dataset
psy_ has joined #ruby
<claw_> actually its nntp using xover if you know about nntp
dramagods has quit []
baweaver has quit [Remote host closed the connection]
<eam> claw_: have you dumped out the data you're reading to see what's actually in it?
quimrstorres has quit [Remote host closed the connection]
<claw_> yes and it looks just valid
leafybas_ has joined #ruby
<eam> the header is correct?
Cust0sL1men has quit [Ping timeout: 255 seconds]
<eam> claw_: I'm curious if you're perhapss mixing deflate and gzip compression formats
gazay has joined #ruby
lkba has quit [Ping timeout: 256 seconds]
mjuszczak has joined #ruby
quimrstorres has joined #ruby
Rollabunna has quit [Remote host closed the connection]
lidenskap has joined #ruby
leafybasil has quit [Ping timeout: 252 seconds]
Rollabunna has joined #ruby
<mwlang> has anyone tried to use the stackprof gem? I’m using it, but all it seems to capture is my rspec examples and not the actual calls into the app’s code.
leafybas_ has quit [Ping timeout: 240 seconds]
c0m0 has quit [Ping timeout: 264 seconds]
<claw_> eam: its correct in 99.9% of the time. and i am doing nothing different with the 0.01% thats what actually confuses me the most
jobewan has quit [Quit: Leaving]
<eam> where's the input coming from?
ismaelga has quit [Remote host closed the connection]
<claw_> from an nntp server i cant control
gluten_hell has quit [Quit: Computer has gone to sleep.]
<eam> right so, perhaps it's presenting a different compressed format? There are AFAIK three possibilities
<eam> gzip, zlib and deflate
<eam> I suggest saving the exact data you read and examining exactly what's different about it
ramfjord has joined #ruby
chthon has quit [Ping timeout: 244 seconds]
Jackneill has joined #ruby
_djbkd has joined #ruby
mrmargolis has quit [Remote host closed the connection]
<claw_> okay lets see if i can catch it.
mrmargolis has joined #ruby
doertedev has quit [Ping timeout: 264 seconds]
<claw_> by the the way : the data is not malformed by the transfer or something because if i rerequest it results in the same error all the time
<eam> claw_: that seems like more evidence that it's related to a particular unit of data or a particular source
moretti has quit [Remote host closed the connection]
lidenskap has quit [Remote host closed the connection]
<eam> perhaps other nntp clients commonly accept deflate data either with or without the zlib header
Mezjin has joined #ruby
kofione has joined #ruby
towski_ has joined #ruby
<eam> it's not uncommon for some small percentage of implementations to behave slightly differently, and for everyone else to accommodate them
Zai00 has quit [Quit: Zai00]
shadoi has joined #ruby
momomomomo has quit [Quit: momomomomo]
sent1nel has joined #ruby
mikecmpbll has joined #ruby
Mon_Ouie has quit [Ping timeout: 240 seconds]
ixti has joined #ruby
Guest47465 has joined #ruby
<Guest47465> list
Guest47465 has left #ruby [#ruby]
wallerdev has joined #ruby
mjuszczak has quit [Ping timeout: 272 seconds]
EagleDelta has joined #ruby
redlegion_ has joined #ruby
redlegion has quit [Ping timeout: 244 seconds]
gizmore has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
yh has quit [Ping timeout: 246 seconds]
noname1 has quit [Ping timeout: 244 seconds]
allcentury has joined #ruby
wchun has joined #ruby
<mwlang> claw_: I’m just speculating, but I’m thinking there’s a possible boundary issue with the size of the data being returned. perhaps the error’s only occurring when you have an input size that is a multiple of 64 or is not a multiple of 64.
<claw_> mwlang: i works most of time so multiple of 64 theorie might fit
thiagovsk has joined #ruby
<claw_> mwlang: if that happens to be true how could i fix it ?
Soda has quit [Remote host closed the connection]
RegulationD has quit [Remote host closed the connection]
<mwlang> claw_: I’d work on capturing the data so you can examine it offline and then see if that’s the case before trying to figure out how to fix.
<mwlang> I’m just not all that familiar with decompressing the way you’re doing it with Ruby…but I’ve done similar tasks with C and Pascal back in the day.
<claw_> yes i am currently waiting for that data because it happens rarely
<mwlang> and it was a matter of ensuring the buffer sizes were correct.
giuseppesolinas has quit [Quit: Leaving]
ismaelga has joined #ruby
nik_-_ has joined #ruby
Hijiri has quit [Quit: WeeChat 1.0.1]
kraljev11 has quit [Ping timeout: 264 seconds]
Spami has joined #ruby
Spami has quit [Changing host]
Spami has joined #ruby
wchun has quit [Quit: Leaving]
xcesariox has joined #ruby
segfalt_ has joined #ruby
ismaelga has quit [Remote host closed the connection]
peteykun has joined #ruby
fuzzyhorns1 has joined #ruby
mrmargol_ has joined #ruby
segfalt has quit [Ping timeout: 256 seconds]
segfalt_ is now known as segfalt
ismaelga has joined #ruby
ndrei has quit [Ping timeout: 252 seconds]
<fuzzyhorns1> is there any way to pass a ruby option in to an executable? like i want to pass a ruby level option in to rubocop — nonsense?
ki0 has joined #ruby
zlude has joined #ruby
nik_-_ has quit [Remote host closed the connection]
ndrei has joined #ruby
<shevy> you can modify rubocop's behaviour
<zlude> Hello! I want to 'simulate' a browser request using Ruby. Why? Because I need access a page that set some cookies and then access another page that require these cookies, is that possible? someone can help me? thank you!
mrmargolis has quit [Ping timeout: 256 seconds]
<shevy> I am not sure what you mean with an "executable" though
noname1 has joined #ruby
moted has quit [Read error: Connection reset by peer]
failshell has quit []
<mwlang> Is there a good call graph viewer for macs? Something like KCachegrind?
<shevy> zlude it might be doable with mechanize
ghr has quit [Ping timeout: 240 seconds]
<shevy> zlude have a look at the examples; https://github.com/sparklemotion/mechanize
Eiam has joined #ruby
<shevy> there also is some other automatic browser-test thingy... I think. But I don't remember the name
<shevy> the #rubyonrails guys might know the name perhaps
ismaelga has quit [Remote host closed the connection]
<zlude> shevy, thank you bro!
<shevy> these are old examples btw http://mechanize.rubyforge.org/EXAMPLES_rdoc.html
vickleton has joined #ruby
<shevy> not sure if they still work but you can get the idea
<shevy> end.click_button
<shevy> weird API :D
<havenwood> fuzzyhorns1: Do you mean like?: ruby -W2 -S rubocop
moretti has joined #ruby
<wallerdev> yeah mechanize is pretty good if you dont need JS to run
<zlude> shevy, good! thank you.
<havenwood> fuzzyhorns1: If not, say more about what you're trying to do or show some pseudo code.
<wallerdev> otherwise id look at something with phantomjs tbh
<shevy> javascript rules the world
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ki0 has quit [Ping timeout: 276 seconds]
<havenwood> fuzzyhorns1: ruby -S $0 $*
Mon_Ouie has joined #ruby
Mezjin has quit [Remote host closed the connection]
<fuzzyhorns1> havenwood: yeah, i guess actually specifically i want to give jruby a command line arg
goggy has joined #ruby
rdark has quit [Quit: leaving]
Eiam has quit [Ping timeout: 264 seconds]
<fuzzyhorns1> im basically trying to get rubocop to run on nailgun in jruby :d prob should just ask in that channel
Guest1421 has joined #ruby
apurcell has joined #ruby
<fuzzyhorns1> what do W2 and S stand for, btw?
poguez_ has joined #ruby
quazimodo has quit [Ping timeout: 250 seconds]
<havenwood> fuzzyhorns1: "-S Makes Ruby use the PATH environment variable to search for script, unless its name begins with a slash."
<mwlang> nevermind the Kcachegrind…I can produce dot files for graphviz with ruby-prof
<havenwood> fuzzyhorns1: -W turns on verbose warning, level, and -W2 is the same as -w, that is verbose.
ndrei has quit [Ping timeout: 265 seconds]
sshao has joined #ruby
xcesariox has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<havenwood> 0 silence, 1 middling, 2 verbose
ndrei has joined #ruby
sshao has quit [Client Quit]
PhantomSpank has joined #ruby
rbennacer has quit [Remote host closed the connection]
Guest1421 has quit [Ping timeout: 256 seconds]
<havenwood> fuzzyhorns1: JRuby has -S and -W[level] too.
ixti has quit [Ping timeout: 272 seconds]
peteykun has quit [Quit: Leaving]
<fuzzyhorns1> yeah i saw them working :)
<havenwood> \o/
<fuzzyhorns1> is this documented in ruby docs or?
<havenwood> fuzzyhorns1: man ruby
<fuzzyhorns1> cool :)
chrishough has quit [Quit: Textual IRC Client: www.textualapp.com]
einarj has quit [Remote host closed the connection]
<havenwood> fuzzyhorns1: Or, for a shorter list: ruby -h
<havenwood> fuzzyhorns1: Or: jruby -h
xcesariox has joined #ruby
diegoaguilar has quit [Remote host closed the connection]
rbennacer has joined #ruby
wallerdev has quit [Quit: wallerdev]
wallerdev has joined #ruby
<fuzzyhorns1> something like rubocop is an executable itself on the command line
<fuzzyhorns1> so i dont call it `ruby rubocop args` but just `rubocop args`
<fuzzyhorns1> how could i do the first?
pabloh has joined #ruby
<havenwood> fuzzyhorns1: ruby -S rubocop args
lidenskap has joined #ruby
moretti has quit [Remote host closed the connection]
Guest1421 has joined #ruby
lodgenbd has joined #ruby
tonyhb has joined #ruby
flou has quit [Quit: Textual IRC Client: www.textualapp.com]
jsrn has joined #ruby
jenrzzz has joined #ruby
ismaelga has joined #ruby
tjbiddle has quit [Quit: tjbiddle]
vivekananda has joined #ruby
pglombardo has joined #ruby
rbirch has joined #ruby
Zekka has quit [Ping timeout: 240 seconds]
that1guy has quit [Quit: This computer has gone to sleep]
kaspernj has quit [Remote host closed the connection]
ypasmk has quit [Quit: ypasmk]
dcarmich has joined #ruby
Sawbones_ has quit [Remote host closed the connection]
altamic has joined #ruby
ebbflowgo has joined #ruby
serivich has quit [Ping timeout: 240 seconds]
gluten_hell has joined #ruby
slash_nick has quit [Ping timeout: 264 seconds]
Sawbones_ has joined #ruby
ghr has joined #ruby
Rollabunna has quit [Remote host closed the connection]
Rollabunna has joined #ruby
quazimodo has joined #ruby
gazay has quit [Quit: gazay]
musty_ has joined #ruby
jordanm has joined #ruby
thatslifeson has quit [Remote host closed the connection]
Sawbones_ has quit [Remote host closed the connection]
dfinninger has joined #ruby
scripore has quit [Quit: This computer has gone to sleep]
musty has quit [Ping timeout: 252 seconds]
barhum2013 has joined #ruby
scripore has joined #ruby
Igorshp has quit [Remote host closed the connection]
momomomomo has joined #ruby
<shevy> certainty is this making you horny: https://github.com/LuxLang/lux
barhum2013 has quit [Client Quit]
<shevy> "statically-typed Lisp"
ghr has quit [Ping timeout: 272 seconds]
<shevy> fuzzyhorns1 why not define an alias? alias rubocop=path_to_rubocopy; or use a script with a proper shebang, then you don't have to use leading "ruby"
<shevy> alias rubocop='path to rubocop here'
baweaver has joined #ruby
<shevy> hmm it is probably in bin/rubocop so just add it to PATH, and look at the shebang line is correct
scripore has quit [Client Quit]
pabloh has quit [Remote host closed the connection]
Mohan__ has quit [Ping timeout: 256 seconds]
jackjackdripper has quit [Quit: Leaving.]
charliesome has joined #ruby
Mohan has joined #ruby
scripore has joined #ruby
Mohan is now known as Guest56508
swgillespie has joined #ruby
rbirch has quit []
<shevy> is there a way to find out how non-flattened an array is, at max?
scripore has quit [Client Quit]
<shevy> [[['foo','bar']]].flatten_level? # 3
cryptarium has joined #ruby
<shevy> I just inflated one Array from [['foo,bar']] into [[['foo','bar']]] precisely... wonder how I did that
casadei_ has quit [Remote host closed the connection]
<shevy> obviously one new layer I got via .split(',')
<shevy> ohhh .flatten accepts an argument
<picasso> hey y'all, whats the cleanest way to split an array into first, [rest] ?
<adaedra> shift
<adaedra> >> a = [1, 2, 3]; b = a.shift; [a, b]
<ruboto> adaedra # => [[2, 3], 1] (https://eval.in/327796)
<adaedra> shevy: that's a tree problem
<havenwood> picasso: or: a, *b = [1, 2, 3]
<baweaver> >> ary = (1..10).to_a; head, tail = ary.first, ary[1..-1]
<ruboto> baweaver # => [1, [2, 3, 4, 5, 6, 7, 8, 9, 10]] (https://eval.in/327799)
<baweaver> I like havenwoods
Zekka has joined #ruby
<baweaver> Always forget splat can be a leftside op
jackjackdripper has joined #ruby
<shevy> a tree problem
<shevy> beaver, that is your job!
Mon_Ouie has quit [Ping timeout: 256 seconds]
<picasso> do either/both work on an empty array?
<baweaver> >> a, *b = [1, 2, 3]
<ruboto> baweaver # => [1, 2, 3] (https://eval.in/327800)
<adaedra> >> a = []; b = a.shift; [a, b]
<ruboto> adaedra # => [[], nil] (https://eval.in/327801)
<shevy> >> ary = []; ary[1..-1]
<ruboto> shevy # => nil (https://eval.in/327802)
<havenwood> >> head, *tail = []; [head, tail]
<ruboto> havenwood # => [nil, []] (https://eval.in/327803)
<shevy> picasso I guess it'll give you nil back
<picasso> yeah i'd like an empty list in this case
<picasso> both look nice though, tyvm!
<adaedra> baweaver's one is not really good for empty arrays :/
<shevy> but you can check whether your array is empty, via array.empty?
<adaedra> why, if other methods do that directly?
<shevy> beaver's are not good with empty things, they want full trees
<adaedra> one less operaton!
<baweaver> picasso: now the question is why, because tail recursion in ruby isn't going to work well.
<shevy> I don't trust any other methods
<picasso> just for displaying a UI
<havenwood> >> head, *tail = []; [head.to_a, tail]
<ruboto> havenwood # => [[], []] (https://eval.in/327804)
lavros has quit [Ping timeout: 244 seconds]
ponga has quit [Quit: Leaving...]
<baweaver> making sure, sometimes Haskell types get happy with it and blow the stack.
<jhass> worth noting, .shift modifies the array, *splat creates a new one
<picasso> nah, not algorithm code
<adaedra> yeah, shift is really meant to get the tail, but it modifies the array
cgrieger is now known as cgrieger^away
<gambl0re> i need help again..
<baweaver> Draft version of a new article out (Rails stuff) if anyone would be interested in taking a look: https://gist.github.com/baweaver/b74a1f6c485a8e8666b1
<jhass> ?gist-usage gambl0re
<ruboto> https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
<gambl0re> i dont understand how this code converts "bridge over the river kwai" into Bridge over the River Kwai
Deele2 has joined #ruby
<gambl0re> and War and Peace
<jhass> mh, didn't I create one that explains syntax highlighting etc specifically?
<eam> gambl0re: what part is confusing to you?
lavros has joined #ruby
RegulationD has joined #ruby
<gambl0re> the if statement
someguy has joined #ruby
<adaedra> >> def deep(a); a.is_a?(Array) ? a.map { |e| deep(e) }.max + 1: 0; end; deep([1, [2, [3, 4]]])
<baweaver> >> [1,2,3].include?(1)
<ruboto> adaedra # => 3 (https://eval.in/327810)
<gambl0re> if %w(the and over).include?(word)
<gambl0re> word
<gambl0re> else
<gambl0re> end
<gambl0re> word.capitalize
<ruboto> baweaver # => true (https://eval.in/327811)
<adaedra> shevy ^
Deele has quit [Ping timeout: 256 seconds]
<eam> gambl0re: in ruby, conditionals return values
someguy has quit [Client Quit]
<jhass> gambl0re: do you know waht %w(the and over) is?
<baweaver> Also, avoid pasting more than a single line into IRC
<baweaver> >> %w(one two three)
<ruboto> baweaver # => ["one", "two", "three"] (https://eval.in/327816)
<eam> >> if true; 99; else 88; end
<ruboto> eam # => 99 (https://eval.in/327818)
<gambl0re> ["the","and","over"]
<baweaver> >> ["the","and","over"].include? 'and'
<ruboto> baweaver # => true (https://eval.in/327838)
<al2o3-cr> >> class Object; def level; self.class == Array ? 1 + self[0].level : 0; end; end; [[[[[[:foo]]]]]].level
<ruboto> al2o3-cr # => 6 (https://eval.in/327843)
<gambl0re> i dont dont under stand this ===> if %w(the and over).include?(word)
<jhass> gambl0re: let's do something called rubber ducking, explain to us what you think the code does (and everybody else remains silent for a moment)
<baweaver> >> if ["the","and","over"].include?('and') then :true else :false end
<ruboto> baweaver # => :true (https://eval.in/327846)
<jhass> try to come up with what it could mean
<gambl0re> ok...i want to pass ("bridge over the river kwai") to the function..
<jhass> check, works
<gambl0re> bridge over the river kwai the goes through split returning each word into its own array element?
claw has joined #ruby
<gambl0re> correct?
<jhass> yes
towski_ has quit [Remote host closed the connection]
claw_ has quit [Ping timeout: 272 seconds]
<gambl0re> and then it goes to map which then does the block of code..
ramfjord has quit [Ping timeout: 265 seconds]
<jhass> let's proceed line by line
<jhass> we're in line 3 now
<jhass> what's word here, what do you think it could do?
<gambl0re> if %w(the and over).include?(word) ---> if ["the" "and" "over"] includes the word from the parameter then do the next line of code
<gambl0re> so "and" matches
<gambl0re> i mean "over" and "the"
<gambl0re> bridge over the river kwai
<gambl0re> bridge over the river kwai = (word) parameter
<gambl0re> then it returns (word) parameter
<jhass> gambl0re: right, let's go through it with t he example
<gambl0re> i dont understand that part
<jhass> word = "bridge"
<jhass> what does happen?
<gambl0re> goes to else
juanpablo___ has joined #ruby
rrichardsr3 has quit [Quit: Textual IRC Client: www.textualapp.com]
Guest1421 has quit [Ping timeout: 252 seconds]
<normalra> Hello! Is there some syntactic sugar for passing down all arguments like Lua does: `function test(...) another_function(...) end`?
<baweaver> normalra: *args
momomomomo has quit [Quit: momomomomo]
<jhass> gambl0re: right, so do you know what map does?
<normalra> bebijlya: that's something like `def test(*args) another_function(*args) end`?
<gambl0re> so if the if statement is check each element array....."the" "and" "over" include? [bridge,over,the,river,kwai]?
<normalra> bebijlya: whops, meant baweaver :D
hs366 has joined #ruby
<baweaver> >> def b(*args) args.reduce(:+) end; def a(*args) b(args) end; a(1,2,3,4)
<ruboto> baweaver # => [1, 2, 3, 4] (https://eval.in/327853)
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<baweaver> >> def b(*args) args.reduce(:+) end; def a(*args) b(*args) end; a(1,2,3,4)
<ruboto> baweaver # => 10 (https://eval.in/327854)
<gambl0re> bridge, river and kwai does not match so they go to the else statement?
<baweaver> there it is
jefus has quit [Read error: Connection reset by peer]
mjuszczak has joined #ruby
eichenwald has joined #ruby
juanpablo__ has quit [Ping timeout: 240 seconds]
<gambl0re> and then those words get capitalized?
<normalra> baweaver: interesting, thank you!
jefus has joined #ruby
<jhass> gambl0re: right
<baweaver> no problem mate. You can do the same with kw_args like args = {}
ki0 has joined #ruby
m8 has joined #ruby
momomomomo has joined #ruby
<jhass> gambl0re: I think the missing piece of the puzzle for you is map
malcolmva has joined #ruby
momomomomo has quit [Client Quit]
<jhass> >> [1, 2, 3].map {|i| i * 2 }
<ruboto> jhass # => [2, 4, 6] (https://eval.in/327855)
<jhass> as you can see map returns a new array, with the return values of the block
<dudedudeman> (this has been cool to watch, how you guys walked through that with gambl0re)
quimrstorres has quit [Remote host closed the connection]
quimrstorres has joined #ruby
x1337807x has joined #ruby
x1337807x has quit [Client Quit]
<baweaver> gambl0re: http://ruby-doc.org/core-2.2.2/Enumerable.html - This is your best friend when starting to get into Ruby. Explains map among other things.
ndrei has quit [Ping timeout: 244 seconds]
<shevy> adaedra let's make babies
f3lp has quit [Ping timeout: 255 seconds]
<adaedra> o_O
<adaedra> this is getting weird
<baweaver> shevy: Well that was direct
<dudedudeman> and from left field, we have shevy
<shevy> haha
<shevy> but your nick has dude twice man
scripore has joined #ruby
scripore has quit [Client Quit]
<dudedudeman> don't change the subject on me mister
<shevy> we have a beaver and a dudette
joelataylor has joined #ruby
<dudedudeman> who's the dudette!?
ki0 has quit [Ping timeout: 264 seconds]
<shevy> why do you have double dude there
blackmesa has quit [Ping timeout: 272 seconds]
loechel has quit [Ping timeout: 256 seconds]
<dudedudeman> because i can't use dude... dude.... man... come on... as a user name
bigmac has quit [Ping timeout: 272 seconds]
<dudedudeman> :P
<gambl0re> i could never understand the ruby-docs. they use a simple concept and put in a very confusing example.
lavros has quit [Quit: leaving]
musty_ has quit [Quit: leaving]
jottr has joined #ruby
<baweaver> Really? They're a lot better than some other docs
DerisiveLogic has joined #ruby
quimrstorres has quit [Remote host closed the connection]
<shevy> gambl0re yeah. I ended up collecting documentation on my own - in german though
<gambl0re> what about the "david copperfield" example?
<jhass> gambl0re: IME it helps a lot to play around with it, do you have irb or pry locally?
<gambl0re> i have irb
moretti has joined #ruby
<jhass> ?pry
<ruboto> Pry, the better IRB. Includes easy object inspection via `ls`, `history`, docs view with `?`, source view with `$` and syntax highlighting, among other features (see `help` for more). It can also be used for easy debugging by putting ’binding.pry’ directy in your source code. Visit https://pryrepl.org/ or get it now with gem install pry pry-doc
<shevy> \o/
qwertme has joined #ruby
<shevy> now you can test stuff!
<baweaver> Rails docs are a step up, ala Radar
<shevy> I guess so
<shevy> rails will become the new ruby eventually
jaygen has quit []
moretti has quit [Remote host closed the connection]
moretti_ has joined #ruby
swgillespie has joined #ruby
<gambl0re> david copperfield does not match "the" "and" "over" so it passes to else statement
<gambl0re> word.capitalize
lessless has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<gambl0re> word.capitlize = David Copperfield ?
fuzzyhorns1 has left #ruby [#ruby]
<gambl0re> and i assume it would be the same for "jaws"
baweaver has quit [Remote host closed the connection]
<gambl0re> if its thats the case then line 14-15 for?
<GaryOak_> word.disappear == David Copperfield!!!
dcarmich has quit [Quit: Textual IRC Client: www.textualapp.com]
huddy has quit [Quit: Connection closed for inactivity]
<GaryOak_> audience.gasp && audience.applause
dfinninger has quit [Remote host closed the connection]
<Peetooshock> NoMethodError
swgillespie has quit [Client Quit]
postmodern has joined #ruby
<dudedudeman> i have a field which writes to my database as a boolean, but i want the user to only be able to input yes or no as options, not type out true or false. i've attempted to type out a method for this, but i'm apparently doing it wrong.. is there a better way to do this?
RegulationD has quit [Ping timeout: 272 seconds]
<jhass> gambl0re: s is "david copperfield", so what's s.split ?
<gambl0re> i removed lines 14-15 and it still passed the test..
ndrei has joined #ruby
<adaedra> GaryOak_: I laughed
Mon_Ouie has joined #ruby
<shevy> gambl0re remember = vs. ==
<GaryOak_> adaedra: I'm glad someone got it ;)
Guest1421 has joined #ruby
jobewan has joined #ruby
<gambl0re> i think we all know who david copperfield is..
<shevy> p0rnstar
tonyhb has quit [Quit: peace]
<shevy> or a trickster
<shevy> a PICKPOCKET
<shevy> he stole an airplane once
<gambl0re> ["david","copperfield]
<shevy> that is not valid syntax!
RegulationD has joined #ruby
<jhass> gambl0re: so what's word?
<gambl0re> it doesnt match the first if statement. passed on to else and gets capitalized..
<gambl0re> word is "david" and "copperfield"
psy_ has quit [Read error: Connection reset by peer]
<jhass> and what's the result of the .map call?
surs has quit [Ping timeout: 244 seconds]
<shevy> :)
psy_ has joined #ruby
<shevy> .map is a super convenient method gambl0re
<gambl0re> i dont know...
<shevy> you can check live in irb
<shevy> if you are on linux, just have one irb session running all the time
kiki_lamb has quit [Ping timeout: 272 seconds]
<gambl0re> im on windows with linux vm
<shevy> awww :(
ramfjord has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
towski_ has joined #ruby
<gambl0re> what is the result of the .map?
kiki_lamb has joined #ruby
yfeldblum has joined #ruby
<shevy> .map should yield you back a modified array
<shevy> either the normal word (unchanged), or upcased, in your example
Dopagod has quit [Ping timeout: 255 seconds]
<gambl0re> it should be David Copperfield..
<shevy> you can add "debug" statements to keep track what happens
<jhass> gambl0re: try to use a valid Ruby literal
<jhass> "foo", ["foo", "bar"], 123
<jhass> David Copperfield is not a valid Ruby literal
<shevy> something is strange with your code
<gambl0re> ["david","coppefield"].collect
<shevy> I can not even get it to run
<gambl0re> you mean?
<al2o3-cr> >> "#comment\n#comment\n#comment\nthis is code\nthis is code\n#another comment".each_line{ |l| puts l unless l =~ /^#/ .. l =~ /^#/; end
<ruboto> al2o3-cr # => /tmp/execpad-ee2d819ee9e0/source-ee2d819ee9e0:2: syntax error, unexpected keyword_end, expecting '}' ...check link for more (https://eval.in/327885)
<al2o3-cr> >> "#comment\n#comment\n#comment\nthis is code\nthis is code\n#another comment".each_line{ |l| puts l unless l =~ /^#/ .. l =~ /^#/ }
<ruboto> al2o3-cr # => this is code ...check link for more (https://eval.in/327886)
<jhass> gambl0re: .collect is an alias for .map
<al2o3-cr> would this ever be used?
<jhass> gambl0re: and you should say what the result of the map call is, not the input
<gambl0re> i know..if you look at the code....and see the arguments being passed is line 14-15 necessary?
_blizzy_ has joined #ruby
<gambl0re> i ran the code without lines 14-15 and still worked
jobewan has quit [Quit: leaving]
<shevy> >> ['david','copperfield'].map(&:upcase)
<ruboto> shevy # => ["DAVID", "COPPERFIELD"] (https://eval.in/327887)
<jhass> well, 14 and 15 are test inputs, what do you mean it still worked?
<shevy> oops, should have been .capitalize
cmckee has joined #ruby
TheHodge has quit [Quit: Connection closed for inactivity]
<gambl0re> it still passed the test script..
jobewan has joined #ruby
<jhass> well, I guess then the test script is poor ;)
<jhass> I'm not sure how that's relevant to understanding the code though :)
workmad3 has quit [Ping timeout: 264 seconds]
<gambl0re> it's not relevant...i just wanted to point it out.
<gambl0re> i know ['david','copperfield'].map(&:upcase)
<shevy> \o/
jobewan has quit [Client Quit]
yqt has joined #ruby
<gambl0re> what im confused is. if i do x=["hi","bye"] and then do x.capitalize it doesnt work
<shevy> yeah
<shevy> you apply .map as in "on each element" of your array
<gambl0re> but if i do x.map(&:capitalize) it works
<shevy> yeah because you invoke the method .map() there
<gambl0re> shouldnt x.capitalize assume i want to capitalize each element??
<shevy> >> array = Array.new; array.capitalize
<ruboto> shevy # => undefined method `capitalize' for []:Array (NoMethodError) ...check link for more (https://eval.in/327918)
<al2o3-cr> >> [*'a'..'z'].select.with_index(1) {|e,i| "#{i}\t#{e}" if i == 10 .. i == 17 }
<ruboto> al2o3-cr # => ["j", "k", "l", "m", "n", "o", "p", "q"] (https://eval.in/327919)
<shevy> but the method does not exist gambl0re
jobewan has joined #ruby
<shevy> not sure why it does not exist, but this is by default
thatslifeson has joined #ruby
<al2o3-cr> thats not right :/
<gambl0re> capitalize is a method and i want to apply it to the elements in an array so x.capitalize should work according to my logic.
<shevy> should all methods work by logic?
<shevy> we could have thousand methods
<gambl0re> programming = logic so why not.
<al2o3-cr> programming = logic + common sense :)
<gambl0re> so if i want to change an array element such as capitalize i have to use a .map/.collect so it can select EACH one?
<shevy> >> class Array; def capitalize; self.map(&:capitalize); end; end; x = Array.new(['a','b','c']); x.capitalize
<ruboto> shevy # => ["A", "B", "C"] (https://eval.in/327922)
<shevy> gambl0re ^^^ now your arrays have the method called .capitalize
mdw has joined #ruby
yh has joined #ruby
cmckee has quit [Quit: cmckee]
<shevy> you can modify everything in ruby
charliesome has quit [Quit: zzz]
<shevy> almost at least
<gambl0re> .capitalize is not a method?
<gambl0re> on its own?
<shevy> it is a method on class String
<shevy> not class Array
<gambl0re> oh i see...
<shevy> I do not know why not; you can ask the core devs at bugs.ruby-lang.org/projects/ruby-trunk if you think there should be, you can propose there
<gambl0re> so if i did "asdf asdfasdf asdfas".capitalize it would wokr.
<jhass> gambl0re: [1, true, nil].capitalize what would that return?
<shevy> I think they try to not have too many methods and settle mostly for more common ones
uri_ has quit [Ping timeout: 256 seconds]
<adaedra> >> "asdf asdfasdf asdfas".capitalize
<ruboto> adaedra # => "Asdf asdfasdf asdfas" (https://eval.in/327925)
<shevy> the above would return: [1, true, nil]
<al2o3-cr> >> String.instance_methods.include? :capitalize
<ruboto> al2o3-cr # => true (https://eval.in/327926)
<shevy> gambl0re yeah it worked, you can use the bot here too via leading >>
<gambl0re> jhass it woul give error message...
<gambl0re> because you're calling capitalze on array class.
<shevy> >> [1, true, nil].map &:capitalize
<ruboto> shevy # => undefined method `capitalize' for 1:Fixnum (NoMethodError) ...check link for more (https://eval.in/327927)
<jhass> gambl0re: I mean according to your logic
<shevy> you are right, there is an error ;)
dfinninger has joined #ruby
<gambl0re> what if i did ["hi","bob"].to_s.capitalize
<shevy> use >>
<shevy> >> ["hi","bob"].to_s.capitalize
<ruboto> shevy # => "[\"hi\", \"bob\"]" (https://eval.in/327928)
<shevy> ugly
<gambl0re> or what if i did ["hi","bob"].join(' ').capitalize
<shevy> [ is obviously the first char there
<havenwood> >> class Array; def method_missing meth, *args, &block; self.map { |i| i.public_send meth, *args, &block } end end; ['hi', 'bob'].capitalize
<ruboto> havenwood # => ["Hi", "Bob"] (https://eval.in/327929)
<gambl0re> >>["hi","bob"].join(' ').capitalize
<ruboto> gambl0re # => "Hi bob" (https://eval.in/327930)
<shevy> then you have a string gambl0re
<jhass> gambl0re: try, you got irb!
<shevy> and on strings it works
<gambl0re> it worked...
<shevy> you can also turn a string back into an array
jackjackdripper has quit [Quit: Leaving.]
<shevy> via .split
<shevy> >> ["hi","bob"].join(' ').capitalize.split(' ')
<dudedudeman> >> ["david", "copperfield"].join(' ').capitalize
<ruboto> shevy # => ["Hi", "bob"] (https://eval.in/327933)
<ruboto> dudedudeman # => "David copperfield" (https://eval.in/327933)
<shevy> ok, capitalize works only on the first character
<dudedudeman> would a ! make it for all items in the list?
<shevy> so you'd have to use map to capitalize all of them
<dudedudeman> array*
<shevy> what is with the ! there
<shevy> usually ! means modify-in-place
<shevy> >> x = 'abc'; x.delete! 'b'; x # <--- we obtain x again
<ruboto> shevy # => "ac" (https://eval.in/327934)
<gambl0re> it overwrites?
<shevy> and the ! methods are usually faster
<shevy> I used to do: x = x.delete 'b' in the above
<dudedudeman> >> ["david", "copper"].map(' ').capitalize
<ruboto> dudedudeman # => wrong number of arguments (1 for 0) (ArgumentError) ...check link for more (https://eval.in/327935)
jenrzzz has joined #ruby
<shevy> gambl0re sorta; it remains the same object, with the same object_id though
ghr has joined #ruby
<shevy> if you do: x = x.bla you end up with a new object
<shevy> you can check by calling .object_id
<gambl0re> variable x being the object?
Hirzu has joined #ruby
<shevy> yeah
<shevy> it's short to type
<shevy> :)
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<yxhuvud> al2o3-cr:
<yxhuvud> >> ('a'..'z').select{|x| true if x == 'j' .. x == 'q' }
<ruboto> yxhuvud # => ["j", "k", "l", "m", "n", "o", "p", "q"] (https://eval.in/327937)
<shevy> ruby will turn you into a very lazy programmer; if you use java, you have a lot more to write
kofione has quit [Quit: Leaving...]
<gambl0re> people say ruby is happy programming or something like that..
<shevy> ruby is quite nice because it is flexible
<gambl0re> i thought it would be easy to learn...
<shevy> there is more than one way to spank a monkey
<shevy> well it depends
<shevy> stick to simple things!
<gambl0re> i understand javascript easier..
<shevy> strings and array you already understand
<dudedudeman> shevy: i'm stealling that and putting it in my project quotes
<shevy> javascript is super similar; it has methods too right? ruby has methods too
jobewan has quit [Quit: leaving]
<gambl0re> but they use different names that confuses me
<shevy> ruby is bigger than javascript though
<shevy> you can define all methods you want to use in ruby just fine
<shevy> look at the above example I gave to modify: class Array
jobewan has joined #ruby
<gambl0re> in ruby why is it elsif?? i spent like an hour trying to figure what was wrong.
<shevy> you can do that for EVERY class in ruby at runtime, all the time, wh enever you wanna do
<shevy> dunno, you'd have to ask matz
<shevy> I guess he liked it
<jhass> gambl0re: else if
<yxhuvud> gambl0re: use an editor with proper syntax highlighting.
cgrieger^away is now known as cgrieger
<shevy> ruby people love brevity
dawkirst has joined #ruby
<dudedudeman> ?brevity
<ruboto> I don't know anything about brevity
NinjaOps has quit [Quit: Konversation terminated!]
<shevy> ruboto is an alien
<gambl0re> i was doing it on online tutorial and they didn have the special editor stuff..
altamic has quit [Quit: altamic]
<jhass> gambl0re: without parens (both, () and {}) else if is ambiguous
Hirzu_ has quit [Ping timeout: 250 seconds]
jobewan has quit [Client Quit]
<shevy> gambl0re well ok, ruby syntax is more flexible than javascript I guess
<shevy> the parser has to handle more cases
<shevy> you can use () or omit them in ruby; in javascript, I think you must use them?
ghr has quit [Ping timeout: 264 seconds]
<xxneolithicxx> i dont think ive ever had a need for else if in ruby given it has case statements
<gambl0re> you have to use () in javascript...i stil use them in ruby
<xxneolithicxx> rarer than in other languages
scripore has joined #ruby
ferr has joined #ruby
scripore has quit [Remote host closed the connection]
<jhass> gambl0re: we had that discussion over at Crystal recently https://github.com/manastech/crystal/issues/528
joshs has joined #ruby
ndrei has quit [Ping timeout: 276 seconds]
joshs has quit [Client Quit]
<shevy> good
<shevy> perhaps crystal will become the simpler ruby
<shevy> gambl0re how did you come to pick ruby by the way?
Igorshp has joined #ruby
<jhass> shevy: doubt it ;)
ramfjord has quit [Ping timeout: 240 seconds]
<gambl0re> im trying to learn web development....i had already learned html/css. learned some javascript/jquery for front end then chose ruby as backend
scripore has joined #ruby
Motoservo has joined #ruby
scripore has quit [Client Quit]
<gambl0re> i didnt choose...the course chose it for me..
<jhass> shevy: though Matz seems to watch it :D
<gambl0re> and im worried that what im learning now wont be relevant in the next 10 years or so..
casadei_ has joined #ruby
<gambl0re> and ill have to relearn a whole new programming language.
<dudedudeman> are you working on the Cyrstal project, jhass?
<jhass> gambl0re: at this stage you're learning programming
jackjackdripper has joined #ruby
<jhass> gambl0re: the language is just the tool, the skill is easily transferred to others
<gambl0re> yea cant you tell by the questions im asking..
<shevy> jhass really? how do you know?
<al2o3-cr> yxhuvud: yeah i was just wondering what use case a flip flop op would have in day to day coding :)
<shevy> gambl0re well what other language would you want to pick? php? python?
<jhass> dudedudeman: mh, more as evangelist I guess ;P
<gambl0re> i keep reading php is dieing and has security flaws..
<dudedudeman> jhass: ha, i support it. i've been lurking along with it, over on reddit as well
scripore has joined #ruby
scripore has quit [Client Quit]
jack_rabbit has joined #ruby
<shevy> well there is python then
<shevy> you could use django
<gambl0re> and a lot of these coding bootcamps are teaching ruby/rails so i thought i should learn it.
lodgenbd has quit [Quit: Leaving]
<gambl0re> and like i said ruby was supposed to be "easy" to learn..
<dudedudeman> gambl0re: you're very much where i was a year or two ago. i had learned html/css and was looking for a scripting language to go along with it, and i started touching python
<dudedudeman> gambl0re: but what I realized, is that i was focusing on learning a syntax, rather than the actual logic and patterns that would lead me to using that syntax in the first place
<shevy> ruby is quite big as a whole
ndrei has joined #ruby
swgillespie has joined #ruby
<jhass> gambl0re: don't worry, ruby is fine to teach you programming, other languages won't make it easier, once you can work with Ruby it'll be a lot easier to pick up other languages
yokel has quit [Ping timeout: 272 seconds]
<shevy> jhass haha matz announced crystal?!
<jhass> shevy: well, shared the release blogpost ;)
<jhass> we also have his permission to copy paste documentation :D
jobewan has joined #ruby
<gambl0re> well im hoping to learn enough about ruby/rails in 3 months combined with my html/css,javascript skills to get a entry level job
ferr has quit [Quit: WeeChat 1.1.1]
<gambl0re> i dont know if thats realistic or not but who knows..
sohrab has quit [Ping timeout: 272 seconds]
casadei_ has quit [Ping timeout: 264 seconds]
yokel has joined #ruby
<jhass> gambl0re: it depends on the person tbh, some can do it in 3 months, some take more time
<gambl0re> dudeman are you web developer?
Hirzu has quit [Remote host closed the connection]
lidenskap has quit [Remote host closed the connection]
<jhass> there's no general rule
<dudedudeman> gambl0re: it is of my opinion that if you're going to gun for a job that quickly, then you might want to just focus on the html/css/javascript side of things, get the postiion, then keep learning/implementing ruby until you are extremely comfortable with it
Matthews_ has quit [Remote host closed the connection]
quimrstorres has joined #ruby
<dudedudeman> gambl0re: yes? i have a few freelance clients that i've coded for on top of a template, and then i have my projects which i've been using to learn. those projects are going ot be what i hope get my first entry level job
<gambl0re> this is what im currently doing...http://www.theodinproject.com/courses?ref=homenav
<dudedudeman> oh! the odin project is great!
<gambl0re> if you take a look you'll see that theres crap loads of ruby...
<gambl0re> have you done it?
<dudedudeman> i've gone through a good chunk of it
<gambl0re> how far are you?
<dudedudeman> let me log in and check
casadei_ has joined #ruby
freerobby has quit [Quit: Leaving.]
ndrei has quit [Ping timeout: 240 seconds]
cryptarium has quit [Ping timeout: 272 seconds]
<dudedudeman> well, i was using that as a guide, but learned a bit of out of order
tonyhb has joined #ruby
Guest1421 has quit [Ping timeout: 240 seconds]
<dudedudeman> i 'learned' html5, css, basic javascript and jquery before doing any ruby
claw has quit [Ping timeout: 264 seconds]
<dudedudeman> and a lot of the ruby i know now would pass for what this course has you learning
<dudedudeman> if that makes sense
cryptarium has joined #ruby
claw has joined #ruby
quimrstorres has quit [Ping timeout: 255 seconds]
Zekka has quit [Ping timeout: 255 seconds]
<gambl0re> are you sure? you should take a look at some of the stuff they want you to do.
<gambl0re> some of the ruby assignments are hard..
<dudedudeman> yeah but they're not meant to be hard enough to impede your learning advancement
moretti_ has quit [Remote host closed the connection]
<dudedudeman> don't let yourself get stuck on one for a week. if you need to move on, refresh your mind, and then come back, do it
Guest1421 has joined #ruby
<gambl0re> yea but i hate it when i cant understand a certain concept but sometimes its better to continue on and later things click.
<dudedudeman> are you ingesting any other learning resources aside from the odin project?
yoni has joined #ruby
<gambl0re> irc...and google.
yoni is now known as Guest56726
<gambl0re> codecademy, codeschool and any other free lessons i can fidn online.
Sawbones_ has joined #ruby
Altonymous has joined #ruby
<dudedudeman> ah. word. i found for me, this is just my personal experience, that sometimes stepping away from the exact project/lesson i'm working on, and ingesting something similar but presented in an entirely different way, was really helpful
<dudedudeman> for instance, listening to the ruby rogues podcast. i started hearing all these terms and buzzwords that seemingly everyone already knew, and i was like, wait... i need ot go look those up
Parker0 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<dudedudeman> so i would, and i would start finding things that i had been learning about codecademy or codeschool and it would start tying together
jamesaxl has joined #ruby
<jamesaxl> hi
<jamesaxl> could i convert script ruby to binary ?
<shevy> huh
<shevy> ruby is textfiles no?
<shevy> puts 'hello world'
terlar has quit [Ping timeout: 256 seconds]
<dudedudeman> >> puts 'hello shevy'
<ruboto> dudedudeman # => hello shevy ...check link for more (https://eval.in/328004)
<shevy> gambl0re yeah that would be my advice in ruby - keep it as simple as possible. ignore any concept that you don't need for now, make your life as simple as possible - minimal ruby
Hirzu has joined #ruby
ixti has joined #ruby
slash_nick has joined #ruby
<shevy> you could use ruby just like javascript really
<gambl0re> ok!!
<dudedudeman> gambl0re: do you like reading books? the prag prog guide to programming ruby is really good
<shevy> ruby has Structs and OpenStruct too, so you can have objects at runtime where you can at-will add new methods and have query methods and setter methods to them
<shevy> I guess these would be similar to the javascript objects
scripore has joined #ruby
scripore has quit [Client Quit]
<shevy> gambl0re here is an example: http://blog.rubybestpractices.com/posts/rklemme/017-Struct.html don't read the text, just look at the examples and see if you can infer what happens there. should be easy
Zai00 has joined #ruby
kofione has joined #ruby
<shevy> ok that was not a good example
<shevy> let me find a better one ;)
<shevy> yeah
<gambl0re> i hate programming books....i've tried a few and i fall asleep withing 5 minutes
<shevy> I think this is better
<shevy> class Point < Struct.new(:x, :y)
<shevy> ^^^ subclassing from a Struct object there
<shevy> origin = Point.new(0,0)
<shevy> ^^^ initialize a new instance from class Point; the 0,0 will become values x, and y
<shevy> and origin.x and origin.y should work for free
<shevy> as methods
<shevy> is not that difficult or?
<aewffwea> shevy: I wouldn't do that
Guest1421 has quit [Ping timeout: 256 seconds]
<gambl0re> but do you guys think ruby will stil be relevant in 10 years or so?
<aewffwea> gambl0re: what?
icarus_ has joined #ruby
<shevy> gambl0re as long as people keep on using it - sure
<gambl0re> will companies still be using ruby?
<shevy> dunno
<shevy> they tend to use more than one programming language when they become bigger
Matachines has joined #ruby
<shevy> like... twitter I think. was written in ruby at one point mostly right? then moved to... java or so
icarus_ has quit [Client Quit]
<GaryOak_> python is like 15 years old now
<_blizzy_> Twitter uses Scala now
<_blizzy_> btw, Scala is pretty cool imo.
<_blizzy_> also, anyone know a good sandbox gem for running evals and stuff
<_blizzy_> like how some channels have "#{language}bot" that can eval.
ndrei has joined #ruby
<shevy> gambl0re see? they will have many languages
<dudedudeman> like our very own ruboto!
<shevy> is the source code of ruboto available
Sawbones_ has quit [Remote host closed the connection]
frem has quit [Quit: Connection closed for inactivity]
<_blizzy_> yeah, I need a sandbox for ruby for 2 bots of mine.
<dudedudeman> not sure, but i know my mom's source code is available, shevy
scripore has joined #ruby
scripore has quit [Client Quit]
<shevy> your mom is bugged
that1guy has joined #ruby
A205B064 has joined #ruby
kirun has joined #ruby
<dudedudeman> you're not wrong
<_blizzy_> so
<shevy> eh I don't know your mom, I never peeked at her source code
<shevy> dudedudeman I think we bring the channel's intellectual level down together
Sawbones_ has joined #ruby
<dudedudeman> shevy: you're probably right.... there is quite hte amount of knowledge here. none of it mine, but still
<shevy> yeah, individuals hold a lot of knowledge
<shevy> like havenwood
<shevy> and if you want crazy syntax that works, you can ask hanmac
<shevy> and if you want crystal code you can ask jhass
My_Hearing has joined #ruby
My_Hearing has joined #ruby
<dudedudeman> weaksauce: got me going with a couple of things a few weeks ago when i first joined
Mon_Ouie has quit [Disconnected by services]
My_Hearing is now known as Mon_Ouie
gluten_hell has quit [Read error: Connection reset by peer]
gluten_hell_ has joined #ruby
<dudedudeman> shoot, you all have
Soda has joined #ruby
<dudedudeman> i have my local user group meetup tonight. i'm pretty stoked about that
<_blizzy_> well, I'll search rubygems
<_blizzy_> also, there should be a SU character named Ruby.
Matachines has quit [Read error: Connection reset by peer]
Matachines has joined #ruby
gluten_hell_ has quit [Client Quit]
Igorshp has quit [Remote host closed the connection]
gluten_hell_ has joined #ruby
casadei_ has quit [Remote host closed the connection]
that1guy has quit [Quit: This computer has gone to sleep]
Igorshp has joined #ruby
casadei_ has joined #ruby
that1guy has joined #ruby
mjuszczak has quit []
segfalt has quit [Quit: segfalt]
scripore has joined #ruby
gluten_hell_ has quit [Ping timeout: 256 seconds]
laurentide has quit [Quit: Leaving]
segfalt has joined #ruby
lidenskap has joined #ruby
scripore has quit [Ping timeout: 246 seconds]
Guest1421 has joined #ruby
that1guy has quit [Quit: This computer has gone to sleep]
revoohc has joined #ruby
casadei_ has quit [Remote host closed the connection]
Perdomo_ has joined #ruby
frem has joined #ruby
dseitz has joined #ruby
marius has quit [Ping timeout: 264 seconds]
Hirzu has quit [Remote host closed the connection]
Hijiri has joined #ruby
Perdomo has quit [Ping timeout: 276 seconds]
ghr has joined #ruby
umgrosscol has quit [Remote host closed the connection]
Guest56508 has quit [Ping timeout: 246 seconds]
blackmesa has joined #ruby
scripore has joined #ruby
_djbkd has quit [Remote host closed the connection]
kromm has joined #ruby
kromm has left #ruby [#ruby]
segfalt has quit [Quit: segfalt]
Mohan has joined #ruby
_djbkd has joined #ruby
Mohan is now known as Guest26504
duderonomy has quit [Ping timeout: 276 seconds]
scripore has quit [Client Quit]
ghr has quit [Ping timeout: 245 seconds]
mengu has joined #ruby
_djbkd has quit [Remote host closed the connection]
luksaur has quit [Ping timeout: 265 seconds]
pragmatism has joined #ruby
duncannz has joined #ruby
mjuszczak has joined #ruby
ramfjord has joined #ruby
that1guy has joined #ruby
weaksauce has quit [Ping timeout: 265 seconds]
rhllor has quit [Read error: Connection reset by peer]
chipotles has joined #ruby
casadei_ has joined #ruby
rhllor has joined #ruby
cryptarium has quit [Ping timeout: 264 seconds]
ismaelga has quit [Remote host closed the connection]
pwattste has quit [Quit: Textual IRC Client: www.textualapp.com]
ghr has joined #ruby
zarubin has joined #ruby
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
scripore has joined #ruby
_ixti_ has joined #ruby
pglombardo has quit []
yfeldblum has quit [Remote host closed the connection]
baweaver has joined #ruby
chipotles has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ixti has quit [Ping timeout: 240 seconds]
asmodlol has quit [Ping timeout: 264 seconds]
mdw has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
yfeldblum has joined #ruby
pragmatism has quit [Quit: Textual IRC Client: www.textualapp.com]
redlegion_ is now known as redlegion
luksaur has joined #ruby
casadei_ has quit [Remote host closed the connection]
asmodlol has joined #ruby
<dudedudeman> in an if/elsif/else statement, does the order of events matter?
<dudedudeman> i'm assuming that ruby walks down the tree and goes, alright if not this, then that then this over here
chipotles has joined #ruby
<dudedudeman> ah, nvm. i should have tested that out before asking. :)
<dudedudeman> don't mind me....
<Oka> TIAS, a classic tactic.
* dudedudeman whistles away quietly...
<dudedudeman> TIAS... google tells me that's a transient ischemic attack
<Oka> Try It And See :)
<dudedudeman> ah
<baweaver> >> a = -> { false }; b = -> { p 'foo' }; a && b
<ruboto> baweaver # => #<Proc:0x41d27f6c@/tmp/execpad-5fc07ce0fb00/source-5fc07ce0fb00:2 (lambda)> (https://eval.in/328106)
<dudedudeman> would we just call that an order of operations in ruby?
dawkirst has quit [Quit: Leaving...]
<baweaver> >> a = -> { false }; b = -> { p 'foo' }; a[] && b[]
cryptarium has joined #ruby
<ruboto> baweaver # => false (https://eval.in/328109)
RegulationD has quit [Read error: Connection reset by peer]
<baweaver> short circuit
<baweaver> >> a = nil; a ||= 5; a
<ruboto> baweaver # => 5 (https://eval.in/328112)
<baweaver> >> a = 4; a ||= 5; a
<ruboto> baweaver # => 4 (https://eval.in/328113)
RegulationD has joined #ruby
<baweaver> >> a = nil; a = a || 5; a
<ruboto> baweaver # => 5 (https://eval.in/328114)
Zekka has joined #ruby
diegoviola has quit [Quit: WeeChat 1.1.1]
_djbkd has joined #ruby
tuelz has quit [Ping timeout: 272 seconds]
allcentury has quit [Ping timeout: 264 seconds]
Sawbones_ has quit [Remote host closed the connection]
that1guy has quit [Quit: This computer has gone to sleep]
mjuszczak has quit []
Jackneill has quit [Read error: Connection reset by peer]
<al2o3-cr> >> "1" " 2" " 3" " 4"
<ruboto> al2o3-cr # => "1 2 3 4" (https://eval.in/328115)
revoohc has quit [Quit: revoohc]
ismaelga has joined #ruby
_djbkd has quit [Remote host closed the connection]
_djbkd has joined #ruby
DerisiveLogic has quit [Ping timeout: 256 seconds]
asmodlol has quit [Ping timeout: 250 seconds]
workmad3 has joined #ruby
keen________ has quit [Ping timeout: 250 seconds]
Rapier- has quit [Quit: (null)]
longfeet has joined #ruby
asmodlol has joined #ruby
Hijiri has quit [Ping timeout: 246 seconds]
wolflee_______ has joined #ruby
codecop has quit [Remote host closed the connection]
yh has quit [Ping timeout: 256 seconds]
wolflee______ has quit [Read error: Connection reset by peer]
<shevy> cute little beaver
workmad3 has quit [Ping timeout: 265 seconds]
<shevy> trying to teach itself how to code when it could instead rampage some trees down
crus has quit [Remote host closed the connection]
crus has joined #ruby
blueOxigen has quit [Ping timeout: 272 seconds]
casadei_ has joined #ruby
eichenwald has quit [Ping timeout: 256 seconds]
al2o3-cr has quit [Ping timeout: 256 seconds]
Sawbones_ has joined #ruby
alol___ has quit [Ping timeout: 256 seconds]
cbetta has quit [Ping timeout: 256 seconds]
Guest15 has joined #ruby
poguez_ has quit [Read error: Connection reset by peer]
mostlybadfly has quit [Read error: Connection reset by peer]
cardoni has quit [Read error: Connection reset by peer]
frem has quit [Read error: Connection reset by peer]
BackEndCoder has quit [Ping timeout: 256 seconds]
Billias has quit [Ping timeout: 256 seconds]
alol___ has joined #ruby
cardoni has joined #ruby
cbetta has joined #ruby
konsolebox has quit [Remote host closed the connection]
poguez_ has joined #ruby
sfr^ has quit [Ping timeout: 256 seconds]
eichenwald has joined #ruby
frem has joined #ruby
mostlybadfly has joined #ruby
vickleton has quit [Ping timeout: 256 seconds]
kofione has quit [Quit: Leaving...]
Hien has quit [Ping timeout: 256 seconds]
lidenskap has quit [Remote host closed the connection]
maletor has joined #ruby
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
cgrieger is now known as cgrieger^away
andikr has quit [Remote host closed the connection]
sfr^ has joined #ruby
BackEndCoder has joined #ruby
Billias has joined #ruby
asmodlol has quit [Ping timeout: 252 seconds]
Kricir has joined #ruby
tvw has joined #ruby
Soda has quit [Ping timeout: 255 seconds]
vickleton has joined #ruby
sohrab has joined #ruby
asmodlol has joined #ruby
Soda has joined #ruby
Guest26504 has quit [Ping timeout: 244 seconds]
Hien has joined #ruby
yh has joined #ruby
neonalpine has joined #ruby
MatthewsFace[SEA has joined #ruby
kofione has joined #ruby
Mohan__ has joined #ruby
neonalpine has quit [Remote host closed the connection]
Bira has quit [Remote host closed the connection]
TheHodge has joined #ruby
wolf4ood_ has joined #ruby
joonty has joined #ruby
joonty has quit [Client Quit]
quimrstorres has joined #ruby
shock_one has joined #ruby
JDiPierro has quit [Remote host closed the connection]
Hirzu has joined #ruby
tvw has quit []
Matachines has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
quimrstorres has quit [Ping timeout: 264 seconds]
mrmargol_ has quit [Remote host closed the connection]
x1337807x has joined #ruby
Hijiri has joined #ruby
bruno- has quit [Read error: Connection reset by peer]
Hirzu has quit [Ping timeout: 246 seconds]
momomomomo has joined #ruby
hololeap has joined #ruby
momomomomo has quit [Client Quit]
bruno- has joined #ruby
Mohan__ has quit [Ping timeout: 255 seconds]
nemesit|znc has quit [Quit: quit]
Hirzu has joined #ruby
bruno- is now known as Guest39059
doodlehaus has quit [Remote host closed the connection]
<hololeap> how can i remove an arbitrary amount of parent directories from a Pathname? for instance, i have Pathname.new('/mnt/cifs/foo/bar') and i want to get 'foo/bar' (the '/mnt/cifs/' part is chopped off)
Mohan has joined #ruby
rien has joined #ruby
Mohan is now known as Guest63259
baweaver has quit [Remote host closed the connection]
mallu has joined #ruby
<rien> "this string has a number: 4567".what_method_am_I_looking_for(/(\d+)/, "the number was $1") # => "the number was 4567"
<mallu> Can someone please tell me how I can achieve this? https://dpaste.de/99Ve
Sawbones_ has quit [Remote host closed the connection]
lidenskap has joined #ruby
<hololeap> best i've done so far is pathname.to_s.sub(/^\/mnt\/cifs\//, '')
x3cion has quit [Remote host closed the connection]
CloCkWeRX has joined #ruby
rhllor has quit [Ping timeout: 246 seconds]
Hirzu has quit [Ping timeout: 256 seconds]
mengu has quit []
Peetooshock has quit [Remote host closed the connection]
ips|malc has quit [Remote host closed the connection]
<mallu> Anyone?
mary5030 has quit [Remote host closed the connection]
scripore has quit [Quit: This computer has gone to sleep]
edwinvdg_ has quit [Read error: Connection reset by peer]
edwinvdgraaf has joined #ruby
<apeiros> hololeap: by what logic? random?
<hololeap> mallu: here is what i would do: https://gist.github.com/hololeap/9526b6014a76b198caa1/revisions
<hololeap> apeiros: what do you mean?
<apeiros> rien: "this string has a number: 4567"[/\d+/]
scripore has joined #ruby
<apeiros> >> "this string has a number: 4567"[/\d+/]
<ruboto> apeiros # => "4567" (https://eval.in/328205)
someguy has joined #ruby
<apeiros> alternatively gsub
zzing has joined #ruby
rhllor has joined #ruby
<apeiros> hololeap: "remove an arbitrary amount of parent directories" - a random amount? or by what logic arbitrary?
ldnunes has quit [Quit: Leaving]
<hololeap> apeiros: for that example i gave there were two parent directories cut off, but i might want 3, or 4...
<apeiros> hololeap: so you have a parameter - the number of directories to remove from the front?
<hololeap> apeiros: yeah, i'm simply trying to get the path relative to another path
thiagovsk has quit [Quit: Connection closed for inactivity]
<toertore> split('/')[n..-1]
<apeiros> hololeap: um, why didn't you say that right away instead?
dblessing has quit [Quit: Textual IRC Client: www.textualapp.com]
<rien> apeiros: I had to write that
<shock_one> >> '/mnt/cifs/foo/bar'.split(File::SEPARATOR)[2..-1].join(File::SEPARATOR)
<ruboto> shock_one # => "cifs/foo/bar" (https://eval.in/328236)
<hololeap> apeiros: i guess i wasn't thinking about it clearly
tonyhb has quit [Quit: peace]
<rien> apeiros: neither gsub nor what you said do what I mean
DefV has quit [Ping timeout: 252 seconds]
<rien> gsub is highly annoyhing with its "I match everything! so that I'm useless" philosophy
<apeiros> >> require 'pathname'; Pathname.new('/mnt/cifs/foo/bar').relative_path_from(Pathname.new('/mnt/cifs'))
<ruboto> apeiros # => #<Pathname:foo/bar> (https://eval.in/328237)
<apeiros> hololeap: ^
<apeiros> pathname has methods to do that
matchaw has joined #ruby
<hololeap> apeiros: awesome. i missed that method in the docs. thanks!
al2o3-cr has joined #ruby
<apeiros> rien: it helps to understand the tools you use instead of just swearing about how they are not supposed to be used…
leafybasil has joined #ruby
Hirzu has joined #ruby
<apeiros> mallu: found a solution yet?
someguy has quit [Quit: This computer has gone to sleep]
<rien> apeiros: are you saying there's a way to have gsub do this?: "this number: 4567 and another: 55".simple_gsub(/(\d+)[^\d]+(\d+)/, "here: $1 and $2") # => "here: 4567 and 55"
<rien> apeiros: I read a bunch of pages on capture groups and backreferences in ruby and none of them have a clear example like that
Bira has joined #ruby
<apeiros> no
<apeiros> gsub is the wrong tool
<apeiros> but it's unclear to me what you want to achieve.
<rien> apeiros: it seems right with its block variant
<apeiros> >> "here: %d and %d" % "this number: 4567 and another: 55".scan(/\d+/)
joelataylor has quit [Quit: Lingo: www.lingoirc.com]
<ruboto> apeiros # => "here: 4567 and 55" (https://eval.in/328238)
<rien> apeiros: it can't be unclear as I gave you a working example ;)
<apeiros> rien: it is totally unclear
<apeiros> a working example does not convey intent
mdarby has quit [Quit: Textual IRC Client: www.textualapp.com]
<apeiros> otherwise I'll show you an example of an expanding number series and let you guess the algorithm behind.
<rien> apeiros: I want to be able to provide some capture groups and then have them be accessible via backreferences in the new string I'm building
zzing_ has joined #ruby
jenrzzz_ has joined #ruby
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
chipotle has quit [Quit: cheerio]
<apeiros> rien: you're describing your desired solution instead of the problem.
Soda has quit [Remote host closed the connection]
jerius has quit [Quit: /quit]
<apeiros> gsub provides you the captures. in the replacement string via \1-\n
rbennace_ has joined #ruby
<rien> apeiros: I'm describing the function/method I'm looking for in terms of inputs and outputs. its inputs must be the capture groups, the string matched, and the string that contains the backreferences. the output should be the string with the backreferences having been replaced by the result of matching the capture groups
<mallu> hololeap: I'm getting ./aws_elb_health.rb:23: syntax error, unexpected tLPAREN_ARG, expecting keyword_end ...state == "OutOfService" }.map (&:instance_id).join(', ')
jenrzzz has quit [Ping timeout: 256 seconds]
<apeiros> rien: as said, you're describing your desired solution. not your problem. to the extent of your question, I gave you two answers.
<mallu> apeiros: Testing hololeap's suggestion
<rien> apeiros: regarding what you said about gsub and \1 \2... : "this number: 4567 and another: 55".gsub(/(\d+)[^\d]+(\d+)/, "here: \1 and \2") #=> "this number: here: \u0001 and \u0002"
<apeiros> if you want better answers, come up with a better question. best by describing the actual problem.
zzing has quit [Ping timeout: 256 seconds]
baweaver has joined #ruby
<apeiros> rien: \ in " is an escape character. you need either ' or \\
someguy has joined #ruby
<apeiros> >> "this number: 4567 and another: 55".gsub(/\D*(\d+)\D+(\d+)/, "here: \\1 and \\2")
<ruboto> apeiros # => "here: 4567 and 55" (https://eval.in/328239)
malcolmva has quit [Ping timeout: 255 seconds]
<rien> apeiros: yep, that is indeed the example I never could find: "this number: 4567 and another: 55".gsub(/(\d+)[^\d]+(\d+)/, "here: \\1 and \\2")
<rien> apeiros: thanks!
<apeiros> from `ri String#gsub`: ""hello".gsub(/([aeiou])/, '<\1>') #=> "h<e>ll<o>""
barkerd427 is now known as zz_barkerd427
rbennacer has quit [Ping timeout: 256 seconds]
rodfersou has quit [Quit: leaving]
rbennace_ has quit [Ping timeout: 272 seconds]
Hirzu has quit [Ping timeout: 256 seconds]
Cust0sL1men has joined #ruby
<hololeap> mallu: what version of ruby are you using?
<rien> apeiros: thanks again for the help and patience, this helped me!
<apeiros> yw
baweaver has quit [Remote host closed the connection]
<mallu> hololeap: 1.9.3
baweaver has joined #ruby
edwinvdg_ has joined #ruby
<mallu> hololeap: sorry I had a space between map and (
someguy has quit [Quit: This computer has gone to sleep]
<hololeap> mallu: ok :)
rien has quit [Quit: Page closed]
edwinvdgraaf has quit [Ping timeout: 264 seconds]
<mallu> hololeap: this is giving me all the ELBs. I only want the ELBs that has instance.status == OutOfService
rodfersou has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
someguy has joined #ruby
paulcsmith has quit [Quit: Be back later ...]
<hololeap> mallu: that's why i included select {|i| i.state == "OutOfService" } ... that should do the same filtering that you had in your original code
Guest63259 has quit [Ping timeout: 256 seconds]
normalra has quit [Quit: WeeChat 1.1.1]
shock_one has quit [Remote host closed the connection]
jph98 has joined #ruby
Hijiri has quit [Quit: WeeChat 1.0.1]
shock_one has joined #ruby
<mallu> hololeap: puts " ELB: #{elb} InstanceID: " + This will display all the ELBs
Guest24 is now known as lele
Mohan__ has joined #ruby
tonyhb has joined #ruby
qwertme has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<mallu> hololeap: I only want to display elbs that has i.state == OutOfService
zzing_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
m8 has quit [Quit: Sto andando via]
<apeiros> mallu: hololeaps code does that. so if yours doesn't - gist up what you did
workmad3 has joined #ruby
Matachines has joined #ruby
chrishough has joined #ruby
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<mallu> hololeap: apeiros: THis is what I have https://dpaste.de/6Jws
scripore has quit [Quit: This computer has gone to sleep]
<apeiros> mallu: that does the same filtering as your old code. or do you mean your old code filtered wrongly?
AlphaAtom has joined #ruby
<apeiros> the one thing I could imagine is that you are seeing elbs without ids.
AlphaAtom has quit [Max SendQ exceeded]
mitchellhenke has quit [Quit: Computer has gone to sleep.]
<mallu> apeiros: yes I am seeing elbs without instanceIDs
x1337807x has joined #ruby
<apeiros> then do it in two steps
<apeiros> collect the id list
<apeiros> check if the list is empty
werelivinginthef has quit [Remote host closed the connection]
<apeiros> if not, print
<mallu> apeiros: new to ruby.. can you please show me an example
<apeiros> mallu: unless array.empty? then; puts …your list…; end
momomomomo has joined #ruby
<mallu> ok
EagleDelta has quit [Remote host closed the connection]
[Franklin] has joined #ruby
<[Franklin]> hello
<apeiros> seems you're lucky and hololeap goes out of their way and provides full free consulting here
<apeiros> hi [Franklin]
<hololeap> apeiros: it's like code golf
<[Franklin]> I'm trying to understand some ruby code not written by me
Guest15 has quit [Quit: Textual IRC Client: www.textualapp.com]
AlphaAtom has joined #ruby
<hololeap> apeiros: and its a simple problem
<[Franklin]> and YAML
<apeiros> hololeap: sure. not that you misunderstand me - I have nothing against it.
someguy has quit [Quit: This computer has gone to sleep]
<hololeap> apeiros: i took it as a compliment :)
AlphaAtom has quit [Max SendQ exceeded]
someguy has joined #ruby
<apeiros> I just hesitate to do it. feels to me like people who want others to do their job for free.
swgillespie has joined #ruby
<apeiros> [Franklin]: then gist the relevant parts and explain as good as possible what you do understand and what you don't.
<ruboto> [Franklin], we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/2a50629310cfe82ab436
<ruboto> pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
<[Franklin]> is line 224 a function call to config?
<apeiros> `config` can be either a local variable or a method
<apeiros> with the given excerpt it's not possible to determine.
<[Franklin]> sorry, never really used ruby before :(
<[Franklin]> time for a little crash course before I get back
<apeiros> you know it's a method call if there's no assignment to a local variable in the same local variable scope.
<apeiros> if there's none, then it's a method call.
someguy has quit [Client Quit]
<apeiros> and in `config['allowed_ips']`, the ['allowed_ips'] is then a method call on the value of `config`
momomomomo has quit [Ping timeout: 276 seconds]
<[Franklin]> ok
chipotles has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<apeiros> with the ||= it's actually up to two method calls.
<apeiros> `a ||= b` is syntax sugar and expands to `a || a = b`
Hijiri has joined #ruby
<apeiros> so `config['allowed_ips'] ||= []` expands to `config['allowed_ips'] || config['allowed_ips'] = []`
michael_mbp has quit [Excess Flood]
quimrstorres has joined #ruby
<[Franklin]> so is the [...] like a subscript in C?
quazimodo has quit [Ping timeout: 272 seconds]
<apeiros> which means in english: either the value at key 'allowed_ips', or an empty array - and the empty array is also associated with the 'allowed_ips' key in the same turn
rhllor has quit [Quit: rhllor]
<apeiros> no, [] is a method ca..
<apeiros> *call
CaptainCibai has joined #ruby
<[Franklin]> which performs a key->value lookup?
Zen-Zen has joined #ruby
yh has quit [Ping timeout: 264 seconds]
<apeiros> >> class Foo; def [](key); "You called [] with #{key.inspect}"; end; end; foo = Foo.new; foo["plerp"]
<ruboto> apeiros # => "You called [] with \"plerp\"" (https://eval.in/328300)
<apeiros> [Franklin]: no, which performs whatever your method definition states to perform
slash_nick has quit [Ping timeout: 240 seconds]
asmodlol has quit [Ping timeout: 250 seconds]
<apeiros> the only thing special about it is how you can invoke it. i.e. that you can do foo[arg1, arg2, …] instead of foo.[](arg1, arg2, …) - note, the latter works too.
<[Franklin]> ok
michael_mbp has joined #ruby
<apeiros> but yes, with a hash - which config likely is - it's a key-value lookup
AlphaAtom has joined #ruby
<apeiros> if you know the author of the code, you can tell them that there's YAML.load_file
segfalt has joined #ruby
<al2o3-cr> game of blackjack anyone?
<al2o3-cr> >> cards = [?A, *[*1..9], ?T, ?J, ?Q, ?K].map(&:to_s); suits = [9824, 9827, 9829, 9830].map{|n| [n].pack('U*')}; cards.product(suits).shuffle.sample(2)
<ruboto> al2o3-cr # => [["9", "♣"], ["2", "♥"]] (https://eval.in/328303)
mrmargolis has joined #ruby
someguy has joined #ruby
<apeiros> al2o3-cr: [9824, 9827, 9829, 9830].map{|n| [n].pack('U*')} that's a rather complex way to write ["\u2660", "\u2663", "\u2665", "\u2666"]
decoponio has quit [Read error: Connection reset by peer]
<al2o3-cr> hehe
asmodlol has joined #ruby
<apeiros> and in 1.9+, [?A, *1..9, ?T, …] is valid ;-)
quimrstorres has quit [Ping timeout: 276 seconds]
decoponio has joined #ruby
<al2o3-cr> apeiros: is it true that ruby 3.0 is over 50% ?
<apeiros> (and obviously you use that - otherwise the double nesting would be invalid too anyway)
<apeiros> I'm not a core dev. no idea.
<al2o3-cr> oki doki
<apeiros> but their planned release cycle is every year a major release. agile style - what's in is in.
momomomomo has joined #ruby
<hololeap> >> cards = [?A, *[*1..9], ?T, ?J, ?Q, ?K].map(&:to_s); suits = [9824, 9827, 9829, 9830].map{|n| [n].pack('U*')}; cards.product(suits).shuffle.sample(2)
robbyoconnor has quit [Read error: Connection reset by peer]
<ruboto> hololeap # => [["2", "♣"], ["1", "♠"]] (https://eval.in/328336)
<hololeap> freakin leet
Pupeno has joined #ruby
Pupeno has quit [Changing host]
Pupeno has joined #ruby
<al2o3-cr> ok thanks apeiros
<al2o3-cr> no leet just ruby ;P
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
malcolmva has joined #ruby
<hololeap> should be ruby's new slogan
<al2o3-cr> ah leet as joined lol
robbyoconnor has joined #ruby
Zai00 has quit [Quit: Zai00]
Bira has quit [Remote host closed the connection]
Pupeno_ has quit [Ping timeout: 245 seconds]
jph98 has quit [Quit: jph98]
<hololeap> i don't understand this syntax at all: [?A, *[*1..9], ?T, ?J, ?Q, ?K] what does ?<letter> mean?
<al2o3-cr> check this out ruby brainfuck interpreter in 137 bytes: http://ruby.janlelis.de/9-ruby-brainfuck-golf-update
<ericwood> hmmmm the ? is weird
<adaedra> oh
<ericwood> >> [?A]
<ruboto> ericwood # => ["A"] (https://eval.in/328337)
<mozzarella> it's a character
<adaedra> 18>> ?A
<ruboto> adaedra # => 65 (https://eval.in/328338)
<hololeap> didn't know you could do that
tonyhb has quit [Quit: peace]
<ericwood> >> ?asdf
<ruboto> ericwood # => /tmp/execpad-0440a163567c/source-0440a163567c:2: syntax error, unexpected '?' ...check link for more (https://eval.in/328339)
<ericwood> ah okay
<adaedra> Careful there, ?x changed meaning in 19
<adaedra> 1.9*
<ericwood> where do I find the docs on this
mjuszczak has joined #ruby
<ericwood> it's syntactic sugar it seems
Zekka has quit [Ping timeout: 272 seconds]
<mozzarella> I use ?\n sometimes
moretti has joined #ruby
<apeiros> ericwood: no sugar
<apeiros> it's syntax
<al2o3-cr> in 1.8 ?A would give you 65
<ericwood> fair enough
<apeiros> not everything in syntax is sugar ;-)
<adaedra> yeah, see ruboto samples
<al2o3-cr> >> $/
<ruboto> al2o3-cr # => "\n" (https://eval.in/328340)
jackjackdripper has quit [Quit: Leaving.]
<adaedra> apeiros: is `"sugar"` sugar? :p
<apeiros> no, it's "sugar". .-p
<ericwood> I just like saying syntactic sugar, okay?!
Zekka has joined #ruby
<hololeap> also i didn't know you could splat a range
CloCkWeRX has quit [Quit: Leaving.]
but3k4 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
vickleton has quit [Ping timeout: 276 seconds]
<al2o3-cr> >> 10.chr
<ruboto> al2o3-cr # => "\n" (https://eval.in/328341)
<hololeap> or however you would say that ...
<adaedra> >> %w[good night].join(' ').capitalize + " everyone!"
<ruboto> adaedra # => "Good night everyone!" (https://eval.in/328342)
<ericwood> >>[*1..9]
<ruboto> ericwood # => [1, 2, 3, 4, 5, 6, 7, 8, 9] (https://eval.in/328343)
<ericwood> >>[1..9]
<ruboto> ericwood # => [1..9] (https://eval.in/328344)
<ericwood> huh neat shorthand for .to_a
<hololeap> quite
wolf4ood_ has quit [Quit: (null)]
eichenwald has quit [Quit: Leaving]
<hololeap> are there any other objects you can "splat?"
hs366 has quit [Read error: Connection reset by peer]
lkba has joined #ruby
<apeiros> hololeap: splat calls to_a
<apeiros> so any object responding to to_a can be splatted
<ericwood> neato
<hololeap> thats cool as F***
<ericwood> so I can splat AR associations? :)
<mozzarella> >> [*?a..?z].join(?\ )
<ruboto> mozzarella # => "a b c d e f g h i j k l m n o p q r s t u v w x y z" (https://eval.in/328345)
Guest1421 has quit [Ping timeout: 240 seconds]
<hololeap> >> require 'active_record'
<ruboto> hololeap # => cannot load such file -- active_record (LoadError) ...check link for more (https://eval.in/328346)
<hololeap> tee hee
<apeiros> ericwood: sure. ruby doesn't hold you back from shooting your foot. it happily lends you the bazooka.
<adaedra> (?a..?z).join(' ')
<adaedra> >> (?a..?z).join(' ')
<ruboto> adaedra # => undefined method `join' for "a".."z":Range (NoMethodError) ...check link for more (https://eval.in/328347)
Matachines has quit [Ping timeout: 244 seconds]
<adaedra> Fair enough
<hololeap> >> [*(?a..?z)].join(' ')
<ruboto> hololeap # => "a b c d e f g h i j k l m n o p q r s t u v w x y z" (https://eval.in/328348)
<apeiros> Enumerable not having join is still something I don't get.
<adaedra> >> (?a..?z).each.join(' ')
<ruboto> adaedra # => undefined method `join' for #<Enumerator: "a".."z":each> (NoMethodError) ...check link for more (https://eval.in/328349)
<mozzarella> try to_a
<adaedra> I know
<hololeap> see what i did thar?
<adaedra> I wanted to see if there was a way to do it without generating the array
jackjackdripper has joined #ruby
<apeiros> you can patch join into Enumerable
<adaedra> great
<adaedra> so, real sleep now
<adaedra> remember, sweet dreams are made of this
<al2o3-cr> >> c = %w[. - ']; 0.upto(100) {|i| print c[(Math.cos(i)+1).round.to_i] }
<ruboto> al2o3-cr # => ''-..-''-..-''-..-''-...-''-..-''-..-''-..-'''-..-''-..-''-..-''-...-''-..-''-..-''-..-'''-..-''-..- ...check link for more (https://eval.in/328350)
Juanchito has quit [Quit: Connection closed for inactivity]
<apeiros> adaedra: did you also travel the world?
<apeiros> adaedra: and the seven seas?
riotjone_ has joined #ruby
<mozzarella> who am I to disagree?
<hololeap> >> [?c] * 7
<ruboto> hololeap # => ["c", "c", "c", "c", "c", "c", "c"] (https://eval.in/328381)
<al2o3-cr> and the 7 seas
<apeiros> so, personal playtime with the bot is over kids
<apeiros> use your own pry/irb please
someguy has quit [Quit: This computer has gone to sleep]
<ericwood> shut up, dad!
Altonymous has quit [Quit: Altonymous]
SouL_|_ has quit [Ping timeout: 272 seconds]
<apeiros> this dad wields the !kick and !ban hammers, so careful there with the uppity :-p
DynamicMetaFlow has joined #ruby
<al2o3-cr> whos zzak?
someguy has joined #ruby
riotjones has quit [Ping timeout: 272 seconds]
<al2o3-cr> i thought founder was fflush?
scripore has joined #ruby
Bira has joined #ruby
<apeiros> was
<apeiros> he was retired
<al2o3-cr> he gave it up?
<apeiros> zzak is a member of ruby-core
<apeiros> no
<al2o3-cr> ah ok ;)
someguy has quit [Client Quit]
chipotles has joined #ruby
<claw> mwlang: remember me ? zlib error ?
<claw> eam: you there ?
<apeiros> he was chronically unreachable and barely ever in the channel
momomomomo_ has joined #ruby
DefV has joined #ruby
goggy has quit [Ping timeout: 240 seconds]
shock_one has quit [Remote host closed the connection]
<Radar> claw: just ask your question and someone else can probably help
Pupeno has quit [Remote host closed the connection]
<mozzarella> What, did he have a social life?
<Radar> mozzarella: Unfortunately it would seem that way.
momomomomo has quit [Ping timeout: 240 seconds]
momomomomo_ is now known as momomomomo
jottr has quit [Ping timeout: 244 seconds]
chinmay_dd has quit [Read error: Connection reset by peer]
<al2o3-cr> apeiros: so did you have to beg freenode or what?
that1guy has joined #ruby
<claw> okay well then: i am facing sometimes a error when inflating a deflated stream. the stream is sent from the server. i specify the ammount data it should send as the amount of dataset i want
<apeiros> al2o3-cr: something like that.
<al2o3-cr> ;p
<claw> the error is buffer error followed by incorrect header check
<claw> from zlib class
<claw> if i get that error an rerequest the same amount of data i am getting the same error. so there no data malformed randomly by transfer or something
<claw> if i change the amount of data i am requesting i can inflate it
<claw> http://paste.triple6.org/qRk6Rw heres my inflate class
qwertme has joined #ruby
kyrylo_ has joined #ruby
momomomomo has quit [Client Quit]
<claw> no a few hours after asking that question already i was able to export a stream i cannot inflate
wallerdev_ has joined #ruby
maxmanders_ has joined #ruby
<claw> mwlang: thought i might be that its because has the size of a multiple of 64 ( which i am buffering in my method ) a the stream i can not inflate has the size of 332 which is a multiple of 64
bollullera has left #ruby [#ruby]
<claw> but if i change the buffer size in my inflate method the exception is still raised
chrisseaton_ has joined #ruby
kyrylo has quit [Ping timeout: 264 seconds]
akitada_ has joined #ruby
bestie_ has joined #ruby
brb3_ has joined #ruby
artmann has joined #ruby
aef has quit [Remote host closed the connection]
flori_ has joined #ruby
_Tristan-Speccy_ has joined #ruby
gkra_ has joined #ruby
_jasonmit has joined #ruby
speaking1ode has joined #ruby
jack_rabbit_ has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
akitada has quit [Ping timeout: 252 seconds]
amitchellbullard has quit [Ping timeout: 252 seconds]
kwd has quit [Ping timeout: 252 seconds]
maxmanders has quit [Ping timeout: 252 seconds]
chrisseaton has quit [Ping timeout: 252 seconds]
wallerdev has quit [Ping timeout: 252 seconds]
Tristan-Speccy has quit [Ping timeout: 252 seconds]
hellschreiber has quit [Ping timeout: 252 seconds]
jmcc has quit [Ping timeout: 252 seconds]
bestie has quit [Ping timeout: 252 seconds]
jasonmit has quit [Ping timeout: 252 seconds]
brb3 has quit [Ping timeout: 252 seconds]
speakingcode has quit [Ping timeout: 252 seconds]
exadeci has quit [Ping timeout: 252 seconds]
fumduq has quit [Ping timeout: 252 seconds]
[diecast] has quit [Ping timeout: 252 seconds]
A205B064 has quit [Ping timeout: 252 seconds]
shellfu has quit [Ping timeout: 252 seconds]
machty has quit [Ping timeout: 252 seconds]
fumduq has joined #ruby
Muz has quit [Ping timeout: 252 seconds]
zrl has quit [Ping timeout: 252 seconds]
dukedave has quit [Ping timeout: 252 seconds]
gsd has quit [Ping timeout: 252 seconds]
vikram_ has quit [Ping timeout: 252 seconds]
gkra has quit [Ping timeout: 252 seconds]
flori has quit [Ping timeout: 252 seconds]
artmann_ has quit [Ping timeout: 252 seconds]
jack_rabbit has quit [Ping timeout: 252 seconds]
linduxed has quit [Ping timeout: 252 seconds]
tobiasvl has quit [Ping timeout: 252 seconds]
FrankenDaemon has quit [Ping timeout: 252 seconds]
iceden has quit [Ping timeout: 252 seconds]
wallerdev_ is now known as wallerdev
[diecast] has joined #ruby
[diecast] has joined #ruby
[diecast] has quit [Changing host]
amitchellbullard has joined #ruby
tvl has joined #ruby
aef has joined #ruby
Muz_ has joined #ruby
tvl is now known as tobiasvl
ebbflowgo has quit [Quit: ebbflowgo]
zrl_ has joined #ruby
zz_barkerd427 is now known as barkerd427
A205B064 has joined #ruby
iceden has joined #ruby
hellschreiber has joined #ruby
chrisseaton_ is now known as chrisseaton
akitada_ is now known as akitada
dukedave has joined #ruby
bestie_ is now known as bestie
gsd has joined #ruby
FrankenDaemon has joined #ruby
kwd has joined #ruby
brb3_ is now known as brb3
zzing has joined #ruby
linduxed has joined #ruby
vikram_ has joined #ruby
icebourg has quit []
jmcc has joined #ruby
baweaver has quit [Remote host closed the connection]
arescorpio has joined #ruby
I has joined #ruby
chipotles has quit [Quit: Textual IRC Client: www.textualapp.com]
zrl_ is now known as zrl
I is now known as Guest76750
baweaver has joined #ruby
machty has joined #ruby
exadeci has joined #ruby
<claw> if i look at a good stream and the bad stream in a hexdump : the bad stream actually has a incorrect header for deflate
<eam> claw: aha
<claw> starts with 1a43 (hex)
<claw> good ones are always 9c78
leekme has joined #ruby
baweaver has quit [Ping timeout: 256 seconds]
umby24|offline is now known as umby24
barkerd427 is now known as zz_barkerd427
<eam> claw: 789c is the standard zlib magic header for default compression
<eam> I suspect your other bad sample is just raw deflate data
<eam> try decoding it that way?
CloCkWeRX has joined #ruby
kyrylo has joined #ruby
<claw> eam: how would i do that?
kyrylo_ has quit [Ping timeout: 256 seconds]
<eam> window_bits
zz_barkerd427 is now known as barkerd427
<eam> claw: the underlying docs are here: http://www.zlib.net/manual.html#Advanced
baweaver has joined #ruby
<claw> you mean this is the data without any header ?
weaksauce has joined #ruby
<eam> that's my guess
that1guy has quit [Quit: This computer has gone to sleep]
<eam> try -15
scripore has quit [Quit: This computer has gone to sleep]
<eam> past that, maybe run your bad buffer sample against magic(8), eg run file on it
senayar has joined #ruby
<eam> claw: can you share a larger sample?
segfalt has quit [Quit: segfalt]
mostlybadfly has quit [Quit: Connection closed for inactivity]
revoohc has joined #ruby
jerematic has quit [Remote host closed the connection]
someguy has joined #ruby
jerematic has joined #ruby
banister has joined #ruby
thatslifeson has quit [Remote host closed the connection]
jeremati_ has joined #ruby
jerematic has quit [Read error: Connection reset by peer]
mjuszczak has quit []
mjuszczak has joined #ruby
someguy has quit [Client Quit]
<claw> none of MAX_WBITS worked
leekme has quit [Remote host closed the connection]
mjuszczak has quit [Client Quit]
doodlehaus has joined #ruby
dfinninger has quit [Remote host closed the connection]
<claw> Zlib::DataError: invalid distance too far back for all negative values
<Perdomo_> what happend to a variiable or methods when you add "?" at the end
jimms has joined #ruby
werelivinginthef has joined #ruby
<claw> Perdomo_: nothing
Altonymous has joined #ruby
<al2o3-cr> it means the method is going to return true || false
<claw> ? is a marker for method which return a bool value
einarj has joined #ruby
<bricker> Perdomo_: to be clear, it doesn't actually technically mean anything to Ruby. The boolean return value is just convention.
millerti has joined #ruby
<bricker> >> def hello?; "Hi"; end; hello?
<ruboto> bricker # => "Hi" (https://eval.in/328443)
someguy has joined #ruby
einarj has quit [Read error: Connection reset by peer]
<Perdomo_> i kinda undestand now
zz_Outlastsheep has quit [Ping timeout: 264 seconds]
einarj has joined #ruby
Hijiri has quit [Ping timeout: 265 seconds]
<claw> Perdomo_: there no actual action connected to the "?" its just part of style. the method foo? does not have to return bool at all
spyderman4g63 has joined #ruby
werelivinginthef has quit [Ping timeout: 252 seconds]
Guest76750 has quit [Quit: This computer has gone to sleep]
<claw> but it should
serivich has joined #ruby
<Perdomo_> gotcha so its just like a best practice to add ? at the end when expecting a bool
<al2o3-cr> yes
<claw> yes
moretti has quit [Ping timeout: 265 seconds]
<claw> >> 2.even? ; 3.even?
<ruboto> claw # => false (https://eval.in/328474)
<al2o3-cr> and the ! methods are a sign of jeopardy to your health
<Perdomo_> THANKS GUYS
someguy has quit [Quit: This computer has gone to sleep]
<bricker> YOU WELCOME
arescorpio has quit [Quit: Leaving.]
<claw> .downcase
jobewan has quit [Quit: Leaving]
Guest56726 has quit [Ping timeout: 272 seconds]
<Perdomo_> One more random question. Im thinking about getting a Raspberry Pi. It is a good tool to practice ruby on? or is it best with Python?
<claw> Perdomo_: you can run ruby as well
einarj has quit [Remote host closed the connection]
<al2o3-cr> Perdomo_: any language at all :)
serivich has quit [Ping timeout: 272 seconds]
<claw> al2o3-cr: you cant run x86 assambler
<claw> :D
<Perdomo_> Oh ok Thanks :)
<al2o3-cr> claw: well....
Guest1421 has joined #ruby
<al2o3-cr> any scripting language is what i meant ;P
redlegion has quit [Read error: Connection reset by peer]
redlegion has joined #ruby
blackmesa has quit [Quit: WeeChat 1.1.1]
<hololeap> strangely enough it looks like sonic-pi is a ruby DSL: https://www.raspberrypi.org/documentation/usage/sonic-pi/README.md
mikecmpbll has quit [Quit: i've nodded off.]
Rickmasta has joined #ruby
ismaelga has quit [Remote host closed the connection]
mistermocha has quit [Read error: Connection reset by peer]
mistermocha has joined #ruby
duderonomy has joined #ruby
<jhass> al2o3-cr: uh, sure you can't run a x86 vm on it?
<jhass> eh, claw ^
<jhass> sorry
Matachines has joined #ruby
<bricker> hololeap: not only does it look like it, it actualy is
a346 has joined #ruby
chipotle has joined #ruby
<GaryOak_> Is everyone ready for type systems in Ruby?
revoohc has quit [Quit: revoohc]
Hijiri has joined #ruby
Zarthuss has quit [Quit: This night will fall like any other, daylight subsides and shadows crawl.]
Matachines has quit [Read error: Connection reset by peer]
<mozzarella> optional typing in ruby?
<GaryOak_> Who knows
zzing has quit [Read error: Connection reset by peer]
mistermocha has quit [Ping timeout: 256 seconds]
<bricker> GaryOak_: I'm ready! I hate weak typing!!
Hirzu has joined #ruby
<havenwood> Ruby is strongly typed.
<GaryOak_> I can definitely see static typing being used for certain situations
gsd has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
lampd1 has quit [Remote host closed the connection]
<mozzarella> I want optional typing and better concurrency
mjuszczak has joined #ruby
MatthewsFace[SEA has quit [Remote host closed the connection]
Deele2 has quit [Ping timeout: 256 seconds]
zzing has joined #ruby
redlegion has quit [Ping timeout: 264 seconds]
<havenwood> mozzarella: So you want Elixir? :P
mjuszczak has quit [Client Quit]
mjuszczak has joined #ruby
Matachines has joined #ruby
<havenwood> /Crystal|Elixir/
Sawbones_ has joined #ruby
enebo has quit [Quit: enebo]
CloCkWeRX has quit [Quit: Leaving.]
iamninja has quit [Read error: Connection reset by peer]
Hirzu has quit [Ping timeout: 264 seconds]
<havenwood> mozzarella: I think you'll get your concurrency wish in Ruby 3. Not so sure about the optional typing materializing.
iamninja has joined #ruby
Guest1421 has quit [Ping timeout: 264 seconds]
Hirzu has joined #ruby
gsd has joined #ruby
iceden has quit [Remote host closed the connection]
CloCkWeRX has joined #ruby
senayar has quit [Remote host closed the connection]
Sawbones_ has quit [Ping timeout: 250 seconds]
Guest76750 has joined #ruby
kirun has quit [Remote host closed the connection]
mallu has quit [Ping timeout: 246 seconds]
<havenwood> Maybe a Dialyzer-style static analysis tool?
wallerdev has quit [Ping timeout: 256 seconds]
kofione has quit [Quit: Linkinus - http://linkinus.com]
nettoweb has joined #ruby
diegoviola has joined #ruby
marr has quit [Ping timeout: 265 seconds]
crdpink has quit [Quit: q term]
yqt has quit [Quit: KVIrc 4.0.4 Insomnia http://www.kvirc.net/]
shellfu has joined #ruby
shellfu is now known as shellfu_afk
hololeap has quit [Remote host closed the connection]
rgb-one has joined #ruby
<baweaver> >> class Object; def absent?() self.nil? || self.empty? end end; nil.absent?
<ruboto> baweaver # => true (https://eval.in/328534)
<baweaver> >> class Object; def absent?() self.nil? || self.empty? end end; ''.absent?
<ruboto> baweaver # => true (https://eval.in/328535)
<baweaver> >> class Object; def absent?() self.nil? || self.empty? end end; [].absent?
<ruboto> baweaver # => true (https://eval.in/328536)
<baweaver> >>nil.empty?
<ruboto> baweaver # => undefined method `empty?' for nil:NilClass (NoMethodError) ...check link for more (https://eval.in/328537)
* baweaver sighs
Igorshp has quit [Remote host closed the connection]
Igorshp has joined #ruby
<baweaver> try ``present?`` on ``nil`` in Rails.
Igorshp has quit [Remote host closed the connection]
<baweaver> ``empty? != not present?``
zzing has quit [Read error: Connection reset by peer]
ghr has quit [Ping timeout: 264 seconds]
barhum2013 has joined #ruby
Hirzu has quit [Ping timeout: 256 seconds]
<mozzarella> havenwood: does elixir have optional typing?
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Hirzu has joined #ruby
quimrstorres has joined #ruby
werelivinginthef has joined #ruby
barhum2013 has quit [Client Quit]
nettoweb has joined #ruby
Sawbones_ has joined #ruby
ismaelga has joined #ruby
<baweaver> Most functional languages tend to have Some, None, Any, and Maybe.
Matachines has quit [Ping timeout: 240 seconds]
Hirzu has quit [Ping timeout: 256 seconds]
mitchellhenke has joined #ruby
Ropeney_ has joined #ruby
cryptarium_ has joined #ruby
Ropeney_ has quit [Client Quit]
<GaryOak_> elixir has :ok
Ropeney has joined #ruby
Bira has quit [Remote host closed the connection]
<mozzarella> I should learn elixir
zzing has joined #ruby
towski_ has quit [Read error: Connection reset by peer]
spyderman4g63 has quit []
ismaelga has quit [Ping timeout: 264 seconds]
cryptarium has quit [Ping timeout: 272 seconds]
<GaryOak_> I feel like CS depts, won't keep up with the new interest in functional languages, and concepts
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ebbflowgo has joined #ruby
insidious has joined #ruby
towski__ has joined #ruby
ebbflowgo has quit [Client Quit]
quazimod1 has joined #ruby
Zekka has quit [Ping timeout: 272 seconds]
towski___ has joined #ruby
DerisiveLogic has joined #ruby
DerisiveLogic has quit [Remote host closed the connection]
lfox has joined #ruby
Bira has joined #ruby
Igorshp has joined #ruby
jeramy_s has joined #ruby
iamvery has joined #ruby
lordkryss has quit [Quit: Connection closed for inactivity]
snockerton has quit [Quit: Leaving.]
Joufflu has joined #ruby
crdpink has joined #ruby
<mwlang> GaryOak_: huh? why wouldn’t CS depts keep up?
kyrylo has quit [Ping timeout: 246 seconds]
<GaryOak_> at least in teaching undergrad students
towski__ has quit [Ping timeout: 255 seconds]
<mwlang> maybe that’s a problem at the community colleges, but certainly not at the top tier colleges.
<GaryOak_> I'm sure research will keep up, but most CS depts is about getting students hired