havenwood changed the topic of #ruby to: Rules & more: http://ruby-community.com || Ruby 2.3.1; 2.2.5; 2.1.9: https://ruby-lang.org || Paste >3 lines of text on https://gist.github.com || logs @ http://irclog.whitequark.org/ruby/
blackmesa has joined #ruby
symm- has quit [Ping timeout: 252 seconds]
hanmac has quit [Ping timeout: 276 seconds]
<benzrf> cooldavid: im not familiar with this api & im busy
<benzrf> sorry :I
djbkd has quit [Remote host closed the connection]
bronson has joined #ruby
djbkd has joined #ruby
djbkd has quit [Remote host closed the connection]
hanmac has joined #ruby
djbkd has joined #ruby
bruce_lee has quit [Read error: Connection reset by peer]
<weaksauce> cooldavid make payments_collected_in return the correct number of payments collected
edwinvdgraaf has quit [Ping timeout: 250 seconds]
djbkd has quit [Read error: Connection reset by peer]
djbkd has joined #ruby
SilverKey has quit [Quit: Halted.]
<cooldavid> not sure where I'm going to get that from
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
djbkd has quit [Read error: Connection reset by peer]
<cooldavid> that's the only data I have
<weaksauce> the data is there from what you are inputting
djbkd has joined #ruby
<weaksauce> you need to query the db and calculate the payments
<cooldavid> yes but how do you calculate that, that's the thing I'm having problem with
ensyde has quit [Ping timeout: 276 seconds]
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
idefine has joined #ruby
whathappens has quit [Quit: Leaving...]
idefine has quit [Ping timeout: 240 seconds]
bronson has quit [Remote host closed the connection]
|ifei5good has joined #ruby
|ifei5g00d has quit [Ping timeout: 240 seconds]
RegulationD has quit [Remote host closed the connection]
jaguarmagenta has joined #ruby
blaxter has quit [Read error: Connection reset by peer]
chouhoulis has quit [Remote host closed the connection]
pharaoh2 has joined #ruby
pharaoh2 has quit [Client Quit]
pharaoh2 has joined #ruby
roshanavand has quit [Quit: This computer has gone to sleep]
hanmac has quit [Ping timeout: 250 seconds]
slackbotgz has joined #ruby
papachan has joined #ruby
hanmac has joined #ruby
jaguarma_ has joined #ruby
roshanavand has joined #ruby
saneax is now known as saneax_AFK
Madplatypus has joined #ruby
jaguarmagenta has quit [Read error: Connection reset by peer]
joaumg has joined #ruby
sneakerhax has quit [Ping timeout: 276 seconds]
ensyde has joined #ruby
nankyokusei has joined #ruby
<cooldavid> if Date is my only input, how I'm supposed to get the correct number of payments with only that info?
idefine has joined #ruby
nb_bez___ has quit [Quit: Connection closed for inactivity]
djcp has quit [Ping timeout: 240 seconds]
dgncn has quit [Ping timeout: 240 seconds]
nankyokusei has quit [Ping timeout: 260 seconds]
jhack has quit [Quit: jhack]
mjuszczak has quit []
idefine has quit [Ping timeout: 250 seconds]
jhack has joined #ruby
jhack has quit [Client Quit]
montyboy has quit [Read error: Connection reset by peer]
dgncn has joined #ruby
CloCkWeRX has quit [Read error: Connection reset by peer]
CloCkWeRX has joined #ruby
idefine has joined #ruby
djcp has joined #ruby
djbkd has quit [Quit: My people need me...]
zotherstupidguy has joined #ruby
ledestin has joined #ruby
sp4rrow has quit [Quit: Textual]
exadeci has joined #ruby
cdg has quit [Remote host closed the connection]
pietr0 has quit [Quit: pietr0]
cdg has joined #ruby
marr has quit [Ping timeout: 252 seconds]
jaguarma_ has quit [Read error: Connection reset by peer]
jaguarmagenta has joined #ruby
idefine has quit [Ping timeout: 252 seconds]
johnmilton has quit [Remote host closed the connection]
davedev2_ has quit []
jaguarma_ has joined #ruby
jaguarmagenta has quit [Read error: Connection reset by peer]
gigetoo has quit [Ping timeout: 246 seconds]
idefine has joined #ruby
gigetoo has joined #ruby
hahuang61 has joined #ruby
diegoaguilar has quit [Remote host closed the connection]
cdg has quit [Ping timeout: 260 seconds]
halfamind has joined #ruby
DissonantGuil3 has joined #ruby
statelesscode has quit [Ping timeout: 276 seconds]
pharaoh2 has quit [Quit: Textual IRC Client: www.textualapp.com]
idefine has quit [Remote host closed the connection]
hahuang61 has quit [Ping timeout: 276 seconds]
edwinvdgraaf has joined #ruby
slackbotgz has quit [Remote host closed the connection]
<DissonantGuil3> Any way to evaluate a ruby file into new Proc so I can call it later in a given binding?
amclain has quit [Quit: Leaving]
roamingdog has quit [Remote host closed the connection]
panpainter has joined #ruby
edwinvdgraaf has quit [Ping timeout: 240 seconds]
roamingdog has joined #ruby
bmurt has joined #ruby
blackmesa has quit [Ping timeout: 265 seconds]
panpainter has quit [Ping timeout: 260 seconds]
Yiota has joined #ruby
robbyoconnor has joined #ruby
jaguarma_ has quit [Read error: Connection reset by peer]
jaguarmagenta has joined #ruby
idefine has joined #ruby
bronson has joined #ruby
roamingdog has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 246 seconds]
hanmac has quit [Ping timeout: 276 seconds]
RegulationD has joined #ruby
hanmac has joined #ruby
<DissonantGuil3> nvm it's just Proc.new { eval(code) }
idefine has quit [Ping timeout: 260 seconds]
bronson has quit [Ping timeout: 252 seconds]
fedexo has joined #ruby
RegulationD has quit [Ping timeout: 260 seconds]
janebootydoe2 has joined #ruby
matp has quit [Ping timeout: 252 seconds]
matp has joined #ruby
<benzrf> hah
janebootydoe has quit [Ping timeout: 244 seconds]
halfamind has quit [Quit: Leaving.]
jaguarmagenta has quit [Read error: Connection reset by peer]
jaguarmagenta has joined #ruby
kareeoleez has joined #ruby
roamingdog has joined #ruby
kareeoleez has quit [Ping timeout: 276 seconds]
jaguarmagenta has quit [Read error: Connection reset by peer]
jaguarma_ has joined #ruby
karmatr0n has joined #ruby
janebootydoe2 has quit [Ping timeout: 246 seconds]
edwinvdgraaf has joined #ruby
bmurt has quit [Quit: Textual IRC Client: www.textualapp.com]
zeroDi has quit [Quit: WeeChat 1.5]
jaguarma_ has quit [Read error: Connection reset by peer]
jaguarmagenta has joined #ruby
janebootydoe has joined #ruby
ropeney has joined #ruby
papachan has quit [Quit: Leaving]
smathy is now known as smathy_afk
edwinvdgraaf has quit [Ping timeout: 276 seconds]
n_blownapart has quit []
chipotle has joined #ruby
smathy_afk is now known as smathy
jaguarmagenta has quit [Remote host closed the connection]
mattp_ is now known as mattp
saneax_AFK is now known as saneax
ramfjord has quit [Ping timeout: 240 seconds]
halfamind has joined #ruby
halfamind1 has joined #ruby
halfamind has quit [Read error: Connection reset by peer]
roamingdog has quit [Remote host closed the connection]
idefine has joined #ruby
halfamind1 has quit [Read error: Connection reset by peer]
halfamind has joined #ruby
jaguarmagenta has joined #ruby
<cooldavid> but I think this is cheating
banister has joined #ruby
mistermocha has quit [Remote host closed the connection]
<cooldavid> weaksauce: ^
halfamind1 has joined #ruby
halfamind has quit [Read error: Connection reset by peer]
raeoks has joined #ruby
roamingdog has joined #ruby
Vingador has joined #ruby
dikaio has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
roamingdog has quit [Remote host closed the connection]
kasisnu_ has joined #ruby
duncannz has joined #ruby
MiniFrenchbread has joined #ruby
joaumg has quit [Quit: WeeChat 0.4.2]
dikaio has joined #ruby
JoshGlzBrk has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rbennacer has joined #ruby
kasisnu has quit [Ping timeout: 276 seconds]
aphprentice has quit [Quit: Connection closed for inactivity]
roamingdog has joined #ruby
blackmesa has joined #ruby
pawnbox has joined #ruby
panpainter has joined #ruby
jaguarmagenta has quit [Remote host closed the connection]
pawnbox has quit [Ping timeout: 250 seconds]
nando293921 has quit [Quit: Lost terminal]
majuscule has quit [Ping timeout: 260 seconds]
majuscule has joined #ruby
kenichi has quit [Ping timeout: 276 seconds]
blackmesa has quit [Ping timeout: 276 seconds]
kenichi has joined #ruby
panpainter has quit [Ping timeout: 265 seconds]
arescorpio has quit [Quit: Leaving.]
stardiviner has quit [Ping timeout: 252 seconds]
ensyde__ has joined #ruby
Junaos has quit [Ping timeout: 260 seconds]
ropeney has quit [Ping timeout: 260 seconds]
roamingdog has quit [Remote host closed the connection]
eam has quit [Ping timeout: 260 seconds]
roamingdog has joined #ruby
rcs_ has quit [Ping timeout: 276 seconds]
roamingdog has quit [Remote host closed the connection]
eam has joined #ruby
ensyde has quit [Ping timeout: 250 seconds]
Junaos has joined #ruby
idefine has quit [Remote host closed the connection]
nando293921 has joined #ruby
armyriad has quit [Ping timeout: 252 seconds]
halfamind1 has quit [Read error: Connection reset by peer]
marienz has quit [Ping timeout: 612 seconds]
halfamind has joined #ruby
idefine has joined #ruby
Coldblackice has quit [Ping timeout: 246 seconds]
rcs has joined #ruby
nando293921 has quit [Client Quit]
nando293921 has joined #ruby
roshanavand has quit [Quit: This computer has gone to sleep]
riobe has quit [Remote host closed the connection]
frem_ has quit [Quit: Connection closed for inactivity]
bigfoot111 has joined #ruby
ropeney has joined #ruby
Channel6 has joined #ruby
roamingdog has joined #ruby
zotherstupidguy has quit [Ping timeout: 244 seconds]
solocshaw has quit [Ping timeout: 260 seconds]
nankyokusei has joined #ruby
Axy has quit [Read error: Connection reset by peer]
araujo_ has joined #ruby
araujo has quit [Ping timeout: 246 seconds]
halfamind1 has joined #ruby
halfamind has quit [Read error: Connection reset by peer]
edwinvdgraaf has joined #ruby
nankyokusei has quit [Ping timeout: 260 seconds]
pawnbox has joined #ruby
edwinvdgraaf has quit [Ping timeout: 276 seconds]
crystal77 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Dimik has quit [Ping timeout: 250 seconds]
pawnbox has quit [Ping timeout: 276 seconds]
joneshf-laptop has joined #ruby
yqt has quit [Ping timeout: 240 seconds]
hahuang61 has joined #ruby
mistermocha has joined #ruby
kasisnu has joined #ruby
jancel has joined #ruby
kies has quit [Ping timeout: 265 seconds]
kasisnu_ has quit [Ping timeout: 250 seconds]
mistermocha has quit [Ping timeout: 244 seconds]
kasisnu has quit []
idefine has quit [Remote host closed the connection]
shinnya has quit [Ping timeout: 246 seconds]
SilverKey has joined #ruby
halfamind1 has quit [Quit: Leaving.]
quakephil has quit [Ping timeout: 244 seconds]
noService has quit [Ping timeout: 252 seconds]
hanmac has quit [Ping timeout: 276 seconds]
hanmac has joined #ruby
nertzy has quit [Ping timeout: 244 seconds]
tubbo has quit [Ping timeout: 252 seconds]
rikai has quit [Ping timeout: 246 seconds]
nwhirschfeld has quit [Ping timeout: 265 seconds]
blackmesa has joined #ruby
braincrash has quit [Quit: bye bye]
marienz has joined #ruby
hanmac has quit [Ping timeout: 250 seconds]
zast has joined #ruby
statelesscode has joined #ruby
hanmac has joined #ruby
blackmesa has quit [Ping timeout: 276 seconds]
braincrash has joined #ruby
braincrash is now known as braincras
stardiviner has joined #ruby
karmatr0n has quit [Ping timeout: 260 seconds]
allcentury has joined #ruby
gix has quit [Ping timeout: 260 seconds]
kobain has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
pawnbox has joined #ruby
Dry_Lips has quit [Ping timeout: 246 seconds]
jancel has quit [Remote host closed the connection]
idefine has joined #ruby
Dry_Lips has joined #ruby
Dry_Lips has joined #ruby
edwinvdgraaf has joined #ruby
gix has joined #ruby
rikai has joined #ruby
nwhirschfeld has joined #ruby
tubbo has joined #ruby
pawnbox has quit [Ping timeout: 252 seconds]
roamingdog has quit [Remote host closed the connection]
saneax is now known as saneax_AFK
jancel has joined #ruby
edwinvdgraaf has quit [Ping timeout: 276 seconds]
LoneHermit has joined #ruby
SilverKey has quit [Quit: Halted.]
halfamind has joined #ruby
dikaio has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
halfamind1 has joined #ruby
halfamind has quit [Read error: Connection reset by peer]
Devalo has joined #ruby
cooldavid has quit [Quit: leaving]
karmatr0n has joined #ruby
bruno- has quit [Ping timeout: 276 seconds]
Devalo has quit [Ping timeout: 250 seconds]
yfeldblum has quit [Remote host closed the connection]
roamingdog has joined #ruby
elavee has joined #ruby
<elavee> ruby is great
horaceheaven has joined #ruby
elavee has quit [Client Quit]
Vingador has quit [Remote host closed the connection]
halfamind1 has quit [Quit: Leaving.]
diegoviola has quit [Quit: WeeChat 1.5]
raeoks has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
noService has joined #ruby
noService has quit [Changing host]
noService has joined #ruby
agent_white has joined #ruby
d0lph1n98 has quit [Ping timeout: 240 seconds]
<agent_white> Evenin
ensyde__ has quit [Ping timeout: 276 seconds]
ramfjord has joined #ruby
djbkd has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
tatsuo has joined #ruby
kies has joined #ruby
kgrz has joined #ruby
Eiam_ has joined #ruby
jaguarmagenta has joined #ruby
blackmesa has joined #ruby
allcentury has quit [Ping timeout: 240 seconds]
Vile` has quit [Ping timeout: 240 seconds]
rbennacer has quit [Remote host closed the connection]
blackmesa has quit [Ping timeout: 250 seconds]
eljimmy has quit [Read error: Connection reset by peer]
eljimbo has quit [Quit: This computer has gone to sleep]
araujo_ has quit [Quit: Leaving]
yfeldblum has joined #ruby
kareeoleez has joined #ruby
janebootydoe has quit [Read error: Connection reset by peer]
kareeoleez has quit [Remote host closed the connection]
kareeoleez has joined #ruby
yfeldblum has quit [Remote host closed the connection]
Vile` has joined #ruby
tildes has joined #ruby
pawnbox has joined #ruby
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ereslibre_laptop has quit [Ping timeout: 260 seconds]
A124 has quit [Ping timeout: 265 seconds]
VeryBewitching has quit [Quit: Konversation terminated!]
edwinvdgraaf has joined #ruby
ramfjord has quit [Ping timeout: 260 seconds]
fedexo has quit [Remote host closed the connection]
idefine has quit [Remote host closed the connection]
halfamind has joined #ruby
edwinvdgraaf has quit [Ping timeout: 276 seconds]
A124 has joined #ruby
jancel has quit [Remote host closed the connection]
Lomex has joined #ruby
Lomex has quit [Remote host closed the connection]
Channel6 has quit [Quit: Leaving]
pawnbox has quit [Remote host closed the connection]
nankyokusei has joined #ruby
pawnbox has joined #ruby
antgel has joined #ruby
nankyokusei has quit [Ping timeout: 260 seconds]
ereslibre has joined #ruby
Yiota has joined #ruby
halfamind has quit [Quit: Leaving.]
jimism has joined #ruby
tatsuo has quit [Remote host closed the connection]
Yiota has quit [Client Quit]
mistermocha has joined #ruby
Devalo has joined #ruby
zast has quit [Remote host closed the connection]
raeoks has joined #ruby
tubbo has quit [Ping timeout: 276 seconds]
rikai has quit [Ping timeout: 252 seconds]
edwinvdgraaf has joined #ruby
nwhirschfeld has quit [Ping timeout: 250 seconds]
karmatr0n has quit [Ping timeout: 252 seconds]
ecksit has joined #ruby
<ecksit> hi, i'm wondering how i would go about doing the following PHP snippet in ruby? `print $myobj->{$myval};` where it would first evaluate the value of $myval and then be usable as a method
halfamind has joined #ruby
edwinvdgraaf has quit [Ping timeout: 276 seconds]
halfamind has quit [Client Quit]
jenrzzz has quit [Ping timeout: 276 seconds]
agit0 has quit [Quit: zzzZZZ….]
antgel has quit [Ping timeout: 276 seconds]
<ecksit> i've found eval but i'm not sure if that is the best approach
nwhirschfeld has joined #ruby
tubbo has joined #ruby
rikai has joined #ruby
nertzy has joined #ruby
govg has quit [Quit: leaving]
monoprotic has quit [Ping timeout: 276 seconds]
panpainter has joined #ruby
bigfoot111 has quit [Ping timeout: 276 seconds]
blackmesa has joined #ruby
Yiota has joined #ruby
bobbycvi has quit [Quit: ...]
crystal77 has joined #ruby
diegoaguilar has joined #ruby
pawnbox has quit [Remote host closed the connection]
ctp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
panpainter has quit [Ping timeout: 260 seconds]
Yiota has quit [Client Quit]
blackmesa has quit [Ping timeout: 246 seconds]
sauvin has joined #ruby
Vile` has quit [Ping timeout: 252 seconds]
LoneHermit has quit [Remote host closed the connection]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
<kgrz> ecksit: something like myobj.send(myval) should work™
<ecksit> thanks, let me try that
<kgrz> Note that myval here should be a symbol
szu has joined #ruby
dionysus69 has joined #ruby
RegulationD has joined #ruby
jackjackdripper1 has joined #ruby
<kgrz> or a string
sdwrage has quit [Quit: Leaving]
jackjackdripper has quit [Ping timeout: 240 seconds]
last_staff has joined #ruby
Eiam_ has quit [Quit: ╯°□°)╯︵ǝpouǝǝɹɟ]
pawnbox has joined #ruby
RegulationD has quit [Ping timeout: 246 seconds]
kareeoleez has quit [Remote host closed the connection]
horaceheaven has quit [Quit: horaceheaven]
<ecksit> yep
yfeldblum has joined #ruby
raeoks has quit [Quit: Textual IRC Client: www.textualapp.com]
pawnbox has quit [Remote host closed the connection]
nankyokusei has joined #ruby
lxsameer has joined #ruby
Coldblackice has joined #ruby
tildes has quit [Ping timeout: 276 seconds]
pawnbox has joined #ruby
Madplatypus has quit [Quit: Connection closed for inactivity]
tatsuo has joined #ruby
saneax_AFK is now known as saneax
Yzguy has joined #ruby
lxsameer has quit [Ping timeout: 240 seconds]
beawesomeinstead has quit [Ping timeout: 260 seconds]
raeoks has joined #ruby
GriffinHeart has joined #ruby
cajone has left #ruby [#ruby]
beawesomeinstead has joined #ruby
ur5us has quit [Remote host closed the connection]
<GriffinHeart> Hi everyone, is there a way to freeze a docstring?
<GriffinHeart> or heredoc
<hanmac> GriffinHeart: ruby doesn't use docstring, use rdoc or yard comment format
mistermocha has quit [Remote host closed the connection]
<GriffinHeart> hanmac: sorry I meant heredoc
<Arcaire> GriffinHeart: a heredoc is just a string
bluOxigen has joined #ruby
<GriffinHeart> `BLEH = <<-EOF something EOF`
tatsuo has quit [Ping timeout: 240 seconds]
<hanmac> there is a comment for freezing string literals, but i remember it correctly
<GriffinHeart> Oh I found it, was trying to do it like `BLEH = <<-EOF something EOF.freeze` but its `BLEH = <<-EOF.freeze something EOF` (with the appropriate line breaks)
bluOxigen_ has quit [Ping timeout: 276 seconds]
dikaio has joined #ruby
diegoaguilar has quit [Remote host closed the connection]
Yzguy has quit [Quit: Zzz...]
aufi has joined #ruby
pawnbox has quit [Remote host closed the connection]
cajone has joined #ruby
jwren has joined #ruby
edwinvdgraaf has joined #ruby
MiniFrenchbread has quit [Remote host closed the connection]
<hanmac> shevy: checkout this: its about today's special day ;P
<hanmac> >> (1616..2616).flat_map {|y| (1..12).map {|m| Date.new(y,m,13).wday }}.group_by(&:itself).map {|k,v| [k,v.size]}.sort_by(&:last)
<ruby[bot]> hanmac: # => uninitialized constant Date ...check link for more (https://eval.in/570448)
<hanmac> >> require "date"; (1616..2616).flat_map {|y| (1..12).map {|m| Date.new(y,m,13).wday }}.group_by(&:itself).map {|k,v| [k,v.size]}.sort_by(&:last)
<ruby[bot]> hanmac: # => [[4, 1710], [6, 1712], [1, 1714], [2, 1714], [0, 1719], [3, 1721], [5, 1722]] (https://eval.in/570449)
fedexo has joined #ruby
<hanmac> means in 1000 years, there are 12 more Friday the 13th than Thursday the 13th ;P
nankyokusei has quit [Remote host closed the connection]
jwren has quit [Remote host closed the connection]
edwinvdgraaf has quit [Ping timeout: 276 seconds]
ur5us has joined #ruby
pawnbox has joined #ruby
ur5us has quit [Remote host closed the connection]
fedexo has quit [Ping timeout: 250 seconds]
fedexo has joined #ruby
kareeoleez has joined #ruby
kareeoleez has quit [Remote host closed the connection]
pawnbox has quit [Remote host closed the connection]
kareeoleez has joined #ruby
jwren has joined #ruby
pawnbox has joined #ruby
apofis has joined #ruby
blackmesa has joined #ruby
Devalo has quit [Remote host closed the connection]
howdoi has joined #ruby
hanmac has quit [Ping timeout: 276 seconds]
agit0 has joined #ruby
d0lph1n98 has joined #ruby
hanmac has joined #ruby
blackmesa has quit [Ping timeout: 276 seconds]
jwren_ has joined #ruby
jwren_ has quit [Client Quit]
sulky_ has quit [Ping timeout: 252 seconds]
Miron has quit [Ping timeout: 276 seconds]
djbkd has quit [Quit: My people need me...]
noobsu has joined #ruby
jwren has quit [Ping timeout: 244 seconds]
DissonantGuil3 has quit [Quit: See ya!]
jaiks has quit [Ping timeout: 250 seconds]
ferr has joined #ruby
yeticry has quit [Read error: Connection reset by peer]
PlasmaStar has quit [Ping timeout: 250 seconds]
apofis has quit [Quit: Textual IRC Client: www.textualapp.com]
Caerus|Away has quit [Ping timeout: 250 seconds]
tagaulap has joined #ruby
nando293921 has quit [Ping timeout: 276 seconds]
yeticry has joined #ruby
PlasmaStar has joined #ruby
firstdayonthejob has joined #ruby
fedexo has quit [Remote host closed the connection]
noobsu has quit [Read error: Connection reset by peer]
noobsu has joined #ruby
bruno- has joined #ruby
djbkd has joined #ruby
yfeldblum has quit [Ping timeout: 265 seconds]
ravishankarjha has joined #ruby
yfeldblum has joined #ruby
Parko has quit [Quit: In a while, crocodile]
bruno- has quit [Ping timeout: 260 seconds]
edwinvdgraaf has joined #ruby
pawnbox has quit [Remote host closed the connection]
<weaksauce> cooldavid of course that's cheating
<weaksauce> jesus
agit0 has quit [Quit: zzzZZZ….]
noobsu has quit [Read error: Connection reset by peer]
pawnbox has joined #ruby
yfeldblum has quit [Ping timeout: 250 seconds]
Macaveli has joined #ruby
firstdayonthejob has quit [Ping timeout: 246 seconds]
sinkensabe has joined #ruby
edwinvdgraaf has quit [Ping timeout: 276 seconds]
Cohedrin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
noobsu has joined #ruby
syndikate has quit [Ping timeout: 265 seconds]
codecop has joined #ruby
agit0 has joined #ruby
MiniFrenchbread has joined #ruby
agit0 has quit [Read error: No route to host]
smathy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
noobsu has quit [Read error: Connection reset by peer]
LoneHerm_ has joined #ruby
ctp has joined #ruby
<bazzy> does ruby really not have `"true" if true else "false"` syntax? namely, the "else" part
<bazzy> (one-liner)
noobsu has joined #ruby
vondruch has joined #ruby
jaruga___ has joined #ruby
jaruga___ is now known as jaruga____
<agent_white> ||
s00pcan has quit [Remote host closed the connection]
GriffinHeart has quit [Remote host closed the connection]
<agent_white> Or turnary?
noark9 has joined #ruby
zyzioziom has joined #ruby
<agent_white> bazzy: return bob || fred
<agent_white> bob ? "BAHB" : "fred"
<bazzy> thanks boss
<agent_white> I actually just learned the first one the other day myself.
<agent_white> :D
yfeldblum has joined #ruby
sinkensabe has quit [Ping timeout: 265 seconds]
<bazzy> agent_white, not sure how that would translate to something like `user = m.user.authname if m.user.authed? else m.user`
panpainter has joined #ruby
sinkensabe has joined #ruby
elaptics`away is now known as elaptics
ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
blackmesa has joined #ruby
noobsu has quit [Read error: Connection reset by peer]
aganov has joined #ruby
<agent_white> bazzy: I would use the ternary operator
Devalo has joined #ruby
TomyWork has joined #ruby
noobsu has joined #ruby
<agent_white> bazzy: is_true? (?) then; do this; : else;do;this
biberu has joined #ruby
<agent_white> bazzy: m.user.authed? ? m.user.authname : m.user
Mia has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
<bazzy> that's the syntax I've forgotten. Thanks!
<bazzy> agent_white, ^
panpainter has quit [Ping timeout: 276 seconds]
<agent_white> I wonder if you can parens around the inside '?'
<agent_white> make it like a question balloon
brunto has joined #ruby
blackmesa has quit [Ping timeout: 276 seconds]
Miron has joined #ruby
mark_66 has joined #ruby
Devalo has quit [Ping timeout: 250 seconds]
edwinvdgraaf has joined #ruby
GriffinHeart has joined #ruby
<agent_white> nope :(
djbkd has quit [Remote host closed the connection]
sinkensabe has quit [Read error: Connection reset by peer]
ecksit has quit []
sulky_ has joined #ruby
sinkensabe has joined #ruby
anisha has joined #ruby
karmatr0n has joined #ruby
jaguarmagenta has quit [Remote host closed the connection]
ensyde__ has joined #ruby
minot has quit [Read error: Connection reset by peer]
dikaio has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
CloCkWeRX has quit [Quit: Leaving.]
karmatr0n has quit [Ping timeout: 260 seconds]
CloCkWeRX has joined #ruby
bruno- has joined #ruby
blackgoat has quit [Quit: WeeChat 1.4]
sinkensabe has quit [Read error: Connection reset by peer]
agent_white has quit [Quit: gnight folks]
sinkensabe has joined #ruby
raeoks has quit [Ping timeout: 252 seconds]
bruno- has quit [Ping timeout: 240 seconds]
lulzmachine_ has joined #ruby
symm- has joined #ruby
sepp2k has joined #ruby
lessless has joined #ruby
ur5us has joined #ruby
Yiota has joined #ruby
reaVer has quit [Ping timeout: 252 seconds]
PlasmaStar has quit [Ping timeout: 260 seconds]
p0p0pr37_ has joined #ruby
roamingdog has quit [Remote host closed the connection]
ensyde__ has quit [Read error: Connection reset by peer]
yfeldblum has quit [Ping timeout: 260 seconds]
Yiota has quit [Client Quit]
kareeole_ has joined #ruby
sinkensabe has quit [Ping timeout: 250 seconds]
pawnbox has quit [Remote host closed the connection]
p0p0pr37 has quit [Ping timeout: 265 seconds]
p0p0pr37_ is now known as p0p0pr37
symm- has quit [Ping timeout: 260 seconds]
pawnbox has joined #ruby
Hobbyboy has quit [Ping timeout: 260 seconds]
crystal77 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
_aeris_ has quit [Ping timeout: 276 seconds]
kareeoleez has quit [Ping timeout: 260 seconds]
kareeoleez has joined #ruby
Yiota has joined #ruby
akem has joined #ruby
neanderslob_ has quit [Ping timeout: 276 seconds]
kareeole_ has quit [Ping timeout: 240 seconds]
yfeldblum has joined #ruby
BlaDe^ has quit [Remote host closed the connection]
PlasmaStar has joined #ruby
Dimik has joined #ruby
neanderslob has joined #ruby
_aeris_ has joined #ruby
Yiota has quit [Client Quit]
dikaio has joined #ruby
siovene has joined #ruby
troulouliou_div2 has joined #ruby
aswen has joined #ruby
sinkensabe has joined #ruby
roamingdog has joined #ruby
nankyokusei has joined #ruby
Hobbyboy has joined #ruby
d0lph1n98 has quit [Ping timeout: 240 seconds]
Yiota has joined #ruby
sinkensa_ has joined #ruby
terlar has joined #ruby
sinkensabe has quit [Read error: Connection reset by peer]
tvw has joined #ruby
LoneHerm_ has quit [Remote host closed the connection]
marr has joined #ruby
nankyokusei has quit [Ping timeout: 244 seconds]
Yiota has quit [Client Quit]
Madplatypus has joined #ruby
ReK2 has quit [Remote host closed the connection]
neanderslob has quit [Ping timeout: 250 seconds]
neanderslob has joined #ruby
ReK2 has joined #ruby
blackmesa has joined #ruby
dikaio has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
janno has joined #ruby
Macaveli has quit [Quit: Textual IRC Client: www.textualapp.com]
szu has quit [Quit: Leaving]
Devalo has joined #ruby
ICantCook has quit [Ping timeout: 240 seconds]
evidex has joined #ruby
ICantCook has joined #ruby
Macaveli has joined #ruby
joneshf-laptop has quit [Ping timeout: 240 seconds]
blackmesa has quit [Ping timeout: 246 seconds]
dikaio has joined #ruby
Devalo has quit [Ping timeout: 250 seconds]
blaxter has joined #ruby
j_mcnally has joined #ruby
syndikate has joined #ruby
pawnbox has quit [Remote host closed the connection]
aswen has quit [Quit: WeeChat 1.4]
pawnbox has joined #ruby
tatsuo has joined #ruby
dionysus69 has quit [Ping timeout: 252 seconds]
dikaio has quit [Quit: Textual IRC Client: www.textualapp.com]
nischay has joined #ruby
karmatr0n has joined #ruby
itgone has joined #ruby
Dimik has quit [Ping timeout: 240 seconds]
yfeldblum has quit [Ping timeout: 276 seconds]
Coldblackice has quit [Ping timeout: 276 seconds]
karmatr0n has quit [Ping timeout: 244 seconds]
startupality has joined #ruby
neanderslob has quit [Read error: Connection reset by peer]
blackmesa has joined #ruby
jgt1 has joined #ruby
d0nn1e has quit [Ping timeout: 276 seconds]
d0nn1e has joined #ruby
alexherbo2 has quit [Quit: WeeChat 1.4]
neanderslob has joined #ruby
aupadhye has joined #ruby
grassass has quit [Remote host closed the connection]
noobsu has quit [Ping timeout: 276 seconds]
akem has quit [Ping timeout: 244 seconds]
last_staff has quit [Quit: last_staff]
quakephil has joined #ruby
skade has joined #ruby
shibly has joined #ruby
DoubleMalt has joined #ruby
araujo has joined #ruby
araujo has quit [Max SendQ exceeded]
joneshf-laptop has joined #ruby
roamingdog has quit [Remote host closed the connection]
matp has quit [Remote host closed the connection]
roamingdog has joined #ruby
araujo has joined #ruby
akem has joined #ruby
jgt1 has quit [Ping timeout: 265 seconds]
jgt1 has joined #ruby
araujo has quit [Max SendQ exceeded]
lessless has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
zyzioziom has quit [Ping timeout: 252 seconds]
bruce_lee has joined #ruby
bruce_lee has quit [Changing host]
bruce_lee has joined #ruby
matp has joined #ruby
sinkensa_ has quit [Ping timeout: 260 seconds]
panpainter has joined #ruby
sinkensabe has joined #ruby
grassass has joined #ruby
tax has quit [Ping timeout: 252 seconds]
panpainter has quit [Ping timeout: 244 seconds]
Macaveli has quit [Remote host closed the connection]
Macaveli has joined #ruby
Caerus|Away has joined #ruby
tvw has quit []
ur5us has quit [Remote host closed the connection]
tvw has joined #ruby
d0lph1n98 has joined #ruby
sinkensabe has quit [Read error: Connection reset by peer]
mdw has joined #ruby
sinkensabe has joined #ruby
ur5us has joined #ruby
ravishankarjha has quit [Remote host closed the connection]
RegulationD has joined #ruby
sinkensabe has quit [Read error: Connection reset by peer]
sinkensabe has joined #ruby
shibly has left #ruby ["Leaving"]
jgt1 has quit [Ping timeout: 240 seconds]
sinkensabe has quit [Read error: Connection reset by peer]
sinkensabe has joined #ruby
LoneHerm_ has joined #ruby
sinkensabe has quit [Remote host closed the connection]
RegulationD has quit [Ping timeout: 276 seconds]
toretore has joined #ruby
Yiota has joined #ruby
jaguarmagenta has joined #ruby
zyzioziom has joined #ruby
LoneHerm_ has quit [Ping timeout: 244 seconds]
Callum has quit [Quit: Page closed]
chipotle has quit [Ping timeout: 244 seconds]
giz|work has joined #ruby
jaguarmagenta has quit [Ping timeout: 250 seconds]
yfeldblum has joined #ruby
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
arup_r has joined #ruby
ohcibi has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
Yiota has joined #ruby
<Bish> hi folks, what's the difference between def x(a:1).. and def x(a=1)...
ohcibi has joined #ruby
<hanmac> Bish: 1) key arguments 2) default arguments
<arup_r> first 1 is keyword argument
jds has joined #ruby
<arup_r> oh answer gives=n!
<arup_r> given**
<Bish> okay, hm, what is key argument syntax? what is it good for?
platzhirsch has joined #ruby
<Bish> i got something like def x a=1,b=2,c=3, i search a way to call x with a value for C but not change a,b defaults
roamingdog has quit [Remote host closed the connection]
<Bish> tried to use the double splat operator for that.. didn't work, unless i use the key notation, which i don't quite understand
nischay_ has joined #ruby
<Bish> i thinki i get it
Yiota has quit [Client Quit]
nischay has quit [Ping timeout: 276 seconds]
<Bish> they're disjunct ways to give functions arguments
<Bish> i get it, they're not compatible
<Bish> right?
<Bish> since when is key argument list a thing? i mean versions
itguru has joined #ruby
<itguru> I started to learn ruby yesterday to write something that does some lookups, and extracts the ip addresses returned into a file — how — I'm currently drinking from the firehose called google search, and it's killing me. I'm loving it, but… well, ruby is too damn flexible. in bash, i would just run sed on the strings to get them back, but would would be the ruby approach?
<Bish> itguru: get the data into a string and use it's scan method
<itguru> ??!
<itguru> awesome!
<Bish> >> "peter:maffay julia:roberts".scan(/([^\s]+):([^\s]+)/)
<ruby[bot]> Bish: # => [["peter", "maffay"], ["julia", "roberts"]] (https://eval.in/570718)
<Bish> as an example
karmatr0n has joined #ruby
<Bish> how you can easily exctract data out of a string
skade has quit [Quit: Computer has gone to sleep.]
GriffinHeart has quit [Remote host closed the connection]
<itguru> Thanks Bish — That looks like what I need, I was running into examples where I would only get the first match, there are multiple ips in the string
j_mcnally has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<itguru> I will now go and struggle with that
cb` has quit [Ping timeout: 276 seconds]
<Bish> >> "1.2.3.4 5.5.5.5 133.255.255.255".scan /\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}/
<ruby[bot]> Bish: # => ["1.2.3.4", "5.5.5.5", "133.255.255.255"] (https://eval.in/570721)
eljimbo has joined #ruby
karmatr0n has quit [Ping timeout: 260 seconds]
roamingdog has joined #ruby
jackjackdripper1 has quit [Quit: Leaving.]
lulzmachine_ has quit [Quit: Connection closed for inactivity]
wigust has joined #ruby
roamingdog has quit [Ping timeout: 252 seconds]
ctp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nankyokusei has joined #ruby
last_staff has joined #ruby
mdw has quit [Quit: Sleeping Zzzzz]
lessless has joined #ruby
nankyokusei has quit [Ping timeout: 260 seconds]
ravishankarjha has joined #ruby
koooge has quit [Quit: Leaving...]
Masonn has joined #ruby
VaibhavRajput has joined #ruby
VaibhavRajput has left #ruby [#ruby]
charliesome has joined #ruby
Macaveli has quit [Quit: Textual IRC Client: www.textualapp.com]
eljimbo has quit [Quit: This computer has gone to sleep]
Devalo has joined #ruby
sepp2k has quit [Ping timeout: 260 seconds]
sdothum has joined #ruby
pandaant has joined #ruby
roshanavand has joined #ruby
sepp2k has joined #ruby
Devalo has quit [Ping timeout: 250 seconds]
itguru has quit [Quit: Leaving.]
noobsu has joined #ruby
<kareeoleez> I want to parse output from ifconfig, do you have any parser to suggest ?
yfeldblum has quit [Ping timeout: 276 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pawnbox has quit [Remote host closed the connection]
Nahra has quit [Ping timeout: 250 seconds]
<kalleth> regex :trollface:
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
hk238 has joined #ruby
itguru has joined #ruby
chipotle has joined #ruby
hanmac has quit [Ping timeout: 250 seconds]
hanmac has joined #ruby
gnufied has joined #ruby
pawnbox has joined #ruby
pawnbox has quit [Remote host closed the connection]
moeabdol has quit [Ping timeout: 252 seconds]
MiniFrenchbread has quit [Remote host closed the connection]
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
startupality has quit [Quit: startupality]
roshanavand_ has joined #ruby
postmodern has quit [Quit: Leaving]
umdstu has joined #ruby
ur5us has quit [Ping timeout: 250 seconds]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
roshanavand has quit [Ping timeout: 260 seconds]
nadir has quit [Quit: Connection closed for inactivity]
roshanavand_ has quit [Client Quit]
blaxter has quit [Read error: Connection reset by peer]
roshanavand_ has joined #ruby
sdothum has joined #ruby
jgt1 has joined #ruby
blaxter has joined #ruby
dvinciguerra has joined #ruby
roshanavand_ has quit [Client Quit]
roshanavand_ has joined #ruby
startupality has joined #ruby
ctp has joined #ruby
eljimbo has joined #ruby
Ishido has joined #ruby
giz|work has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
roshanavand_ has quit [Client Quit]
stardiviner has quit [Ping timeout: 252 seconds]
bruno- has joined #ruby
roshanavand_ has joined #ruby
moeabdol has joined #ruby
terlar has quit [Ping timeout: 246 seconds]
startupality has quit [Quit: startupality]
araujo has joined #ruby
araujo has quit [Max SendQ exceeded]
roshanavand_ has quit [Client Quit]
bruno- has quit [Ping timeout: 265 seconds]
araujo has joined #ruby
startupality has joined #ruby
rodfersou has joined #ruby
ctp has quit [Ping timeout: 244 seconds]
<arup_r> I asked #bundler, but that channel is not responding, so thought to ask here. What is the difference between `bundle update gemname` and `bundle update --source gemname` ?
roshanavand_ has joined #ruby
<arup_r> main, I know how the first one works.. not sure about the second one.
<arup_r> s/main/mainly
johnmilton has joined #ruby
roshanavand_ has quit [Client Quit]
FernandoBasso has joined #ruby
noark9 has quit [Remote host closed the connection]
<Bish> kareeoleez: how about not getting the information from ifconfig
<kareeoleez> Bish: but ?
<Bish> some file in /proc /sys
<kareeoleez> Bish: I've tried Socket, network_interface etc.
<kareeoleez> what file ?
<Bish> wait, i wrote something a while ago, let's see if i can find it
stardiviner has joined #ruby
banister has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
roshanavand_ has joined #ruby
<Bish> kareeoleez: what information do you actually need from ifconfig
<kareeoleez> Bish: everything :P
<kareeoleez> Bish: I am currently writing a parser myself
<Bish> /proc/net/dev gives u some stats aobut interfaces
<kareeoleez> I tried parslet but I find it a bit complicated
<kareeoleez> Bish: I'm on BSD
<kareeoleez> no /proc
<Bish> oh, no clue then
<kareeoleez> np
startupality has quit [Quit: startupality]
tvw has quit []
madgen has joined #ruby
<Bish> lol, ifocnfig uses ioctl to get ip of interfaces
<Bish> why the fuck does it have to be so comlicated, geez
andywww has joined #ruby
<andywww> what am i doing wrong with this simple array concatenation?
<andywww> its pluralising everything in the final array
startupality has joined #ruby
<kareeoleez> Bish: I am not familliar with the usage of ioctl actually but I'd like to
<Bish> kareeoleez: well, ruby out of the box won't be able to do that, no clue if there is some fancy gem that does that
<Bish> mebbe
<kareeoleez> Bish: how do you start with ioctl and ruby ?
startupality has quit [Client Quit]
<Bish> as i said, ruby out of the box won't be able to do that ( im guessing that, relatively sure )
Vile` has joined #ruby
<Bish> but for wifi actually
vzeqi has joined #ruby
horaceheaven has joined #ruby
<jhass> andywww: String#<< modifies the original string, it does not create a copy
<jhass> andywww: you're looking for String#+
<Bish> maybe parsing ifconfig isn't such a bad idea after all
<andywww> yup just sussed it
<andywww> thank you
andywww has left #ruby [#ruby]
<Bish> and off he goes
<kareeoleez> Bish: thanks!
<Bish> this is crazy though
jaguarmagenta has joined #ruby
<kareeoleez> Bish: rethtool looks great
<kareeoleez> Bish: I am interacting a lot with hardware so the "ideal" would be to know-how with ioctl
<kareeoleez> Bish: but seems to me too difficult
<kareeoleez> I mean where do you start ?
<Bish> there won't be an easy way, what you're trying to do seems very special
<Bish> your best hope, someone already had that problem, and wrote a gem
anonymouse1935 has joined #ruby
<anonymouse1935> hey guys
WebDevB has joined #ruby
<Bish> anonymouse1935: hi
<Bish> kareeoleez: but i was wrong, you can do ioctl with ruby
pawnbox has joined #ruby
<WebDevB> Hey guys, we're looking for an ad-hoc ruby on rails developer work will range from a couple of hours a month to a couple of days a month... We need someone to start yesterday haha as we've been let down.
czerasz has joined #ruby
jaguarmagenta has quit [Ping timeout: 265 seconds]
skade has joined #ruby
<kareeoleez> Bish: of course you can
<kareeoleez> Bish: but how do you start ?
<Bish> well, is there something like strace for bsd?
davedev24 has joined #ruby
terlar has joined #ruby
<Bish> track the ioctl syscalls ifconfig does to get the information you need
<Bish> and reproduce them with Kernel.syscall
<Bish> would be a wierd but cool way to dit
noService has quit [Ping timeout: 260 seconds]
nfk has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
ta_ has quit [Read error: Connection reset by peer]
ta_ has joined #ruby
anonymouse1935 has left #ruby ["Leaving"]
lxsameer has joined #ruby
lxsameer has joined #ruby
Mia has joined #ruby
Mia has joined #ruby
Yeomra has joined #ruby
* Bish wonders what syscall will do on windows
noService has joined #ruby
sleetdrop has joined #ruby
blackmesa has quit [Ping timeout: 246 seconds]
panpainter has joined #ruby
itguru1 has joined #ruby
<kareeoleez> Bish: how do you track ifconfig calls ?
<kareeoleez> Bish: in the .c file ?
itguru has quit [Ping timeout: 244 seconds]
<kareeoleez> ifconfig is an executable binary file
aldodelgado has joined #ruby
hanmac has quit [Ping timeout: 250 seconds]
davedev24 has quit [Read error: Connection reset by peer]
Caerus|Away has quit [Ping timeout: 250 seconds]
noService has quit [Ping timeout: 265 seconds]
davedev24 has joined #ruby
<jhass> kareeoleez: strace ?
panpainter has quit [Ping timeout: 252 seconds]
startupality has joined #ruby
<kareeoleez> ?
<jhass> strace -e ioctol ifconfig
<kareeoleez> ah BSD doesn't have strace
<jhass> and no equivalent? oO
<Bish> keep in mind that using syscalls wo't be very portable
<kareeoleez> ktrace maybe
xall has quit [Ping timeout: 250 seconds]
vzeqi has quit [Ping timeout: 240 seconds]
noService has joined #ruby
govg has joined #ruby
<kareeoleez> but even ktrace ifconfig creates a file ktrace.out with some gibberish
j_mcnally has joined #ruby
<Bish> yeah you need to filter for ioctls
<Bish> cat ktrace.out | grep ^ioctl
araujo_ has joined #ruby
nerium has joined #ruby
araujo_ has quit [Read error: Connection reset by peer]
panpainter has joined #ruby
allcentury has joined #ruby
<kareeoleez> nothing comes out
LoneHerm_ has joined #ruby
skade has joined #ruby
<Bish> well i do't know how that ktrace file looks, use the tool that was linked before
<Bish> truss or whatever
araujo has quit [Ping timeout: 265 seconds]
Vile` has quit [Ping timeout: 276 seconds]
panpainter has quit [Ping timeout: 252 seconds]
ldnunes has joined #ruby
mlehrer has quit [Ping timeout: 252 seconds]
banister has joined #ruby
nankyokusei has joined #ruby
hanmac has joined #ruby
synthroid has joined #ruby
mdw has joined #ruby
raz has joined #ruby
Vile` has joined #ruby
zyzioziom has quit [Ping timeout: 265 seconds]
nankyokusei has quit [Ping timeout: 250 seconds]
horaceheaven has quit [Quit: horaceheaven]
LoneHerm_ has quit [Remote host closed the connection]
flips has left #ruby ["Textual IRC Client: www.textualapp.com"]
machinewar has joined #ruby
j_mcnally has quit [Ping timeout: 265 seconds]
LoneHerm_ has joined #ruby
Masonn has quit [Ping timeout: 246 seconds]
<machinewar> anyone know of convention for setting up mini-test in a ruby gem project? i.e. so that all of my classes are when tests run? Do I need to make a spec_helper and add to LOAD_PATH? or do you explicitly require the classes in your specs?
<raz> hmm, how do i set a constant on a class created via Class.new? i can't get it to work :( http://pastebin.com/6wTcrsmf
<ruby[bot]> raz: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/af2377e28aa788b5dddba48f3e33a4cb
<ruby[bot]> raz: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
soc42 has joined #ruby
<raz> woops
<machinewar> RazorX: you can use const_set(constant_name, val)
<kareeoleez> can someone explain what does this "/inet (?<ipv4>[\d\.]+)/ =~ rin" do ?
platzhirsch has quit [Ping timeout: 252 seconds]
<machinewar> if you have instance of the class then you'd do obj = Class.new; obj.class.const_set("MY_CONST", "value")
<machinewar> raz: ^ sorry tagged someone else
<raz> machinewar: oh, gonna try that
<machinewar> raz: then you can do stuff like obj.class::MY_CONST
platzhirsch has joined #ruby
j_mcnally has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
nfk has quit [Quit: Try memory.free_dirty_pages=true in about:config]
<raz> machinewar: sadly doesn't work, still the same error: https://gist.github.com/anonymous/56cc6181bb8d45b238eefa0d154bfc0f
mighty_gorilla has quit [Ping timeout: 264 seconds]
Devalo has joined #ruby
soahccc has quit [Ping timeout: 264 seconds]
<machinewar> raz: you don't need the .new on line 9 you already have an instance
<machinewar> since you called .new on line 1
<machinewar> klass.class.const_set 'MY_CONST', Time.now
`derpy has quit [Ping timeout: 264 seconds]
<raz> machinewar: same error :(
<raz> it seems i can set the constant in a trillion ways, but it's not seen by the methods in the class
bauruine has quit [Ping timeout: 264 seconds]
SuperTux88 has quit [Ping timeout: 264 seconds]
<Elysia> I personally used #const_get to get the constant, I don't know if that's ideal though
<jhass> raz: try your original way but referencing via self.class::MY_CONST
<raz> jhass: you mean reference in the method like that?
<jhass> yes
<raz> well, i'd like to use constant like a normal constant
<raz> that's the whole point here ;)
sleetdrop has quit [Quit: Computer has gone to sleep.]
<raz> (to minimize the syntax voodoo)
<jhass> iirc constant lookup is tied to the lexical scope at definition, not at execution
<machinewar> raz: you need to not make an instance on first line and instead open up the class
<machinewar> class Class def hello puts MY_CONST end end
<machinewar> klass = Class.const_set("MY_CONST", "val")
aupadhye has quit [Read error: Connection reset by peer]
<machinewar> Class.new.hello
<raz> machinewar: but... wouldn't that add the const to 'Class' then?
<machinewar> that works for me
Devalo has quit [Ping timeout: 250 seconds]
noService has quit [Ping timeout: 276 seconds]
roshanavand_ has quit [Read error: Connection reset by peer]
<machinewar> yes constants are defined on a class level
<kareeoleez> guys what does =~ mean ?
itgone has quit [Read error: Connection reset by peer]
<jhass> kareeoleez: at the end of the day it's a method call, Object#=~, String#=~, Regexp#=~
last_staff has quit [Quit: last_staff]
machinewar has quit []
hollywood has joined #ruby
`derpy has joined #ruby
SuperTux88 has joined #ruby
soahccc has joined #ruby
<jhass> raz: machinewar's last version works because it's essentially the same as adding it to Object
<kareeoleez> jhass: can you explain ?
okdas_ has quit [Ping timeout: 276 seconds]
roshanavand_ has joined #ruby
<raz> jhass: hm yes, but i don't see how i'd make that work with my anonymous class
<kareeoleez> what's the alternative
<raz> anyway, trying some more stuff out :)
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
okdas has joined #ruby
okdas has joined #ruby
<jhass> raz: I think what you want is not possible (without defining the constants in the "global" (Object, Module, Class) context
ta_ has quit [Read error: Connection reset by peer]
<raz> jhass: yea i guess if i can get your method to work in my actual context, i'll be fine :)
<jhass> raz: a workaround could be to add a method called MY_CONST ...
<raz> jhass: well, at the core i just want to inject some "configuration" into the created class. it doesn't even have to be a constant, but that seemed the most natural way to define something across all instances of said class
aupadhye has joined #ruby
<raz> i guess a class-var would work equally well, if that is somehow easier
ta_ has joined #ruby
<jhass> I think I'd just inject a method
<jhass> klass.send(:define_method, :configuration) { configuration }
bauruine has joined #ruby
kareeoleez has quit [Remote host closed the connection]
kareeoleez has joined #ruby
<kareeoleez> jhass: thanks
arup_r has left #ruby [#ruby]
<kareeoleez> jhass: I guess somthing like str.match(/ /)
skade has joined #ruby
<jhass> pretty much
<jhass> =
<jhass> er, =~ has some weird side effects but I prefer not to use them
akkmaxon has joined #ruby
<Bish> what side effects?
itguru1 has quit [Ping timeout: 260 seconds]
<Bish> >> "abc"[/(a|b)/,1]
<ruby[bot]> Bish: # => "a" (https://eval.in/570848)
<Bish> i like this one
<Bish> >> "abc"[/(a|b)/,2]
<ruby[bot]> Bish: # => nil (https://eval.in/570849)
<Bish> :O
<Bish> >> "abc"[/(a|b)/,0]
<ruby[bot]> Bish: # => "a" (https://eval.in/570851)
nadir has joined #ruby
<jhass> Bish: like creating local vars for named captures when used inside an if
reaVer has joined #ruby
roamingdog has joined #ruby
|2701 has joined #ruby
panpainter has joined #ruby
<Bish> scan / match doesn't do that?
<Bish> yeah that local var string is scary, and actually i guess my latest project is vulnable to injection there
blackmesa has joined #ruby
<Bish> s/string/thing
startupality has quit [Quit: startupality]
DaniG2k has joined #ruby
startupality has joined #ruby
jancel has joined #ruby
roamingdog has quit [Remote host closed the connection]
Vile` has quit [Ping timeout: 252 seconds]
startupality has quit [Client Quit]
roamingdog has joined #ruby
zyzioziom has joined #ruby
jds has quit [Quit: Connection closed for inactivity]
LoneHerm_ has quit [Remote host closed the connection]
blackmesa has quit [Ping timeout: 244 seconds]
Yiota has joined #ruby
Caerus|Away has joined #ruby
jancel has quit [Ping timeout: 246 seconds]
startupality has joined #ruby
<jhass> well, they need to be literals iirc
codecop has quit [Remote host closed the connection]
startupality has quit [Client Quit]
syndikate has quit [Ping timeout: 244 seconds]
<Bish> oh, so where is the issue then?
monoprotic has joined #ruby
<jhass> it's IMO obscure
startupality has joined #ruby
tatsuo has quit [Remote host closed the connection]
panpainter has quit [Remote host closed the connection]
tatsuo has joined #ruby
<jhass> try running this https://p.jhass.eu/1o.rb
arpegius has joined #ruby
<jhass> now consider the regexp to be much longer and more complex
halfamind has joined #ruby
<jhass> easy to shadow another local accidentially
ramortegui has joined #ruby
panpainter has joined #ruby
millerti has joined #ruby
zyzioziom has quit [Ping timeout: 260 seconds]
anisha has quit [Quit: Leaving]
flashpoint9 has joined #ruby
<Bish> i tried to make use of it, because i actually liked it
<Bish> but i failed, because accessing them can be weird
syndikate has joined #ruby
fedexo has joined #ruby
<Bish> you have your own pasting service, you must have come far :D
rbennacer has joined #ruby
huyderman has quit [Remote host closed the connection]
huyderman has joined #ruby
Couch has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
DaniG2k has quit [Quit: leaving]
skade has joined #ruby
fmcgeough has joined #ruby
circ-user-0vXzk has joined #ruby
malconis has joined #ruby
tatsuo has quit [Remote host closed the connection]
bronson has joined #ruby
RegulationD has joined #ruby
fedexo has quit [Remote host closed the connection]
aegis3121 has joined #ruby
ChiefAlexander has joined #ruby
karmatr0n has joined #ruby
bronson has quit [Ping timeout: 252 seconds]
ChiefAlexander has quit [Read error: Connection reset by peer]
ChiefAlexander has joined #ruby
RegulationD has quit [Ping timeout: 246 seconds]
pawnbox has quit [Remote host closed the connection]
emilkarl has joined #ruby
karmatr0n has quit [Ping timeout: 240 seconds]
jaguarmagenta has joined #ruby
giz|work has joined #ruby
jaguarmagenta has quit [Ping timeout: 244 seconds]
chouhoulis has joined #ruby
pawnbox has joined #ruby
p0p0pr37_ has joined #ruby
xue has quit [Remote host closed the connection]
chipotle has quit [Ping timeout: 244 seconds]
p0p0pr37 has quit [Ping timeout: 252 seconds]
p0p0pr37_ is now known as p0p0pr37
tildes has joined #ruby
pawnbox has quit [Ping timeout: 250 seconds]
crameth has joined #ruby
djbkd has joined #ruby
czerasz has quit [Ping timeout: 250 seconds]
emilkarl has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
chipotle has joined #ruby
mjuszczak has joined #ruby
lessless has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
griffindy has joined #ruby
sdothum has joined #ruby
rkazak has joined #ruby
SilverKey has joined #ruby
roamingdog has quit [Read error: Connection reset by peer]
laska has joined #ruby
d0nn1e has quit [Ping timeout: 250 seconds]
ta_ has quit [Read error: Connection reset by peer]
SilverKey has quit [Client Quit]
cdg has joined #ruby
d0nn1e has joined #ruby
noService has joined #ruby
ta_ has joined #ruby
laska has quit [Client Quit]
nankyokusei has joined #ruby
bruno- has joined #ruby
idle_task has joined #ruby
freerobby has joined #ruby
dionysus69 has joined #ruby
idletask has quit [Ping timeout: 260 seconds]
j_mcnally has quit [Ping timeout: 265 seconds]
nankyokusei has quit [Ping timeout: 252 seconds]
kareeoleez has quit [Remote host closed the connection]
cooldavid has joined #ruby
<cooldavid> hi
noService has quit [Ping timeout: 276 seconds]
<cooldavid> is there a better/not crazy way to write this code: https://gist.github.com/anonymous/cc50a2e0dbcd497fd07080aaeca557d4
<cooldavid> mainly the code in payments_collected_in
kareeoleez has joined #ruby
fgo has joined #ruby
diegoviola has joined #ruby
frem_ has joined #ruby
panpainter has quit [Read error: Connection reset by peer]
<monoprotic> what is it doing
panpainter has joined #ruby
j_mcnally has joined #ruby
<cooldavid> getting some values from the db that the spec is expecting
<monoprotic> i mean is there logic behind payments_collected_in
<cooldavid> I wrote it that way because I don't know how else to get those values
chopin has joined #ruby
jobewan has joined #ruby
kgrz has quit [Ping timeout: 244 seconds]
<cooldavid> not really, or well, I don't know...
zapata has quit [Quit: WeeChat 1.5]
Devalo has joined #ruby
chriscoffee has joined #ruby
nischay_ has quit [Remote host closed the connection]
chouhoulis has quit [Remote host closed the connection]
chriscoffee has quit [Max SendQ exceeded]
syndikate has quit [Quit: Leaving]
kareeoleez has quit [Ping timeout: 260 seconds]
chouhoulis has joined #ruby
karmatr0n has joined #ruby
<monoprotic> cooldavid you could make a date to offset hash
diego3 has joined #ruby
JackMc has joined #ruby
<monoprotic> {Date.new(2016, 1, 1) => 1, Date.new(2016, 2, 1) => 7, ...}
<blaxter> first thing to implement something is to understand the logic
<JackMc> Hey everyone - is there an easy way in Ruby to make something equivalent to a namedtuple in Python?
<JackMc> Like something that I can do thingy.size
<blaxter> i can't understand the logic of that neither looking at the code nor the spec
<blaxter> also magic numbers not a good thing
soc42 has quit [Remote host closed the connection]
<shevy> 42!
<shevy> what do I win
<adaedra> A kick
Devalo has quit [Ping timeout: 250 seconds]
momomomomo has joined #ruby
<blaxter> JackMc: Struct
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
diego4 has joined #ruby
diegoviola has quit [Ping timeout: 244 seconds]
rkazak has quit [Quit: Sleep.....ing....]
mdw has quit [Quit: Sleeping Zzzzz]
<cooldavid> monoprotic: I'm supposed to find out if something can be billed for that month, but I don't know how
<cooldavid> monoprotic: will that require me to change the spec?
panpainter has quit [Read error: Connection reset by peer]
zapata has joined #ruby
panpainter has joined #ruby
diego3 has quit [Ping timeout: 252 seconds]
diego4 has quit [Client Quit]
diego3 has joined #ruby
SilverKey has joined #ruby
Masonn has joined #ruby
ChiefAlexander has quit [Remote host closed the connection]
jancel has joined #ruby
TomyWork has quit [Ping timeout: 244 seconds]
s00pcan has joined #ruby
millerti has joined #ruby
<cooldavid> right, I also don't know what I'm supposed to do, they also won't tell me so I can't know the logic
<cooldavid> they said it's part of guessing, or part of the exercise
[Butch] has joined #ruby
jancel has quit [Ping timeout: 260 seconds]
charliesome has joined #ruby
<shevy> sounds like prison programming
<JackMc> Hey everyone - I'm trying to require Mocha to get the mock() function mentioned here under 'traditional mocking': http://jamesmead.org/blog/2006-09-01-mocha-quickstart. What require should I use? I have tried require 'mocha', require 'mocha/mock', and a bunch of other stuff.
kareeoleez has joined #ruby
stannard has quit [Remote host closed the connection]
dionysus69 has quit [Ping timeout: 252 seconds]
<cooldavid> shevy: yes it doesn't make sense, so I sent them something that doesn't make sense
diego3 has quit [Changing host]
diego3 has joined #ruby
diego3 is now known as diegoviola
rkazak has joined #ruby
SilverKey has quit [Quit: Halted.]
lxsameer has quit [Ping timeout: 240 seconds]
cooldavid has quit [Quit: leaving]
imperator has joined #ruby
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
troter__________ has quit [Ping timeout: 260 seconds]
zast has joined #ruby
SilverKey has joined #ruby
troter__________ has joined #ruby
mjuszczak has quit []
[Butch]_ has joined #ruby
ravishankarjha has quit [Remote host closed the connection]
[Butch] has quit [Ping timeout: 246 seconds]
[Butch]_ is now known as [Butch]
circ-user-0vXzk has quit [Remote host closed the connection]
djbkd has quit [Remote host closed the connection]
kareeoleez has quit [Remote host closed the connection]
dionysus69 has joined #ruby
bruno- has quit [Read error: Connection reset by peer]
aganov has quit [Remote host closed the connection]
chouhoulis has quit [Remote host closed the connection]
bruno- has joined #ruby
stannard has joined #ruby
agent_white has joined #ruby
<agent_white> Mornin'
platzhirsch has quit [Ping timeout: 265 seconds]
ChiefAlexander has joined #ruby
idle_task is now known as idletask
rbennacer has quit [Remote host closed the connection]
dstarh has joined #ruby
stannard has quit [Ping timeout: 252 seconds]
bruno- has quit [Ping timeout: 276 seconds]
tildes has quit [Remote host closed the connection]
Devalo has joined #ruby
lfatsm has joined #ruby
pandaant has quit [Remote host closed the connection]
panpainter has quit [Remote host closed the connection]
startupality has quit [Quit: startupality]
araujo has joined #ruby
araujo has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
d10n-work has joined #ruby
araujo has quit [Max SendQ exceeded]
lsmola has quit [Ping timeout: 260 seconds]
araujo has joined #ruby
kareeoleez has joined #ruby
GinoManWorks has joined #ruby
madgen has quit [Ping timeout: 276 seconds]
huyderman has quit [Remote host closed the connection]
CloCkWeRX has quit [Ping timeout: 240 seconds]
allcentury has quit [Ping timeout: 260 seconds]
huyderman has joined #ruby
Couch has quit [Ping timeout: 244 seconds]
mark_66 has left #ruby ["PART #RubyOnRails :PART #elixir-lang :PART #crystal-lang :PONG :card.freenode.net"]
kies has quit [Ping timeout: 252 seconds]
madgen has joined #ruby
e is now known as Augustus
idefine has joined #ruby
idefine has quit [Remote host closed the connection]
rbennacer has joined #ruby
idefine has joined #ruby
idefine has quit [Remote host closed the connection]
roger_rabbit has quit [Ping timeout: 244 seconds]
idefine has joined #ruby
roamingdog has joined #ruby
Yeomra has quit [Quit: WeeChat 1.5]
skade has quit [Quit: Computer has gone to sleep.]
CloCkWeRX has joined #ruby
nando293921 has joined #ruby
skade has joined #ruby
stannard has joined #ruby
ravishankarjha has joined #ruby
skade has quit [Client Quit]
momomomomo has quit [Quit: momomomomo]
platzhirsch has joined #ruby
rodfersou is now known as rodfersou|lunch
panpainter has joined #ruby
nullFxn has joined #ruby
wigust_ has joined #ruby
noobsu has quit []
lfatsm has quit [Remote host closed the connection]
kus has joined #ruby
kus has quit [Max SendQ exceeded]
jhack has joined #ruby
stannard has quit [Remote host closed the connection]
wigust has quit [Ping timeout: 246 seconds]
phrozen77 has quit [Ping timeout: 250 seconds]
jhack_ has joined #ruby
saneax is now known as saneax_AFK
TomyLobo has joined #ruby
madgen has quit [Ping timeout: 260 seconds]
mistermocha has joined #ruby
panpainter has quit [Ping timeout: 265 seconds]
chouhoulis has joined #ruby
allcentury has joined #ruby
mostlybadfly has quit [Quit: Connection closed for inactivity]
jhack has quit [Ping timeout: 246 seconds]
jhack_ is now known as jhack
madgen has joined #ruby
codecop has joined #ruby
Trynemjoel has quit [Ping timeout: 244 seconds]
startupality has joined #ruby
bruno- has joined #ruby
_aeris_ has quit [Remote host closed the connection]
_aeris_ has joined #ruby
charliesome has joined #ruby
RegulationD has joined #ruby
arpegius has quit [Quit: arpegius]
momomomomo has joined #ruby
hogetaro has joined #ruby
Trynemjoel has joined #ruby
roamingdog has quit [Remote host closed the connection]
Guest00-ru has joined #ruby
isxek has joined #ruby
madgen has quit [Ping timeout: 276 seconds]
roamingdog has joined #ruby
gix has quit [Quit: Client exiting]
akem has quit [Quit: Quitte]
skalfyfan has joined #ruby
blaxter has quit [Read error: Connection reset by peer]
dumdedum has joined #ruby
jancel has joined #ruby
RegulationD has quit [Ping timeout: 276 seconds]
GinoManWorks_ has joined #ruby
momomomomo has quit [Quit: momomomomo]
pawnbox has joined #ruby
edwinvdgraaf has quit [Ping timeout: 276 seconds]
akem has joined #ruby
GinoManWorks has quit [Ping timeout: 246 seconds]
gix has joined #ruby
itguru has joined #ruby
pawnbox has quit [Ping timeout: 240 seconds]
giz|work has quit [Ping timeout: 252 seconds]
j_mcnally has quit [Ping timeout: 276 seconds]
rbr has quit [Ping timeout: 252 seconds]
dgynn has joined #ruby
jgt1 has quit [Ping timeout: 260 seconds]
rodferso1|lunch has joined #ruby
hwdyki has joined #ruby
rikai has quit [Ping timeout: 240 seconds]
j_mcnally has joined #ruby
halfamind has quit [Read error: Connection reset by peer]
ferr has quit [Quit: WeeChat 1.5]
hwdyki has left #ruby [#ruby]
halfamind has joined #ruby
bradleesand has joined #ruby
aufi has quit [Remote host closed the connection]
rodfersou|lunch has quit [Ping timeout: 244 seconds]
Madmanden has joined #ruby
ponga has joined #ruby
<ponga> hello people of #ruby
flashpoint9 has quit [Remote host closed the connection]
idefine has quit [Ping timeout: 240 seconds]
Yiota has joined #ruby
chopin_ has joined #ruby
kareeoleez has quit [Remote host closed the connection]
idefine has joined #ruby
idefine has quit [Remote host closed the connection]
codecop has quit [Ping timeout: 246 seconds]
noService has joined #ruby
jobewan is now known as jobewan_away
chopin has quit [Ping timeout: 240 seconds]
codecop has joined #ruby
zyzioziom has joined #ruby
jobewan_away has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
momomomomo has joined #ruby
diego2 has joined #ruby
itguru has quit [Quit: Leaving.]
jancel has quit [Ping timeout: 276 seconds]
idletask has quit [Quit: .]
stardiviner has quit [Quit: Code, Sex, Just fucking world.]
diegoviola has quit [Ping timeout: 250 seconds]
idefine has joined #ruby
noService has quit [Ping timeout: 276 seconds]
loincloth has quit []
mistermocha has quit [Remote host closed the connection]
andikr has joined #ruby
rodferso1|lunch is now known as rodferso1|afk
rodferso1|afk is now known as rodfersou|afk
brunto has quit [Ping timeout: 276 seconds]
stannard has joined #ruby
WebDevB has quit []
idefine has quit [Ping timeout: 260 seconds]
diego2 has quit [Changing host]
diego2 has joined #ruby
diego2 is now known as diegoviola
platzhirsch has quit [Ping timeout: 250 seconds]
rkazak has quit [Ping timeout: 260 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
DoubleMalt has quit [Remote host closed the connection]
nerium has quit [Quit: nerium]
terlar has quit [Ping timeout: 244 seconds]
SilverKey has quit [Quit: Halted.]
halfamind has quit [Read error: Connection reset by peer]
halfamind1 has joined #ruby
sepp2k has quit [Quit: Leaving.]
aegis3121 has quit [Ping timeout: 244 seconds]
lubekpl has joined #ruby
davidmichaelkarr has joined #ruby
nankyokusei has joined #ruby
jobewan has joined #ruby
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
akem has quit [Quit: Quitte]
araujo_ has joined #ruby
idefine has joined #ruby
stannard has quit [Read error: Connection reset by peer]
amclain has joined #ruby
skolman_ has joined #ruby
j_mcnally has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
noService has joined #ruby
stannard has joined #ruby
araujo has quit [Ping timeout: 252 seconds]
mistermocha has joined #ruby
nankyokusei has quit [Ping timeout: 252 seconds]
<davidmichaelkarr> I'm trying to debug a VagrantFile used in a book (learning puppet 4). I think I'm running into issues with unexpected character handling within a HEREDOC in a Ruby script.
<davidmichaelkarr> The original line was this:
<davidmichaelkarr> sed -i -e 's#\(secure_path = .*\)$#\1:/opt/puppetlabs/bin#' /etc/sudoers
stannard has quit [Read error: Connection reset by peer]
<davidmichaelkarr> When the script is run, I don't see an error message, but the file is not changed. I think the "#" characters are noted as comment characters by Ruby. Does that make sense?
<davidmichaelkarr> And the HEREDOC is initiated with this line:
<davidmichaelkarr> $setupscript = <<END
davedev2_ has joined #ruby
symm- has joined #ruby
QORRiE has joined #ruby
halfamind1 has quit [Read error: Connection reset by peer]
halfamind has joined #ruby
davedev24 has quit [Ping timeout: 276 seconds]
duoi has quit [Ping timeout: 276 seconds]
chouhoulis has quit [Remote host closed the connection]
<davidmichaelkarr> jhass: So you're telling me the line should execute properly? The weird thing is, there are side effects both before and after this in the script, and they all are done, but not from this line. I then later tried running the line manually as root, and it performs the change.
stannard has joined #ruby
drptbl_ has joined #ruby
roamingdog has quit [Read error: Connection reset by peer]
<jhass> I can't spot anything that would affect the resulting value of the line, but if you want to verify just puts the variable
antgel has joined #ruby
idefine has quit [Ping timeout: 240 seconds]
<jhass> or yet better .inspect it
roamingdog has joined #ruby
drptbl_ has quit [Client Quit]
<davidmichaelkarr> jhass: Sorry, I don't grok that.
bradleesand has left #ruby [#ruby]
<jhass> &ri Kernel#puts Object#inspect String#inspect Kernel#p
drptbl has quit [Ping timeout: 250 seconds]
<davidmichaelkarr> jhass: I think the point is, "what variable?" I'm running sed to modify a file.
<vaejor> davidmichaelkarr: do you run it the first time as root?
<davidmichaelkarr> vaejor: I run it with "vagrant up".
kies has joined #ruby
<jhass> davidmichaelkarr: $setupscript is a global variable, <<END starts a heredoc, so a string literal
<davidmichaelkarr> vaejor: Not as root.
duoi has joined #ruby
<jhass> you didn't show anything that "runs" anything
<vaejor> davidmichaelkarr: if you're trying to edit /etc/sudoers, you need root
<davidmichaelkarr> jhass: Ah, ok. print out the script variable. ok.
stannard has quit [Remote host closed the connection]
<davidmichaelkarr> vaejor: Yes, certainly, but the script (which I haven't shown), makes several mods to root-required files, with no complaint.
roamingdog has quit [Ping timeout: 265 seconds]
whathappens has joined #ruby
<davidmichaelkarr> If it matters, here's the excerpt from the VagrantFile that shows the entire script it runs.
<ruby[bot]> davidmichaelkarr: we in #ruby do not like irccloud.com, I reposted your paste to gist for you: https://gist.github.com/eb2f12ece621cbf061405b8cd9cc3334
<ruby[bot]> davidmichaelkarr: irccloud.com has no syntax highlighting, distracting formatting and loads slowly for most.
bigkevmcd has quit [Quit: Outta here...]
<zacts> 3/buffer #dragora
araujo_ has quit [Quit: Leaving]
mistermocha has quit [Remote host closed the connection]
Dell-LT_ has joined #ruby
momomomomo has quit [Quit: momomomomo]
flashpoint9 has joined #ruby
tatsuo has joined #ruby
antgel has quit [Ping timeout: 246 seconds]
rbennacer has quit [Remote host closed the connection]
blackthor has joined #ruby
ChiefAlexander has quit [Remote host closed the connection]
mistermocha has joined #ruby
pawnbox has joined #ruby
The_Phoenix has joined #ruby
The_Phoenix has quit [Max SendQ exceeded]
tildes has joined #ruby
tatsuo has quit [Ping timeout: 260 seconds]
idefine has joined #ruby
pawnbox has quit [Ping timeout: 276 seconds]
mistermocha has quit [Read error: No route to host]
startupality has quit [Quit: startupality]
mistermocha has joined #ruby
Dell-LT_ has quit [Quit: Leaving]
synthroid has quit [Remote host closed the connection]
Madmanden has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
idefine has quit [Ping timeout: 276 seconds]
idletask has joined #ruby
araujo has joined #ruby
araujo has joined #ruby
idefine has joined #ruby
mooe has joined #ruby
symm- has quit [Quit: Leaving...]
lacce has joined #ruby
jancel has joined #ruby
rippa has joined #ruby
codecop has quit [Remote host closed the connection]
crystal77 has joined #ruby
idefine has quit [Remote host closed the connection]
jancel has quit [Ping timeout: 250 seconds]
dionysus69 has quit [Ping timeout: 265 seconds]
dikaio has joined #ruby
fgo has quit [Quit: WeeChat 1.3]
troulouliou_div2 has quit [Remote host closed the connection]
lxsameer has joined #ruby
wrkrcoop has joined #ruby
arpegius has joined #ruby
<wrkrcoop> there’s no way a class can be an API correct?
symm- has joined #ruby
<wrkrcoop> an API refers to routes correct?
<wrkrcoop> or endpoints
<jhass> API is fairly general term
<apeiros> an API refers to a set of function calls the operating system provides to programs to work with
<apeiros> ^ just one alternative definition of API
<apeiros> the term is quite a bit older than http
jpinnix_______ has quit [Remote host closed the connection]
err_ok has quit [Remote host closed the connection]
vcoinminer has quit [Read error: Connection reset by peer]
jhill has quit [Read error: Connection reset by peer]
swgillespie has quit [Remote host closed the connection]
jimcroft has quit [Remote host closed the connection]
acalewin has quit [Remote host closed the connection]
ckrailo has quit [Remote host closed the connection]
angiebadillo has quit [Remote host closed the connection]
jcp has quit [Remote host closed the connection]
[diecast] has quit [Remote host closed the connection]
mroth_ has quit [Remote host closed the connection]
dukedave has quit [Remote host closed the connection]
ijij has quit [Remote host closed the connection]
|2701 has quit [Remote host closed the connection]
ELLIOTTCABLE has quit [Read error: Connection reset by peer]
rflot has quit [Remote host closed the connection]
jmhmccr has quit [Remote host closed the connection]
braderhart has quit [Read error: Connection reset by peer]
mitsuhiko has quit [Remote host closed the connection]
incomprehensibly has quit [Remote host closed the connection]
hayden__ has quit [Write error: Broken pipe]
kapowaz has quit [Write error: Broken pipe]
deepak has quit [Write error: Broken pipe]
deeprave has quit [Remote host closed the connection]
knowtheory has quit [Remote host closed the connection]
Majost has quit [Remote host closed the connection]
<jhass> let's try "an API defines a public interface for other programs to consume"
jancel has joined #ruby
startupality has joined #ruby
ferr has joined #ruby
wrkrcoop has quit [Client Quit]
<hanmac> what about: the API is like the Index of the "Library"? ;P
<jhass> it's not necessarily a library
dikaio has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
firstdayonthejob has joined #ruby
idefine has joined #ruby
[diecast] has joined #ruby
djbkd has joined #ruby
deepak has joined #ruby
kapowaz has joined #ruby
ramfjord has joined #ruby
dukedave has joined #ruby
Dimik has joined #ruby
jhill has joined #ruby
mroth_ has joined #ruby
diegoaguilar has joined #ruby
wrkrcoop has joined #ruby
jpinnix_______ has joined #ruby
ckrailo has joined #ruby
<wrkrcoop> got disconnected.
<wrkrcoop> anyone answer that?
<jhass> ?logs
<ruby[bot]> You can find a log of this channel at http://irclog.whitequark.org/ruby/
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
panpainter has joined #ruby
gizmore has joined #ruby
<wrkrcoop> so creating an API class makes sense?
<jhass> "API class" isn't a well defined term, so maybe
<wrkrcoop> seems to clash with idae of web API
jmhmccr has joined #ruby
<jhass> how so?
ELLIOTTCABLE has joined #ruby
<Zarthus> API's require a bit of thought before making them, perhaps you'd wish to structure what your API will contain on paper before writing something people might not like in code
<davidmichaelkarr> So I found a fix for my misbehaving VagrantFile script, but I'm wondering if what I found is a bug in Ruby. The original line had this string: 's#\(secure_path = .*\)$#
shinnya has joined #ruby
<wrkrcoop> web api is like yelp.com/users/authenticate. a class API has a method like process
<wrkrcoop> i just thought API referred to routes that ppl can hit
<davidmichaelkarr> When I printed out the resulting variable, it printed out 's#(secure_path = .*)$#
<davidmichaelkarr> It seemed to "dequote" the parens.
evidex has quit [Remote host closed the connection]
incomprehensibly has joined #ruby
knowtheory has joined #ruby
<davidmichaelkarr> So I looked in some docs and noted that the "#" can start variable interpolation, so I tried changing my heredoc terminator, adding single quotes around it, which is supposed to disable interpolation. That worked.
<jhass> good catch but that's actually not a bug but intended
<jhass> a normal heredoc is like double quotes
<davidmichaelkarr> The funny thing is, I'm definitely not doing variable interpolation here. Is Ruby somehow "swallowing" the backslash as an attempt to determine if there is variable interpolation happening?
deeprave has joined #ruby
vcoinminer has joined #ruby
idefine has quit [Ping timeout: 250 seconds]
<jhass> >> "\("
<ruby[bot]> jhass: # => "(" (https://eval.in/571128)
<jhass> >> '\('
crystal7_ has joined #ruby
<ruby[bot]> jhass: # => "\\(" (https://eval.in/571129)
crystal77 has quit [Read error: Connection reset by peer]
<jhass> >> "\\"
<ruby[bot]> jhass: # => "\\" (https://eval.in/571130)
<jhass> \ is the escape character, it's interpreted inside " but not inside '
dikaio has joined #ruby
madgen has joined #ruby
rflot has joined #ruby
<jhass> if the escape sequence makes no sense it's simply dropped
kgrz has joined #ruby
<jhass> \\ is the escape sequence for a regular \ character
<davidmichaelkarr> jhass: Ok, so it's not variable interpolation happening, but escaping.
<jhass> yup
<davidmichaelkarr> Ok, got it.
<jhass> didn't spot it either, that heredoc acts like double quotes is easy to forget
crystal7_ has quit [Read error: Connection reset by peer]
crystal77 has joined #ruby
startupality has quit [Quit: startupality]
ijij has joined #ruby
lacce has quit []
acalewin has joined #ruby
kgrz has quit [Ping timeout: 252 seconds]
idefine has joined #ruby
<apeiros> you can have single-quoted here-docs
<apeiros> simply quite the boundary marker in single quotes
babblebre has joined #ruby
<apeiros> oh
<apeiros> I see
Yeomra has joined #ruby
<apeiros> that's where you actually started :)
crystal7_ has joined #ruby
shinnya has quit [Ping timeout: 265 seconds]
crystal77 has quit [Ping timeout: 276 seconds]
lubekpl has quit [Ping timeout: 252 seconds]
shinnya has joined #ruby
jgt1 has joined #ruby
mdw has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
roamingdog has joined #ruby
panpainter has quit []
shinnya has quit [Read error: Connection reset by peer]
Madmanden has joined #ruby
vdamewood has joined #ruby
linc01n has joined #ruby
synthroid has joined #ruby
err_ok has joined #ruby
bronson has joined #ruby
Madmande_ has joined #ruby
riobe has joined #ruby
roamingdog has quit [Ping timeout: 250 seconds]
millerti has joined #ruby
noService has quit [Ping timeout: 276 seconds]
SCHAAP137 has joined #ruby
Madmanden has quit [Ping timeout: 252 seconds]
symm- has quit [Quit: Leaving...]
lubekpl has joined #ruby
dionysus69 has joined #ruby
SilverKey has joined #ruby
bronson has quit [Ping timeout: 252 seconds]
Cohedrin has joined #ruby
crystal7_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dh64 has quit [Quit: Konversation terminated!]
startupality has joined #ruby
umdstu has quit [Quit: umdstu]
braderhart has joined #ruby
hosttor has joined #ruby
chouhoulis has joined #ruby
hayden__ has joined #ruby
swgillespie has joined #ruby
idefine has quit [Remote host closed the connection]
jancel has quit [Remote host closed the connection]
dvinciguerra has quit [Ping timeout: 252 seconds]
angiebadillo has joined #ruby
karmatr0n has quit [Ping timeout: 260 seconds]
noService has joined #ruby
stannard has joined #ruby
TheCubeLord has joined #ruby
shinnya has joined #ruby
roshanavand_ has quit [Ping timeout: 246 seconds]
b|ackwolf has left #ruby ["Leaving"]
idefine has joined #ruby
aupadhye has quit [Ping timeout: 246 seconds]
gizmore has quit [Quit: KVIrc 4.9.2 Aria http://www.kvirc.net/]
raeoks has joined #ruby
idefine_ has joined #ruby
<davidmichaelkarr> apeiros: The original script didn't quote the terminator at all. The fix was to single quote it.
<davidmichaelkarr> Anyway, I now have another curious issue with something from the puppet book, but I'm pretty sure this is a ruby question.
startupality has quit [Quit: startupality]
umdstu has joined #ruby
duoi has quit [Ping timeout: 276 seconds]
<davidmichaelkarr> I first noticed this unsurprising sample:
wigust_ has quit [Remote host closed the connection]
lubekpl has quit [Remote host closed the connection]
<davidmichaelkarr> However, this very similar one confuses me:
Majost has joined #ruby
ravishankarjha has quit [Remote host closed the connection]
jcp has joined #ruby
smathy has joined #ruby
smathy is now known as smathy_afk
smathy_afk is now known as smathy
idefine has quit [Ping timeout: 240 seconds]
<davidmichaelkarr> Any idea what's going on here?
duoi has joined #ruby
jimcroft has joined #ruby
last_staff has joined #ruby
mitsuhiko has joined #ruby
dvinciguerra has joined #ruby
dvinciguerra has quit [Max SendQ exceeded]
lxsameer has quit [Ping timeout: 246 seconds]
pawnbox has joined #ruby
|2701 has joined #ruby
dvinciguerra has joined #ruby
ramfjord has quit [Ping timeout: 276 seconds]
<jhass> ?puppet
<ruby[bot]> Please join #puppet for help with it.
<jhass> it's indeed not ruby
blackmesa has joined #ruby
Madmanden has joined #ruby
<jhass> anyway, !"fee" is probably false and false is not in "coffee", "fee" in "coffee" is probably true and !true is false, "tea" in "coffee" should be false then and !false is true
pawnbox has quit [Ping timeout: 244 seconds]
Madmande_ has quit [Ping timeout: 260 seconds]
dvinciguerra has quit [Ping timeout: 252 seconds]
umdstu has quit [Quit: umdstu]
wof has quit [Ping timeout: 246 seconds]
SilverKey has quit [Quit: Halted.]
<davidmichaelkarr> jhass: Ok, I'll ask there then.
Madmande_ has joined #ruby
Madmanden has quit [Ping timeout: 265 seconds]
phrozen77 has joined #ruby
akkmaxon has quit [Ping timeout: 250 seconds]
firstdayonthejob has quit [Quit: WeeChat 1.5]
isxek has quit [Quit: Leaving]
ChiefAlexander has joined #ruby
rodfersou|afk is now known as rodfersou
dumdedum has quit [Read error: Connection reset by peer]
mistermocha has quit [Remote host closed the connection]
SilverKey has joined #ruby
wrkrcoop has quit [Quit: wrkrcoop]
last_staff has quit [Ping timeout: 265 seconds]
crameth has quit [Quit: crameth]
blaxter has joined #ruby
jord has quit [Ping timeout: 260 seconds]
bestie has quit [Ping timeout: 260 seconds]
dima_ has joined #ruby
workmad3 has quit [Ping timeout: 252 seconds]
ljames has joined #ruby
dima_ has quit [Client Quit]
SCHAAP137 has quit [Quit: Exiting...]
mistermocha has joined #ruby
wrkrcoop has joined #ruby
edavis has quit [Read error: Connection reset by peer]
stannard has quit [Remote host closed the connection]
itguru has joined #ruby
dima_ has joined #ruby
dima_ is now known as pfoyh
bestie has joined #ruby
drptbl has joined #ruby
pfoyh has quit [Client Quit]
PlasmaStar has quit [Ping timeout: 250 seconds]
stannard has joined #ruby
firstdayonthejob has joined #ruby
arpegius has quit [Quit: arpegius]
drptbl has quit [Read error: Connection reset by peer]
jord has joined #ruby
momomomomo has joined #ruby
dima_ has joined #ruby
dima_ is now known as pfoyh
<pfoyh> hi
kareeoleez has joined #ruby
SilverKey has quit [Ping timeout: 252 seconds]
<apeiros> hi pfoyh
skalfyfan has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
postmodern has joined #ruby
cdg has quit [Remote host closed the connection]
stannard has quit [Read error: Connection reset by peer]
skalfyfan has joined #ruby
duoi has quit [Ping timeout: 276 seconds]
wigust has joined #ruby
giz|work has joined #ruby
mdw has quit [Quit: Sleeping Zzzzz]
lxsameer has joined #ruby
duoi has joined #ruby
ramfjord has joined #ruby
CloCkWeRX has quit [Ping timeout: 260 seconds]
PlasmaStar has joined #ruby
dikaio has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
hobodave has joined #ruby
dvinciguerra has joined #ruby
dikaio has joined #ruby
hahuang61 has quit [Quit: WeeChat 1.4]
blackmes1 has joined #ruby
CloCkWeRX has joined #ruby
ChiefAlexander has quit [Remote host closed the connection]
last_staff has joined #ruby
tagaulap has quit [Quit: Connection closed for inactivity]
blackmesa has quit [Ping timeout: 276 seconds]
akiTendo has joined #ruby
<akiTendo> Hello all. Need a little help discovering a value.
<akiTendo> In a Vagrantfile (which is a ruby script)
roamingdog has joined #ruby
<akiTendo> The script is executing from /Users/myname/vagrants/vagrantbox/Vagrantfile
<akiTendo> Now in ruby, how do I get the value of directory “myname”
<akiTendo> Vagrantfile is the ruby script itself.
<akiTendo> PHP this would be dirname(dirname(dirname(__FILE__)))
<akiTendo> I presume it’s something similarly simple in ruby.
SilverKey has joined #ruby
<akiTendo> (ok, technically the above would return “/Users/myname” but I can prune down from there with a pathinfo call”
<adaedra> File.expand_path('../..', __dir__)
hk238 has quit [Quit: http://www.kvirc.net/ 4.9.1 Aria]
madgen has quit [Ping timeout: 276 seconds]
<adaedra> But if your goal is to get current user name, you should be able to just do `ENV['USER']`
madgen has joined #ruby
<apeiros> or via Etc
<apeiros> (the current user's name)
<akiTendo> adaedra: Eventually this may be invoked from ansible script ran by the administrator, not necessarily the user who is going to be using the VM.
roamingdog has quit [Ping timeout: 244 seconds]
<akiTendo> I think. I’ll try ENV[‘USER’] and see if that causes trouble.
<akiTendo> It is simpler.
karmatr0n has joined #ruby
sauvin has quit [Read error: Connection reset by peer]
stannard has joined #ruby
marr has quit [Ping timeout: 276 seconds]
Madplatypus has quit [Quit: Connection closed for inactivity]
<adaedra> yeah, going through Etc would be more correct and reliable, but it's a bit longer.
kirun has joined #ruby
djbkd has quit [Remote host closed the connection]
rikai has joined #ruby
djbkd has joined #ruby
djbkd has quit [Read error: Connection reset by peer]
idefine has joined #ruby
idefine_ has quit [Read error: Connection reset by peer]
djbkd has joined #ruby
lxsameer has quit [Ping timeout: 276 seconds]
bronson has joined #ruby
edavis has joined #ruby
itguru has quit [Quit: Leaving.]
<ramfjord> Why not just match the directory path with a regex like "\/Users\/([^\/]*)\/" instead of jumping up a bunch of paths?
moeabdol has quit [Ping timeout: 265 seconds]
roshanavand has joined #ruby
<shevy> I love you folks
skalfyfan has quit [Ping timeout: 260 seconds]
roshanavand has quit [Client Quit]
itguru has joined #ruby
blackmes1 has quit [Ping timeout: 252 seconds]
dionysus69 has quit [Ping timeout: 260 seconds]
drptbl has joined #ruby
ChiefAlexander has joined #ruby
<jhass> Etc.getpwuid(File.stat(__FILE__).uid).name
am55 has joined #ruby
rbennacer has joined #ruby
bronson has quit [Remote host closed the connection]
eljimbo has quit [Quit: This computer has gone to sleep]
<ironcamel> i have a ruby script that sometimes hangs on a line that does something like x = `ssh host cmd ...`. what is the easiest way to do that operation with some sort of timeout, so it returns after a few seconds with a failure and doesn't hang?
aegis3121 has joined #ruby
wrkrcoop has quit [Quit: wrkrcoop]
<jhass> probably better to use the net-ssh gem so you have more control
am55 has quit [Quit: Leaving]
<jhass> should have timeout options too I'd hope
jancel has joined #ruby
sthns has joined #ruby
<ironcamel> installing gems in not currently an option :(
<ironcamel> *is not
<ironcamel> should i fork a process?
<jhass> -o 'ConnectTimeout 5' perhaps?
elaptics is now known as elaptics`away
pawnbox has joined #ruby
drptbl has quit [Quit: My MAC has gone to sleep. zZz..]
am55 has joined #ruby
<ironcamel> hmmm, that might work
sthns has quit [Remote host closed the connection]
Kruppe has quit [Quit: ZNC - http://znc.in]
cloaked1 has joined #ruby
cloaked1 has joined #ruby
CloCkWeRX has quit [Quit: Leaving.]
mistermocha has quit [Remote host closed the connection]
jancel has quit [Ping timeout: 260 seconds]
vdamewood has quit [Quit: Life beckons.]
juanfra has quit [Quit: juanfra]
pfoyh has left #ruby [#ruby]
pawnbox has quit [Ping timeout: 260 seconds]
wrkrcoop has joined #ruby
darkxploit has joined #ruby
solars has quit [Ping timeout: 260 seconds]
darkxploit has quit [Max SendQ exceeded]
Kruppe has joined #ruby
djbkd has quit [Remote host closed the connection]
jackjackdripper has joined #ruby
Yeomra has quit [Ping timeout: 276 seconds]
diego2 has joined #ruby
diego2 has joined #ruby
diego2 has quit [Changing host]
jackjackdripper has quit [Client Quit]
djbkd has joined #ruby
jackjackdripper has joined #ruby
djbkd has quit [Read error: Connection reset by peer]
karmatr0n has quit [Ping timeout: 250 seconds]
djbkd has joined #ruby
diegoviola has quit [Ping timeout: 240 seconds]
davedev24 has joined #ruby
davedev2_ has quit [Ping timeout: 276 seconds]
diego2 is now known as diegoviola
wilbert has joined #ruby
dionysus69 has joined #ruby
chopin_ has quit [Remote host closed the connection]
alxgsv has quit [Ping timeout: 244 seconds]
diego2 has joined #ruby
drzel has quit [Ping timeout: 250 seconds]
Madmande_ has quit [Ping timeout: 252 seconds]
flopsec has quit [Ping timeout: 244 seconds]
ctrlrsf has quit [Ping timeout: 260 seconds]
davedev2_ has joined #ruby
joneshf-laptop has quit [Ping timeout: 252 seconds]
ghr has quit [Ping timeout: 240 seconds]
ramortegui has quit [Quit: Ex-Chat]
diegoviola has quit [Ping timeout: 265 seconds]
tw1sted_ has joined #ruby
iceden has joined #ruby
davedev24 has quit [Ping timeout: 260 seconds]
Don_John has joined #ruby
Don_John has quit [Remote host closed the connection]
tw1sted has quit [Ping timeout: 240 seconds]
skade has joined #ruby
diego3 has joined #ruby
solars has joined #ruby
diego3 has quit [Changing host]
diego3 has joined #ruby
diego3 is now known as diegoviola
codecop has joined #ruby
Blaguvest has quit []
zyzioziom has quit [Ping timeout: 276 seconds]
skade has quit [Client Quit]
diego2 has quit [Ping timeout: 244 seconds]
momomomomo has quit [Quit: momomomomo]
rhastra has joined #ruby
rhastra has quit [Client Quit]
skade has joined #ruby
rhastra has joined #ruby
wrkrcoop has quit [Quit: wrkrcoop]
tildes has quit [Ping timeout: 260 seconds]
Masonn has quit [Ping timeout: 265 seconds]
zeroDi has joined #ruby
jaruga____ has quit [Quit: jaruga____]
stannard has quit [Read error: Connection reset by peer]
djbkd has quit [Remote host closed the connection]
spider-mario has joined #ruby
ravishankarjha has joined #ruby
ta_ has quit [Read error: Connection reset by peer]
roamingdog has joined #ruby
<TheCubeLord> welp i be off goodnight!
skade has quit [Quit: Computer has gone to sleep.]
ta_ has joined #ruby
jackjackdripper1 has joined #ruby
roamingdog has quit [Ping timeout: 246 seconds]
jackjackdripper has quit [Ping timeout: 260 seconds]
jackjackdripper1 has quit [Read error: Connection reset by peer]
jackjackdripper has joined #ruby
allcentury has quit [Ping timeout: 265 seconds]
xall has joined #ruby
skade has joined #ruby
wigust has quit [Remote host closed the connection]
Rutix has quit []
jgt1 has quit [Ping timeout: 260 seconds]
stannard has joined #ruby
skade has quit [Client Quit]
stannard has quit [Remote host closed the connection]
idefine_ has joined #ruby
skade has joined #ruby
zyzioziom has joined #ruby
skade has quit [Client Quit]
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
idefine has quit [Ping timeout: 260 seconds]
symm- has joined #ruby
karmatr0n has joined #ruby
stannard has joined #ruby
djbkd has joined #ruby
djbkd has quit [Remote host closed the connection]
halfamind has quit [Quit: Leaving.]
djbkd has joined #ruby
scooter_ has joined #ruby
<scooter_> Is this the appropriate channel for ruby on rails question?
chipotle has quit [Quit: cheerio]
prestorium has joined #ruby
<rhastra> there is a #rubyonrails channel
<scooter_> Okay thanks
symm- has quit [Client Quit]
nando293921 has quit [Ping timeout: 265 seconds]
raeoks has quit [Quit: Textual IRC Client: www.textualapp.com]
pawnbox has joined #ruby
drptbl has joined #ruby
halfamind has joined #ruby
oetjenj has joined #ruby
<zacts> hi rubyists
bronson has joined #ruby
<shevy> yo zacts the ruby-learning man
pawnbox has quit [Ping timeout: 260 seconds]
al2o3-cr has quit [Quit: WeeChat 1.5]
mistermocha has joined #ruby
zyzioziom has quit [Ping timeout: 246 seconds]
drptbl has quit [Read error: Connection reset by peer]
<zacts> yo shevy! :-)
drptbl has joined #ruby
al2o3-cr has joined #ruby
<zacts> I'm almost to ch 9 of this Head First Ruby book. I may even finish ch 10 this evening, which will put me 2/3 of the way thru
<zacts> I feel I'm learning tons
bronson has quit [Ping timeout: 252 seconds]
idefine_ has quit [Ping timeout: 250 seconds]
whathappens has quit [Remote host closed the connection]
giz|work|2 has joined #ruby
dikaio has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
whathappens has joined #ruby
whathappens has quit [Remote host closed the connection]
<daemonwrangler> Anyone familiar with rubocop? Confused by something it's flagging for Style/HashSyntax, but I think is just a keyword arg.
<jhass> say more?
giz|work has quit [Ping timeout: 250 seconds]
Es0teric has joined #ruby
<ruby[bot]> daemonwrangler: we in #ruby do not like irccloud.com, I reposted your paste to gist for you: https://gist.github.com/c12d54dda699f1af61607939ddc094c8
<ruby[bot]> daemonwrangler: irccloud.com has no syntax highlighting, distracting formatting and loads slowly for most.
yfeldblum has joined #ruby
andikr has quit [Remote host closed the connection]
roamingdog has joined #ruby
<Zarthus> daemonwrangler: sounds like stuff => :stuff
synthroid has quit []
<daemonwrangler> Yeah, that's what I was thinking, but wasn't expecting it to flag a method call with keyword args. For example, checker_func in remove(destination, checker_func: :directory?)
mistermocha has quit [Remote host closed the connection]
drptbl has quit [Quit: See you later!]
karmatr0n has quit [Ping timeout: 252 seconds]
diego2 has joined #ruby
<daemonwrangler> The rubocop config has TargetRubyVersion set to 2.0, so I would hope it'd recognize keyword arg syntax.
riddley has joined #ruby
ferr has quit [Ping timeout: 250 seconds]
<riddley> you have an array of DateTime objects. how do you group them by proximity within THRESHOLD ?
blackthor has quit [Ping timeout: 252 seconds]
<jhass> riddley: where did you copy paste that assignment from and what did you try so far?
<daemonwrangler> jhass: It may be a better question for me to ask the jekyll devs since they explicitly set "EnforcedStyle: hash_rockets"
diegoviola has quit [Ping timeout: 246 seconds]
djcp has quit [Ping timeout: 276 seconds]
diego2 has joined #ruby
diego2 has quit [Changing host]
<riddley> haha :) it's not an assignment. I'm looking at our snapshot schedules and trying to see when we have snapshots that "collide" (within a few minutes) I've gotten the date time objects created, but haven't been able to figure out what to do next. Enumerable#partition doesn't yield two arguments, so I can't compare proximity that way... seems like only #sort yields things, but sorting doesn't really help me
diego2 is now known as diegoviola
drptbl has joined #ruby
<bougyman> hrm.
<bougyman> Array(some_hash) did not do what I expected.
<bougyman> usually Array(array_or_item) returns [array_or_item]
<jhass> daemonwrangler: https://github.com/bbatsov/rubocop/issues/1451 only thing I found on the issue tracker about it
<bougyman> in the hash's case, it returns [[key, val]]
idefine has joined #ruby
dikaio has joined #ruby
<bougyman> I hate it when ruby surprises me.
<adaedra> bougyman: Array() calls #to_a on the object.
<bougyman> adaedra: I see that now.
<bougyman> but string doesn't have a #to_a
<adaedra> Nothing surprising here.
<bougyman> and Array(string) does the right thing, too
diego2 has joined #ruby
aphprentice_ has joined #ruby
<bougyman> well, the "expected right" thing
diego2 has joined #ruby
diego2 has quit [Changing host]
<adaedra> What is not expected in the above behavior?
<daemonwrangler> jhass: That seems prett definitive though. Thanks!
<daemonwrangler> s/prett/pretty/
<bougyman> I've always used Array(array_or_item) to coerce things to [array_or_item]
<bougyman> it's my habit that led to the surprise.
<adaedra> A hash is representable as a array of [key, value]s
<bougyman> I know that.
Rutix has joined #ruby
Rutix has joined #ruby
hahuang65 has joined #ruby
<riddley> jhass, any thoughts?
diegoviola is now known as Guest91331
diego2 is now known as diegoviola
AnoHito has quit [Read error: Connection reset by peer]
<jhass> still thinking
rhastra has quit [Quit: leaving]
<riddley> I guess I could use Enumerable#each_cons but I was hoping for something else
<bougyman> I guess what i'm asking is how do I get the behavior that i'm used to for strings, numbers, and symbols working in this case.
Guest91331 has quit [Ping timeout: 250 seconds]
<adaedra> so you want `[{one: 1}]`?
arpegius has joined #ruby
<bougyman> yes.
Nahra has joined #ruby
<adaedra> (n.is_a?(Array) ? n : [n]) would be the one that does not expand objects implementing #to_ary/#to_a, I guess.
rhastra has joined #ruby
bluOxigen has quit [Ping timeout: 276 seconds]
<jhass> riddley: I'd say figure out what Enumerable#group_by uses to determine "equalness" (probably Hash's key contract, #hash and #eql?) and write a wrapper that defines those such that two within the threshold are considered equal
djbkd has quit [Remote host closed the connection]
safetypin has joined #ruby
dionysus69 has quit [Ping timeout: 240 seconds]
ghr has joined #ruby
<riddley> jhass, group_by seems to be C, so I'm pretty lost
<bougyman> adaedra: yeah, that's pretty much what I ended up with.
govg has quit [Ping timeout: 260 seconds]
hobodave_ has joined #ruby
<jhass> riddley: it's pretty much .each_with_object({}) {|i, h| (h[yield i] ||= []) << i }
<riddley> jhass, that yield blows my tiny mind... what does that do?
<jhass> it yields?
<aegis3121> h is the {} passed in. `i` is your item. (yield i) returns the result of your block after passing i into it. ||= [] sets that value to a new array if there wasn't one there already. and the push operator is pushing that item into that array.
diegoaguilar has quit [Remote host closed the connection]
hobodave has quit [Ping timeout: 246 seconds]
djbkd has joined #ruby
djbkd has quit [Read error: Connection reset by peer]
<riddley> oh, so you must pass a block to that?
pfoyh has joined #ruby
<riddley> ty aegis3121
djbkd has joined #ruby
dima_ has joined #ruby
idefine has quit [Remote host closed the connection]
safetypin has quit [Quit: Textual IRC Client: www.textualapp.com]
DanyC has joined #ruby
roshanavand has joined #ruby
wrkrcoop has joined #ruby
Jackneill has joined #ruby
<jhass> riddley: say we got [2016-01-01, 2016-01-03, 2016-01-04, 2016-01-06] and a treshold of 2 days, what's the result exactly you expect?
<riddley> I still don't get it.... if I'm only yielding one thing, how can I compare proximity?
<riddley> I'd expect [[2016-01-01, 2016-01-03, 2016-01-04,],[2016-01-06]]
ponga has quit [Quit: Connection closed for inactivity]
safetypin has joined #ruby
<jhass> I don't follow
<jhass> 01 to 03 is two days, 04 to 06 is two days
safetypin has quit [Client Quit]
<riddley> Sorry, I guess I'd expect the whole array
FernandoBasso has quit [Quit: Leaving]
dima_ has left #ruby [#ruby]
pfoyh has left #ruby [#ruby]
mistermocha has joined #ruby
imperator has left #ruby ["Leaving"]
<jhass> and then for [2016-01-06, 2016-01-03, 2016-01-01, 2016-01-04] still?
<riddley> that's just a re-order? if so, yes. I've sorted my array
<jhass> ok
johnmilton has quit [Quit: Namaste]
<riddley> but if -06 was -07 it would be off by itself
pfoyh has joined #ruby
dima_ has joined #ruby
prestorium has quit [Ping timeout: 260 seconds]
bobbycvi has joined #ruby
cdg has joined #ruby
arpegius has quit [Quit: arpegius]
mistermocha has quit [Ping timeout: 240 seconds]
araujo has quit [Read error: Connection timed out]
chopin has joined #ruby
eljimmy has joined #ruby
mistermocha has joined #ruby
araujo has joined #ruby
karmatr0n has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
SilverKey has quit [Quit: Halted.]
idefine has joined #ruby
idefine has quit [Remote host closed the connection]
millerti has joined #ruby
DanyC has quit [Read error: Connection reset by peer]
idefine has joined #ruby
<jhass> riddley: https://p.jhass.eu/1p.rb would be my first shot, not sure yet I prefer it over say implementing something more directly that doesn't require to fix to a single hash bucket
DanyC has joined #ruby
arpegius has joined #ruby
fmcgeough has quit [Quit: fmcgeough]
dikaio has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<riddley> jhass, reading. thank you!
ta_ has quit [Read error: Connection reset by peer]
ChiefAlexander has quit [Quit: Leaving...]
SilverKey has joined #ruby
dvinciguerra has quit [Ping timeout: 240 seconds]
pietr0 has joined #ruby
ta_ has joined #ruby
<riddley> jhass, I don't understand that at all :( reading about simpledelegator
Ouchy has quit [Read error: Connection reset by peer]
<riddley> jhass, thank you very much for helping me with this
blackmes1 has joined #ruby
noService has quit [Ping timeout: 265 seconds]
chouhoulis has quit [Remote host closed the connection]
jancel has joined #ruby
roshanavand has quit [Quit: This computer has gone to sleep]
charliesome has joined #ruby
<jhass> mmmh, given we're operating on a sorted array, slice_before or the like should work too
Yiota has quit [Ping timeout: 276 seconds]
<riddley> jhass, so group_by is being sneaky and passing in two values to the block even though it only has |date| ? which is why your .eql delegator can do the subtraction and compare it to the threshold. I assume PW#hash is some internal thing and that the call to super is about making SimpleDelegator happy?
s2013 has joined #ruby
jgt1 has joined #ruby
bruce_lee has quit [Ping timeout: 240 seconds]
bruce_lee has joined #ruby
bruce_lee has joined #ruby
Coldblackice has joined #ruby
allcentury has joined #ruby
<jhass> yes to the last one. group_by is using a hash (see the ruby version I wrote above). read the docs for Hash (at the top) for an explanation on how #hash and #eql? come into play
chouhoulis has joined #ruby
jancel has quit [Ping timeout: 265 seconds]
<jhass> anyway, disregard it, it's incorrect
chipotle has joined #ruby
<riddley> !
<jhass> .sort.slice_when {|a, b| (a-b).abs > THRESHOLD }.to_a is the correct solution
flashpoint9 has quit [Remote host closed the connection]
<jhass> https://p.jhass.eu/1q.rb here's another one for fun
gizmore has joined #ruby
charliesome has quit [Ping timeout: 265 seconds]
aphprentice_ is now known as aphprentice
rhastra has quit [Quit: leaving]
dvinciguerra has joined #ruby
<riddley> yea the double loop... isn't there some weird behavior when you use break in a block?
roamingdog has quit [Remote host closed the connection]
marr has joined #ruby
SilverKe_ has joined #ruby
<jhass> break returns from the method invoking the block, the argument to break becomes the methods return value. next returns from the block, the argument becomes the blocks return value
SilverKey has quit [Ping timeout: 252 seconds]
pawnbox has joined #ruby
<riddley> jhass, thanks again. This one is closer to my level of understanding. I'll continue to study it.
<jhass> riddley: keep in mind that I consider .slice_when the correct one by now
<jhass> so take that more as a fun exercise
<riddley> ok
charliesome has joined #ruby
shinnya has quit [Ping timeout: 240 seconds]
KINGSABRI has joined #ruby
mistermocha has quit [Remote host closed the connection]
<riddley> jhass, haha the best part is that I'm using (and must keep using) Ruby 2.1 which has no slice_when
stannard has quit [Remote host closed the connection]
<shevy> hehe
zeroDi has quit [Quit: WeeChat 1.5]
<KINGSABRI> Hello guys ,, is there anyway to add hex values and check if there Carry out?
roamingdog has joined #ruby
charliesome has quit [Client Quit]
pawnbox has quit [Ping timeout: 260 seconds]
<jhass> KINGSABRI: could you clarify? show what you've tried so far? example input/desired output?
A124 has quit [Read error: No route to host]
DanyC has quit [Ping timeout: 252 seconds]
chopin has quit [Remote host closed the connection]
yeticry has quit [Quit: leaving]
djbkd has quit [Remote host closed the connection]
<KINGSABRI> jhass https://repl.it/CQdR/1
<KINGSABRI> I want to make sum calcualtion and I need a way/method to tell if there is a carry out of the result
A124 has joined #ruby
johnmilton has joined #ruby
<adaedra> You always have numbers in the [0x0,0x10000[ range?
Gasher has joined #ruby
<KINGSABRI> I didn't understand your question , if you're asking me :)
freerobby has quit [Quit: Leaving.]
<adaedra> Are you numbers always between 0x0 and 0xffff?
codecop has quit [Remote host closed the connection]
smathy is now known as smathy_afk
blackmesa has joined #ruby
<KINGSABRI> the real case is ,, the numbers are 4 bytes but I have to devide it to 2 bytes for each value
JoshGlzBrk has joined #ruby
mistermocha has joined #ruby
<KINGSABRI> I'm working with permutations and find the sum of 3 values that equals a values
diegoviola has quit [Quit: WeeChat 1.5]
<adaedra> so you want to be sure your number is always < 0x10000 then
dstarh has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Devalo has quit [Read error: Connection reset by peer]
djbkd has joined #ruby
blackmes1 has quit [Ping timeout: 260 seconds]
<jhass> .clamp(0..0xffff) ... right this ain't crystal :P
<KINGSABRI> the case is like that I've a values let's say: 0xabcdabcd, I've 121 hex bytes that I've to find a some of 3 characters equals 0xabcdabcd
AnoHito has joined #ruby
<adaedra> But, for the fun, here's to check if you ever have a number of digits bigger than any of the components of your sum: https://eval.in/571298
<adaedra> jhass: shhh.
<KINGSABRI> so the 121 are the only allows value to play with in order to find the sum of the 3 values that = 0xabcdabcd
<adaedra> KINGSABRI: you know that 0x10 and 16 are exactly the same in the eye of Ruby?
<adaedra> there's no really "Hex bytes"
<jhass> adaedra: no need for the & there btw
<adaedra> jhass: yeah, I know, I like to have it :|
<KINGSABRI> adaedra , yes I know
<jhass> isn't it slower?
<adaedra> ah, dunno
<adaedra> also, I think 0xffff is representable in only two bytes
johnmilton has quit [Ping timeout: 276 seconds]
whathappens has joined #ruby
<adaedra> I still don't understand what KINGSABRI is trying to do
JoshGlzBrk has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sesquipedalian has quit [Ping timeout: 244 seconds]
stannard has joined #ruby
<adaedra> jhass: for performance, I actually wonder on the viability of my solution, between Math.log and Numeric#to_s + String#length.
ldnunes has quit [Quit: Leaving]
sesquipedalian has joined #ruby
sp4rrow has joined #ruby
<KINGSABRI> ok , I've this value: 0x33c05068 I need the sum of 3 hex values that equals 0x33c05068
<jhass> I'd expect it be faster until Bignum comes into play
stannard has quit [Remote host closed the connection]
<adaedra> KINGSABRI: 0x33c05065, 0x1, 0x2?
<jhass> math ought to be faster than string allocation
<adaedra> Right
GinoManWorks_ has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
<KINGSABRI> but if you have 121 hex bytes to find the right values
<KINGSABRI> so you guys think it's better to work on it as decemial not hex values ?
arpegius has quit [Quit: arpegius]
joneshf-laptop has joined #ruby
<adaedra> 3 * 0xff is way below 0x33c05068
<adaedra> hex or decimal is the exact same
<adaedra> it's just the representation to your human eyes
<eam> KINGSABRI: they're all binary
djbkd has quit [Remote host closed the connection]
<eam> computers don't use base 10 or base 16
dfockler has joined #ruby
<eam> only base 2
<adaedra> base 16 representation may be a bit easier for your eyes tho, as the limit between bytes is easy to see (every 2 digits)
Coldblackice has quit [Ping timeout: 240 seconds]
halfamind has quit [Read error: Connection reset by peer]
halfamind1 has joined #ruby
<KINGSABRI> ok now I have to split each value into 2 parts: 0x33c0 0x5068
halfamind has joined #ruby
halfamind1 has quit [Read error: Connection reset by peer]
<KINGSABRI> and try to find 3 values = 0x33c0 thne 3 values = 0x5068
sesquipedalian has quit [Ping timeout: 276 seconds]
zyzioziom has joined #ruby
<KINGSABRI> this works for me some values ,, but it gives me wrong values for others
djbkd has joined #ruby
<adaedra> >> v = 0x33c05068; [v & 0xffff, v & 0xffff0000 >> 16]
<ruby[bot]> adaedra: # => [20584, 20584] (https://eval.in/571301)
djbkd has quit [Read error: Connection reset by peer]
<adaedra> erf, beaten by priority of operators.
djbkd has joined #ruby
<adaedra> >> v = 0x33c05068; [v & 0xffff, (v & 0xffff0000) >> 16].map { |e| e.to_s 16 }
<ruby[bot]> adaedra: # => ["5068", "33c0"] (https://eval.in/571303)
ReK2 has quit [Remote host closed the connection]
stannard has joined #ruby
<adaedra> I'm not aware of an easier way of splitting by 2-bytes words in Ruby, I usually don't go this low
<adaedra> eam?
<jhass> could probably .pack & .unpack but ain't really getting prettier
<adaedra> Ah, I forgot those
<KINGSABRI> I didn't understand what the code want to do exactly :(
<adaedra> You're not familiar with binary masks and bit shifting?
mistermocha has quit [Remote host closed the connection]
johnmilton has joined #ruby
<jhass> >> [0x33c05068].pack("L").unpack("S*").map {|n| n.to_s(16) }
halfamind has quit [Read error: Connection reset by peer]
<ruby[bot]> jhass: # => ["5068", "33c0"] (https://eval.in/571305)
halfamind has joined #ruby
<KINGSABRI> I'm trying to be familier becuse I'm doing it the hard way
<adaedra> N and n* would give the array in the wanted order, though.
pfoyh has quit [Ping timeout: 260 seconds]
dima_ has quit [Ping timeout: 252 seconds]
allcentu1 has joined #ruby
allcentury has quit [Read error: No route to host]
allcentu1 has quit [Client Quit]
<adaedra> Even if I'm not sure we're really clear on what we want here.
<jhass> I'm amazed at how you understand anything for 20 minutes already
<shevy> he has a MEGA brain
<adaedra> No, FBI closed MEGAbrain too.
akiTendo has quit [Quit: akiTendo]
<adaedra> I'm still not sure I'm holding the rope from the right end still.
halfamind1 has joined #ruby
halfamind has quit [Read error: Connection reset by peer]
smathy_afk is now known as smathy
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<shevy> just make it a circle!
mtkd has quit [Ping timeout: 276 seconds]
<jhass> yeah I'm still 50/50 between "split visually" (0xabcdef -> 0xab, 0xcd, 0xef) and split "mathematically" ( n / 3 + padding)
eljimador has joined #ruby
<adaedra> well, I read about bytes, so I'd expect to be a byte split, here in network order/big endian
<jhass> iirc the latter was an assignment somewhere, not sure how the hex stuff comes into play then though
<adaedra> KINGSABRI: if it's an assignment, is there the subject somewhere?
<jhass> KINGSABRI: maybe elaborate a bit on what's this for
mtkd has joined #ruby
stryek has quit [Ping timeout: 260 seconds]
rodfersou has quit [Quit: leaving]
<adaedra> there seems to be quite a misunderstanding on some concepts or the subject
austinprog has joined #ruby
<adaedra> CHARS = (0x0..0x7f).map(&:to_s)
<adaedra> oops.
<adaedra> CHARS = (0x0..0x7f).map { |e| e.to_s 16 }
<adaedra> better.
charliesome has joined #ruby
<austinprog> Hey everyone. What is the method to get a number as a double? I know gets.chomp().to_i gets integer but not specifically working for something like 8.0
<KINGSABRI> if I permutations is 4 element it will take forever
jgt1 has quit [Ping timeout: 276 seconds]
replay has joined #ruby
charliesome has quit [Read error: Connection reset by peer]
<shevy> austinprog just float, .to_f should work
platzhirsch has joined #ruby
<austinprog> Thank you! I will try that
griffindy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<adaedra> All of this seems pretty confused
<KINGSABRI> adaedra , jhass as you can see from script
<KINGSABRI> there is a small processing but on huge number of permutations .. the main issue is the carry out
<adaedra> I read badly from source code actually, especially at 23:40, don't you have a clearer explanation of what is needed?
yqt has joined #ruby
karmatr0n has quit [Ping timeout: 265 seconds]
<KINGSABRI> it's an encoder for hex values
roamingdog has quit [Remote host closed the connection]
Ishido has quit [Read error: Connection reset by peer]
<adaedra> Very well
dvinciguerra has quit [Ping timeout: 240 seconds]
hobodave_ has quit [Quit: Computer has gone to sleep.]
pawnbox has joined #ruby
<apeiros> it taketh the input and encodeth it in hex
loincloth has joined #ruby
<apeiros> austinprog: Float(string) might be better than .to_f, since it'll raise if the value is not a valid float representation
<apeiros> >> "hello world".to_f
<ruby[bot]> apeiros: # => 0.0 (https://eval.in/571307)
<apeiros> >> Float("hello world")
<ruby[bot]> apeiros: # => invalid value for Float(): "hello world" (ArgumentError) ...check link for more (https://eval.in/571308)
mooe has quit [Quit: Connection closed for inactivity]
<adaedra> I see an error in both. "0.0" => what the f did you gave to me smiley.
<adaedra> :p
<apeiros> 0.0
<apeiros> o0
<apeiros> 0o
<apeiros> -.-
<adaedra> õ.o
diego1 has joined #ruby
last_staff has quit [Quit: last_staff]
kirun has quit [Quit: Client exiting]
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
diego1 is now known as diegoviola
allcentury has joined #ruby
JoshGlzBrk has joined #ruby
workmad3 has joined #ruby
symm- has joined #ruby
<shevy> are you people doing again animated ascii there
<jhass> KINGSABRI: how about picking random values between 0 and n/2 for the first and second value, and n-v1-v2 for the third?
<adaedra> shevy: let's first implement correctly APNG before doing AASCII.
<adaedra> Woohoo, message at 00:00:00.
<KINGSABRI> jhass mmm I'll try this idea , It might save time
d10n-work has quit [Quit: Connection closed for inactivity]
d0lph1n98 has quit [Ping timeout: 252 seconds]
<jhass> KINGSABRI: or to have a wider spectrum, rand(n) for the first and rand(n-v1) for the second
<jhass> and shuffle the result
workmad3 has quit [Ping timeout: 276 seconds]
halfamind1 has quit [Quit: Leaving.]
mistermocha has joined #ruby
zyzioziom has quit [Ping timeout: 276 seconds]
idefine has quit [Ping timeout: 252 seconds]
Devalo has joined #ruby
mistermocha has quit [Ping timeout: 240 seconds]
Biopandemic has quit [Remote host closed the connection]
stannard has quit [Ping timeout: 250 seconds]
djbkd has quit [Remote host closed the connection]
dvinciguerra has joined #ruby
mistermocha has joined #ruby
dfockler has quit [Quit: Leaving...]
arpegius has joined #ruby
flashpoint9 has joined #ruby
Gasher has quit [Quit: Leaving]
oetjenj has quit [Ping timeout: 260 seconds]
Devalo has quit [Ping timeout: 250 seconds]
djbkd has joined #ruby
leitz has joined #ruby
<leitz> Bummer of the day; reading messy old code and knowing that it's my messy old code....
Coldblackice has joined #ruby
<apeiros> "omg, it's so bad! who wrote that, when, and why?" - "oh, I wrote it. yesterday."
allcentury has quit [Ping timeout: 260 seconds]
<leitz> Hey apeiros, good to see you again.
djbkd has quit [Remote host closed the connection]
<leitz> I'm trying to see if I want to just start over with the project, after I spend a few more weeks relearning the basics.
<adaedra> git blame yourself
djbkd has joined #ruby
djbkd has quit [Remote host closed the connection]
Masonn has joined #ruby
wilbert has quit [Ping timeout: 260 seconds]
JoshGlzBrk has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shevy> leitz yeah, sometimes it is not lack of knowledge though but syntax changes; such as the new hash syntax, I found it to be good for like single-key hashes Ponicorn.new(colour: :pink)
sinkensabe has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<shevy> more annoying is old code that I have that was written by someone else while being very complicated
Guest38 has joined #ruby
<leitz> shevy, yeah, well. You know me, still the old Ruby version. The issue is that I'm an OOP newb and the classes are probalby poorly laid out.
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<leitz> Like, "where is that variable set?" sort of poorly laid out.
<shevy> you are stuck with some older ruby version too?
riobe has quit [Remote host closed the connection]
<leitz> Yup. I mostly do server work and have to use what's on the server.
<shevy> I guess my own code would look very different if I have to remain compatible to 1.8.x now
riobe has joined #ruby
<adaedra> can we keep 1.8 in the past where it belongs?
<apeiros> keeping your code 1.8 compatible is like trying to keep your car horse compatible
aegis3121 has quit [Ping timeout: 260 seconds]
<leitz> Sadly, no adaedra.
<leitz> Not for another couple years.
<shevy> you can eat horses!
oetjenj has joined #ruby
halfamind has joined #ruby
Biopandemic has joined #ruby
<adaedra> apeiros: speaking of which, I think I have a problem with my car. I feed it hay but it refuses to eat it. What should I do?
<leitz> I think this job will require ice cream. I need to map out how the thing works again.
<leitz> Back in a bit.
SCHAAP137 has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
<apeiros> adaedra: you should ask a veterinarian
<apeiros> maybe your car is sick
halfamind has quit [Client Quit]
<adaedra> my car really is sick.
<adaedra> YEAH
<adaedra> Welp, time for me to go to 3053.
tatsuo has joined #ruby
Masonn has quit [Ping timeout: 260 seconds]
duoi has quit [Max SendQ exceeded]
duoi has joined #ruby
djbkd has joined #ruby
cloaked1 has quit [Quit: leaving]
duoi has quit [Max SendQ exceeded]
duoi has joined #ruby
jenrzzz_ has joined #ruby
zenlot6 has joined #ruby
toretore has quit [Ping timeout: 276 seconds]
jenrzzz has quit [Ping timeout: 244 seconds]
<tatsuo> hello.
dvinciguerra has quit [Ping timeout: 260 seconds]
zenlot has quit [Ping timeout: 250 seconds]
djbkd has quit [Remote host closed the connection]
<havenwood> tatsuo: hi
<tatsuo> can I get a upload progress in http post upload for restclient?
chipotle has quit [Ping timeout: 260 seconds]
sinkensabe has quit [Ping timeout: 260 seconds]
tatsuo has quit [Remote host closed the connection]
tatsuo has joined #ruby
sinkensabe has joined #ruby
troulouliou_div2 has joined #ruby
pawnbox has quit [Remote host closed the connection]
mistermocha has quit [Remote host closed the connection]
arpegius has quit [Quit: arpegius]
troulouliou_div2 has quit [Remote host closed the connection]
djbkd has joined #ruby
roamingdog has joined #ruby
* leitz returns with milk and cookies.
sinkensabe has quit [Remote host closed the connection]
austinprog has quit [Ping timeout: 276 seconds]
biberu has quit []
gizless has joined #ruby
casp has joined #ruby
mistermocha has joined #ruby
gizless has quit [Remote host closed the connection]
nando293921 has joined #ruby
<casp> hello
gizless has joined #ruby
casp has left #ruby [#ruby]
mistermocha has quit [Remote host closed the connection]
mistermocha has joined #ruby
gizmore has quit [Ping timeout: 246 seconds]
moeabdol has joined #ruby
chipotle has joined #ruby
Azure|dc has joined #ruby
Azure has quit [Ping timeout: 260 seconds]
SilverKe_ has quit [Quit: Halted.]
ramfjord_ has joined #ruby
arescorpio has joined #ruby
stannard has joined #ruby
mistermocha has quit [Remote host closed the connection]
ramfjord has quit [Ping timeout: 260 seconds]
wrkrcoop has quit [Quit: wrkrcoop]
moeabdol has quit [Ping timeout: 276 seconds]
ReK2 has joined #ruby
ReK2 has joined #ruby
SilverKey has joined #ruby
solars has quit [Ping timeout: 250 seconds]
tildes has joined #ruby
stannard has quit [Ping timeout: 240 seconds]
SilverKey has quit [Client Quit]
pawnbox has joined #ruby
xall has quit [Ping timeout: 265 seconds]
chouhoulis has quit [Remote host closed the connection]
madgen has quit [Ping timeout: 260 seconds]
casp has joined #ruby
pawnbox has quit [Ping timeout: 260 seconds]
firstdayonthejob has quit [Ping timeout: 250 seconds]
Azure|dc has quit [Remote host closed the connection]
jobewan has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
symm- has quit [Quit: Leaving...]
mistermocha has joined #ruby
JesseH has quit [Remote host closed the connection]
Redfoxmoon has quit [Read error: Connection reset by peer]
joaumg has joined #ruby
riobe has quit [Remote host closed the connection]
riobe has joined #ruby
ramfjord_ has quit [Ping timeout: 260 seconds]
chouhoulis has joined #ruby
Kitt3n has joined #ruby
mistermocha has quit [Ping timeout: 276 seconds]
drptbl has quit [Quit: See you later!]
platzhirsch has quit [Ping timeout: 244 seconds]
ramfjord has joined #ruby
xall has joined #ruby
Kitt3n has quit [Changing host]
Kitt3n has joined #ruby
jancel has joined #ruby
idefine has joined #ruby
Kitt3n is now known as Redfoxmoon
jwren has joined #ruby
jancel has quit [Read error: Connection reset by peer]
<leitz> Okay, an actual Ruby question. Not about horses.
djbkd has quit [Remote host closed the connection]
<leitz> In the initialize section of a class, there's a line: @terms = char['terms'] || terms
<leitz> The ending "terms" is a method that will set @terms to something. It is called if char['terms'] isn't passed as a part of the initialize.
whathappens has quit [Quit: Leaving...]
<leitz> Am I right in thinking that if an object like this is created, it has a terms vaule that can get changed if the object's "terms" method is called?
<leitz> So terms is set, and then reset.
AndroidLoverInSF has joined #ruby
djbkd has joined #ruby
<smathy> leitz, only if the `terms` method sets `@terms` as a side-effect.
Guest38 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ramfjord has quit [Ping timeout: 276 seconds]
Jackneill has quit [Remote host closed the connection]
chouhoulis has quit [Ping timeout: 252 seconds]
djbkd has quit [Remote host closed the connection]
AndroidLoverInSF has quit [Client Quit]
<leitz> smathy, not sure if "side effect' has a special meaning. The terms method sets the terms number and derives age from the number of terms.
<leitz> So yes, calling terms sets terms.
<leitz> Hmm... @terms ||= Traveller.roll_dice(6,1,1)
<leitz> That's from the body of the method. So it might only reset it if not set.
ramfjord has joined #ruby
<smathy> leitz, yes, that's correct. It will only set it if it's falsey.
<smathy> (and yes, that's a side effect, although a fairly common one called memoization)
Vile` has joined #ruby
gizmore has joined #ruby
Dimik has quit [Ping timeout: 276 seconds]
jackjackdripper has quit [Quit: Leaving.]
casp has quit [Remote host closed the connection]
dvinciguerra has joined #ruby
juanfra has joined #ruby
saneax_AFK is now known as saneax
kareeole_ has joined #ruby
gizless has quit [Ping timeout: 260 seconds]
johnmilton has quit [Ping timeout: 240 seconds]
bronson has joined #ruby
kareeoleez has quit [Ping timeout: 265 seconds]
rrichardsr3 has joined #ruby
bronson has quit [Ping timeout: 252 seconds]
idefine has quit [Read error: Connection reset by peer]
jtd has quit [Remote host closed the connection]
djbkd has joined #ruby
jtd has joined #ruby
jhack has quit [Quit: jhack]
idefine has joined #ruby
mjs2600 has joined #ruby
cdg has quit [Remote host closed the connection]
kies has quit [Ping timeout: 276 seconds]
d0nn1e has quit [Ping timeout: 265 seconds]
ule has quit [Changing host]
ule has joined #ruby
d0nn1e has joined #ruby
QORRiE has quit [Quit: Leaving]
jgt1 has joined #ruby
mlehrer has joined #ruby