jhass changed the topic of #ruby to: Rules & more: https://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/
yuki_is_bored_ has joined #ruby
yuki_is_bored_ has quit [Client Quit]
<wolffles> jhass: would there be one that returns non prime numbers aswell?
spudowiar has quit [Quit: Leaving.]
<jhass> there are infinitely many of those for any given number
yuki_is_bored_ has joined #ruby
mtkd has quit [Ping timeout: 244 seconds]
axsuul has joined #ruby
mtkd has joined #ruby
<jhass> mh, actually nvm, that doesn't return what I thought it would return
<jhass> ah well, you can still calculate it from it I guess
<wolffles> i saw someones solution where he did something with #prime_division but i didnt understand it
<jhass> .inject(2) {|sum, prime| sum + prime[1] }
<jhass> you always have n and 1 itself
<jhass> >> require "prime"; 28.prime_division
<ruby[bot]> jhass: # => [[2, 2], [7, 1]] (https://eval.in/619131)
<jhass> that means 2**2 * 7**1 or 2 * 2 * 7
<jhass> so 1, 2, 2, 7, 28
tubuliferous has joined #ruby
JeanCarl1Machado has joined #ruby
pontiki has quit [Quit: Lost terminal]
axsuul has quit [Ping timeout: 276 seconds]
threh has quit [Ping timeout: 250 seconds]
yuki_is_bored has quit [Disconnected by services]
yuki_is_bored_ is now known as yuki_is_bored
<wolffles> oh yeah i get that. but for the value 28 i would also need [4 and 14] aswell
JeanCarloMachado has quit [Ping timeout: 244 seconds]
<wolffles> im trying to come up with a way to get the numbers inbetween thats effiecent for large numbers
xlegoman has joined #ruby
<wolffles> jhass: nvm i get it now
CloCkWeRX has joined #ruby
eljimmy has quit [Quit: This computer has gone to sleep]
elifoster has quit [Quit: out]
diegoviola has quit [Quit: WeeChat 1.5]
johnchalekson has quit [Quit: #UNHACKABLE #UNJACKABLE 10^10^78 https://www.youtube.com/watch?v=WIxNHrNM8So&list=RDlCLduR5AGRU&index=4 UNIVERSAL HISTORICAL TIME FROM THA ASHES WISE FROM THE WORD]
toretore has joined #ruby
Izabia has quit [Ping timeout: 240 seconds]
<matthewd> Yeah, I'm struggling to work out how to get from the prime factors list to a full list of factors
<wolffles> matthewd: hopefully that helps
<wolffles> jhass: NO! the answer must not look
Derperperd has joined #ruby
Fly77_ has joined #ruby
the_rhizo has joined #ruby
<matthewd> wolffles: Ah, interesting. I'll admit "just add one to everything" was not on my list of obvious things to try ;)
tmtwd has quit [Ping timeout: 240 seconds]
KnownSyntax_ has quit [Read error: Connection reset by peer]
marr has quit [Ping timeout: 260 seconds]
the_rhizo has quit [Ping timeout: 265 seconds]
xall has quit [Ping timeout: 244 seconds]
<wolffles> matthewd: haha yeah when in doubt brute force
pawnbox has joined #ruby
xall has joined #ruby
zacts has joined #ruby
pawnbox has quit [Ping timeout: 240 seconds]
enterprisey has joined #ruby
hadronzoo has quit [Ping timeout: 244 seconds]
Rodya_ has quit [Remote host closed the connection]
olspookishmagus has quit [Quit: Lost terminal]
hahuang65 has joined #ruby
nisstyre has joined #ruby
nisstyre has quit [Changing host]
nisstyre has joined #ruby
Rodya_ has joined #ruby
c0mrad3 has quit [Quit: Connection closed for inactivity]
eljimmy has joined #ruby
swemoney has quit [Read error: Connection reset by peer]
hahuang65 has quit [Ping timeout: 250 seconds]
toretore has quit [Ping timeout: 258 seconds]
c355e3b has quit [Quit: Connection closed for inactivity]
xall_ has joined #ruby
xall has quit [Ping timeout: 250 seconds]
xall has joined #ruby
djbkd has joined #ruby
xall_ has quit [Ping timeout: 264 seconds]
der-landgraf has quit [Ping timeout: 250 seconds]
postmodern has joined #ruby
A_Drone has joined #ruby
A_Drone has quit [Remote host closed the connection]
howard_ has quit [Quit: Leaving...]
der-landgraf has joined #ruby
eljimmy has quit [Quit: This computer has gone to sleep]
Dry_Lips has quit [Ping timeout: 244 seconds]
Torrone has joined #ruby
yqt has quit [Ping timeout: 276 seconds]
JakFrist has joined #ruby
kobain has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
Ropeney has joined #ruby
the_rhizo has joined #ruby
Ropeney has quit [Client Quit]
memorasus1 has joined #ruby
Dry_Lips has joined #ruby
Dry_Lips has quit [Changing host]
Dry_Lips has joined #ruby
minimalism has quit [Ping timeout: 250 seconds]
memorasus has quit [Ping timeout: 250 seconds]
memorasus1 is now known as memorasus
Torrone has quit [Quit: This computer has gone to sleep]
kobain has joined #ruby
xall has quit [Ping timeout: 240 seconds]
n90b0jjf has quit [Ping timeout: 240 seconds]
n90b0jjf has joined #ruby
JakFrist has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
A_Drone has joined #ruby
wolffles has quit [Quit: wolffles]
tmtwd has joined #ruby
ur5us has quit [Remote host closed the connection]
freerobby has quit [Quit: Leaving.]
sp_ has quit [Ping timeout: 265 seconds]
freerobby has joined #ruby
xxneolithicxx has joined #ruby
Bounga has quit [Ping timeout: 260 seconds]
davedev24 has quit []
Cohedrin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jud^ has joined #ruby
Cohedrin has joined #ruby
A_Drone has quit [Read error: Connection reset by peer]
jud has quit [Ping timeout: 252 seconds]
macsteps has quit [Remote host closed the connection]
zacts has quit [Read error: Connection reset by peer]
xall has joined #ruby
A_Drone has joined #ruby
ICantCook has joined #ruby
nando293921 has quit [Ping timeout: 260 seconds]
hahuang65 has joined #ruby
kobain has quit [Ping timeout: 260 seconds]
tmtwd has quit [Ping timeout: 264 seconds]
xxneolithicxx has quit [Quit: Leaving.]
astrobun_ has joined #ruby
A_Drone has quit [Remote host closed the connection]
hahuang65 has quit [Ping timeout: 250 seconds]
impermanence has joined #ruby
ur5us has joined #ruby
kobain has joined #ruby
JoshGlzBrk has joined #ruby
LoneHerm_ has joined #ruby
JeanCarl1Machado has quit [Quit: Lost terminal]
Hyuk has joined #ruby
harfangk has joined #ruby
Rodya_ has quit [Remote host closed the connection]
memorasus has quit [Ping timeout: 250 seconds]
arescorpio has joined #ruby
Torrone has joined #ruby
dcunit3d has quit [Ping timeout: 258 seconds]
n90b0jjf has quit [Remote host closed the connection]
ThinTim has joined #ruby
hiptobecubic_ has joined #ruby
ThinTim has quit [Client Quit]
poguez_ has quit [Quit: Connection closed for inactivity]
<hiptobecubic_> Hey everyone. I have no idea what I'm doing. I just did `bundle install --path vendor/bundle` as it suggested, but now I'm not sure how to tell ruby to look there when running an application
<hiptobecubic_> And this works differently from python's hermetic approach it seems
macsteps has joined #ruby
TPug has joined #ruby
A_Drone has joined #ruby
eljimmy has joined #ruby
the_rhizo has quit [Ping timeout: 265 seconds]
Izabia has joined #ruby
TPug has quit [Ping timeout: 258 seconds]
Izabia has quit [Max SendQ exceeded]
<hiptobecubic_> sigh
Rodya_ has joined #ruby
<matthewd> hiptobecubic_: Does sigh mean you've worked it out?
<hiptobecubic_> No :)
<hiptobecubic_> I tried a few things
<hiptobecubic_> is "bundle exec ruby app.rb" reasonable looking?
<hiptobecubic_> it looks like maybe it worked, but I don't actually what the semantics of that are
OTORelic2 has joined #ruby
Rodya_ has quit [Remote host closed the connection]
<matthewd> Sounds likely
Derperperd has quit [Quit: Derperperd]
<matthewd> Though I guess my first question would be if you don't have a specific understood requirement, why are you using a non-default option at all?
<matthewd> What is the 'it' that suggested --path ?
<hiptobecubic_> bundle install
<hiptobecubic_> "you don't have permission to .... why not use --path vendor/bundle" ?
<hiptobecubic_> <paraphrasing but that was essentially he message>
minimalism has joined #ruby
OTORelic1 has quit [Ping timeout: 264 seconds]
A_Drone has quit [Ping timeout: 240 seconds]
astrobun_ has quit [Remote host closed the connection]
astrobun_ has joined #ruby
A_Drone has joined #ruby
Derperperd has joined #ruby
<matthewd> Ah, okay. I think I forgot it doesn't just default to --user-install where necessary.
<matthewd> Anyway, yes: run things with bundle exec.
claw has quit [Read error: Connection reset by peer]
Ropeney has joined #ruby
claw has joined #ruby
iMadper has joined #ruby
sp_ has joined #ruby
ruisanto1 has quit [Remote host closed the connection]
astrobun_ has quit [Remote host closed the connection]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
OTORelic2 has quit [Ping timeout: 276 seconds]
xlegoman has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sp_ has quit [Ping timeout: 258 seconds]
govg has quit [Ping timeout: 240 seconds]
LoneHerm_ has quit [Remote host closed the connection]
Hyuk has quit [Quit: Textual IRC Client: www.textualapp.com]
s2013 has joined #ruby
A_Drone has quit [Remote host closed the connection]
A_Drone has joined #ruby
A_Drone has quit [Remote host closed the connection]
A_Drone has joined #ruby
cibs has quit [Ping timeout: 240 seconds]
Torrone has quit [Quit: This computer has gone to sleep]
cibs has joined #ruby
hahuang65 has joined #ruby
rkazak has joined #ruby
A_Drone has quit [Ping timeout: 240 seconds]
hahuang65 has quit [Ping timeout: 258 seconds]
roflmyeggo has joined #ruby
xall has quit [Ping timeout: 244 seconds]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
A_Drone has joined #ruby
s2013 has joined #ruby
Derperperd has quit [Read error: No route to host]
Derperperd has joined #ruby
Derperperd has quit [Client Quit]
pawnbox has joined #ruby
braincrash has quit [Quit: bye bye]
djbkd_ has joined #ruby
pawnbox has quit [Ping timeout: 258 seconds]
Derperperd has joined #ruby
xall has joined #ruby
Dimik has quit [Ping timeout: 260 seconds]
djbkd_ has quit [Ping timeout: 276 seconds]
eljimmy has quit [Quit: This computer has gone to sleep]
ur5us has quit [Remote host closed the connection]
Es0teric has quit [Quit: Computer has gone to sleep.]
der-landgraf has quit [Quit: WeeChat 1.5]
Es0teric has joined #ruby
tubuliferous has quit [Ping timeout: 250 seconds]
harfangk has quit [Quit: Textual IRC Client: www.textualapp.com]
Cohedrin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tubuliferous has joined #ruby
Cohedrin has joined #ruby
Izabia has joined #ruby
pawnbox has joined #ruby
OTORelic2 has joined #ruby
tmtwd has joined #ruby
alfiemax has joined #ruby
yardenbar has joined #ruby
Bounga has joined #ruby
tubuliferous has quit [Ping timeout: 250 seconds]
alfiemax has quit [Ping timeout: 244 seconds]
WillAus has joined #ruby
rkazak has quit [Quit: Sleep.....ing....]
OTORelic2 has quit [Ping timeout: 250 seconds]
LoneHerm_ has joined #ruby
Bounga has quit [Ping timeout: 260 seconds]
beilabs has joined #ruby
Fly77_ has quit [Remote host closed the connection]
davedev24 has joined #ruby
j416 has quit [Ping timeout: 240 seconds]
CloCkWeRX has quit [Ping timeout: 258 seconds]
j416 has joined #ruby
dcunit3d has joined #ruby
hahuang65 has joined #ruby
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
leea has joined #ruby
gix has quit [Ping timeout: 258 seconds]
hahuang65 has quit [Ping timeout: 250 seconds]
A_Drone has quit [Remote host closed the connection]
dhollinger has joined #ruby
dhollinger has quit [Client Quit]
gix has joined #ruby
A_Drone has joined #ruby
dhollinger has joined #ruby
dhollinger has quit [Client Quit]
dhollinger has joined #ruby
macsteps has quit [Remote host closed the connection]
qguv has quit [Quit: bye]
Raboo has quit [Remote host closed the connection]
n90b0jjf has joined #ruby
qguv has joined #ruby
craigp_ has quit [Ping timeout: 265 seconds]
freerobby has quit [Quit: Leaving.]
pwnd_nsfw has quit [Ping timeout: 258 seconds]
LoneHerm_ has quit [Ping timeout: 252 seconds]
CloCkWeRX has joined #ruby
A_Drone has quit [Remote host closed the connection]
A_Drone has joined #ruby
nisstyre has quit [Quit: WeeChat 1.5]
rkazak has joined #ruby
A_Drone has quit [Remote host closed the connection]
The_Phoenix has joined #ruby
The_Phoenix has quit [Max SendQ exceeded]
The_Phoenix has joined #ruby
The_Phoenix has quit [Changing host]
The_Phoenix has joined #ruby
pwnd_nsfw has joined #ruby
The_Phoenix has quit [Max SendQ exceeded]
A_Drone has joined #ruby
enterprisey has quit [Remote host closed the connection]
yardenbar has quit [Ping timeout: 264 seconds]
The_Phoenix has joined #ruby
The_Phoenix has quit [Max SendQ exceeded]
djbkd_ has joined #ruby
davedev24 has quit []
The_Phoenix has joined #ruby
The_Phoenix has quit [Max SendQ exceeded]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
The_Phoenix has joined #ruby
yfeldblum has quit [Remote host closed the connection]
blackgoat has quit [Ping timeout: 240 seconds]
Es0teric has quit [Quit: Computer has gone to sleep.]
yfeldblum has joined #ruby
djbkd_ has quit [Ping timeout: 244 seconds]
A_Drone has quit [Remote host closed the connection]
impermanence has quit [Ping timeout: 258 seconds]
s2013 has joined #ruby
arescorpio has quit [Excess Flood]
_djbkd has joined #ruby
jishankai has joined #ruby
Cohedrin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Cohedrin has joined #ruby
pawnbox has quit [Remote host closed the connection]
Es0teric has joined #ruby
bluOxigen has left #ruby [#ruby]
rkazak has quit [Quit: Sleep.....ing....]
koooge has joined #ruby
Cohedrin has quit [Client Quit]
WillAus has quit [Ping timeout: 244 seconds]
pawnbox has joined #ruby
ixti has joined #ruby
ponga has joined #ruby
the_drow has joined #ruby
xall has quit [Ping timeout: 276 seconds]
enterprisey has joined #ruby
alfiemax has joined #ruby
hk238 has joined #ruby
roflmyeggo has quit [Ping timeout: 260 seconds]
xall has joined #ruby
astrobun_ has joined #ruby
johnny56 has joined #ruby
johnny56_ has quit [Ping timeout: 264 seconds]
ixti has quit [Ping timeout: 252 seconds]
hahuang65 has joined #ruby
pwnd_nsfw has quit [Ping timeout: 250 seconds]
Es0teric has quit [Quit: Computer has gone to sleep.]
sp_ has joined #ruby
hahuang65 has quit [Ping timeout: 250 seconds]
Cohedrin has joined #ruby
tubuliferous has joined #ruby
craigp_ has joined #ruby
n90b0jjf has quit [Remote host closed the connection]
pwnd_nsfw has joined #ruby
sp_ has quit [Ping timeout: 265 seconds]
memorasus has joined #ruby
LoneHerm_ has joined #ruby
craigp_ has quit [Ping timeout: 244 seconds]
govg has joined #ruby
LoneHerm_ has quit [Ping timeout: 252 seconds]
tmtwd has quit [Ping timeout: 276 seconds]
eljimmy has joined #ruby
djbkd_ has joined #ruby
sp_ has joined #ruby
kobain has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
kobain has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kobain has quit [Client Quit]
leea has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sp_ has quit [Ping timeout: 240 seconds]
djbkd_ has quit [Ping timeout: 240 seconds]
beilabs_ has joined #ruby
memorasus has quit [Ping timeout: 250 seconds]
tmtwd has joined #ruby
skade has joined #ruby
Madplatypus has joined #ruby
the_drow has quit [Quit: This computer has gone to sleep]
beilabs has quit [Ping timeout: 244 seconds]
Silthias has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
_djbkd has quit [Remote host closed the connection]
_djbkd has joined #ruby
impermanence has joined #ruby
govg has quit [Ping timeout: 250 seconds]
kobain has joined #ruby
craigp_ has joined #ruby
kobain has quit [Client Quit]
the_drow has joined #ruby
dhollinger has quit [Quit: WeeChat 1.4]
enterprisey has quit [Quit: Leaving]
_djbkd has quit [Ping timeout: 252 seconds]
craigp_ has quit [Ping timeout: 240 seconds]
impermanence has quit [Ping timeout: 276 seconds]
l4v2 has quit [Quit: l4v2]
Silthias has quit [Ping timeout: 250 seconds]
JoshGlzBrk has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
OTORelic2 has joined #ruby
djbkd_ has joined #ruby
_djbkd has joined #ruby
pawnbox has quit [Remote host closed the connection]
Silthias has joined #ruby
djbkd has quit [Ping timeout: 250 seconds]
pawnbox has joined #ruby
OTORelic2 has quit [Ping timeout: 258 seconds]
dreamyspell_ has joined #ruby
xall has quit [Ping timeout: 260 seconds]
dminuoso has joined #ruby
dreamyspell has quit [Ping timeout: 258 seconds]
der-landgraf has joined #ruby
govg has joined #ruby
raeoks has joined #ruby
rails is now known as evilNerd
hahuang65 has joined #ruby
hiptobecubic_ has quit [Ping timeout: 276 seconds]
A_Drone has joined #ruby
hahuang65 has quit [Ping timeout: 250 seconds]
last_staff has joined #ruby
xlegoman has joined #ruby
Dimik-- has joined #ruby
A_Drone has quit [Remote host closed the connection]
LoneHermit has joined #ruby
rkazak has joined #ruby
A_Drone has joined #ruby
ICantCook has quit [Quit: bye]
blaxter has joined #ruby
ICantCook has joined #ruby
LoneHermit has quit [Ping timeout: 252 seconds]
ur5us has joined #ruby
AlexRussia has quit [Ping timeout: 264 seconds]
A_Drone has quit [Remote host closed the connection]
mradmacher has joined #ruby
tmtwd has quit [Ping timeout: 276 seconds]
djbkd has joined #ruby
the_drow has quit [Quit: This computer has gone to sleep]
xall has joined #ruby
brianpWins has joined #ruby
raeoks has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
raeoks has joined #ruby
harfangk has joined #ruby
djbkd has quit [Ping timeout: 265 seconds]
craigp_ has joined #ruby
govg has quit [Ping timeout: 276 seconds]
Silthias has quit [Ping timeout: 260 seconds]
yuki_is_1ored has joined #ruby
yuki_is_bored has quit []
yuki_is_1ored has quit [Client Quit]
yuki_is_bored has joined #ruby
Velizar has joined #ruby
brianpWins has quit [Ping timeout: 264 seconds]
grenierm has joined #ruby
brianpWins has joined #ruby
dminuoso_ has joined #ruby
dminuoso has quit [Ping timeout: 276 seconds]
eljimmy has quit [Quit: This computer has gone to sleep]
firstdayonthejob has joined #ruby
_djbkd has quit [Quit: My people need me...]
xall has quit [Read error: Connection reset by peer]
xall has joined #ruby
ctp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
impermanence has joined #ruby
conta has joined #ruby
rkazak has quit [Quit: Sleep.....ing....]
djbkd has joined #ruby
dreamyspell_ is now known as dreamyspell
lightheaded has joined #ruby
impermanence has quit [Ping timeout: 244 seconds]
xall has quit [Ping timeout: 258 seconds]
anaeem1_ has joined #ruby
anaeem1_ has quit [Remote host closed the connection]
aganov has joined #ruby
firstdayonthejob has quit [Ping timeout: 258 seconds]
edwinvdgraaf has quit [Remote host closed the connection]
dminuoso_ has quit [Remote host closed the connection]
al2o3-cr has quit [Ping timeout: 250 seconds]
hahuang65 has joined #ruby
tubuliferous has quit [Quit: ZNC - http://znc.in]
avelldiroll has quit [Ping timeout: 276 seconds]
al2o3-cr has joined #ruby
hightower4 has quit [Ping timeout: 250 seconds]
hightower2 has quit [Ping timeout: 240 seconds]
avelldiroll has joined #ruby
devec0 has joined #ruby
submitnine has joined #ruby
Dimik-- has quit [Ping timeout: 276 seconds]
hahuang65 has quit [Ping timeout: 250 seconds]
harfangk has quit [Quit: Textual IRC Client: www.textualapp.com]
dunpeal has quit [Ping timeout: 240 seconds]
AlexJakeGreen has joined #ruby
iMadper` has joined #ruby
xlegoman has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
beilabs_ has quit [Remote host closed the connection]
dminuoso has joined #ruby
atom_ has quit [Ping timeout: 265 seconds]
iMadper has quit [Ping timeout: 252 seconds]
anisha has joined #ruby
A_Drone has joined #ruby
grenierm has quit [Quit: grenierm]
xall has joined #ruby
govg has joined #ruby
the_drow has joined #ruby
xall has quit [Ping timeout: 252 seconds]
anisha has quit [Quit: This computer has gone to sleep]
lizard2010 has joined #ruby
sp_ has joined #ruby
Ropeney has quit [Read error: Connection reset by peer]
xall has joined #ruby
beilabs has joined #ruby
antgel has joined #ruby
ur5us has quit [Remote host closed the connection]
mark_66 has joined #ruby
platzhir1 has joined #ruby
symm- has quit [Ping timeout: 250 seconds]
xall has quit [Read error: Connection reset by peer]
Dimik has joined #ruby
ta_ has joined #ruby
hightower2 has joined #ruby
ledestin has joined #ruby
platzhir1 has quit [Ping timeout: 258 seconds]
dminuoso has quit [Ping timeout: 276 seconds]
dionysus69 has joined #ruby
anisha has joined #ruby
govg has quit [Ping timeout: 252 seconds]
dminuoso has joined #ruby
teclator has quit [Ping timeout: 264 seconds]
edwinvdgraaf has joined #ruby
mim1k has joined #ruby
pokalyis has joined #ruby
aufi has joined #ruby
OTORelic2 has joined #ruby
Cohedrin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
A_Drone has quit [Remote host closed the connection]
jinie_ has quit [Ping timeout: 250 seconds]
OTORelic2 has quit [Ping timeout: 258 seconds]
bigkevmcd has joined #ruby
jinie has joined #ruby
mrgrieves has joined #ruby
Dimik has quit [Ping timeout: 240 seconds]
antgel has quit [Ping timeout: 244 seconds]
yfeldblum has quit [Remote host closed the connection]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
mim1k has quit [Ping timeout: 244 seconds]
hahuang65 has joined #ruby
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
teclator has joined #ruby
mim1k has joined #ruby
Silthias has joined #ruby
hahuang65 has quit [Ping timeout: 250 seconds]
yeticry has quit [Read error: Connection reset by peer]
chriscoffee has joined #ruby
giz|work has joined #ruby
leea has joined #ruby
Hyuk has joined #ruby
Hyuk has quit [Client Quit]
jackjackdripper has joined #ruby
LoneHermit has joined #ruby
yeticry has joined #ruby
elaptics`away is now known as elaptics
Bounga has joined #ruby
bigkevmcd has quit [Quit: Outta here...]
LoneHermit has quit [Ping timeout: 252 seconds]
pandaant has joined #ruby
ctp has joined #ruby
mlehrer has joined #ruby
bigkevmcd has joined #ruby
soLucien has joined #ruby
<soLucien> hi guys ! i have an array A that contains tuples of MacAddress+SwitchName information
flying has joined #ruby
<soLucien> i want to change its format and values to this
<soLucien> hv_options.map{|a| a['mac_address'] = a['MacAddress'].scan(/([A-F0-9]{2})/).join(':') a['name']= a['SwitchName'] }
Bounga has quit [Remote host closed the connection]
<soLucien> how do i do it ?
<soLucien> of course, this is not correct
Bounga has joined #ruby
<soLucien> but what would be the appropriate ruby synthax for this ?
<soLucien> i feel that I am really close
<Zarthus> it being 10 in the morning does not help, but I'm not sure what you mean
<Zarthus> what's wrong with your existing code?
memorasus has joined #ruby
<Zarthus> aside from possibly editing the same hash in a loop
<soLucien> idk it does not lint
<soLucien> unexpected tIDENTIFIER
platzhir1 has joined #ruby
yfeldblum has joined #ruby
<Zarthus> You'll need to provide full code and full error message then
<Zarthus> although I still think you probably want to use better variable names and/or not edit 'a' mid loop
<soLucien> tuplet
<hanmac> soLucien: your problem is that you miss the ";" inside the block ...
<hanmac> and imo you use map wrong
<Zarthus> hanmac: if that wasn't merged together for display on IRC I fear there's more problems with that code than just a missing ; :P
<hanmac> that what i would probably do: hv_options.map{|a| { 'mac_address' => a['MacAddress'].scan(/([A-F0-9]{2})/).join(':'), 'name' => a['SwitchName'] }
<soLucien> i'll gist it
Hyuk has joined #ruby
dminuoso has quit [Ping timeout: 252 seconds]
dminuoso has joined #ruby
nofxx has quit [Ping timeout: 250 seconds]
nofxx has joined #ruby
<soLucien> hanmac Zarthus the map thing i was trying to do was in order to reuse the same variable
<soLucien> i was thinking of map! as well in this situation
<Zarthus> you don't have indentation in your code?
<soLucien> but i have only been doing Ruby for about a week, so help me out here
<Zarthus> options has to be a hash
<soLucien> i do .. i ctrl-deleted it in this gist
<Zarthus> other than that it looks OK to me
<jhass> why?!
<soLucien> because it was 10 lines indented
<soLucien> why what ?
Sammichmaker has joined #ruby
<jhass> well that's not good by itself
<jhass> but why remove the relative indentation too
<jhass> so, how does a map "reuse the same variable" but each doesn't?
<soLucien> ah indentation .. well it's in the middle of the code
<soLucien> jhass help me do it better
A_Drone has joined #ruby
<jhass> you should review the difference between array and hash
<soLucien> really .. in powershell it's $var | $_.mac_address=$_.MacAddress
<soLucien> i know the difference mate
<soLucien> it's not a hash
<jhass> nope, you don't
<jhass> "['SwitchName'='your-interface-name','MacAddress'='1234567890ab']" is just nothing, not an array, not hash
A_Drone has quit [Remote host closed the connection]
<soLucien> i wrote it off the top of my head
<soLucien> to serve as an example
<jhass> doesn't make it any more right
<jhass> having these concepts crystal clear at any point is quite important
<jhass> they're at the core of doing data processing with ruby
Xeago_ has joined #ruby
ferr has joined #ruby
vondruch has joined #ruby
A_Drone has joined #ruby
<soLucien> updated for you jhass
Xeago has quit [Ping timeout: 258 seconds]
Xeago_ is now known as Xeago
matp has quit [Remote host closed the connection]
<jhass> you want an (I have to guess!) array of hashes in return, knowing the ruby presentation of that is important
tomphp has joined #ruby
memorasus has quit [Ping timeout: 250 seconds]
<soLucien> updated yet again.
<soLucien> now .. what's the best way of doign thsi ?
<soLucien> this
dionysus69 has quit [Quit: dionysus69]
<jhass> you "I want this" still isn't valid Ruby (well it is, but it doesn't make much sense and isn't what you want)
<soLucien> i want to 1 ) iterate through it , change both keys and values of the hash 2) end up with no extra objects
antgel has joined #ruby
<soLucien> so no options object would be prefferable
<soLucien> is that possible using anything from the stdlib ?
<jhass> Ruby is pass by reference, seems easy enough
<jhass> you would use Array#each
<jhass> perhaps Hash#delete
impermanence has joined #ruby
<soLucien> i know how to do it in 6 other programming languages, not yet in Ruby :)
<soLucien> ok, i'll change to use each and delete
<hanmac> soLucien: why not like i said before? hv_options.map{|a| { 'mac_address' => a['MacAddress'].scan(/([A-F0-9]{2})/).join(':'), 'name' => a['SwitchName'] }
A_Drone has quit [Remote host closed the connection]
<hanmac> it returns a new array with new hashs ... imo the most clean way for that
<zenspider> deleting over the data structure you're enumerating is a Bad Idea™ in nearly every language I've ever coded in
<soLucien> yes and it throws exceptions in c#/Java
<jhass> zenspider: they're iterating over an outer array, not the hash I suggested to delete from
lightheaded has quit []
impermanence has quit [Ping timeout: 258 seconds]
<zenspider> soLucien: as it should
der-landgraf has quit [Ping timeout: 252 seconds]
A_Drone has joined #ruby
djbkd has quit [Remote host closed the connection]
govg has joined #ruby
senayar has joined #ruby
ericsupreme has joined #ruby
djbkd has joined #ruby
OTORelic2 has joined #ruby
karapetyan has joined #ruby
djbkd has quit [Client Quit]
jaruga___ has joined #ruby
jaruga___ is now known as jaruga____
marr has joined #ruby
PickAndMix has quit [Quit: WeeChat 1.4]
govg has quit [Ping timeout: 258 seconds]
n90b0jjf has joined #ruby
<zenspider> map! seems obvious... but I also think OP needs to learn the difference between arrays and hashes (and there are no real tuples in ruby either). *shrug*
OTORelic2 has quit [Ping timeout: 258 seconds]
ur5us has joined #ruby
postmodern has quit [Quit: Leaving]
karapetyan has quit [Ping timeout: 276 seconds]
jackjackdripper has quit [Quit: Leaving.]
max1 has joined #ruby
<soLucien> i have fixed it and yes i have used map!
<soLucien> i know the difference between an array and hash. What i lack is experience in Ruby.
n90b0jjf has quit [Ping timeout: 240 seconds]
max1 is now known as PickAndMix
ericsupreme has quit [Quit: Leaving]
bookies has joined #ruby
hahuang65 has joined #ruby
dunpeal has joined #ruby
Torrone has joined #ruby
bluOxigen has joined #ruby
<bookies> How can I get the rate of CHF in this JSON? (https://bitpay.com/api/rates)? I tried something like JSON.parse(website.body)["GBP"]["rate"].to_f and some other ways but I can't understand how its format works
govg has joined #ruby
<zenspider> bookies: that looks like an array of hashes, not a hash of hashes, so your first access on it is broken
hahuang65 has quit [Ping timeout: 250 seconds]
dunpeal has quit [Ping timeout: 265 seconds]
<bookies> zenspider: how do I handle an array of hashes? Can I be calling like that (somehow) to get these rates?
<bookies> I tried the [1] and [5], etc and I just get characters
hahuang65 has joined #ruby
<zenspider> you'll have to look through the array for the hash that meets your needs
<zenspider> bookies: huh? "just got characters"?? how?
<bookies> zenspider so if I do website.body[5] I get => "d" for excample
A_Drone has quit [Remote host closed the connection]
<zenspider> well, yes, website.body is a string and you asked for the 6th char (0-based)
joonty has joined #ruby
<zenspider> clearly you can see the difference between that code and the code you have above
bookies has quit [Quit: Page closed]
<zenspider> but maybe you can't....
<zenspider> so I guess we won't work up to understanding nested structures
fergal has joined #ruby
sp_ has quit [Ping timeout: 276 seconds]
hahuang65 has quit [Ping timeout: 250 seconds]
toretore has joined #ruby
jobat has joined #ruby
n90b0jjf has joined #ruby
sp_ has joined #ruby
c355e3b has joined #ruby
Hyuk has quit [Quit: Textual IRC Client: www.textualapp.com]
<fergal> hi guys, currently i am able to test that a method throws an exception by checking for the exception message like: `expect(logger).to receive(:warn).with(/has invalid syntax/)` - the thing is, there are two different exception types that throw this message, how can i test that a specific exception type has been thrown?
<zenspider> fergal: you're testing that a logger gets some text... not that a method throws an exception... why not test that the method throws an exception?
<jhass> mh, I guess if it doesn't bubble up to your spec you can't
The_Phoenix1 has joined #ruby
The_Phoenix has quit [Ping timeout: 260 seconds]
ntt has quit [Ping timeout: 260 seconds]
Bounga has quit [Ping timeout: 265 seconds]
<fergal> zenspider: do you have any links to resources that show how to do that?
<jhass> I guess you could do something like expect(ArgumentError).to receive(:new) or even expect(foo).to receive(:raise).with(ArgumentError) ...
n90b0jjf has quit [Ping timeout: 240 seconds]
<jhass> but even if that works... meh
<zenspider> in minitest it is assert_raises(XType) do ... end
<jhass> fergal: assuming it _does_ bubble up to your spec ^
<zenspider> in minitest/spec it is lambda { ... }.must_raise XType
<jhass> expect_raises(ArgumentError) do end in rspec
<zenspider> there's probably somethnig similar
<fergal> jhass: well my method catches the exception, then logs a message and the program proceeds as normal
<zenspider> expect_raises? haha! that sure looks like an assertion
tomphp has quit [Read error: Connection reset by peer]
<jhass> fergal: guessed so, hence my earlier comments
<zenspider> fergal: sounds like you're either testing at the wrong level or your method does too much
tomphp has joined #ruby
<dminuoso> fergal: How about you just raise the specific error with allow(obj).to receive(:trigger).and_raise(ArgumentError, "foo")
astrobun_ has quit [Remote host closed the connection]
<dminuoso> If that's what you are trying to test for.
<dminuoso> Test behavior, not your inner workings.
yeticry has quit [Ping timeout: 244 seconds]
xall has joined #ruby
TomyWork has joined #ruby
<fergal> zenspider: well this method just parses a file, and if parsing is successful, returns true. if there are errors in the file, it raises some exceptions, which log certain messages
<fergal> thanks for the help guys, i’ll try out these suggestions :)
yeticry has joined #ruby
Ishido has joined #ruby
anisha_ has joined #ruby
<zenspider> fergal: one method tries to parse & return true, or raises. another method calls that method, rescues and logs. now testing is easy
anisha has quit [Ping timeout: 244 seconds]
<soLucien> i have a self.method. i want to create some helper methods in this class .
<soLucien> should they also be called as self.stuff ?
<soLucien> because it seems that i cannot access instance methods
<soLucien> in a "self" context
<zenspider> def parse src; do_real_parse(src); end; def can_parse? src; !! parse src; rescue => X; ... end
<jhass> well, think about it, which instance would they be called on?
<soLucien> none. So what can i do ?
<soLucien> declare them all as self ?
<jhass> yes
<soLucien> how about calling them ? also need to use self ?
<zenspider> soLucien: you're ALWAYS in a "self" context. it just matters what self is at the time. what you're describing is a class method, so self is the class.
<zenspider> in an instance method, self is the instance
<soLucien> alright, that means no , i don;t need to specify it
<dminuoso> soLucien: "def self.method" is the only weird thing, since it's very special syntax sugar.
<soLucien> because it's the same context
flyingX has joined #ruby
<soLucien> how about class variables ? Is this ok ?
<soLucien> then refer to it as @udev_config_file_path
<soLucien> evrywhere in the class
flyingX has quit [Remote host closed the connection]
DanyC has joined #ruby
<jhass> note that's what commonly referred to as class instance variables, class variables are the @@double_at_things
<jhass> (don't use them)
flyingX has joined #ruby
<zenspider> bah. use them if you need them.
<zenspider> but you don't need them
blackgoat has joined #ruby
flying has quit [Ping timeout: 250 seconds]
dionysus69 has joined #ruby
<jhass> yes of course, I expect people truly knowing when they need them to be able to overturn the advice in that specific situation
<jhass> if you say use them if you need them people think they need them while they don't more often ;)
<soLucien> i used it to declare module-specific paths at import-time
<zenspider> I prefer people to learn (sometimes by making mistakes). you prefer to give short answers.
<soLucien> and "gobals" such as this one
<zenspider> my way involves a lot more typing :)
<zenspider> I should sleep
<soLucien> zenspider i don't have time to make all the mistakes in the world :)
govg has quit [Ping timeout: 240 seconds]
<zenspider> soLucien: you're gonna have to actually learn the language.
n90b0jjf has joined #ruby
<soLucien> i'm gonna have to finish this vagrant plugin then get back to writing the c# code that i need the plugin for :)
dionysus69 has quit [Client Quit]
dionysus69 has joined #ruby
Bounga has joined #ruby
n90b0jjf has quit [Ping timeout: 240 seconds]
ICantCook has quit [Ping timeout: 244 seconds]
senayar has quit [Remote host closed the connection]
zeroDivisible has joined #ruby
tvw has joined #ruby
mikecmpbll has joined #ruby
workmad3 has joined #ruby
irc_BT has joined #ruby
<irc_BT> hi
<irc_BT> I need help with a ruby progam
<irc_BT> new to ruby
araujo_ has quit [Quit: Leaving]
<irc_BT> any anyone help?
alexandernst has left #ruby ["Bye bye!"]
araujo has joined #ruby
n90b0jjf has joined #ruby
araujo has quit [Max SendQ exceeded]
yfeldblum has quit [Ping timeout: 250 seconds]
araujo has joined #ruby
Coldblackice has quit [Ping timeout: 276 seconds]
<irc_BT> ?
araujo has quit [Max SendQ exceeded]
araujo has joined #ruby
karapetyan has joined #ruby
atom_ has joined #ruby
atom_ has left #ruby ["WeeChat 1.5"]
araujo has quit [Max SendQ exceeded]
n90b0jjf has quit [Ping timeout: 240 seconds]
araujo has joined #ruby
iMadper`` has joined #ruby
araujo has quit [Max SendQ exceeded]
araujo has joined #ruby
karapetyan has quit [Ping timeout: 258 seconds]
Izabia has quit [Ping timeout: 244 seconds]
impermanence has joined #ruby
araujo has quit [Max SendQ exceeded]
<jhass> ?anyone irc_BT
<ruby[bot]> irc_BT: Just ask your question, if anyone has, is or can, they will respond.
ishe has joined #ruby
iMadper` has quit [Ping timeout: 240 seconds]
A_Drone has joined #ruby
Izabia has joined #ruby
iMadper`` has quit [Remote host closed the connection]
impermanence has quit [Ping timeout: 240 seconds]
ishe has quit [Client Quit]
minimalism has quit [Quit: minimalism]
hk238 has quit [Quit: http://www.kvirc.net/ 4.9.1 Aria]
DanyC has quit []
joonty has quit [Quit: This computer has gone to sleep]
hahuang65 has joined #ruby
n90b0jjf has joined #ruby
craigp_ has quit [Ping timeout: 276 seconds]
LoneHermit has joined #ruby
n90b0jjf has quit [Ping timeout: 240 seconds]
hahuang65 has quit [Ping timeout: 250 seconds]
<jhass> irc_BT: so?
dionysus69 has quit [Ping timeout: 276 seconds]
LoneHermit has quit [Ping timeout: 252 seconds]
fergal_ has joined #ruby
tvw has quit [Read error: Connection reset by peer]
tvw has joined #ruby
beilabs_ has joined #ruby
fergal has quit [Ping timeout: 252 seconds]
fergal_ is now known as fergal
n90b0jjf has joined #ruby
AzureStigma has joined #ruby
beilabs has quit [Ping timeout: 244 seconds]
AzureStigma has quit [Client Quit]
leea has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
n90b0jjf has quit [Ping timeout: 240 seconds]
freerobby has joined #ruby
freerobby1 has joined #ruby
freerobby has quit [Read error: Connection reset by peer]
ChoiKyuSang has quit [Quit: See ya!]
rodfersou has joined #ruby
govg has joined #ruby
nadir has quit [Quit: Connection closed for inactivity]
craigp_ has joined #ruby
xall has quit [Ping timeout: 258 seconds]
n90b0jjf has joined #ruby
matp has joined #ruby
kavanagh has joined #ruby
dcunit3d has quit [Ping timeout: 252 seconds]
A_Drone has quit [Ping timeout: 250 seconds]
Bounga has quit [Ping timeout: 244 seconds]
joonty has joined #ruby
n90b0jjf has quit [Ping timeout: 240 seconds]
dsea has quit [Ping timeout: 244 seconds]
Madplatypus has quit [Quit: Connection closed for inactivity]
rodfersou has quit [Ping timeout: 264 seconds]
A_Drone has joined #ruby
A_Drone has quit [Remote host closed the connection]
rodfersou has joined #ruby
devec0 has quit [Ping timeout: 250 seconds]
joonty has quit [Quit: This computer has gone to sleep]
OTORelic2 has joined #ruby
n90b0jjf has joined #ruby
rileyy has joined #ruby
beilabs_ has quit [Remote host closed the connection]
mrmortondk has joined #ruby
andikr has joined #ruby
OTORelic2 has quit [Ping timeout: 258 seconds]
rileyy has quit [Remote host closed the connection]
Nahra has quit [Read error: Connection reset by peer]
Parko has quit [Quit: In a while, crocodile]
Nahra has joined #ruby
Torrone has quit [Quit: This computer has gone to sleep]
n90b0jjf has quit [Ping timeout: 240 seconds]
dunpeal has joined #ruby
Torrone has joined #ruby
n90b0jjf has joined #ruby
vuoto has joined #ruby
Hyuk has joined #ruby
hahuang65 has joined #ruby
<fergal> hi guys, i am trying to test a method that calls YAML.load_file to parse this yaml file: https://gist.github.com/anonymous/a53685dfc092de2a7e87b0952b54f065 this yaml should cause the YAML.load_file to throw a SyntaxError. in my test, i am trying to hardcode the broken yaml file, then mock the call to the method that calls YAML.load_file so that the broken hash is returned, but i can’t seem to get it working - or rather, the broken yaml always causes a type err
<fergal> rather than a syntax error. are there any examples online of testing against malformed file contents?
<dminuoso> fergal: Show us some code.
GodFather has joined #ruby
<dminuoso> expect { Parser.parse(broken_hash) }.to raise_error(SyntaxError) seems fairly straight forward, so Id like to see what exactly you are doing in your tests.
n90b0jjf has quit [Ping timeout: 240 seconds]
LoneHerm_ has joined #ruby
GodFather has quit [Read error: Connection reset by peer]
jgt has quit [Quit: WeeChat 1.4]
hahuang65 has quit [Ping timeout: 250 seconds]
vuoto has quit [Remote host closed the connection]
jgt has joined #ruby
vuoto has joined #ruby
GodFather has joined #ruby
ta_ has quit [Read error: Connection reset by peer]
beilabs has joined #ruby
ta_ has joined #ruby
dunpeal has quit [Ping timeout: 258 seconds]
xall has joined #ruby
LoneHerm_ has quit [Ping timeout: 252 seconds]
beilabs_ has joined #ruby
<dminuoso> Is there a more idiomatic way of doing this? https://gist.github.com/anonymous/4aaafe28d507e3ea0fe6cd5279d51f6b
n90b0jjf has joined #ruby
beilabs has quit [Ping timeout: 260 seconds]
astrobunny has quit [Quit: Leaving...]
xall has quit [Ping timeout: 240 seconds]
Bounga has joined #ruby
<jhass> .sub!(..., "\\1") ?
<dminuoso> jhass: Bzz! I like that.
<dminuoso> It was too obvious, I should have seen this.
zarubin has joined #ruby
<lizard2010> may be, scan(…).flatten also?
n90b0jjf has quit [Ping timeout: 240 seconds]
<jhass> took me a minute too though :)
mradmacher has quit [Ping timeout: 240 seconds]
soLucien has quit [Quit: Leaving]
<jhass> =~ is my secret nemesis, I try to never use it again but it keeps cropping up anyway
<dminuoso> lizard2010: That will reject strings that don't match the pattern.
<dminuoso> jhass: Heh indeed.
<dminuoso> Though I'm not too fond of the magical "\\1"
geekbri has joined #ruby
hanmac has quit [Ping timeout: 258 seconds]
<dminuoso> But I guess I would have to obtain the MatchData and use that instead, if I wanted to avoid that.
<jhass> well, not any more magical than $1 to me
geekbri has quit [Remote host closed the connection]
<dminuoso> True.
<jhass> .sub!(..) { $1 }
<jhass> ugh
<dminuoso> To consider the sheer performance penalty of this..
<jhass> crystal just yields matchdata's, .sub(..., &.[1])
hanmac has joined #ruby
<dminuoso> That's actually sweet.
<dminuoso> Stop seducing me.
n90b0jjf has joined #ruby
<jhass> no :P
<dminuoso> Do you folks have pointers? I want raw access to memory.
<jhass> yes
astrobunny has joined #ruby
<lizard2010> i commented (=
<jhass> and slices (bounds checked pointers)
<lizard2010> whats wrong with this?
joonty has joined #ruby
<jhass> it allocates a new string and two arrays
<jhass> more than .sub!
<lizard2010> hm, gisthub strip tags
beilabs has joined #ruby
<jhass> use code fences
<jhass> ``` code ```
<lizard2010> thanks
<lizard2010> that is better
<dminuoso> jhass: I don't want bounds checked pointers. I want to be allowed to do stupid stuff. :)
<lizard2010> and, you right
<jhass> dminuoso: you are!
<dminuoso> Sounds like a language suited for me.
beilabs has quit [Remote host closed the connection]
<dminuoso> Sweet, homebrew has it. :)
govg has quit [Ping timeout: 252 seconds]
<irc_BT> anyone from ch**** mai here?
<jhass> from what?
beilabs_ has quit [Ping timeout: 260 seconds]
<dminuoso> jhass: Now where is my 'irc'?
<dminuoso> :|
<dminuoso> Oh wait, icr!
<dminuoso> Nope.
<jhass> compiled language, REPLs are hard
<jhass> give crystal play a shot
<dminuoso> I know, was just teasing you.
<dminuoso> interesting.
memorasus has joined #ruby
<jhass> also http://devdocs.io/crystal/ and #crystal-lang ;)
dr0lan has joined #ruby
ICantCook has joined #ruby
beilabs has joined #ruby
chriscoffee has quit [Ping timeout: 265 seconds]
playfullyExist has joined #ruby
s2013 has joined #ruby
blaxter has quit [Remote host closed the connection]
blaxter has joined #ruby
nadir has joined #ruby
binaryplease1 has joined #ruby
<TheBrayn> can crystal do math? searching for “crystal math” on google didn't yield anything related
<TheBrayn> /s
ldnunes has joined #ruby
<jhass> TheBrayn: there are some libraries, /join #crystal-lang and I might look them up for you ;)
Torrone has quit [Quit: This computer has gone to sleep]
fergal has quit [Quit: fergal]
vuoto has quit [Remote host closed the connection]
binaryplease has quit [Ping timeout: 258 seconds]
dionysus69 has joined #ruby
the_rhizo has joined #ruby
A_Drone has joined #ruby
joonty has quit [Quit: This computer has gone to sleep]
A_Drone has quit [Ping timeout: 260 seconds]
binaryplease1 is now known as binaryplease
mradmacher has joined #ruby
dminuoso has quit [Ping timeout: 265 seconds]
playfullyExist has quit [Quit: irc]
memorasus has quit [Ping timeout: 250 seconds]
karapetyan has joined #ruby
minotep has joined #ruby
Aria22 has quit [Remote host closed the connection]
OTORelic2 has joined #ruby
vuoto has joined #ruby
dminuoso has joined #ruby
karapetyan has quit [Ping timeout: 240 seconds]
zarubin has quit [Remote host closed the connection]
tvw has quit [Ping timeout: 240 seconds]
OTORelic2 has quit [Ping timeout: 258 seconds]
impermanence has joined #ruby
Sembei has quit [Ping timeout: 244 seconds]
mim1k has quit [Ping timeout: 244 seconds]
Sembei has joined #ruby
blaxter has quit [Quit: foo]
Torrone has joined #ruby
nadir has quit [Ping timeout: 258 seconds]
Aria22 has joined #ruby
ur5us has quit [Remote host closed the connection]
impermanence has quit [Ping timeout: 250 seconds]
nadir has joined #ruby
xlegoman has joined #ruby
ur5us has joined #ruby
ur5us has quit [Remote host closed the connection]
bluOxigen has quit [Ping timeout: 260 seconds]
bluOxigen has joined #ruby
hahuang65 has joined #ruby
tvw has joined #ruby
xall has joined #ruby
mradmacher has quit [Ping timeout: 276 seconds]
LoneHerm_ has joined #ruby
hahuang65 has quit [Ping timeout: 250 seconds]
xall has quit [Ping timeout: 260 seconds]
blingrang has joined #ruby
karapetyan has joined #ruby
sdothum has joined #ruby
Sammichmaker has quit [Ping timeout: 250 seconds]
karapetyan has quit [Remote host closed the connection]
karapetyan has joined #ruby
gnufied has joined #ruby
dunpeal has joined #ruby
LoneHerm_ has quit [Ping timeout: 264 seconds]
vuoto has quit [Remote host closed the connection]
vondruch has quit [Quit: Ex-Chat]
vuoto has joined #ruby
vondruch has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
zarubin has joined #ruby
fergal has joined #ruby
kedare has joined #ruby
kedare has quit [Max SendQ exceeded]
kedare has joined #ruby
synthroid has joined #ruby
swills has quit [Quit: Leaving]
ken_barber has quit [Excess Flood]
ken_barber has joined #ruby
<fergal> dminuoso: sorry, was afk, my test looks like this: https://gist.github.com/anonymous/da731b1b4eff7efbb7ca6771f4b84ea1 notice the single quote after default, which should cause a syntax error
s2013 has joined #ruby
zarubin has quit [Ping timeout: 244 seconds]
Hyuk has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
alfiemax has quit [Ping timeout: 250 seconds]
Hyuk has joined #ruby
Hyuk has quit [Client Quit]
chriscoffee has joined #ruby
Hyuk has joined #ruby
vuoto has quit [Remote host closed the connection]
umdstu has joined #ruby
n90b0jjf has quit [Remote host closed the connection]
karapetyan has quit [Remote host closed the connection]
karapetyan has joined #ruby
<jhass> "throws a ... and continues" seems to contradict itself
reisei has joined #ruby
<reisei> hi, all!
<reisei> Is there a way to check indents in text file?
<tobiasvl> reisei: check how?
tvw has quit [Ping timeout: 244 seconds]
<reisei> tobiasvl: count indents of each line in txt file I guess.
<tobiasvl> OK, what's an indent then? is one indent == 4 spaces? if so you can easily just count them?
<tobiasvl> not aware of a gem that does it for you but should be easy enough to make yourself
PickAndMix has quit [Quit: WeeChat 1.4]
tyang has joined #ruby
mim1k has joined #ruby
kobain has joined #ruby
<reisei> tobiasvl: well, that's what I'm interesting in :) I'm just starting to learn ruby. I try to google how to count it, but somehow didn't find any usefull methods
<reisei> tobiasvl: can you point me articles or anything about it?
conta has quit [Remote host closed the connection]
<tobiasvl> well, where are you stuck? I could just link you to articles about IO in ruby but I'm not sure that's what you want
A_Drone has joined #ruby
<reisei> I don't understand how to get number of spaces in the beginning of line ( i think that's how I get the indents)
GodFather has quit [Quit: Ex-Chat]
<canton7> reisei, have you figured out how to get each line in a file?
GodFather has joined #ruby
last_staff has quit [Quit: last_staff]
<reisei> canton7: yes, I think so, with cycle and `line`
byteflame has joined #ruby
pawnbox has quit [Remote host closed the connection]
<canton7> reisei, ok, do you know how to get each character in a string?
pawnbox has joined #ruby
mim1k has quit [Ping timeout: 276 seconds]
A_Drone has quit [Ping timeout: 265 seconds]
synthroi_ has joined #ruby
<reisei> canton7: theoretically string is an aray, so I can check all its values.
synthroi_ has quit [Remote host closed the connection]
<canton7> well, not really, but there's a method to iterate over the characters in a string. Look on the doc page for String
<canton7> but anyway. So you know how to get each character in each line. Do you know how to test if a character is equal to a space?
OTORelic2 has joined #ruby
flashpoint9 has joined #ruby
synthroid has quit [Ping timeout: 264 seconds]
<reisei> canton7: yes, sure, but I don't need any character I just need the first characters.
dionysus69 has quit [Remote host closed the connection]
<jhass> look up the break keyword or Enumerable#take_while
<tobiasvl> (you can use regex too…)
<tobiasvl> the filthy word
<canton7> reisei, ok, but look through the characters one by one, starting at the beginning of the line, and keep going until you reach something that isn't an indentation character
<canton7> tobiasvl, he can't write this using simple loops. I doubt he can handle the regex :P
<tobiasvl> hehe
mradmacher has joined #ruby
<canton7> reisei, do it using pencil and paper, and see how you do it. You start at the first character on a line, and you count the number of spaces until you reach actual text
<canton7> now you need to tell the computer to do the same thing
synthroid has joined #ruby
OTORelic2 has quit [Ping timeout: 260 seconds]
<reisei> Thanks everyone!
synthroi_ has joined #ruby
eizua has joined #ruby
A_Drone has joined #ruby
mim1k has joined #ruby
joonty has joined #ruby
karapety_ has joined #ruby
<reisei> canton7: you know how to teach properly :)
<canton7> you get a lot of practice on IRC :P
conta has joined #ruby
<reisei> IRC is my last resort
<rubirc> hey guys, when I do an ffi call into a function and that function blocks for some reason (doesn't immediately return back to the program) and I try to stop the ruby program with ctrl+c, it will wait until the function returns
<rubirc> is there a solution for this?
theery has joined #ruby
giz|work has quit [Ping timeout: 250 seconds]
<jhass> mmh, any function call at all, tried something stupid simple like sleep(3)?
AzureStigma has joined #ruby
<jhass> just to check that the function you call doesn't mask signals (intentionally)
dionysus69 has joined #ruby
jmignault has joined #ruby
synthroid has quit [Ping timeout: 260 seconds]
karapetyan has quit [Ping timeout: 258 seconds]
xall has joined #ruby
A_Drone has quit [Ping timeout: 276 seconds]
theery has quit [Client Quit]
ramortegui has joined #ruby
blackgoat has quit [Quit: WeeChat 1.5]
theery has joined #ruby
xlegoman has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
karapety_ has quit [Remote host closed the connection]
mradmacher has quit [Quit: WeeChat 1.4]
GodFather has quit [Ping timeout: 240 seconds]
antgel has quit [Ping timeout: 260 seconds]
karapetyan has joined #ruby
hahuang65 has joined #ruby
karapetyan has quit [Read error: Connection reset by peer]
xall has quit [Ping timeout: 265 seconds]
dminuoso has quit [Ping timeout: 276 seconds]
karapetyan has joined #ruby
karapetyan has quit [Read error: Connection reset by peer]
antgel has joined #ruby
hahuang65 has quit [Ping timeout: 250 seconds]
beilabs has quit [Read error: Connection reset by peer]
xall has joined #ruby
govg has joined #ruby
karapetyan has joined #ruby
beilabs has joined #ruby
sp_ has quit [Quit: leaving]
ruby-lang710 has joined #ruby
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
karapetyan has quit [Remote host closed the connection]
xall has quit [Ping timeout: 276 seconds]
karapetyan has joined #ruby
ChiefAlexander has joined #ruby
dminuoso has joined #ruby
CloCkWeRX has quit [Quit: Leaving.]
karapetyan has quit [Read error: Connection reset by peer]
karapetyan has joined #ruby
GodFather has joined #ruby
irc_BT is now known as rubynewbie
harfangk has joined #ruby
jaiks has quit [Ping timeout: 250 seconds]
karapetyan has quit [Remote host closed the connection]
swills has joined #ruby
sepp2k has joined #ruby
swills has quit [Changing host]
swills has joined #ruby
raeoks has quit [Quit: Textual IRC Client: www.textualapp.com]
<ruby-lang710> Hello I want to make a local intercepting proxy (or something like it) witch will change the body of the response, but I have problems with HTTPS, what should I use?
karapetyan has joined #ruby
LastWhisper____ has joined #ruby
LastWhisper____ has quit [Read error: Connection reset by peer]
LastWhisper____ has joined #ruby
Pupeno has joined #ruby
Mongey_ has quit [Quit: ZNC - http://znc.in]
cibs has quit [Ping timeout: 240 seconds]
<dminuoso> ruby-lang710: Ignore TLS, let some other part handle it.
pawnbox has quit [Remote host closed the connection]
<dminuoso> ruby-lang710: Every http server in Ruby completely forgoes TLS, assuing you have some reverse proxy handling TLS termination (e.g. a local nginx)
pawnbox has joined #ruby
cibs has joined #ruby
submitnine has quit [Ping timeout: 276 seconds]
<dminuoso> ruby-lang710: For othe other, make sure you look at Rack (its perfect for your task)
aegis3121 has joined #ruby
karapetyan has quit [Remote host closed the connection]
<jhass> I think puma can handle it actually
<workmad3> jhass: was about to say taht :)
<jhass> and I vaguely remember thin too?
<workmad3> *that
dminuoso has quit [Remote host closed the connection]
jaiks has joined #ruby
karapetyan has joined #ruby
karapetyan has quit [Read error: Connection reset by peer]
ta_ has quit [Remote host closed the connection]
malconis has joined #ruby
alfiemax has joined #ruby
n90b0jjf has joined #ruby
DanyC has joined #ruby
karapetyan has joined #ruby
soLucien has joined #ruby
hutch34 has joined #ruby
jmignault has quit [Ping timeout: 250 seconds]
karapetyan has quit [Read error: Connection reset by peer]
<ruby-lang710> dminuoso: So my app should connect to reverse proxy add that proxy have to deal with encryption/decryption between itself and the final destination?
<soLucien> is "monkey patching" possible in Ruby ?
impermanence has joined #ruby
eizua has quit [Quit: Leaving]
n90b0jjf has quit [Read error: Connection reset by peer]
<jhass> yes
<soLucien> the method, class name, all of that
<soLucien> should stay the same
<jhass> sure
<jhass> the question rather is if you can do it early enough in the context of vagrant
<soLucien> i want to overwrite the method implementation with something else that runs a different line as sudo
flashpoint9 has quit [Remote host closed the connection]
ChiefAlexander has quit [Remote host closed the connection]
<soLucien> hmm i want to overwrite it in the context of my plugin only , if that makes sense
<jhass> def VagrantPlugins::GuestLinux::Cap::NetworkInterfaces.network_interfaces(machine, path = "/sbin/ip"); ...; end
flashpoint9 has joined #ruby
<jhass> no, scoped monkey patching isn't possible
<soLucien> ok, so if i simply do that , does it "stick" forever ?
<jhass> yes
karapetyan has joined #ruby
<soLucien> i see. How about i take the old implementation, save to temp , overwrite , then put it back once i'm done
<jhass> you can do scoped monkey patching on a file level, but the patch will only be active for calls which literally are in that file then
<soLucien> i guess it is possible
karapetyan has quit [Read error: Connection reset by peer]
<soLucien> that's how Pry does it
<jhass> at which point you could just call a custom implementation instead
<soLucien> yeah i'll just roll my own, call it something else
<jhass> yes, that works too
karapetyan has joined #ruby
DanyC has left #ruby [#ruby]
pandaant has quit [Remote host closed the connection]
submitnine has joined #ruby
karapetyan has quit [Read error: Connection reset by peer]
impermanence has quit [Ping timeout: 240 seconds]
malconis has quit [Remote host closed the connection]
malconis has joined #ruby
Hyuk has quit [Quit: Textual IRC Client: www.textualapp.com]
beilabs has quit [Ping timeout: 264 seconds]
macsteps has joined #ruby
karapetyan has joined #ruby
karapetyan has quit [Read error: Connection reset by peer]
cevett has joined #ruby
beilabs has joined #ruby
ChiefAlexander has joined #ruby
karapetyan has joined #ruby
karapetyan has quit [Read error: Connection reset by peer]
xlegoman has joined #ruby
n90b0jjf has joined #ruby
OTORelic2 has joined #ruby
max1 has joined #ruby
Derperperd has quit [Quit: Derperperd]
JakFrist has joined #ruby
xall has joined #ruby
hk238 has joined #ruby
macsteps has quit [Remote host closed the connection]
A_Drone has joined #ruby
cdg has joined #ruby
OTORelic2 has quit [Ping timeout: 258 seconds]
Fly77 has joined #ruby
teclator has quit [Ping timeout: 258 seconds]
Bounga has quit [Ping timeout: 264 seconds]
karapetyan has joined #ruby
playfullyExist has joined #ruby
karapetyan has quit [Read error: Connection reset by peer]
xall has quit [Ping timeout: 244 seconds]
eljimmy has joined #ruby
Bounga has joined #ruby
Drakevr has joined #ruby
GodFather has quit [Ping timeout: 276 seconds]
Drakevr has quit [Changing host]
Drakevr has joined #ruby
grenierm has joined #ruby
A_Drone has quit [Ping timeout: 240 seconds]
The_Phoenix1 has quit [Read error: Connection reset by peer]
macsteps has joined #ruby
freerobby1 has quit [Quit: Leaving.]
hahuang65 has joined #ruby
jrafanie has joined #ruby
beilabs has quit [Remote host closed the connection]
n90b0jjf has quit [Ping timeout: 276 seconds]
GodFather has joined #ruby
macsteps has quit [Remote host closed the connection]
blaxter has joined #ruby
dumdedum has joined #ruby
l4v2 has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
giz|work has joined #ruby
hahuang65 has quit [Ping timeout: 250 seconds]
eljimmy has quit [Quit: This computer has gone to sleep]
playfullyExist has quit [Quit: irc]
blaxter has quit [Client Quit]
AlexJakeGreen has quit [Remote host closed the connection]
eljimador has quit [Read error: Connection reset by peer]
craigp_ has quit [Ping timeout: 240 seconds]
jgt1 has joined #ruby
Derperperd has joined #ruby
teclator has joined #ruby
aufi has quit [Ping timeout: 250 seconds]
shinnya has joined #ruby
jgt has quit [Ping timeout: 265 seconds]
Bounga has quit [Ping timeout: 244 seconds]
n90b0jjf has joined #ruby
grenierm has quit [Quit: grenierm]
grenierm has joined #ruby
grenierm has quit [Client Quit]
max1 has quit [Quit: WeeChat 1.4]
grenierm has joined #ruby
zarubin has joined #ruby
moei has quit [Quit: Leaving...]
colegatron_origi has quit [Ping timeout: 240 seconds]
moei has joined #ruby
playfullyExist has joined #ruby
giz|work has quit [Ping timeout: 264 seconds]
zarubin has quit [Ping timeout: 264 seconds]
grenierm has quit [Ping timeout: 264 seconds]
ChiefAlexander has quit [Remote host closed the connection]
beilabs has joined #ruby
giz|work has joined #ruby
axl_ has joined #ruby
Lord_of_Life has quit [Excess Flood]
Snowy has joined #ruby
Chris3y_RubyNewb has quit [Ping timeout: 258 seconds]
Lord_of_Life has joined #ruby
<soLucien> is there a better way than doing arr.map! {|a|{a.split(' ')[0]=>a.split(' ')[1]}}
<soLucien> so i dont have to perform split twice ?
<jhass> sure, it's called local variable
ChiefAlexander has joined #ruby
<soLucien> yes, is it possible inside the map scope ?
<rubynewbie> anybody from chiang mai?
jmignault has joined #ruby
flying has joined #ruby
<Zarthus> soLucien: try it and see
<soLucien> i know that a local var is the solution in this case, my question is more about how it fits in this case
threh has joined #ruby
<soLucien> arr.map! {|a| tmp = a.split(' '); {tmp[0]=>tmp[1]}}
flyingX has quit [Ping timeout: 244 seconds]
chipotle has joined #ruby
jmignault has quit [Ping timeout: 250 seconds]
<Papierkorb> soLucien: do you want an array of hashes?
<soLucien> array of hashes is fine, yes .. it scales better
submitnine has quit []
<Papierkorb> array of hashes. scaling. aha.
threh has quit [Quit: 'Til next time]
<soLucien> to my purpose .
ule has quit [Remote host closed the connection]
ule has joined #ruby
chipotle has quit [Ping timeout: 240 seconds]
ule has quit [Changing host]
ule has joined #ruby
<soLucien> Papierkorb info.map! {|a| tmp = a.split(' '); {'name' =>tmp[0], 'mac_address'=>tmp[1], 'state' => tmp[2] .....}}
<soLucien> it scales better.
dminuoso has joined #ruby
giz|work has quit [Ping timeout: 258 seconds]
memorasus has joined #ruby
joonty has quit [Quit: This computer has gone to sleep]
xlegoman has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
OTORelic2 has joined #ruby
beilabs has quit [Remote host closed the connection]
beilabs has joined #ruby
jmignault has joined #ruby
theery has quit []
eljimmy has joined #ruby
fmcgeough has joined #ruby
dionysus69 has quit [Remote host closed the connection]
segy has quit [Ping timeout: 258 seconds]
jmignault has quit [Ping timeout: 250 seconds]
c0mrad3 has joined #ruby
segy has joined #ruby
aganov has quit [Quit: Leaving]
memorasus has quit [Ping timeout: 250 seconds]
smathy has joined #ruby
<gregf_> soLucien: you can also use zip?
Fly77 has quit [Remote host closed the connection]
<gregf_> ['name','mac_address','state' ].zip(a.split(' ')).to_h
smathy has quit [Client Quit]
ctp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kedare has quit [Quit: Leaving]
playfullyExist has quit [Quit: irc]
<soLucien> gregf the input is like ["name1 macaddress1 state1","name2 macaddress2 state2"]
minotep has quit [Ping timeout: 244 seconds]
<soLucien> it comes from grep | awk
etetz has joined #ruby
hiptobecubic_ has joined #ruby
cdg has quit [Read error: Connection reset by peer]
hahuang65 has joined #ruby
cdg has joined #ruby
<nebg> hello everyone... can somebody suggest me a good guide to get started in ruby ?
<nebg> i want to use it for pentest
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Zarthus> the basic one on the website is a very basic one
flying has quit [Remote host closed the connection]
<Zarthus> i'd also recommend bookmarking devdocs.io/ruby for documentation
flying has joined #ruby
<soLucien> is there any array merge function ?
<soLucien> kind of like sql join ?
<soLucien> join 2 arrays of hashes on a common field
Bish has joined #ruby
<Bish> how can you make that not logged in thing DRY?
<Bish> throw catch?
hahuang65 has quit [Ping timeout: 250 seconds]
<Bish> inb4 UEEGHH tabs
synthroi_ has quit [Remote host closed the connection]
<dminuoso> nebg: ?books
<dminuoso> mmmm
<dminuoso> ?books
<ruby[bot]> You can find a list of recommended books at http://ruby-community.com/pages/links
beilabs has quit []
ChiefAlexander has quit [Remote host closed the connection]
kbni has quit [Ping timeout: 276 seconds]
ta_ has joined #ruby
kbni has joined #ruby
giz|work has joined #ruby
slackbotgz has joined #ruby
joonty has joined #ruby
nebg has quit [K-Lined]
dionysus69 has joined #ruby
zarubin has joined #ruby
nebg has joined #ruby
bad_ip has joined #ruby
Es0teric has joined #ruby
mrmortondk has quit [Quit: Textual IRC Client: www.textualapp.com]
gizmore has joined #ruby
nebg has quit [K-Lined]
dionysus69 has quit [Ping timeout: 264 seconds]
hiptobecubic_ has quit [Ping timeout: 252 seconds]
zarubin has quit [Ping timeout: 276 seconds]
anisha_ has quit [Quit: This computer has gone to sleep]
flashpoint9 has quit [Remote host closed the connection]
flashpoint9 has joined #ruby
mim1k has quit [Ping timeout: 250 seconds]
mim1k_ has joined #ruby
cdg has quit [Remote host closed the connection]
dionysus69 has joined #ruby
cdg has joined #ruby
rubynewbie has quit [Quit: Me fail English? That's unpossible.]
Lord_of_Life has quit [Excess Flood]
synthroid has joined #ruby
nando293921 has joined #ruby
giz|work has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
tristanp has quit []
tristanp has joined #ruby
polishdub has joined #ruby
axl__ has joined #ruby
[Butch] has joined #ruby
flashpoint9 has quit [Ping timeout: 265 seconds]
axl_ has quit [Ping timeout: 265 seconds]
axl__ is now known as axl_
Lord_of_Life has joined #ruby
cdg has quit [Ping timeout: 276 seconds]
bad_ip has quit [Ping timeout: 244 seconds]
Bounga has joined #ruby
man0fS0rr0w has joined #ruby
JakFrist has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bad_ip has joined #ruby
xall has joined #ruby
DanyC has joined #ruby
LastWhisper____ has joined #ruby
LastWhisper____ has quit [Read error: Connection reset by peer]
dcunit3d has joined #ruby
LastWhisper____ has joined #ruby
ddffg has joined #ruby
zacts has joined #ruby
dionysus69 has quit [Remote host closed the connection]
Derperperd has quit [Quit: Derperperd]
jishankai has quit [Ping timeout: 260 seconds]
dionysus69 has joined #ruby
xall has quit [Ping timeout: 244 seconds]
DanyC has quit [Ping timeout: 260 seconds]
mark_66 has quit [Quit: Leaving.]
mim1k_ has quit [Quit: Reconnecting]
mim1k has joined #ruby
ta_ has quit [Remote host closed the connection]
Bounga has quit [Remote host closed the connection]
Bounga` has joined #ruby
agent_white has joined #ruby
andikr has quit [Remote host closed the connection]
slappy16 has quit [Remote host closed the connection]
slackbotgz has quit [Remote host closed the connection]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
The_Phoenix has joined #ruby
the_drow has quit [Quit: This computer has gone to sleep]
The_Phoenix has quit [Max SendQ exceeded]
The_Phoenix has joined #ruby
man0fS0rr0w has left #ruby [#ruby]
The_Phoenix has quit [Max SendQ exceeded]
A_Drone has joined #ruby
amclain has joined #ruby
The_Phoenix has joined #ruby
marxarelli has joined #ruby
edwinvdgraaf has quit [Ping timeout: 250 seconds]
Vingador has joined #ruby
AndyStabler has joined #ruby
flyingX has joined #ruby
aufi has joined #ruby
flyingX has quit [Remote host closed the connection]
AndyStabler has left #ruby [#ruby]
A_Drone has quit [Ping timeout: 240 seconds]
flying has quit [Read error: Connection reset by peer]
ferr has quit [Quit: WeeChat 1.5]
flying has joined #ruby
mello has quit [Quit: Lost terminal]
ctp has joined #ruby
platzhir1 has quit [Quit: WeeChat 1.4]
iLogic has joined #ruby
anisha_ has joined #ruby
joonty has quit [Quit: This computer has gone to sleep]
hahuang65 has joined #ruby
aegis3121 has quit [Ping timeout: 252 seconds]
xpt has joined #ruby
chriscoffee has quit [Ping timeout: 276 seconds]
zacts has quit [Quit: WeeChat 1.4]
bluOxigen has quit [Ping timeout: 240 seconds]
kavanagh has quit [Ping timeout: 276 seconds]
bluOxigen has joined #ruby
vuoto has joined #ruby
hahuang65 has quit [Ping timeout: 250 seconds]
flashpoint9 has joined #ruby
n90b0jjf has quit []
tomphp has quit [Ping timeout: 264 seconds]
bluOxigen has quit [Ping timeout: 244 seconds]
jackjackdripper has joined #ruby
bluOxigen has joined #ruby
antgel has quit [Ping timeout: 250 seconds]
vuoto has quit [Client Quit]
AzureStigma is now known as AzureStigma|Away
AzureStigma|Away has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
vuoto has joined #ruby
xaxisx has joined #ruby
SilverKey has joined #ruby
Snowy has quit [Quit: ragequit]
SCHAAP137 has joined #ruby
gnufied has quit [Quit: Leaving]
shinnya has quit [Ping timeout: 250 seconds]
Bounga` has quit [Ping timeout: 276 seconds]
TomyLobo has joined #ruby
zarubin has joined #ruby
dcunit3d has quit [Ping timeout: 258 seconds]
mrgrieves has quit [Ping timeout: 264 seconds]
memorasus has joined #ruby
AzureStigma has joined #ruby
mim1k has quit [Ping timeout: 250 seconds]
ChiefAlexander has joined #ruby
vuoto has quit [Remote host closed the connection]
vuoto has joined #ruby
colegatron_origi has joined #ruby
kavanagh has joined #ruby
chriscoffee has joined #ruby
soLucien has quit [Read error: Connection reset by peer]
mtkd has quit [Ping timeout: 240 seconds]
zarubin has quit [Ping timeout: 258 seconds]
daffy_duck_2 has joined #ruby
chriscoffee has quit [Client Quit]
nando293921 has quit [Ping timeout: 276 seconds]
daffy_duck has quit [Ping timeout: 258 seconds]
mtkd has joined #ruby
mikecmpbll has quit [Ping timeout: 276 seconds]
GodFather has quit [Ping timeout: 276 seconds]
Lord_of_Life has quit [Excess Flood]
c_nick has joined #ruby
Lord_of_Life has joined #ruby
kavanagh has quit [Ping timeout: 244 seconds]
Lord_of_Life has quit [Max SendQ exceeded]
jaruga___ has joined #ruby
Lord_of_Life has joined #ruby
xall has joined #ruby
bad_ip has quit [Ping timeout: 244 seconds]
freerobby has joined #ruby
jaruga____ has quit [Ping timeout: 265 seconds]
<c_nick> how to extract 10.9 from Proj10.9.html .. note it can become majar minor patch , majar minor revision patch
kavanagh has joined #ruby
jackjackdripper has quit [Quit: Leaving.]
ponga has quit [Quit: Connection closed for inactivity]
jackjackdripper has joined #ruby
DanyC has joined #ruby
xall has quit [Ping timeout: 265 seconds]
rodfersou is now known as rodfersou|lunch
DanyC has left #ruby [#ruby]
zacts has joined #ruby
<xpt> c_nick: 'Proj10.9.html'.scan(/[0-9][0-9.]+[0-9]/)
freerobby has quit [Ping timeout: 258 seconds]
JeanCarloMachado has joined #ruby
Guest48 has joined #ruby
smathy has joined #ruby
<Papierkorb> << 'Proj10.9.html'[/[0-9]+(?:\.[0-9]+)+/]
dhollinger has joined #ruby
<Papierkorb> >> 'Proj10.9.html'[/[0-9]+(?:\.[0-9]+)+/]
<ruby[bot]> Papierkorb: # => "10.9" (https://eval.in/619583)
<Papierkorb> c_nick: ^
flashpoint9 has quit [Remote host closed the connection]
Pupeno has quit [Remote host closed the connection]
MaraJade has joined #ruby
flashpoint9 has joined #ruby
mrgrieves has joined #ruby
<xpt> Good to know you can use regexp inside of []
theery has joined #ruby
whathappens has quit [Quit: Leaving...]
flashpoint9 has quit [Ping timeout: 276 seconds]
<chris2> also str[rx, n] for n-th group
<Papierkorb> chris2: Heh that I didn't know. A whole new world of regexp abuse!
<havenwood> >> filename = 'Proj10.9.html'; File.basename(filename, '.*').sub(/\A\D+/, '')
<ruby[bot]> havenwood: # => "10.9" (https://eval.in/619584)
<chris2> :)
<MaraJade> Question: Are http connections disabled by default in ruby? Is there some setting I need to put in to turn them on? Or is this a project specific thing?
<jhass> no, yes
<gregf_> >> "Proj10.9.html"[/\d+(?:\.\d+)/]
<ruby[bot]> gregf_: # => "10.9" (https://eval.in/619585)
<gregf_> oops, sorry for interupting :|
<dminuoso> MaraJade: Your question seems application specific. What application/framework are you using?
<MaraJade> dminuoso: Dashing + sinatra
aufi has quit [Ping timeout: 250 seconds]
<MaraJade> This is the error I'm getting: https://pastebin.osuosl.org/41576/
<dminuoso> MaraJade: Ruby has no notion of "Enable/disable http connections". Can you be specific about what error/behavior you are getting?
<dminuoso> Thank you.
SilverKey has quit [Quit: Halted.]
<dminuoso> MaraJade: Sounds like you are trying to fire up your application in a development or testing environment.
<dminuoso> MaraJade: Refer to your applications documentation on how to ensure the "environment is set to production" (or something along these lines)
dcunit3d has joined #ruby
kus has joined #ruby
kus has quit [Max SendQ exceeded]
ChiefAlexander has quit [Remote host closed the connection]
A_Drone has joined #ruby
ChiefAlexander has joined #ruby
ChanServ changed the topic of #ruby to: Rules & more: https://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 @ https://irclog.whitequark.org/ruby/
cibs has quit [Ping timeout: 240 seconds]
aegis3121 has joined #ruby
ta_ has joined #ruby
JeanCarloMachado has quit [Ping timeout: 244 seconds]
<dminuoso> No more MITM attacks on whitequark :(
jaruga___ has quit [Quit: jaruga___]
SuperLag has quit [Ping timeout: 240 seconds]
* dminuoso needs to find a new source of income
SuperLag has joined #ruby
A_Drone has quit [Ping timeout: 240 seconds]
wald0 has joined #ruby
cibs has joined #ruby
JammyHammy has joined #ruby
<smathy> :)
JeanCarloMachado has joined #ruby
vuoto has quit [Remote host closed the connection]
reisei has quit [Ping timeout: 258 seconds]
howdoi has quit [Quit: Connection closed for inactivity]
VladGh_ has quit [Ping timeout: 240 seconds]
leea has joined #ruby
flying has quit []
mrgrieves has quit [Remote host closed the connection]
A_Drone has joined #ruby
ta_ has quit [Remote host closed the connection]
ta_ has joined #ruby
rcvalle has joined #ruby
AndrewIsHere has joined #ruby
VladGh has joined #ruby
rellis has quit [Quit: Leaving.]
rellis has joined #ruby
A_Drone has quit [Ping timeout: 240 seconds]
karapetyan has joined #ruby
AzureStigma is now known as AzureStigma|Away
AzureStigma|Away has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jaruga___ has joined #ruby
zarubin has joined #ruby
JeanCarloMachado has quit [Ping timeout: 260 seconds]
flashpoint9 has joined #ruby
davedev24 has joined #ruby
JeanCarloMachado has joined #ruby
zacts has quit [Ping timeout: 276 seconds]
symm- has joined #ruby
c_nick has quit [Quit: Leaving.]
zarubin has quit [Ping timeout: 260 seconds]
djbkd has joined #ruby
ixti has joined #ruby
whathappens has joined #ruby
Guest48 has quit [Quit: Textual IRC Client: www.textualapp.com]
SilverKey has joined #ruby
tvw has joined #ruby
SilverKey has quit [Client Quit]
Eyes has joined #ruby
Eyes has left #ruby ["Leaving"]
freerobby has joined #ruby
aryaching has joined #ruby
JeanCarloMachado has quit [Ping timeout: 276 seconds]
zacts has joined #ruby
JeanCarloMachado has joined #ruby
JammyHammy has quit [Read error: Connection reset by peer]
tyang has quit [Ping timeout: 252 seconds]
pokalyis has quit [Quit: Textual IRC Client: www.textualapp.com]
VladGh has quit [Remote host closed the connection]
VladGh has joined #ruby
VladGh has quit [Remote host closed the connection]
gnufied has joined #ruby
SilverKey has joined #ruby
freerobby has quit [Ping timeout: 250 seconds]
memorasus has quit [Ping timeout: 250 seconds]
VladGh has joined #ruby
VladGh has quit [Remote host closed the connection]
Cohedrin has joined #ruby
jottr has joined #ruby
ferr has joined #ruby
Heskie has joined #ruby
spider-mario has joined #ruby
ruby-lang710 has quit [Ping timeout: 250 seconds]
VladGh_ has joined #ruby
tyang has joined #ruby
c_nick has joined #ruby
spider-mario has quit [Read error: Connection reset by peer]
SilverKey has quit [Client Quit]
SilverKey has joined #ruby
spider-mario has joined #ruby
VladGh_ has quit [Remote host closed the connection]
leea has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
theery has quit [Ping timeout: 276 seconds]
<c_nick> thanks guys .. gregf_ i didnt understand the capture group here [/\d+(?:\.\d+)/
freerobby has joined #ruby
<c_nick> what does ?: stand for
cschneid_ has joined #ruby
<dminuoso> c_nick: It disables backreference generation (e.g. for $1 etc)
firstdayonthejob has joined #ruby
<dminuoso> c_nick: It's useful when you need to group a capture group together (to specify some repeatance pattern), but don't care about it later on.
nertzy has quit [Ping timeout: 258 seconds]
<dminuoso> >> "x1" => /(?:.)(.)/; puts $1
<ruby[bot]> dminuoso: # => /tmp/execpad-ce07a17bff5f/source-ce07a17bff5f:2: syntax error, unexpected =>, expecting keyword_end ...check link for more (https://eval.in/619602)
<dminuoso> >> "x1" =~ /(?:.)(.)/; puts $1
<ruby[bot]> dminuoso: # => 1 ...check link for more (https://eval.in/619604)
<dminuoso> >> "x1" =~ /(.)(.)/; puts $1
<ruby[bot]> dminuoso: # => x ...check link for more (https://eval.in/619606)
Izabia has quit [Ping timeout: 240 seconds]
theery has joined #ruby
ramfjord has joined #ruby
jaruga___ has quit [Quit: jaruga___]
fergal has quit [Quit: fergal]
<c_nick> why is it not picking up 1.. '.' selects all right
smathy has quit [Excess Flood]
Pupeno has joined #ruby
smathy has joined #ruby
craigp_ has joined #ruby
dionysus70 has joined #ruby
rodfersou|lunch is now known as rodfersou
dionysus69 has quit [Ping timeout: 244 seconds]
dionysus70 is now known as dionysus69
shinnya has joined #ruby
<apeiros> c_nick: for the reason dminuoso just explained to you - because (?:) does not capture. () does.
Torrone has quit [Quit: This computer has gone to sleep]
mikecmpbll has joined #ruby
sulky has quit [Ping timeout: 258 seconds]
nadir has quit [Quit: Connection closed for inactivity]
smathy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Miron has quit [Ping timeout: 260 seconds]
tomphp has joined #ruby
smathy has joined #ruby
<c_nick> apeiros: so ?: just tells it to merge all the captures
<c_nick> ?
Vingador has quit [Ping timeout: 244 seconds]
<apeiros> no. it tells it to not capture that group.
wrkrcoop has joined #ruby
wrkrcoop has left #ruby [#ruby]
ramfjord_ has joined #ruby
<aeruder> i think something you may be missing is that puts $1 prints out the first (), the entire match in both cases is still x1
dsea has joined #ruby
tomphp has quit [Client Quit]
PlasmaStar has quit [Ping timeout: 260 seconds]
elaptics is now known as elaptics`away
JeanCarloMachado has quit [Ping timeout: 264 seconds]
ramfjord has quit [Ping timeout: 265 seconds]
Pupeno has quit [Remote host closed the connection]
Pupeno has joined #ruby
Pupeno has quit [Changing host]
Pupeno has joined #ruby
<aeruder> >> "x1" =~ /(.)(.); puts "#{$&} -- #{$1}"
<aeruder> hm, guess i'm not cool enough
<apeiros> you're not registered/authenticated?
<apeiros> besides, your snippet contains a syntax error.
<aeruder> >> "x1" =~ /(.)(.)/; puts "#{$&} -- #{$1}"
<ruby[bot]> aeruder: # => x1 -- x ...check link for more (https://eval.in/619620)
<aeruder> >> "x1" =~ /(?:.)(.)/; puts "#{$&} -- #{$1}"
<ruby[bot]> aeruder: # => x1 -- 1 ...check link for more (https://eval.in/619621)
<aeruder> thanks apeiros
hahuang65 has joined #ruby
dcunit3d has quit [Ping timeout: 250 seconds]
PlasmaStar has joined #ruby
Pupeno_ has joined #ruby
Pupeno has quit [Read error: Connection reset by peer]
SilverKey has quit [Quit: Halted.]
MaraJade has left #ruby [#ruby]
last_staff has joined #ruby
tomphp has joined #ruby
<smathy> Also, FWIW, in the example c_nick asked about ( /\d+(?:\.\d+)/ ) the grouping serves no purpose at all.
<apeiros> hurray for pointless noise in regexen :D
devec0 has joined #ruby
<jhass> we should add pointless noses instead
<apeiros> POINTLESS NOSES UNTO THE NOSE GODS!
<jhass> (?:-)*+
hahuang65 has quit [Ping timeout: 250 seconds]
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
JakFrist has joined #ruby
SilverKey has joined #ruby
ftj has joined #ruby
dcunit3d has joined #ruby
A_Drone has joined #ruby
SilverKey has quit [Client Quit]
<apeiros> (?:[\u002d])*+
karapetyan has quit [Remote host closed the connection]
dumdedum has quit [Quit: foo]
malconis has joined #ruby
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
enodata has joined #ruby
wrkrcoop has joined #ruby
<wrkrcoop> so i have an API where i call a class that deletes a message from a queue if it was successful. Instead of creating a new instance of the class I made all the methods class methods and store some immutable state in class variables. does this sound ok … ?
A_Drone has quit [Ping timeout: 250 seconds]
j416 has quit [Ping timeout: 258 seconds]
tomphp has joined #ruby
Derperperd has joined #ruby
<apeiros> &ri Singleton wrkrcoop
Dimik has joined #ruby
<jhass> no need for class vars, class level instance vars work just fine there
zarubin has joined #ruby
<jhass> also what's wrong with ||= ?
<wrkrcoop> jhass: idk ive never use it
j416 has joined #ruby
aeruder has left #ruby ["WeeChat 1.5"]
<wrkrcoop> how would i use that?
<wrkrcoop> @@sqs ||= new_sqs_client
<wrkrcoop> ?
<jhass> yes
bocaneri has quit [Read error: Connection reset by peer]
<wrkrcoop> and if i use singleton i can just do sqs ||= new_sqs_client
<eam> ruby needs an or= operator
<wrkrcoop> ?
<c_nick> thanks all
<eam> you know, for readability
SilverKey has joined #ruby
deniskozlov has joined #ruby
xall has joined #ruby
zarubin has quit [Ping timeout: 244 seconds]
<wrkrcoop> apeiros: if i use singleton can i get rid of all the def self.
<wrkrcoop> or the self part
dr0lan has quit [Quit: WeeChat 1.0.1]
dr0lan has joined #ruby
<apeiros> yes
the_rhizo has quit [Ping timeout: 276 seconds]
<wrkrcoop> and then wherever i want to use it i just call SQS::Publisher.instance()
postmodern has joined #ruby
AzureStigma has joined #ruby
wrkrcoop has quit [Quit: wrkrcoop]
xall has quit [Ping timeout: 276 seconds]
marsjaninzmarsa has quit [Ping timeout: 276 seconds]
LastWhisper____ has quit [Quit: Textual IRC Client: www.textualapp.com]
jobat has quit [Ping timeout: 250 seconds]
<smathy> "POINTLESS NOSES UNTO THE NOSE GODS" sounds like a codepoint.
Vingador has joined #ruby
banisterfiend has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
marsjaninzmarsa has joined #ruby
nando293921 has joined #ruby
<jhass> eam: but I always name my locals or and who needs spaces around assignments anyway
<jhass> and I totally do assignments in method calls
conta has quit [Ping timeout: 276 seconds]
hk238 has quit [Quit: http://www.kvirc.net/ 4.9.1 Aria]
DanyC has joined #ruby
cdg has joined #ruby
minotep has joined #ruby
karapetyan has joined #ruby
c_nick has left #ruby [#ruby]
ramortegui has quit [Quit: Ex-Chat]
poguez_ has joined #ruby
spiette has joined #ruby
leea has joined #ruby
SilverKey has quit [Read error: Connection reset by peer]
SilverKey has joined #ruby
xaxisx has quit [Quit: xaxisx]
the_rhizo has joined #ruby
skakri` has joined #ruby
chrisarc1nd has joined #ruby
Ariadeno_ has joined #ruby
RazorX has joined #ruby
sirecote_ has joined #ruby
yosafbridge` has joined #ruby
gypsydav15 has joined #ruby
marens_ has joined #ruby
marens_ has quit [Changing host]
marens_ has joined #ruby
ljarvis_ has joined #ruby
drale2k_ has joined #ruby
heinrich5991_ has joined #ruby
reinh1 has joined #ruby
thejoecarroll_ has joined #ruby
erlendf has joined #ruby
priodev_ has joined #ruby
connor_g1odwolf has joined #ruby
connor_goodwolf has quit [*.net *.split]
woodruffw has quit [*.net *.split]
Ariadeno has quit [*.net *.split]
thejoecarroll has quit [*.net *.split]
Psi-Jack has quit [*.net *.split]
mgorbach has quit [*.net *.split]
deimos has quit [*.net *.split]
jcp has quit [*.net *.split]
tris has quit [*.net *.split]
crank1988 has quit [*.net *.split]
ljarvis has quit [*.net *.split]
Karunamon has quit [*.net *.split]
heinrich5991 has quit [*.net *.split]
dgncn has quit [*.net *.split]
Adam_FrVancouver has quit [*.net *.split]
priodev has quit [*.net *.split]
[reed] has quit [*.net *.split]
yosafbridge has quit [*.net *.split]
MissionCritical has quit [*.net *.split]
stevednd has quit [*.net *.split]
davic has quit [*.net *.split]
ELLIOTTCABLE has quit [*.net *.split]
erlend has quit [*.net *.split]
skakri has quit [*.net *.split]
FifthWall has quit [*.net *.split]
gypsydave5 has quit [*.net *.split]
marens has quit [*.net *.split]
drale2k has quit [*.net *.split]
luluapple has quit [*.net *.split]
ReinH has quit [*.net *.split]
trajing has quit [*.net *.split]
kenichi has quit [*.net *.split]
quarcu has quit [*.net *.split]
guardian has quit [*.net *.split]
RazorX- has quit [*.net *.split]
chrisarcand has quit [*.net *.split]
gse has quit [*.net *.split]
sirecote has quit [*.net *.split]
tris- has joined #ruby
yossarian has joined #ruby
yossarian has quit [Excess Flood]
priodev_ is now known as priodev
FifthWall_ has joined #ruby
Karunamon has joined #ruby
trajing has joined #ruby
FifthWall_ is now known as FifthWall
gse has joined #ruby
quarcu has joined #ruby
Steve_Jobs has joined #ruby
Psi-Jack_ has joined #ruby
kenichi has joined #ruby
mgorbach has joined #ruby
[reed] has joined #ruby
[reed] has joined #ruby
deimos has joined #ruby
woodruffw has joined #ruby
jcp has joined #ruby
stevednd has joined #ruby
davic has joined #ruby
heinrich5991_ is now known as heinrich5991
dgncn has joined #ruby
ELLIOTTCABLE has joined #ruby
crank1988_ has joined #ruby
elifoster has joined #ruby
Torrone has joined #ruby
nitric has joined #ruby
DanyC has quit [Ping timeout: 258 seconds]
tomphp_ has joined #ruby
<eam> pretty sure you can't use a keyword for a local, yeah?
<eam> not that my suggestion should be taken seriously ...
tomphp has quit [Ping timeout: 264 seconds]
replay has joined #ruby
karapetyan has quit [Remote host closed the connection]
techietrash has quit [Max SendQ exceeded]
techietrash has joined #ruby
nadir has joined #ruby
l4v2 has quit [Quit: l4v2]
Mission-Critical has joined #ruby
amclain has quit [Ping timeout: 244 seconds]
amclain has joined #ruby
tomphp_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sulky has joined #ruby
Miron_ has joined #ruby
grenierm has joined #ruby
chipotle has joined #ruby
jenrzzz has joined #ruby
Miron_ is now known as Miron
zacts has quit [Quit: WeeChat 1.4]
zeroDi has joined #ruby
AndrewIs_ has joined #ruby
AndrewIsHere has quit [Read error: Connection reset by peer]
leea has quit [Ping timeout: 250 seconds]
AndrewIsHere has joined #ruby
AndrewIs_ has quit [Read error: Connection reset by peer]
xall has joined #ruby
ramfjord_ has quit [Ping timeout: 264 seconds]
xall has quit [Read error: Connection reset by peer]
xall has joined #ruby
Pupeno_ has quit [Remote host closed the connection]
nando293921 has quit [Quit: Lost terminal]
AndrewIs_ has joined #ruby
AndrewIsHere has quit [Read error: Connection reset by peer]
dionysus69 has quit [Remote host closed the connection]
TPug has joined #ruby
AndrewIs_ has quit [Read error: Connection reset by peer]
AndrewIsHere has joined #ruby
dhollinger has quit [Quit: WeeChat 1.5]
ineb has quit [Remote host closed the connection]
smathy has quit [Quit: Textual IRC Client: www.textualapp.com]
Pupeno has joined #ruby
Pupeno has quit [Changing host]
Pupeno has joined #ruby
dagda1 has joined #ruby
the_rhizo has quit [Ping timeout: 264 seconds]
marxarelli is now known as marxarelli|afk
memorasus has joined #ruby
grenierm has quit [Quit: grenierm]
djbkd has quit [Remote host closed the connection]
djbkd has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
ineb has joined #ruby
brianpWins has quit [Ping timeout: 244 seconds]
jenrzzz_ has joined #ruby
djbkd has quit [Ping timeout: 240 seconds]
The_Phoenix has quit [Quit: Leaving.]
macsteps has joined #ruby
AzureStigma has quit [Quit: Textual IRC Client: www.textualapp.com]
alfiemax has quit [Ping timeout: 260 seconds]
jenrzzz has quit [Ping timeout: 276 seconds]
DanyC has joined #ruby
Rodya_ has joined #ruby
tomphp has joined #ruby
ramfjord has joined #ruby
SilverKey has quit [Quit: Halted.]
cdg has quit [Remote host closed the connection]
cdg has joined #ruby
zacstewart has quit [Ping timeout: 264 seconds]
memorasus has quit [Remote host closed the connection]
memorasus has joined #ruby
conta has joined #ruby
deimos has quit [Changing host]
deimos has joined #ruby
davic has quit [Changing host]
davic has joined #ruby
ELLIOTTCABLE has quit [Changing host]
ELLIOTTCABLE has joined #ruby
nadir has quit [Changing host]
nadir has joined #ruby
ramfjord has quit [Ping timeout: 264 seconds]
zacstewart has joined #ruby
cdg has quit [Ping timeout: 250 seconds]
Vingador has quit [Ping timeout: 244 seconds]
deniskozlov has quit [Quit: Konversation terminated!]
djbkd has joined #ruby
ptierno has joined #ruby
yfeldblum has joined #ruby
flashpoint9 has joined #ruby
iLogic has quit [Ping timeout: 240 seconds]
AndrewIs_ has joined #ruby
AndrewIsHere has quit [Read error: Connection reset by peer]
iLogic has joined #ruby
perlgod has joined #ruby
sepp2k has quit [Quit: Leaving.]
AndrewIsHere has joined #ruby
AndrewIs_ has quit [Read error: Connection reset by peer]
Torrone has quit [Quit: This computer has gone to sleep]
patrick-sartent has joined #ruby
eljimmy has quit [Quit: This computer has gone to sleep]
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
macsteps has quit [Remote host closed the connection]
tomphp has joined #ruby
iLogic has left #ruby [#ruby]
solars has quit [Ping timeout: 265 seconds]
vuoto has joined #ruby
vuoto has quit [Remote host closed the connection]
karapetyan has joined #ruby
vuoto has joined #ruby
SilverKey has joined #ruby
zarubin has joined #ruby
DanyC has left #ruby [#ruby]
jenrzzz_ has quit [Ping timeout: 258 seconds]
minimalism has joined #ruby
zarubin has quit [Client Quit]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
dionysus69 has joined #ruby
hahuang65 has joined #ruby
clandry94 has joined #ruby
ramfjord has joined #ruby
<clandry94> Hi all, question regarding the behavior of hashes. Referring a hash key (which exists), but has a value of nil. If I call that key, then nil should be returned, correct?
karapetyan has quit [Ping timeout: 276 seconds]
Uranio has joined #ruby
Uranio has quit [Client Quit]
mikecmpbll has quit [Quit: inabit. zz.]
mikecmpbll has joined #ruby
<jhass> yes
ta_ has quit [Ping timeout: 244 seconds]
hahuang65 has quit [Ping timeout: 276 seconds]
tfitts has quit [Quit: Connection closed for inactivity]
ta_ has joined #ruby
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
conta has quit [Ping timeout: 264 seconds]
solars has joined #ruby
QORRiE has joined #ruby
tomphp has joined #ruby
blackmesa has joined #ruby
Es0teric has quit [Quit: Computer has gone to sleep.]
DanyC has joined #ruby
DanyC has quit [Client Quit]
Coldblackice has joined #ruby
perlgod has quit [Quit: Textual IRC Client: www.textualapp.com]
flashpoint9 has quit [Remote host closed the connection]
dcunit3d has quit [Ping timeout: 264 seconds]
sepp2k has joined #ruby
tyang has quit [Ping timeout: 250 seconds]
<clandry94> @jhass Okay, I was experimenting a bit and came across a weird issue. Suppose there is a hash named 'foo' with a few keys. I then use #each on foo.keys to iterate over each of the keys yielding to |key|. Inside of the loop I have a case statement and one of those when statements is foo[key].nil?. When that when statement is called, foo[key].nil? is never true even when foo[key] is definitely true
<clandry94> @jhass will send a snippet
mweshi has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
mikecmpbll has joined #ruby
<nofxx> clandry94, hsh.keys { |x| next if x.nil?
<nofxx> if you do have a nil key there il'll work
<nofxx> clandry94, have in mind nil: 'foo' =! nil => 'foo'
<nofxx> first is a symbol
<clandry94> @nofxx Yes, I've considered that. Trying to create a test case to send
replay has quit [Ping timeout: 265 seconds]
JeanCarloMachado has joined #ruby
<clandry94> @nofxx
<clandry94> When I run this both keys print "Not Nil!"
<nofxx> clandry94, make it each do |k, v| whatever if v.nil?
<nofxx> remove #keys
<aegis3121> because `:bar === false`
<aegis3121> will never match
ta_ has quit [Remote host closed the connection]
<clandry94> Then how come if I just call foo[:bar] in irb I get nil back?
ta_ has joined #ruby
<aegis3121> because the value at that hash is nil
<aegis3121> but the key isn't
<nofxx> clandry94, case uses === 3... notice that
swills has quit [Ping timeout: 240 seconds]
<nofxx> == =! === hehe... BRAINFUCK?
<aegis3121> your case statement is comparing the key to the value of a #nil? call.
<clandry94> crazy lol. I see what you mean, but now calling foo[:bar].nil? returns true
<aegis3121> it's not performing that block when it's nil, it's performing it when (key === foo[:bar].nil?) evaluates to true
l4v2 has joined #ruby
<clandry94> ah
<clandry94> I see now
memorasus has quit [Remote host closed the connection]
<nofxx> clandry94, another rule of thumb: case only for 2+ options...even 3+
<nofxx> maybe one elsif is better
memorasus has joined #ruby
<clandry94> I have more in the code I'm using, only 2 in the example I made
<nofxx> ah cool
smathy has joined #ruby
fmcgeough has quit [Quit: fmcgeough]
blackmesa has quit [Ping timeout: 250 seconds]
<aegis3121> cool, then just...make sure you understand what it's comparing to lol.
<aegis3121> if you're using it like a....nicer looking if/elsif/elsif/else statement, then don't attach anything to the `case` call
<clandry94> Okay, so if I had when foo[key] == nil, then that should evaluate to true if foo[:bar] = nil?
<nofxx> clandry94, another nice tip with case: if you can, make else return 'nil', so you don't need an else...
<aegis3121> clandry94 no
jottr has quit [Ping timeout: 252 seconds]
<aegis3121> case; when foo[key].nil?
ta_ has quit [Ping timeout: 276 seconds]
mikecmpbll has quit [Quit: inabit. zz.]
minotep has quit [Quit: minotep]
mikecmpbll has joined #ruby
<clandry94> Okay, it all just came to me now. Leaving the case call empty lets everything evaluate as I expected
<aegis3121> yes
zeroDi has quit [Quit: WeeChat 1.5]
<clandry94> like @aegis3121 showed with (key === foo[:bar].nil?)
JeanCarloMachado has quit [Quit: Lost terminal]
<clandry94> Thanks so much, everyone. That was mildly infuriating
blackmesa has joined #ruby
vuoto has quit [Remote host closed the connection]
joonty has joined #ruby
vuoto has joined #ruby
synthroid has quit []
<Dimik> so i was wondering is it possible to have the ruby code create a variable on it's own and later on use that variable in the code
<Dimik> with like a random variable name
<eam> Dimik: sure
<clandry94> @dimik That is possible with instance variables
<matthewd> Dimik: How do you want to use it?
<Dimik> hm thanks
dn`_ has joined #ruby
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Dimik> i was just wondering if it's possible is all
<eam> Dimik: there are two methods, instance_variable_set and instance_variable_get, which you can use
der-landgraf has joined #ruby
<clandry94> @eam I don't think you can use instance_variable_set unless the variable has already been set somewhere else
<clandry94> So random names wouldn't work out
<baweaver> oh it works
ddffg has quit [Quit: Leaving]
<baweaver> I've abused that fact in the past a few times.
<eam> >> instance_variable_set "@foobar", 99; @foobar
<ruby[bot]> eam: # => 99 (https://eval.in/619708)
<clandry94> Hmm must be since I am using ruby 2.1
theery has quit []
dn` has quit [Ping timeout: 260 seconds]
johnmilton has quit [Ping timeout: 260 seconds]
dn`_ is now known as dn`
<jhass> Dimik: but! the desire for that usually means you want to use a hash
blackgoat has joined #ruby
<eam> you can use binding to mess with locals
jenrzzz has quit [Ping timeout: 264 seconds]
<matthewd> clandry94: Nope, it's worked like that forever
<baweaver> eam: It's handy when you're in a bind
<eam> RDRR
<clandry94> heh
jenrzzz has joined #ruby
mweshi has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<clandry94> oh god
<clandry94> I made a huge mistake, I did not mean instance_variable_set
<matthewd> You can't set *locals* (via binding) if they don't already exist (well, you can, but you'll be pretty confused thereafter)
<clandry94> i meant local_variable_set
borodin has joined #ruby
<clandry94> that is what i meant lol
<jhass> >> local_variable_set(:foo, 1)
<ruby[bot]> jhass: # => undefined method `local_variable_set' for main:Object ...check link for more (https://eval.in/619709)
rileyy has joined #ruby
rileyy has quit [Client Quit]
<matthewd> >> binding.local_variable_set(:foo, true); foo
<ruby[bot]> matthewd: # => undefined local variable or method `foo' for main:Object ...check link for more (https://eval.in/619710)
<matthewd> >> foo = false; binding.local_variable_set(:foo, true); foo
<ruby[bot]> matthewd: # => true (https://eval.in/619711)
rileyy has joined #ruby
pawnbox has quit [Remote host closed the connection]
<matthewd> >> binding.local_variable_set(:foo, true); binding.local_variable_get(:foo)
<ruby[bot]> matthewd: # => local variable `foo' not defined for #<Binding:0x40715ae4> (NameError) ...check link for more (https://eval.in/619712)
<clandry94> Why is it that local_variable_set doesn't work outside of the current binding?
<clandry94> in the current binding*
<clandry94> Wow... I can not think straight today
pawnbox has joined #ruby
hutch34 has quit [Ping timeout: 276 seconds]
symm- has quit [Ping timeout: 244 seconds]
<jhass> Dimik: ^ is all fun etc. but just use a hash ;)
<matthewd> +1000 do not do this
<eam> I mean, a local namespace is a hash
ferr has quit [Ping timeout: 244 seconds]
ChiefAlexander has quit [Remote host closed the connection]
ChiefAlexander has joined #ruby
chipotle has quit [Quit: cheerio]
workmad3 has quit [Ping timeout: 250 seconds]
chipotle has joined #ruby
solars has quit [Quit: WeeChat 0.4.2]
rileyy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
xall has quit [Quit: WeeChat 1.5]
yfeldblum has quit [Read error: Connection reset by peer]
SilverKey has quit [Quit: Halted.]
yfeldblum has joined #ruby
dionysus69 has quit [Ping timeout: 264 seconds]
symm- has joined #ruby
jordanm has quit [Quit: Konversation terminated!]
hutch34 has joined #ruby
Kyhz has joined #ruby
johnmilton has joined #ruby
xapak has joined #ruby
<xapak> Hello.
dagda1 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<xapak> Anybody familiar with RuboCop?
<xapak> I’m curious about a warning I’m getting.
<bougyman> what is it?
<xapak> I made a constant with some HTTP errors, and I’m getting this: .rb:13:17: C: Freeze mutable objects assigned to constants.
<xapak> My constant is like this:
<bougyman> don't ask to ask, just ask
<xapak> HTTP_ERRORS = [EOFError, Errno::EINVAL]
<xapak> Just, writing
<xapak> :p
<foxxx0> i'd use a hash
<foxxx0> so that you can add some stuff later for each error
<foxxx0> additional messages or whatever
<xapak> Well, I’m doing a rescue like: rescue *HTTP_ERRORS :p
<foxxx0> and just add .freeze to the closing }
* xapak checks `freeze`
<foxxx0> [].freeze should do the trick
<foxxx0> tbh the message from rubocop is really obvious
<xapak> :okay:
<xapak> Yep, no more flags. Thanks, that was it.
banisterfiend has joined #ruby
ur5us has joined #ruby
JakFrist has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
OTORelic2 has quit [Ping timeout: 250 seconds]
dagda1_ has joined #ruby
ixti has quit [Ping timeout: 252 seconds]
mikecmpbll has quit [Quit: inabit. zz.]
Heskie has quit []
der-landgraf has quit [Quit: WeeChat 1.5]
ldnunes has quit [Quit: Leaving]
pokalyis has joined #ruby
mikecmpbll has joined #ruby
hahuang65 has joined #ruby
harfangk has quit [Quit: Textual IRC Client: www.textualapp.com]
<nofxx> xapak, that's good cuz you'll now sure no one, including yrself, will change yr CONSTANTS ;)
<nofxx> now know for sure*
the_rhizo has joined #ruby
byteflame has quit [Ping timeout: 260 seconds]
hahuang61 has quit [Ping timeout: 260 seconds]
rileyy has joined #ruby
jhack has joined #ruby
dcunit3d has joined #ruby
<xapak> nofxx, yep, now I see what the error meant. :p
last_staff has quit [Quit: last_staff]
<xapak> Thanks!
xapak has left #ruby [#ruby]
marxarelli|afk has quit [Quit: Textual IRC Client: www.textualapp.com]
wald0 has quit [Quit: Lost terminal]
marxarelli has joined #ruby
OTORelic2 has joined #ruby
siaw23 has joined #ruby
<siaw23> is there a shorter way to write this? https://gist.github.com/siaw23/29cc89d8374fb6cab3ac582cc2f63527
dreamyspell has quit [Quit: Leaving]
ixti has joined #ruby
swills has joined #ruby
tomphp has joined #ruby
<smathy> siaw23, you meant to have two 2 IDs?
OTORelic2 has quit [Ping timeout: 244 seconds]
<zenspider> siaw23: why? what's wrong with it? what are you hoping to remove?
Psi-Jack_ is now known as Psi-Jack
<nitric> siaw23: you could do "fh.write <<~EOS", the so-called "squiggly heredoc"
arashb has joined #ruby
arashb has quit [Remote host closed the connection]
<siaw23> nitric: what that EOS stand for? i saw it a lot lately
<siaw23> smathy: yes
swills has quit [Quit: Leaving]
<nitric> siaw23: "end of string", but you can use any string you want: EOF is another common one for "end of file"
swills has joined #ruby
<siaw23> zenspider: to avoid the repitition of “fh” or “<<“
<smathy> siaw23, make a hash or array ahead of time and then iterate over it in your CSV.open block if you prefer.
<smathy> It won't really be shorter, but you'll have removed that `fh << ` process duplication.
<nitric> "heredoc" is a catchall term for a multiline string that is terminated by a fixed, known string such as "EOS" or "the_end_of_my_multiline_string" or any other legal string
<siaw23> smathy: more like it :)
ChiefAlexander has quit [Remote host closed the connection]
solars has joined #ruby
marxarelli has quit [Ping timeout: 244 seconds]
dreamyspell has joined #ruby
<smathy> siaw23, comment in your gist.
<siaw23> more like it. thanks :)
<smathy> Np.
sp3 has quit [Quit: Connection closed for inactivity]
rileyy has quit [Quit: Textual IRC Client: www.textualapp.com]
mindcrooker has joined #ruby
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mindcrooker has quit [Client Quit]
gnufied has quit [Quit: Leaving]
gnufied has joined #ruby
LoneHerm_ has joined #ruby
Spami has joined #ruby
jenrzzz_ has joined #ruby
Torrone has joined #ruby
gizmore has quit [Quit: KVIrc 4.9.2 Aria http://www.kvirc.net/]
[Butch] has quit [Quit: I'm out . . .]
sepp2k has quit [Read error: Connection reset by peer]
JeanCarloMachado has joined #ruby
jenrzzz has quit [Ping timeout: 250 seconds]
aegis3121 has quit [Ping timeout: 244 seconds]
kavanagh has quit [Quit: That's all folks!]
<zenspider> siaw23: the code is fine as it is.
joonty has quit [Quit: This computer has gone to sleep]
hahuang61 has joined #ruby
<siaw23> zenspider: thanks :)
capitainIsh has joined #ruby
SCHAAP137 has quit [Quit: Leaving]
Xeago has quit [Ping timeout: 240 seconds]
axl_ has quit [Quit: axl_]
<capitainIsh> quick question about ruby: what's the difference between a = "hello written outside of functions/classes and $b = "hello"
axl_ has joined #ruby
der-landgraf has joined #ruby
<jhass> the former creates a local variable, the latter creates a global variable
Xeago has joined #ruby
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hahuang61 has quit [Ping timeout: 250 seconds]
unreal has joined #ruby
<jhass> ?crosspost capitainIsh
<ruby[bot]> capitainIsh: Please do not crosspost without at least telling so and mentioning provided suggestions and their outcome in all channels. Experience shows that people don't do either, and not doing so is considered rude.
<jhass> matthewd: ^
rodfersou has quit [Quit: leaving]
hutch34 has quit [Quit: WeeChat 1.5]
xlegoman has joined #ruby
matp has quit [Ping timeout: 244 seconds]
anisha_ has quit [Quit: This computer has gone to sleep]
polishdub has quit [Quit: Leaving]
Es0teric has joined #ruby
Es0teric has quit [Max SendQ exceeded]
Es0teric has joined #ruby
<capitainIsh> ah gotcha. my apologies.
replay has joined #ruby
replay has quit [Client Quit]
replay has joined #ruby
ebbflowgo has joined #ruby
maloik has quit [Remote host closed the connection]
maloik has joined #ruby
nitric has quit [Read error: Connection reset by peer]
nitric_ has joined #ruby
mozzarella has quit [Remote host closed the connection]
nitric_ has quit [Max SendQ exceeded]
mozzarella has joined #ruby
smathy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
smathy has joined #ruby
<havenwood> capitainIsh: Rubists generally avoid defining their own global variables.
smathy has quit [Client Quit]
spudowiar has joined #ruby
<capitainIsh> thanks, havenwood. I was just wondering because I thought making a variable at the very top level actually creates a global variable without th $
<capitainIsh> apparently, it's local, but is also accessible to every other method/variable you create?
<havenwood> capitainIsh: Nope, that's still a local variable, it's just bound to `main`.
borodin has quit [Ping timeout: 250 seconds]
<capitainIsh> i see, so what wouldn't be able to access the local variable at the top level (main)?
<zenspider> any method, class, or module body
someguy has joined #ruby
spider-mario has quit [Remote host closed the connection]
JeanCarloMachado has quit [Ping timeout: 276 seconds]
<capitainIsh> understood. thanks guys. i've just realized that all the index variables i've been working with have been inside of functions, or was a part of the top level altogether.
<capitainIsh> i'm thinking of changing my un to rubyNewbie
firstdayonthejob has quit [Ping timeout: 240 seconds]
LoneHerm_ has quit [Remote host closed the connection]
<someguy> Can someone tell me the ruby equivalent for Java's cert.getPublicKey().getEncoded()?
<someguy> Specifically the getEncoded() part
<shellie_> experienced rubyists, what are some well written / clear ruby applications you would recommend a newbie for inspiration?
nitric has joined #ruby
<jhass> someguy, to_pem I guess?
fmcgeough has joined #ruby
eljimmy has joined #ruby
zodiac19 has joined #ruby
dr0lan has quit [Ping timeout: 240 seconds]
tvw has quit [Read error: Connection reset by peer]
zodiac19 has left #ruby [#ruby]
chris349 has joined #ruby
ftj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
solars has quit [Ping timeout: 276 seconds]
Silthias has quit [Ping timeout: 244 seconds]
roflmyeggo has joined #ruby
<someguy> jhass: I don't think so. getEncoded() is supposed to return a byte array.
roflmyeggo has quit [Client Quit]
<someguy> jhass: the docs say "Returns the key in its primary encoding format, or null if this key does not support encoding."
macsteps has joined #ruby
roflmyeggo has joined #ruby
blackgoat has quit [Ping timeout: 244 seconds]
the_rhizo2 has joined #ruby
the_rhizo has quit [Ping timeout: 258 seconds]
Asher has quit [Quit: Leaving.]
<jhass> to_der then
ctp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
JeanCarloMachado has joined #ruby
Velizar has quit [Quit: Velizar]
solars has joined #ruby
craigp_ has quit [Ping timeout: 250 seconds]
ereslibre_laptop is now known as ereslibre
Asher has joined #ruby
Bugboy1028 has quit [Remote host closed the connection]
cschneid_ has quit [Remote host closed the connection]
matp has joined #ruby
ruid has joined #ruby
ruid has quit [Changing host]
ruid has joined #ruby
memorasus has quit [Remote host closed the connection]
ctp has joined #ruby
etetz has quit [Remote host closed the connection]
Bugboy1028 has joined #ruby
nofxx has quit [Ping timeout: 276 seconds]
hahuang61 has joined #ruby
ptierno has quit [Quit: Lost terminal]
Bugboy1028 has quit [Client Quit]
whathappens has quit [Remote host closed the connection]
crdpink2 has joined #ruby
whathappens has joined #ruby
memorasus has joined #ruby
<siaw23> an upvote will be fine too :D
crdpink has quit [Ping timeout: 250 seconds]
Bugboy1028 has joined #ruby
the_rhizo2 has quit [Ping timeout: 258 seconds]
hahuang61 has quit [Ping timeout: 250 seconds]
blackgoat has joined #ruby
the_rhizo2 has joined #ruby
whathappens has quit [Ping timeout: 265 seconds]
Derperperd has quit [Quit: Derperperd]
gregf has quit [Read error: Connection reset by peer]
vuoto has quit [Ping timeout: 244 seconds]
vuoto has joined #ruby
yuki_is_bored has quit [Remote host closed the connection]
solars has quit [Ping timeout: 258 seconds]
mweshi has joined #ruby
fmcgeough has quit [Quit: fmcgeough]
mweshi has quit [Client Quit]
nando293921 has joined #ruby
axl_ has quit [Quit: axl_]
mweshi has joined #ruby
mweshi has quit [Remote host closed the connection]
mweshi has joined #ruby
A_Drone has joined #ruby
CloCkWeRX has joined #ruby
banisterfiend has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
banisterfiend has joined #ruby
vuoto has quit [Ping timeout: 240 seconds]
Silthias has joined #ruby
bjh13 has quit [Remote host closed the connection]
solars has joined #ruby
LoneHerm_ has joined #ruby
A_Drone has quit [Ping timeout: 240 seconds]
mweshi has quit [Ping timeout: 244 seconds]
memorasus has quit [Ping timeout: 244 seconds]
Torrone has quit [Quit: This computer has gone to sleep]
xlegoman has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
soahccc has quit [Ping timeout: 260 seconds]
xlegoman has joined #ruby
ruid has quit [Ping timeout: 276 seconds]
QORRiE has quit [Quit: Leaving]
ruid has joined #ruby
patrick-sartent has quit [Quit: .]
LoneHerm_ has quit [Ping timeout: 258 seconds]
Spami has quit [Quit: This computer has gone to sleep]
someguy has quit [Quit: Page closed]
Torrone has joined #ruby
macsteps has quit [Remote host closed the connection]
Spami has joined #ruby
Spami has quit [Client Quit]
JoshGlzBrk has joined #ruby
enodata has quit [Quit: Leaving]
gregf has joined #ruby
symm- has quit [Ping timeout: 250 seconds]
mweshi has joined #ruby
Madplatypus has joined #ruby
jhack has quit [Quit: jhack]
zacts has joined #ruby
mweshi has quit [Ping timeout: 240 seconds]
mweshi has joined #ruby
karapetyan has joined #ruby