havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com || Ruby 2.4.1, 2.3.4 & 2.2.7: https://www.ruby-lang.org || Paste >3 lines of text to: https://gist.github.com || Rails questions? Ask in: #RubyOnRails || Logs: https://irclog.whitequark.org/ruby || Books: https://goo.gl/wpGhoQ
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nOwz has joined #ruby
Snickers has quit [Quit: Snickers]
d3d1rty has quit [Ping timeout: 264 seconds]
nOwz has quit [Ping timeout: 240 seconds]
Channel6 has joined #ruby
patarr has quit [Ping timeout: 246 seconds]
patarr has joined #ruby
gdonald has quit [Read error: Connection reset by peer]
gdonald has joined #ruby
__Yiota has joined #ruby
dlitvak has joined #ruby
CloCkWeRX has quit [Ping timeout: 246 seconds]
al2o3-cr has quit [Quit: WeeChat 1.7]
mim1k has joined #ruby
<Disavowed> Afternoon all. What is the idiomatic way to have optional arguments in Ruby? In Python my function signature would look like this: def test(a, b, c=None) - is the Ruby equivalent the way to go or is there a neater way?
meshsmith has joined #ruby
lupine has quit [Ping timeout: 256 seconds]
<nofxxxx> Disavowed, same.... but I guess None is nil
<nofxxxx> dunno python
renatosilva has left #ruby ["http://renatosilva.net"]
rakm has joined #ruby
mim1k has quit [Ping timeout: 260 seconds]
patarr has quit [Ping timeout: 258 seconds]
<nofxxxx> Disavowed, there's also this way -> https://robots.thoughtbot.com/ruby-2-keyword-arguments
agent_white has joined #ruby
JeanCarloMachado has quit [Ping timeout: 260 seconds]
<Disavowed> This is exactly what I've been googling for! Don't know how I didn't hit upon it. Thank you so much
patarr has joined #ruby
<nofxxxx> Disavowed, some call 'named parameters', first time I've seen 'keyword arguments' I believe hehe
<Disavowed> keyword arguments seems more familiar to me but maybe whoever wrote this also came from a Python background
username1 has quit [Ping timeout: 240 seconds]
<Disavowed> (optional named arguments would be this in Python: `def test (a, b, **kwargs):` but kwargs is just a convention.
TPug has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
gnufied has quit [Ping timeout: 246 seconds]
montanonic has quit [Ping timeout: 246 seconds]
<nofxxxx> Disavowed, in ruby -> def test(a, b, *opts) or def test(a, b, opts = {})
<nofxxxx> opts also convention
acrux09 has joined #ruby
<Disavowed> Oh neat - I wouldn't have known that were it not for you. Thank you.
<nofxxxx> believe ** and * same... we call it 'splat'
<Disavowed> Same I think :)
<nofxxxx> cool, no prob
bocaneri has joined #ruby
patarr has quit [Ping timeout: 260 seconds]
cow[baby] has joined #ruby
<Disavowed> I think I might take influence from your IRC handle and break out a little NOFX to get me through the rest of my Friday afternoon... it's been a while!
<adam12> Jeez. Haven't heard that name in a while
<Disavowed> Oh I have another remedial question: how can I ensure at least one value in a list is truthy? Like Python's any() builtin
<Disavowed> adam12: Same
<adam12> Disavowed: I'm having flashbacks to IRC circa 98/99?
postmodern has quit [Quit: Leaving]
<nofxxxx> hehe download mIRC for that
<nofxxxx> Disavowed, foo.any?
Guest80652 has quit [Ping timeout: 240 seconds]
<nofxxxx> know the interrogation thing right? always returns bool Disavowed
<nofxxxx> so if you're looking for bool, you're looking for a question hehe
benlieb has quit [Quit: benlieb]
<Disavowed> nofxxxx: that was so obvious - I can't believe I didn't think of it
CloCkWeRX has joined #ruby
<nofxxxx> Disavowed, ops..wait, I always confuse if it's a rails thing... if it doesn't work you need to: !foo.empty?
<Disavowed> interogration thing is anything suffixed with a '?' ?
<nofxxxx> yup
<Disavowed> nice
<adam12> any? is a thing
<adam12> but you might need an arg for it?
<nofxxxx> Disavowed, but I believe it's been added to ruby in 2.3 or 2.4 Disavowed
<adam12> >> [false, false].any?
<ruby[bot]> adam12: # => false (https://eval.in/764931)
<nofxxxx> adaedra, nope, it's just empty? negation
<adam12> Guess not.
<Disavowed> adam12: I didn't discover IRC until about 6 years ago so I can't reminisce with you there I'm afraid. I did listen to it on my own around that time though!
<nofxxxx> actually very handy for readability
<nofxxxx> !foo.empty? looks like ill written spanish
<Disavowed> nofxxxx: you're a saint. Thank you. That behaves exactly as I expected it
TPug has joined #ruby
<adam12> Disavowed: I was in a HUGE irc channel back in the mid-late 90s for the area I lived in. It was impressive to see 1000's of people chatting, over dialup mostly, in the afternoons/evenings. I bet I met (IRL) a few hundred people over the time I spent on IRC.
<Disavowed> From an English guy who doesn't know much about Spanish, it absolutely does!
Roa_ is now known as Roa
Nicmavr has joined #ruby
Roa has quit [Changing host]
Roa has joined #ruby
<Disavowed> adam12: See, that's the internet I miss
<adam12> Disavowed: Anyways, I think NOFX was a thing back then, and someone had a nick to that regard.
Nicmavr is now known as Guest37211
<Disavowed> adam12: I'm with you. It ties in well. I think NOFX are still going as a band!
<adam12> Had no idea.
<adam12> Thew me back just seeing it mentioned - like I was running BitchX on Slackware.
<nofxxxx> adam12, also, you make contact with ppl different than you.. that's a win win, social networks insanely tries to "match" friends for you
<adam12> Anyways, probably more suitable for ruby-offtopic :P
patarr has joined #ruby
<Disavowed> The thing I like about this channel is that it's much more accomodating of these particular slides. This would never fly in Python.
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Papierkorb> adam12, Disavowed, y'all welcome in #ruby-offtopic no one's even hangman-ing in there right now!
<adam12> :O
<Disavowed> Papierkorb: I'm lurking!
<Disavowed> It's much quieter than python-offtopic
LuckyABA has joined #ruby
duckpupp1 has joined #ruby
milardovich has quit [Remote host closed the connection]
Verity has joined #ruby
milardovich has joined #ruby
nitric has quit [Ping timeout: 260 seconds]
patarr has quit [Ping timeout: 268 seconds]
Rodya_ has joined #ruby
<Verity> refers to packet more than self, maybe move it to a class? what is this reek error all abhout
duckpupp1 has quit [Ping timeout: 256 seconds]
<matthewd> Verity: It's accusing your method of feature envy
<Disavowed> Could anyone point me in the direction of the smart way of handling hashes in rspec? I am mutating unintentionally.
<Disavowed> Oh is it let binding?
milardovich has quit [Ping timeout: 260 seconds]
meshsmith has quit [Remote host closed the connection]
benlieb has joined #ruby
patarr has joined #ruby
benlieb has quit [Client Quit]
Rodya_ has quit [Ping timeout: 246 seconds]
houhoulis has quit [Remote host closed the connection]
patarr has quit [Ping timeout: 264 seconds]
patarr has joined #ruby
gregf_ has quit [Ping timeout: 260 seconds]
alibby has joined #ruby
postmodern has joined #ruby
davorb has quit [Read error: Connection reset by peer]
davorb has joined #ruby
patarr has quit [Ping timeout: 256 seconds]
bkxd has joined #ruby
patarr has joined #ruby
juggler has joined #ruby
bkxd has quit [Ping timeout: 260 seconds]
<Verity> matthewd, I dont know what that is
<Verity> should I be moving to a class now?
<Verity> I'm still loving ruby, btw
<Verity> even if its made this assignment more difficult in the short term
hndk has joined #ruby
sepp2k has quit [Ping timeout: 240 seconds]
<agent_white> Disavowed: How are you mutating them?
<agent_white> !code
<allisio> !postcode
<Verity> !showcode
<agent_white> !helloweneedthecode
<allisio> !allyourcodearebelongtous
cfec0b8d has quit [Remote host closed the connection]
cow[baby] has quit [Quit: cow[baby]]
<agent_white> !iswearithoughtyousaidtacos
<agent_white> Disavowed: Srsly doe. Feed us.
<Verity> have at it
<Verity> I'd love to know how I could improve
TPug has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Verity> forget the fact that sendpacket doesnt actually SEND them correctly yet, it does print them though
harfangk has joined #ruby
JeanCarloMachado has joined #ruby
patarr has quit [Ping timeout: 268 seconds]
<adam12> I'd say you definitely have at least a Packet class, and probably some sort of Packet collection
Beverage1 has quit [Quit: Leaving]
patarr has joined #ruby
<matthewd> I'd start with the packet-building duplication in build_packet_array
<agent_white> Hehe line 84. I like how it looks
houhoulis has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
<agent_white> Verity: 63 just for debugging? Wonder why you didn't nest.
<agent_white> I like your code doe. Nice and neat. Like fresh shower neat.
JeanCarloMachado has quit [Ping timeout: 258 seconds]
<Verity> let me go over the suggestions
JeanCarloMachado has joined #ruby
juggler has quit [Quit: Leaving]
DTZUZO has joined #ruby
majuscul1 is now known as majuscule
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
patarr has quit [Ping timeout: 240 seconds]
Rodya_ has joined #ruby
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
JeanCarloMachado has quit [Ping timeout: 246 seconds]
patarr has joined #ruby
JeanCarloMachado has joined #ruby
d^sh has quit [Ping timeout: 260 seconds]
Vile` has joined #ruby
d^sh has joined #ruby
Rodya_ has quit [Ping timeout: 246 seconds]
raspado has quit [Remote host closed the connection]
nowhere_man has quit [Remote host closed the connection]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
libastral has quit [Ping timeout: 256 seconds]
alibby has quit [Quit: Leaving.]
nOwz has joined #ruby
retozon has joined #ruby
patarr has quit [Ping timeout: 264 seconds]
ozcanesen has joined #ruby
<retozon> hello
edgr has quit [Ping timeout: 260 seconds]
libastral has joined #ruby
znz_jp has quit [Remote host closed the connection]
nOwz has quit [Ping timeout: 260 seconds]
_aeris_ has quit [Ping timeout: 240 seconds]
edgr has joined #ruby
znz_jp has joined #ruby
<havenwood> retozon: hi
jameser has joined #ruby
JeanCarloMachado has quit [Ping timeout: 256 seconds]
baweaver is now known as baweaver_away
JeanCarloMachado has joined #ruby
_aeris_ has joined #ruby
astrobunny has joined #ruby
bmurt has joined #ruby
mim1k has joined #ruby
AndrewIsHere has quit []
mim1k has quit [Ping timeout: 260 seconds]
Rodya_ has joined #ruby
JeanCarloMachado has quit [Ping timeout: 260 seconds]
Vile` has quit [Ping timeout: 256 seconds]
gnufied has joined #ruby
CloCkWeRX has quit [Ping timeout: 240 seconds]
gusrub has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 240 seconds]
JeanCarloMachado has joined #ruby
acrux09 has quit [Quit: ChatZilla 0.9.93 [Firefox 52.0.2/20170323105023]]
<Verity> there is a differentce though, matthewd
<Verity> -t
jeyraof^mbpr has joined #ruby
<matthewd> I see the difference in the padding, if that's what you mean.. but that just sounds wrong to me
JeanCarloMachado has quit [Ping timeout: 260 seconds]
<Verity> its for the case where the last packet has a message the full size
JeanCarloMachado has joined #ruby
<Verity> then eot cant fit, so a final packet must be crafted consisting of SOHEOTPADPADPADPADCRC
skweek has quit [Read error: Connection reset by peer]
skweek has joined #ruby
gnufied has quit [Ping timeout: 246 seconds]
gnufied has joined #ruby
JeanCarloMachado has quit [Ping timeout: 240 seconds]
t-recx has quit [Quit: t-recx]
<matthewd> Verity: I know what it's doing, and I know what I said.. can you clarify what you heard?
howdoi has quit [Quit: Connection closed for inactivity]
JeanCarloMachado has joined #ruby
CloCkWeRX has joined #ruby
duckpupp1 has joined #ruby
JeanCarloMachado has quit [Ping timeout: 260 seconds]
JeanCarloMachado has joined #ruby
houhoulis has quit [Remote host closed the connection]
duckpupp1 has quit [Ping timeout: 256 seconds]
JoshS has joined #ruby
HoierM has quit [Ping timeout: 240 seconds]
Channel6 has quit [Quit: Leaving]
knight33 has joined #ruby
<allisio> Verity: May I offer a potentially brutal piece of constructive criticism?
charliesome has joined #ruby
bkxd has joined #ruby
<Verity> allisio, sure
<allisio> Verity: Line 84 strikes me as plainly indicative of the fact that you simply don't pay close enough attention to what you're doing while programming. That's going to be a continual source of frustration and disappointment for you if you don't nip it in the bud.
<Verity> I'll consider that
Rodya_ has quit [Remote host closed the connection]
<allisio> Thank you.
bkxd has quit [Ping timeout: 246 seconds]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
JeanCarloMachado has quit [Ping timeout: 268 seconds]
gigetoo has quit [Ping timeout: 240 seconds]
hndk has quit [Quit: Leaving]
gix has quit [Ping timeout: 260 seconds]
__Yiota has joined #ruby
gigetoo has joined #ruby
s2013 has quit [Quit: Textual IRC Client: www.textualapp.com]
baweaver_away is now known as baweaver
gix has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
gnufied has quit [Ping timeout: 246 seconds]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
m1911 has joined #ruby
akkad has quit [Ping timeout: 240 seconds]
akkad has joined #ruby
charliesome has joined #ruby
m1911 has quit [Quit: Mutter: www.mutterirc.com]
JoshS has quit [Quit: Leaving]
Joufflu has joined #ruby
shad0 has joined #ruby
<shad0> anybody got much experience mixing bundler with docker?
shad0 is now known as randomluser
claw has quit [Ping timeout: 260 seconds]
claw has joined #ruby
Joufflu has quit [Quit: Leaving]
TPug has joined #ruby
agent_white has quit [Quit: agent_white]
agent_white has joined #ruby
<retozon> what everone doing this evening
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<retozon> i have this app idea I have been working on... just not sure where to put it.... I am certified in ruby but unsure of how to put it in layout format
<retozon> also been working with python i am so confused right now
<retozon> any ideas
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
raspado has joined #ruby
Rodya_ has joined #ruby
randomluser has quit [Quit: Leaving]
charliesome has joined #ruby
xall has joined #ruby
amclain has quit [Quit: Leaving]
nOwz has joined #ruby
raspado has quit [Ping timeout: 246 seconds]
Rodya_ has quit [Ping timeout: 246 seconds]
nOwz has quit [Ping timeout: 240 seconds]
djbkd has quit [Remote host closed the connection]
djbkd has joined #ruby
_djbkd has joined #ruby
djbkd has quit [Ping timeout: 268 seconds]
milardovich has joined #ruby
mim1k has joined #ruby
herbmillerjr has joined #ruby
benlieb has joined #ruby
milardovich has quit [Ping timeout: 246 seconds]
mim1k has quit [Ping timeout: 260 seconds]
bkxd has joined #ruby
_djbkd has quit [Quit: My people need me...]
bkxd has quit [Ping timeout: 240 seconds]
meinside has joined #ruby
renchan has joined #ruby
retozon has quit [Ping timeout: 260 seconds]
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ozcanesen has quit [Quit: Textual IRC Client: www.textualapp.com]
duckpupp1 has joined #ruby
SeepingN has joined #ruby
Arpanet69 has joined #ruby
duckpupp1 has quit [Ping timeout: 240 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
username_ has joined #ruby
charliesome has joined #ruby
username_ has quit [Ping timeout: 240 seconds]
Rodya_ has joined #ruby
bungoman has quit [Ping timeout: 246 seconds]
davorb has quit [Read error: Connection reset by peer]
bungoman has joined #ruby
davorb has joined #ruby
Rodya_ has quit [Ping timeout: 246 seconds]
benlieb has quit [Quit: benlieb]
Pumukel has joined #ruby
Maven has joined #ruby
JoshS has joined #ruby
Maven has quit []
hays has quit [Ping timeout: 240 seconds]
TPug has quit [Quit: Textual IRC Client: www.textualapp.com]
krzysztoff is now known as grzegorz
grzegorz is now known as grzegorzz
benlieb has joined #ruby
djbkd has joined #ruby
milardovich has joined #ruby
milardovich has quit [Client Quit]
aufi has joined #ruby
igniting has quit [Ping timeout: 260 seconds]
skweek has quit [Ping timeout: 260 seconds]
meshsmith has joined #ruby
rhyselsmore has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dionysus69 has joined #ruby
rhyselsmore has joined #ruby
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
meshsmith_ has joined #ruby
meshsmith_ has quit [Remote host closed the connection]
meshsmith has quit [Ping timeout: 260 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bocaneri is now known as Bock
Bock is now known as Boc
jusa has joined #ruby
Rodya_ has joined #ruby
nOwz has joined #ruby
charliesome has joined #ruby
Rodya_ has quit [Ping timeout: 246 seconds]
jusa has quit [Ping timeout: 240 seconds]
nOwz has quit [Ping timeout: 240 seconds]
mim1k has joined #ruby
aganov has joined #ruby
cfec0b8d has joined #ruby
patarr has joined #ruby
mim1k has quit [Ping timeout: 268 seconds]
benlieb has quit [Quit: benlieb]
cfec0b8d has quit [Ping timeout: 240 seconds]
bkxd has joined #ruby
patarr has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
andikr has joined #ruby
conta has joined #ruby
bkxd has quit [Ping timeout: 260 seconds]
doublemalt__ has quit [Ping timeout: 268 seconds]
last_staff has joined #ruby
PaulCape_ has quit [Quit: .]
rhyselsmore has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
muelleme_ has joined #ruby
nOwz has joined #ruby
djbkd has quit [Remote host closed the connection]
PaulCapestany has joined #ruby
djbkd has joined #ruby
duckpupp1 has joined #ruby
SeepingN has joined #ruby
SeepingN has quit [Client Quit]
djbkd has quit [Ping timeout: 260 seconds]
fmartingr has joined #ruby
last_staff is now known as Maui
Maui is now known as Last_Maui
duckpupp1 has quit [Ping timeout: 240 seconds]
Last_Maui is now known as last_staff
CloCkWeRX has quit [Ping timeout: 256 seconds]
bkxd has joined #ruby
mazeinmaze_ has quit [Ping timeout: 268 seconds]
kegster has joined #ruby
Xiti has quit [Quit: Xiti]
Yzguy has joined #ruby
jgnagy has quit [Remote host closed the connection]
grillon has joined #ruby
bkxd has quit [Ping timeout: 240 seconds]
jgnagy has joined #ruby
bkxd has joined #ruby
ensyde has joined #ruby
mazeinmaze_ has joined #ruby
jgnagy has quit [Ping timeout: 258 seconds]
muelleme_ has quit [Ping timeout: 256 seconds]
AnoHito_ has joined #ruby
AnoHito has quit [Ping timeout: 268 seconds]
nOwz has quit [Ping timeout: 256 seconds]
maattdd has joined #ruby
jaequery has joined #ruby
Yzguy has quit [Read error: Connection reset by peer]
mim1k has joined #ruby
grh has joined #ruby
nOwz has joined #ruby
Snickers has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
weualo has joined #ruby
jeyraof^mbpr has quit [Quit: This computer has gone to sleep]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Boc is now known as Bock
enterprisey has joined #ruby
uncertainty has quit [Ping timeout: 256 seconds]
jusa has joined #ruby
charliesome has joined #ruby
djbkd has joined #ruby
jusa has quit [Ping timeout: 260 seconds]
maattdd_ has joined #ruby
djbkd has quit [Client Quit]
uncertainty has joined #ruby
rhyselsmore has joined #ruby
rhyselsmore has quit [Client Quit]
maattdd has quit [Ping timeout: 240 seconds]
Arpanet69 has quit [Read error: Connection reset by peer]
Arpanet69 has joined #ruby
chuff has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
uncertainty has quit [Ping timeout: 260 seconds]
AnoHito_ has quit [Read error: Connection reset by peer]
AnoHito has joined #ruby
kernelPaniq has joined #ruby
aglorei1 has quit [Remote host closed the connection]
nOwz has quit [Ping timeout: 260 seconds]
aglorei1 has joined #ruby
hurricanehrndz has quit [Quit: Goodbye]
uncertainty has joined #ruby
raspado has joined #ruby
hurricanehrndz has joined #ruby
Rodya_ has joined #ruby
astrobunny has quit [Remote host closed the connection]
dysfigured has quit [Quit: I hate quit messages.]
raspado has quit [Ping timeout: 256 seconds]
Rodya_ has quit [Ping timeout: 246 seconds]
astrobunny has joined #ruby
kevinfagan has joined #ruby
mim1k has joined #ruby
ByronJohnson has quit [Ping timeout: 268 seconds]
jaequery has quit [Quit: Textual IRC Client: www.textualapp.com]
dysfigured has joined #ruby
dysfigured has quit [Client Quit]
dysfigured has joined #ruby
ByronJohnson has joined #ruby
vondruch has joined #ruby
tvw has joined #ruby
patarr has joined #ruby
MittelDank has quit [Ping timeout: 258 seconds]
marr has joined #ruby
mikecmpbll has joined #ruby
patarr has quit [Ping timeout: 240 seconds]
nofxxx has joined #ruby
nofxxxx has quit [Ping timeout: 240 seconds]
flying has joined #ruby
esObe_ has joined #ruby
ddffg has joined #ruby
jameser_ has joined #ruby
jameser has quit [Ping timeout: 260 seconds]
enterprisey has quit [Remote host closed the connection]
agent_white has quit [Read error: Connection reset by peer]
duckpupp1 has joined #ruby
lxsameer has joined #ruby
Silthias1 has joined #ruby
Silthias has quit [Ping timeout: 258 seconds]
AnoHito has quit [Read error: Connection reset by peer]
duckpupp1 has quit [Ping timeout: 268 seconds]
djbkd has joined #ruby
AnoHito has joined #ruby
pwnd_nsfw` has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
nOwz has joined #ruby
djbkd has quit [Ping timeout: 260 seconds]
dhollin3 has joined #ruby
bkxd has quit [Ping timeout: 240 seconds]
pwnd_nsfw has quit [Ping timeout: 246 seconds]
jaruga has joined #ruby
dhollinger has quit [Ping timeout: 240 seconds]
spicerack has joined #ruby
Beams has joined #ruby
davorb has quit [Read error: Connection reset by peer]
davorb has joined #ruby
GreySunshine has joined #ruby
mim1k has joined #ruby
jgnagy has joined #ruby
maattdd has joined #ruby
maloik has quit [Remote host closed the connection]
maloik has joined #ruby
jgnagy has quit [Ping timeout: 240 seconds]
bkxd has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
maattdd_ has quit [Ping timeout: 268 seconds]
<GreySunshine> #jruby
rgtk has joined #ruby
bkxd has quit [Ping timeout: 260 seconds]
biberu has joined #ruby
jenrzzz has joined #ruby
nOwz has quit [Ping timeout: 240 seconds]
nOwz has joined #ruby
bkxd has joined #ruby
nOwz has quit [Client Quit]
Silthias1 has quit [Read error: Connection reset by peer]
grillon has quit [Quit: Connection closed for inactivity]
jusa has joined #ruby
workmad3 has joined #ruby
bkxd has quit [Ping timeout: 240 seconds]
jusa has quit [Ping timeout: 240 seconds]
vuoto has joined #ruby
DARPA has joined #ruby
Arpanet69 has quit [Ping timeout: 260 seconds]
Silthias has joined #ruby
bkxd has joined #ruby
cfec0b8d has joined #ruby
Arpanet69 has joined #ruby
DARPA has quit [Ping timeout: 240 seconds]
<terens> hi
<terens> I have a template for a file (erb)
<terens> where should I store it?
bkxd has quit [Ping timeout: 256 seconds]
gdonald has quit [Read error: Connection reset by peer]
gdonald has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
vuoto has quit [Remote host closed the connection]
jameser_ has quit [Ping timeout: 246 seconds]
rgtk has quit [Ping timeout: 260 seconds]
jameser has joined #ruby
pandaant has joined #ruby
bkxd has joined #ruby
mazeinmaze_ has quit [Ping timeout: 240 seconds]
bkxd has quit [Ping timeout: 240 seconds]
jamesaxl has joined #ruby
Rodya_ has joined #ruby
xall_ has joined #ruby
bkxd has joined #ruby
xall has quit [Ping timeout: 240 seconds]
<ddffg> in memory
Rodya_ has quit [Ping timeout: 246 seconds]
bkxd has quit [Ping timeout: 258 seconds]
bkxd has joined #ruby
chuff has left #ruby ["Textual IRC Client: www.textualapp.com"]
astrobunny has quit [Remote host closed the connection]
mim1k has quit [Ping timeout: 258 seconds]
bkxd has quit [Ping timeout: 240 seconds]
ferr1 has joined #ruby
patarr has joined #ruby
gnufied has joined #ruby
bkxd has joined #ruby
patarr has quit [Ping timeout: 264 seconds]
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bkxd has quit [Ping timeout: 264 seconds]
vali has joined #ruby
gnufied has quit [Ping timeout: 246 seconds]
vali has quit [Remote host closed the connection]
bkxd has joined #ruby
tvw has quit [Ping timeout: 258 seconds]
jusa has joined #ruby
vali has joined #ruby
pandaant has quit [Remote host closed the connection]
bkxd has quit [Ping timeout: 246 seconds]
<darix> terens: /usr/share/yourscript/
<darix> if you want to install it systemwide
<terens> no within app
duckpupp1 has joined #ruby
ledestin has quit [Quit: Textual IRC Client: www.textualapp.com]
tvw has joined #ruby
postmodern has quit [Quit: Leaving]
djbkd has joined #ruby
bkxd has joined #ruby
duckpupp1 has quit [Ping timeout: 240 seconds]
djbkd has quit [Ping timeout: 268 seconds]
bkxd has quit [Ping timeout: 240 seconds]
KnownSyntax has quit [Quit: No Ping reply in 180 seconds.]
HoierM has joined #ruby
xall has joined #ruby
bkxd has joined #ruby
Burgestrand has joined #ruby
davorb has quit [Read error: Connection reset by peer]
davorb has joined #ruby
xall_ has quit [Ping timeout: 260 seconds]
KnownSyntax has joined #ruby
KnownSyntax has joined #ruby
KnownSyntax has quit [Changing host]
Rodya_ has joined #ruby
ssinghi has joined #ruby
ssinghi has quit [Client Quit]
j3ll3 has joined #ruby
bkxd has quit [Ping timeout: 246 seconds]
jgnagy has joined #ruby
j3ll3 has left #ruby ["WeeChat 1.7"]
TomyWork has joined #ruby
Rodya_ has quit [Ping timeout: 246 seconds]
username_ has joined #ruby
jgnagy has quit [Ping timeout: 256 seconds]
<TomyWork> i want to write a little script that keeps track of when /tmp files are created or deleted. in order to query that from within another script, i need a lightweight (local?) key-value storage, preferably one that i dont need to install. I can only think of sqlite, but is there a more fitting choice maybe?
<TomyWork> only has to work with ruby
username_ has quit [Ping timeout: 260 seconds]
<darix> TomyWork: sqlite seems fine... but you can also just store it in memory.
<darix> TomyWork: and use inotify
<darix> (or similar things one other platforms)
<adaedra> There may be a generic gem that wraps different method to have a cross-platform solution
mim1k has joined #ruby
Pumukel has quit [Read error: Connection reset by peer]
duckpupp1 has joined #ruby
_joes_ has quit [Remote host closed the connection]
<darix> adaedra: ... rb-fsevent would be a good name for it ...
<darix> but sadly there doesnt seems to be the generic wrapper module yet
Lord_of_Life has quit [Excess Flood]
<adaedra> You mean like https://github.com/guard/listen ?
<kke> i have a thing with a kind of interactive console thing that goes like "while buf = Readline.readline(..) { run_command(buf) }" .. now i'm thinking that it needs to work with input like "((command1 || command2) && command3) && command4; command5". i'm guessing my best choice is to split(';'), regex replace the commands with "run_command('${command}')" and eval the whole thing
<adaedra> are you trying to write a shell?
<kke> yes
<kke> kind of
Lord_of_Life has joined #ruby
<adaedra> I suggest you write a real parser for your commands then
<adaedra> eval()ing user-provided data is not a good idea
<kke> that's what i'm thinking too
<adaedra> and regexp'ing what you wrote above looks like a nightmare
t-recx has joined #ruby
<kke> but if i escape it, i don't see how you could "break out"
<kke> yes it does
<darix> kke: you will find a lot of fun with different quoting things and such
stoffus has quit [Quit: leaving]
<TomyWork> darix yes my plan was to use inotify. but you know what, i figured out that what i want to implement is essentially already done by the FS in the mtime field :)
nowhere_man has joined #ruby
<kke> i think i only need to escape any single quotes
<kke> the run_command thing itself doesn't do anything dangerous
<kke> so as long as the user input remains inside that, it should be safe
ldnunes has joined #ruby
xall has quit [Ping timeout: 240 seconds]
<darix> kke: if you call your commands via a shell
<darix> then i can have fun with $() or `` or \
Pumukel has joined #ruby
JeanCarloMachado has joined #ruby
<kke> my commands are internal to the app and don't shell out
uncertainty has quit [Ping timeout: 268 seconds]
kevinfagan has quit [Quit: Textual IRC Client: www.textualapp.com]
<kke> it splits the input by whitespace, finds a command using first word, and does command.new(args).run
Burgestrand has quit [Quit: Closing time!]
SimpleIRC_VLBcT has joined #ruby
<TomyWork> kke you may not shell out, but if you eval my user input, i will shell out for you :)
harfangk has quit [Quit: Textual IRC Client: www.textualapp.com]
Deviation has quit [Ping timeout: 264 seconds]
raspado has joined #ruby
mim1k has quit [Ping timeout: 258 seconds]
<kke> maybe, but i'm curious to see how
<kke> > x = "hello"; x.gsub!(/['\\]/) { |match| "\\#{match}" }; eval("puts '#{x}'")
<kke> >> x = "hello"; x.gsub!(/['\\]/) { |match| "\\#{match}" }; eval("puts '#{x}'")
<kke> hmph
mim1k has joined #ruby
<kke> anyways, can you escape the puts?
raspado has quit [Ping timeout: 260 seconds]
Rodya_ has joined #ruby
<kke> >> %w(1 2 3).join("..")
<kke> ruby[bot]: why you no work
<kke> >> p %w(1 2 3).join("..")
<matthewd> If you're just turning it into a static string, what's the point of the eval?
Pumukel has quit [Remote host closed the connection]
Pumukel has joined #ruby
Pumukel has quit [Remote host closed the connection]
jusa has quit [Ping timeout: 260 seconds]
Pumukel has joined #ruby
Rodya_ has quit [Ping timeout: 246 seconds]
Pumukel has quit [Ping timeout: 240 seconds]
<kke> thinking about turning something like "(foo || bar) && baz" into eval("(perform('foo') || perform('bar')) && perform('baz')")
mim1k has quit [Ping timeout: 240 seconds]
<kke> unless you can come up with a way to break out of the '..'
esObe_ has quit [Ping timeout: 240 seconds]
esObe_ has joined #ruby
Pumukel has joined #ruby
patarr has joined #ruby
vondruch has quit [Quit: vondruch]
loechel has joined #ruby
Pumukel has quit [Remote host closed the connection]
loechel has quit [Remote host closed the connection]
Pumukel has joined #ruby
charliesome has joined #ruby
vondruch has joined #ruby
patarr has quit [Ping timeout: 240 seconds]
charliesome has quit [Ping timeout: 256 seconds]
vuoto has joined #ruby
charliesome has joined #ruby
<ikopico> Hey peep-chaps, can someone suggest which is preffered, $stderr/STDERR ($stdout/STDOUT)?
<kke> ikopico: $
<Verity> allisio, I don't see the issue with line 84 unless you just mean the fact thats its rather poor checking of proper usage
<ikopico> Thanks kke, can you please explain why?
<Verity> as in, I only check if the proper # of args have been entered, but nothing beyond that
<Verity> matthewd, are you suggesting that I rewrite that function such that it takes two variables
<kke> ikopico: $ you can change. for example in tests or something you might want to do something like output = StringIO.new; $stdout = output; run_command(); $stdout.rewind; expect($stdout.read).to match(/foofoo/)
<Verity> one the packet list to return, and another to either build a data packet or final eot packet
<ytti> $stderr/STDERR is tricky one
<ikopico> Awesome kke, thanks a lot.
<ytti> on principle i hate all global variables
<matthewd> ikopico: Kernel#puts, #warn, etc use $stdout/$stderr
<Verity> then I just run my eot sent test using global var and call the func with true or false for 2nd arg
<ytti> but then again, you can change $stderr
<Verity> but that doesnts eem much better, maybe if it were inside a class and had state
<ytti> but i'm s till gonna go with STDERR and STDOUT
<ytti> i don't think ruby code should have single global variable in them
<Verity> and finally, adam12 could you give me a couple tips about how I might structure such a class? I'm not quite sure how to tell when I need a class, and how to structure and use one when i do
<ikopico> ytti: yes, but you can say also that having STDERR as const it's unnatural
<matthewd> Verity: I think you want a function that takes a <= 5 character string and returns a built packet
<ikopico> matthewd: thanks
<matthewd> Verity: You're doing that twice at the moment.
<canton7> ytti, the normal approach (irrc) is to use the globals, since you can e.g. fiddle them for testing, and the constants are to be used as "backups" to reset the globals
<kke> $stderr and $stdout are going to point to STDERR and STDOUT unless something deliberately wants to redirect ouput.
<kke> in that case, i suppose it's annoying that your thing didn't respect $stdout/err but insisted on using the real STDOUT/ERR
<ytti> i disagree
<ytti> if i want code where i intend err/out to be changable
<ytti> i'll create my own outputter, which can be instansiated with arbitrary outputs
arquebus has joined #ruby
CloCkWeRX has joined #ruby
<ytti> if i strictly mean STDOUT/STDERR, i'll use those
<ytti> $stderr, $stdout are ambiguous
<ytti> does the developer mean strictly those
<ytti> or just use them as well known, pre-assigned variables?
<ikopico> ytti: I think that it's more of changable for testing, not for usage
<ytti> but of course this is higly opinionated stuff
<matthewd> ytti: How are the constants truly different from the globals for that? Someone could equally change those.
<ytti> yes
<ytti> it's just style issue, no one expects STDOUT/STDERR to be changed
<ytti> the code communicates by haivng those 'these are static'
<ytti> which may or may not be true
<ytti> but that is the implicit promise
cgibsonmm has joined #ruby
<kke> do you expect $stdout/$stderr to contain something that is not intentional?
synthroid has joined #ruby
<kke> since the kernel methods use those too, if you're messing with $stdout/err you will break kernel stuff too.
noem has joined #ruby
tolerablyjake has quit [Ping timeout: 246 seconds]
<ytti> i don't know what developer means when they use those
<ytti> did they choose them, because they fully intend to change them
<ytti> or did they choose then, but fully intend to use them verbatim
vifino- is now known as vifino
zapata has quit [Ping timeout: 258 seconds]
x0f has quit [Ping timeout: 240 seconds]
noem has quit [Quit: noem]
jrafanie has joined #ruby
vuoto has quit [Remote host closed the connection]
x0f has joined #ruby
<ikopico> Can we settle on IO.new(1)/IO.new(2)? :)
knight33 has joined #ruby
cow[baby] has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
last_staff has quit [Quit: last_staff]
zapata has joined #ruby
cats has quit [Quit: BURN HIS HOUSE DOWN]
cats has joined #ruby
CloCkWeRX has quit [Quit: Leaving.]
SimpleIRC_VLBcT has quit [Remote host closed the connection]
CloCkWeRX has joined #ruby
boz_ has joined #ruby
mim1k has joined #ruby
patarr has joined #ruby
aupadhye has joined #ruby
patarr has quit [Ping timeout: 260 seconds]
<Verity> I'll think this over
<Verity> I think the most important suggestion of all is that its likely time for a class
<Verity> migrating to that without breaking my program will be the key
<Verity> I've never designed or used my own classes, only others
<Verity> well, once or twice a while back in C++
<Verity> I did make a linked list class
<Verity> so I want to create a class that represents a serial connection? and contains the packet array and functions that operate on it?
<Verity> and the constructor will open the serial port
<Verity> and take the com port as arg
<canton7> constructors shouldn't normally do things that make take a long time or randomly fail
<canton7> you'd normally see an 'open' method to open the port
<Verity> hmm, ok. Lots to consider here
s2013 has joined #ruby
jrafanie has joined #ruby
boz_ has quit []
jrafanie has quit [Client Quit]
bmurt has joined #ruby
gnufied has joined #ruby
yurikoles has joined #ruby
vali has quit [Quit: vali]
banisterfiend has joined #ruby
aupadhye has quit [Remote host closed the connection]
jrafanie has joined #ruby
aupadhye has joined #ruby
s2013 has quit [Read error: No route to host]
harfangk has joined #ruby
Deviation has joined #ruby
jrafanie has quit [Client Quit]
<Verity> I also need to consider that this will be changed to TCP from serial later
<Verity> it would be nice if through classes that was an easy switch (thats one of the main points of the lab)
millerti has quit [Read error: Connection reset by peer]
millerti has joined #ruby
uncertainty has joined #ruby
renchan has quit [Quit: Leaving...]
flying has quit []
<Verity> so in C++//C# we would have made a base class port with abstract methods and then derived two new classes from it, serialport and tcpport class
<Verity> then I would set them up so they take the same args, connection string to determine type of conn. then methods the same like read and write
<Verity> but in ruby, I read you wouldn't do it the same way
s2013 has joined #ruby
Deviation has quit [Ping timeout: 240 seconds]
<Verity> the goal being a universal interface between the two classes
<Verity> so they are interchangeable
<Verity> at least this is my understanding of it all
<Verity> I'm going to work on ASM lab for a while, back later hopefully someone has some advice for me
enterprisey has joined #ruby
fuzzyhorns has joined #ruby
aupadhye is now known as aupadhye|brb
sepp2k has joined #ruby
enterprisey has quit [Remote host closed the connection]
__Yiota has joined #ruby
jameser has joined #ruby
millerti has quit [Quit: Textual IRC Client: www.textualapp.com]
grh has quit [Ping timeout: 264 seconds]
arquebus has quit [Quit: Leaving]
aupadhye|brb is now known as aupadhye
Snickers has quit [Quit: Snickers]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
spicerack has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
spicerack has joined #ruby
andikr has quit [Remote host closed the connection]
planigan has quit [Ping timeout: 258 seconds]
<manveru> Verity: there's no reason why you wouldn't do it the same in ruby
Rodya_ has joined #ruby
<manveru> for example see the IO family...
planigan has joined #ruby
Rodya_ has quit [Remote host closed the connection]
Rodya_ has joined #ruby
mim1k has quit [Ping timeout: 256 seconds]
hxegon_afk is now known as hxegon
dhollin3 is now known as dhollinger
cgibsonmm has quit [Ping timeout: 246 seconds]
Bish has joined #ruby
<Bish> im writing the best ruby app there ever is / will be
<Bish> how does it log?
borodin has joined #ruby
dionysus69 has quit [Ping timeout: 246 seconds]
jaruga has quit [Read error: Connection reset by peer]
jaruga has joined #ruby
cgibsonmm has joined #ruby
<manveru> Bish: you could try to use Logger
<Bish> well, okay, i will be more specific
flying has joined #ruby
<Bish> im writing an application, running in docker, on many machines, many instances
<Bish> which has no logging as of yet
<Bish> i was about to send myself udp packets and store them somewhere, to which i thought
<Bish> "i should do this correctly"
<Bish> ah, and i use a lot of aws
<manveru> yeah...
<Bish> so.. what can i do there.. i want it to be centralized somehow
arthurl has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
x0f has quit [Ping timeout: 260 seconds]
<manveru> there are services for that, like papertrailapp
x0f has joined #ruby
<manveru> i used logentries.com in the past as well
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Bish> hm, is there something i don't need to pay money for ;;
<manveru> fluentd
patarr has joined #ruby
<Bish> what do i actually log, i don't have experience in that
<manveru> there are probably a few hundred results if you google for "docker log aggregation" :)
<Bish> erorrs only, all data between client<=>server
bmurt has joined #ruby
<Bish> manveru: exactly, should i print to stdout and collect them in docker
charliesome has quit [Read error: Connection reset by peer]
<Bish> should i send packets somewhere!?
<Bish> is there a gem!?
<Bish> why is this shit so hard
enterprisey has joined #ruby
<manveru> well, try https://www.fluentd.org/ then
ferr1 has quit [Quit: WeeChat 1.7]
<manveru> i'd just log everything... until you run out of space, then you can become more selective using filters in fluentd
<Bish> my servers speaks fluent'd
<Bish> eh.ehhe..
Rodya_ has quit [Remote host closed the connection]
<Bish> sigh that looks like something that will eat my time
cgibsonmm has quit [Remote host closed the connection]
<manveru> you could also try remote syslog... but that might be a bit more complex
<Bish> manveru: well i already did that.. a docker container i used did that by default
<manveru> oh look, there's awslogs driver
<Bish> sending udp packets to another docker.. which then wrote them to a file
<Bish> AWSLOGS
<Bish> WHATS THAT
<manveru> no idea, but it sounds like logs for aws
<Bish> THAT SOUNDS LIKE NO WORK
<Bish> AWS CloudWatch logs for Humans™
<Bish> haha, that fitting name
<Bish> so workflow would be: print to stdout, let amazon log everything, until the bill gets too high
<manveru> "AWS Free Tier includes 10 Metrics, 10 Alarms, and 1,000,000 API requests with Amazon CloudWatch."
ResidentBiscuit has joined #ruby
<manveru> should be enough to get started and locked in a bit more to AWS ;)
<Bish> well, would i be able to select a type of log that way?
<Bish> my logs would be tied to the docker container.. which could throw all sorts of errors
<Bish> i imagine logging to be like [auth] user tried to login
<Bish> [hw] my core is at 10%
<Bish> i dunno
<manveru> yeah
<manveru> usually you can filter those lines
<Bish> ah.. so i do the filtering on the lines
<Bish> yeah that'd be clever.
<manveru> then set alerts for things like "Segfault"
<Bish> okay cool thanks alot manveru
<Bish> ruby doesn't segfault right
<manveru> right...
Rodya_ has joined #ruby
<manveru> never
<manveru> ever
<Bish> it's like macbooks
<Bish> they dont break
<manveru> exactly :D
<Bish> how do you know im sarcastic :D i've heard people saying that
<manveru> well, i've seen enough broken ones
<manveru> the case though, that probably won't break
<Bish> when i was studying it, there was a tv channel visiting my uni (where i worked)
<Bish> and a guy, that had windows on his macbook
<Bish> the cameraman asked him "why do you have windows on your macbook"
ResidentBiscuit has quit [Client Quit]
<Bish> $itdude "my macbook just reset itself, due to a hardware issue, yadda yadda, not using osx since then"
Guest18348 is now known as rprimus
<Bish> cameraman "no, thats your fault, you must've done something wrong, macbooks dont break"
<manveru> lol
<Bish> he said to the guy, nearly finished with his phd in cs
<manveru> well, about ruby, it'll of course segfault sometimes, especially if you use gems with C extensions
tau has joined #ruby
tvw has quit [Read error: Connection reset by peer]
tvw has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
flying has quit []
mim1k has joined #ruby
GreySunshine has left #ruby [#ruby]
<Bish> i think i saw one segfault in ruby
<Bish> and many in rubinius
haylon_ has joined #ruby
cfec0b8d has quit [Ping timeout: 240 seconds]
mim1k has quit [Ping timeout: 260 seconds]
mim1k has joined #ruby
jrafanie has joined #ruby
armando has quit [Remote host closed the connection]
LuckyABA has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
DLSteve has joined #ruby
enterprisey has quit [Remote host closed the connection]
aganov has quit [Remote host closed the connection]
armando has joined #ruby
JeanCarloMachado has quit [Quit: Lost terminal]
itsdaflash has joined #ruby
Mon_Ouie has joined #ruby
davorb has quit [Read error: Connection reset by peer]
davorb has joined #ruby
nadir has quit [Quit: Connection closed for inactivity]
haylon_ has quit [Quit: Leaving]
benlieb has joined #ruby
jeanlinux has joined #ruby
Lord_of_Life has quit [Excess Flood]
xall has joined #ruby
enterprisey has joined #ruby
<itsdaflash> Hi, I was curious if anyone may be able to offer some insight. I am trying to complete two things. I'd like to search an array called rmq_federation_nodes which contains the following elements ["rabbitmq1.devops.local", "rabbitmq2.devops.local", "rabbitmq3.devops.local"] and grab out an element matching the first part of the regex pattern (as the environment in this case devops could change).
<itsdaflash> nodeC = rmq_federation_nodes.select {|a| a.match(/^rabbitmq3/)}
<itsdaflash> nodeB = rmq_federation_nodes.select {|a| a.match(/^rabbitmq2/)}
<itsdaflash> nodeA = rmq_federation_nodes.select {|a| a.match(/^rabbitmq1/)}
<itsdaflash> Example, the element matching rabbit1, I assign to a variable rabbit1, and rabbit2, to variable rabbit2...etc. Second, id like to pull out the element matching that same regex pattern and convert it to a string and assign to a separate variable. I completed the below:
<itsdaflash> puts nodeB
<itsdaflash> puts nodeA
<itsdaflash> puts nodeC
<itsdaflash> rabbitmq1.arxdevops.local
<itsdaflash> rabbitmq2.arxdevops.local
<itsdaflash> rabbitmq3.arxdevops.local
<itsdaflash> The above gives me the string, from what I can tell, but is there a way to get select the actual element also?
jgnagy has joined #ruby
Lord_of_Life has joined #ruby
renchan has joined #ruby
<Mon_Ouie> What do you mean by "the actual element"?
<Bish> i think he wants the match, too, maybe?
renchan has quit [Remote host closed the connection]
<Mon_Ouie> Also, please use gist when pasting three lines of code or more
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
renchan has joined #ruby
<itsdaflash> Sorry, by element I just mean that I would like to obtain ["rabbitmq1.arxdevops.local"] if it matches rabbitmq1*
<Mon_Ouie> That's what select is returning here
<Bish> but you get the elements that match in an array
<itsdaflash> ideally, i'd like one to remain a single element array and the other a string
<Bish> well, it's not given that only one string matches your rule, and all of those are strings
<Mon_Ouie> >> ["rabbitmq1.stuf", "rabbitmq2.stuff"].select { |x| x.match(/^rabbitmq1/) }
<Bish> so what do you mean by saying element
<ruby[bot]> Mon_Ouie: # => ["rabbitmq1.stuf"] (https://eval.in/765570)
<Bish> >> ["there","is","find","also"].find { |x| x =~ /^a/ }
jgnagy has quit [Ping timeout: 256 seconds]
<Bish> >> ["there","is","find","also"].find { |x| x =~ /^a/ }
<ruby[bot]> Bish: # => "also" (https://eval.in/765572)
LuckyABA has joined #ruby
fmartingr has quit [Quit: Connection closed for inactivity]
<Bish> but find is actually returning the first it finds, it doesn't make sure there is only one
<itsdaflash> sorry, maybe I am confusing element. I just mean i'd like to search the array and find a match for rabbit1*, if it matches then id like to store that attribute. I'd then also like to complete the same search but strip the [" "] part and store as a string
grh has joined #ruby
<Bish> store? where, what is an attribute :D
jusa has joined #ruby
<Bish> and what [" "] part
<itsdaflash> My array being rmq_federation_nodes = ["rabbitmq1.arxdevops.local", "rabbitmq2.arxdevops.local", "rabbitmq3.arxdevops.local"]. Pull out this from the array ["rabbitmq1.arxdevops.local"] based on a regex match and store as a single element array, then also search the same array and store as rabbitmq1.arxdevops.local
s2013 has joined #ruby
<Bish> >My array being rmq_federation_nodes = ["rabbitmq1.arxdevops.local", "rabbitmq2.arxdevops.local", "rabbitmq3.arxdevops.local"]. Pull out this from
<Bish> the array ["rabbitmq1.arxdevops.local"] based on a regex match and store as a single element array
<Bish> thats what your code does already
<Bish> the second part of that question i still dont get
<Bish> store as "rabbitmq1.arxdevops.local"
polishdub has joined #ruby
<Mon_Ouie> You can just use #first to get the first/only element of the array
<itsdaflash> Yeah, I was pulling it out as rmq_federation_nodes[0], but in chef sometimes not all the nodes will registered, so I was having an issue where the position could change, even with a sort
<itsdaflash> So, I was recoding it to instead search the array for the fqdn
jrafanie has joined #ruby
<itsdaflash> and assign that as a variable for later use in my recipe. Problem is, my recipe needs that fqdn as an actual attribute in one section to determine what to actually apply and in another it requires it as a string
jrafanie has quit [Client Quit]
antgel has joined #ruby
grillon has joined #ruby
jrafanie has joined #ruby
gdonald has quit [Read error: Connection reset by peer]
gdonald has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
enterprisey has quit [Remote host closed the connection]
vcavallo has quit [Quit: leaving]
vcavallo has joined #ruby
Snickers has joined #ruby
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
DLSteve has joined #ruby
aufi has quit [Quit: Leaving]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ResidentBiscuit has joined #ruby
Lord_of_Life has quit [Excess Flood]
enterprisey has joined #ruby
Deviation has joined #ruby
jrafanie has joined #ruby
Lord_of_Life has joined #ruby
jrafanie has quit [Client Quit]
loveablelobster has joined #ruby
[Butch] has joined #ruby
bmurt has joined #ruby
loveablelobster has quit [Client Quit]
rakm has joined #ruby
ozcanesen has joined #ruby
Pumukel has quit []
Deviation has quit [Ping timeout: 268 seconds]
djbkd has joined #ruby
conta has quit [Ping timeout: 240 seconds]
grh has quit [Ping timeout: 246 seconds]
vuoto has joined #ruby
synbit has joined #ruby
vuoto has quit [Client Quit]
vuoto has joined #ruby
destructure has quit [Changing host]
destructure has joined #ruby
username_ has joined #ruby
igeaod has joined #ruby
djbkd has quit [Ping timeout: 268 seconds]
igeaod has quit [Remote host closed the connection]
synbit has quit [Client Quit]
visudo has joined #ruby
visudo has quit [Client Quit]
cgibsonmm has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
amclain has joined #ruby
yehowyada has quit [Quit: Textual IRC Client: www.textualapp.com]
enterprisey has quit [Ping timeout: 246 seconds]
<adam12> Anybody have a preferred option parser outside of `OptionParser` in stdlib? Something that can change the options depending on ARGV[0] (or equiv)
nadir has joined #ruby
<adam12> (git style subcommands)
hxegon is now known as hxegon_afk
raspado has joined #ruby
grh has joined #ruby
<manveru> adam12: i think people usually use thor for that
cgibsonm_ has joined #ruby
<adam12> You might be right - I don't care for Thor tho. I just want to parse ARGV. I think Thor wants me to structure commands a lot differently.
<adam12> Maybe trollop?
mikecmpbll has quit [Quit: inabit. zz.]
skweek has joined #ruby
armyriad has quit [Ping timeout: 240 seconds]
<adam12> or commander? Lots of options I guess.
armyriad has joined #ruby
raspado has quit [Ping timeout: 246 seconds]
cgibsonmm has quit [Ping timeout: 246 seconds]
rwb has joined #ruby
bmurt has joined #ruby
cgibsonm_ has quit [Remote host closed the connection]
enterprisey has joined #ruby
<havenwood> adam12: Slop for simple options. Thor for more complex, git-like options.
aryaching has joined #ruby
marcdel has joined #ruby
Yzguy has joined #ruby
<adam12> I'll re-look at Thor - thanks for feedback.
xall has quit [Ping timeout: 260 seconds]
mim1k has quit [Ping timeout: 256 seconds]
millerti has joined #ruby
millerti has quit [Client Quit]
gusrub has joined #ruby
xall has joined #ruby
cgibsonmm has joined #ruby
nitric has joined #ruby
jusa has quit [Ping timeout: 260 seconds]
mustmodify has joined #ruby
millerti has joined #ruby
<mustmodify> ARRRGGHHHH
muelleme_ has joined #ruby
cow[baby] has quit [Quit: cow[baby]]
<mustmodify> What method on hash gives you a hash with just the named keys? {a: 1, b: 2, c: 3}.some(:a, :b) => {a: 1, b: 2}
rakm has quit [Quit: Textual IRC Client: www.textualapp.com]
<mustmodify> slice.
<mustmodify> duh.
A124 has joined #ruby
weualo has quit [Ping timeout: 258 seconds]
swills has quit [Ping timeout: 240 seconds]
synthroid has quit [Remote host closed the connection]
d^sh has quit [Ping timeout: 246 seconds]
d^sh has joined #ruby
A124 has quit [Quit: '']
millerti has quit [Quit: Textual IRC Client: www.textualapp.com]
vuoto has quit [Quit: Lost terminal]
millerti has joined #ruby
s2013 has joined #ruby
thistle has joined #ruby
bigkevmcd has quit [Quit: Outta here...]
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
jgnagy has joined #ruby
Asher1 has joined #ruby
A124 has joined #ruby
Asher has quit [Ping timeout: 240 seconds]
swills has joined #ruby
Asher1 has quit [Client Quit]
Asher has joined #ruby
Asher is now known as Guest83319
raspado has joined #ruby
Guest83319 has quit [Client Quit]
x0f has quit [Ping timeout: 256 seconds]
shinnya has joined #ruby
benlieb has quit [Quit: benlieb]
x0f has joined #ruby
rippa has joined #ruby
chouhoulis has quit [Remote host closed the connection]
enterprisey has quit [Remote host closed the connection]
jenrzzz has joined #ruby
montanonic has joined #ruby
houhoulis has joined #ruby
ruby-lang508 has joined #ruby
nowhere_man has quit [Ping timeout: 240 seconds]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ruby-lang508 has quit [Client Quit]
jrafanie has joined #ruby
boombox_ has joined #ruby
pwnd_nsfw has joined #ruby
pwnd_nsfw` has quit [Ping timeout: 240 seconds]
Beams has quit [Quit: .]
jrafanie has quit [Client Quit]
raspado has quit [Quit: Leaving...]
benlieb has joined #ruby
jrafanie has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
gusrub has quit [Remote host closed the connection]
thistle has quit [Remote host closed the connection]
gusrub has joined #ruby
boombox_ has quit [Remote host closed the connection]
jaruga has quit [Quit: jaruga]
Fernando-Basso has joined #ruby
coredump has quit [Ping timeout: 240 seconds]
azwieg103 has quit [Remote host closed the connection]
azwieg103 has joined #ruby
tvw has quit [Remote host closed the connection]
jeanlinux has quit [Remote host closed the connection]
gusrub has quit [Ping timeout: 256 seconds]
Vile` has joined #ruby
cow[baby] has joined #ruby
djbkd has joined #ruby
nowhere_man has joined #ruby
TomyWork has quit [Remote host closed the connection]
ltem has joined #ruby
ltem has quit [Client Quit]
antgel has quit [Ping timeout: 260 seconds]
ltem has joined #ruby
jud^ is now known as jud
jud has quit [Changing host]
jud has joined #ruby
nowhere_man has quit [Remote host closed the connection]
ltem has quit [Client Quit]
ltem has joined #ruby
nowhere_man has joined #ruby
rakm has joined #ruby
rakm_ has joined #ruby
rakm has quit [Ping timeout: 240 seconds]
shinnya has quit [Ping timeout: 246 seconds]
nowhere_man has quit [Remote host closed the connection]
nowhere_man has joined #ruby
Rodya_ has quit [Remote host closed the connection]
marr has quit [Ping timeout: 246 seconds]
A124 has quit [Quit: '']
grh has quit [Ping timeout: 240 seconds]
whathappens has joined #ruby
Bock has quit [Read error: Connection reset by peer]
Vile` has quit [Ping timeout: 240 seconds]
Fernando-Basso has quit [Quit: WeeChat 1.7]
nowhere_man has quit [Remote host closed the connection]
A124 has joined #ruby
rakm_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Vile` has joined #ruby
cgibsonmm has quit []
tpendragon has quit [Remote host closed the connection]
Guest36413 has quit [Remote host closed the connection]
s2013 has joined #ruby
_sfiguser has joined #ruby
Fernando-Basso has joined #ruby
lxsameer has quit [Quit: WeeChat 1.5]
synthroid has joined #ruby
Deviation has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Asher has joined #ruby
dionysus69 has joined #ruby
Deviation has quit [Ping timeout: 258 seconds]
duderonomy has joined #ruby
duderonomy is now known as Guest34625
jrafanie has joined #ruby
kirun has joined #ruby
Vile` has quit [Ping timeout: 240 seconds]
djbkd has quit [Quit: My people need me...]
enterprisey has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gusrub has joined #ruby
gheegh has quit [Quit: Textual IRC Client: www.textualapp.com]
Guest34625 has quit [Quit: Textual IRC Client: www.textualapp.com]
rgtk has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
thistle has joined #ruby
duderono_ has joined #ruby
gusrub has quit [Remote host closed the connection]
workmad3 has quit [Ping timeout: 240 seconds]
gdonald has quit [Read error: Connection reset by peer]
gdonald has joined #ruby
gusrub has joined #ruby
rgtk has quit [Ping timeout: 260 seconds]
thistle has quit [Ping timeout: 240 seconds]
MittelDank has joined #ruby
montanonic has quit [Quit: Ex-Chat]
Vile` has joined #ruby
t-recx has quit [Quit: t-recx]
TomyLobo2 has joined #ruby
jrafanie has joined #ruby
jrafanie has quit [Client Quit]
xall has quit [Ping timeout: 240 seconds]
pupsicle has quit [Remote host closed the connection]
Mon_Ouie has quit [Quit: WeeChat 1.7]
ericx2x has joined #ruby
kirun has quit [Quit: Konversation terminated!]
Violentr has joined #ruby
cfec0b8d has joined #ruby
ineb has quit [Ping timeout: 268 seconds]
AndBobsYourUncle has joined #ruby
SeepingN has joined #ruby
Violentr has quit [Quit: jIRCii - http://www.oldschoolirc.com]
gusrub has quit [Read error: No route to host]
gusrub has joined #ruby
Vile` has quit [Ping timeout: 240 seconds]
jusa has joined #ruby
pabelanger has joined #ruby
pabelanger has left #ruby ["WeeChat 1.6"]
gusrub has quit [Remote host closed the connection]
jrafanie has joined #ruby
giraffe has joined #ruby
statelesscode has quit [Ping timeout: 264 seconds]
hxegon_afk is now known as hxegon
tpendragon has joined #ruby
yurikoles has quit [Read error: Connection reset by peer]
jrafanie has quit [Client Quit]
yurikoles has joined #ruby
jrafanie has joined #ruby
spicerack has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
s2013 has quit [Read error: No route to host]
Guest96 has quit [Remote host closed the connection]
jrafanie has quit [Client Quit]
Yzguy has quit [Quit: Zzz...]
gusrub has joined #ruby
Guest96 has joined #ruby
x0f has quit [Ping timeout: 246 seconds]
x0f has joined #ruby
jrafanie has joined #ruby
migge has joined #ruby
mikecmpbll has joined #ruby
gusrub has quit [Ping timeout: 256 seconds]
marr has joined #ruby
xall has joined #ruby
yurikoles has quit [Read error: Connection reset by peer]
gusrub has joined #ruby
gusrub has quit [Remote host closed the connection]
gusrub has joined #ruby
yurikoles has joined #ruby
yurikoles has quit [Remote host closed the connection]
grillon has quit [Quit: Connection closed for inactivity]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
davorb has quit [Remote host closed the connection]
Rodya_ has joined #ruby
binaryplease has joined #ruby
ineb has joined #ruby
sepp2k has quit [Quit: Leaving.]
coredump has joined #ruby
thistle has joined #ruby
jusa has quit [Ping timeout: 246 seconds]
jackjackdripper has joined #ruby
thistle has quit [Ping timeout: 260 seconds]
grillon has joined #ruby
binaryplease has quit [Ping timeout: 260 seconds]
enterprisey has quit [Quit: Leaving]
xall has quit [Ping timeout: 240 seconds]
jrafanie has joined #ruby
muelleme_ has quit [Ping timeout: 258 seconds]
xall has joined #ruby
chichou has joined #ruby
banandana has quit [Quit: WeeChat 1.7-dev]
username_ has quit [Ping timeout: 260 seconds]
hahuang61 has quit [Ping timeout: 256 seconds]
Tharbakim has quit [Quit: Something has gone terribly wrong. Send help.]
binaryplease has joined #ruby
Tharbakim has joined #ruby
Tharbakim has joined #ruby
Tharbakim has quit [Changing host]
houhoulis has quit [Remote host closed the connection]
d5sx43 has joined #ruby
banisterfiend has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
AndBobsYourUncle has quit [Ping timeout: 240 seconds]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
d5sx43 has quit [Quit: Leaving...]
ozcanesen has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
yqt has joined #ruby
cow[baby] has quit [Quit: cow[baby]]
ozcanesen has joined #ruby
Deviation has joined #ruby
DTZUZO has quit [Ping timeout: 260 seconds]
DTZUZO has joined #ruby
Deviation has quit [Ping timeout: 240 seconds]
xall has quit [Ping timeout: 240 seconds]
Fernando-Basso has quit [Quit: WeeChat 1.7]
chichou has quit [Ping timeout: 240 seconds]
username_ has joined #ruby
Arpanet69 has quit [Ping timeout: 260 seconds]
synthroid has quit []
ResidentBiscuit has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
chichou has joined #ruby
binaryplease has quit [Quit: binaryplease]
chichou has quit [Ping timeout: 268 seconds]
Synthead has quit [Remote host closed the connection]
futilegames has joined #ruby
Guest96_ has joined #ruby
thistle has joined #ruby
futilegames has left #ruby [#ruby]
kirun has joined #ruby
rakm has joined #ruby
Guest96 has quit [Ping timeout: 246 seconds]
spicerack has joined #ruby
thistle has quit [Ping timeout: 240 seconds]
cava has joined #ruby
Yzguy has joined #ruby
hahuang61 has joined #ruby
rwb has quit [Ping timeout: 264 seconds]
chichou has joined #ruby
govg has quit [Ping timeout: 240 seconds]
renchan has quit [Quit: Leaving...]
tolerablyjake has joined #ruby
chichou has quit [Ping timeout: 240 seconds]
govg has joined #ruby
Yzguy has quit [Quit: Zzz...]
harfangk has quit [Quit: Textual IRC Client: www.textualapp.com]
Yzguy has joined #ruby
pupsicle has joined #ruby
cava has quit [Quit: Ex-Chat]
tdy has quit [Ping timeout: 268 seconds]
Emmanuel_Chanel has quit [Ping timeout: 268 seconds]
gdonald has quit [Read error: Connection reset by peer]
gdonald has joined #ruby
thistle has joined #ruby
<Verity> shit
<Verity> if anyone responded my scrollback doesnt go far enough
<Verity> !log
<Verity> .log
<Verity> !give verity log
Vadi has joined #ruby
<Vadi> I don't know Ruby and I'm having real difficulty with one script. Does open(url).read from 'open-uri' cache the response?
<Vadi> I'm looking at the json it is fetching vs json in chrome and ruby is getting the wrong json somehow. I have verified the URLs.
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
gloscombe_ has joined #ruby
<elomatreb> Verity: Channel log is linked in the topic
<KevinMGranger> How are you confirming that? And where does the json come from?
<elomatreb> Vadi: I don't think open-uri caches, but I don't think it will follow redirects
<KevinMGranger> Could they be changing the response based on user-agent?
benlieb has quit [Remote host closed the connection]
oliv_____ has joined #ruby
benlieb has joined #ruby
<Vadi> and I'm just looking at the total_size key and it keeps coming out wrong in Ruby
<Vadi> it will randomly change to be the right value (and that's how I confirm it's the right data) but I have not found a pattern as to when
<Vadi> At this point I am attempting to just stuff the json response as-is into ruby instead of having it download
benlieb has quit [Client Quit]
<KevinMGranger> Hmm, it comes out differently when I curl it versus in the browser. You should try setting your user-agent or simply say it's their fault and not yours :P
<Vadi> Yeah I need it for a migration script
benlieb has joined #ruby
<elomatreb> If it's like KevinMGranger describes there's little you can do about it, besides setting your useragent to something resembling a desktop browser
<elomatreb> And I don't know if open-uri supports that
yqt has quit [Ping timeout: 240 seconds]
<Verity> oh
<Verity> allisio, never replied, what is wrong with line 84 other than being a poor test of proper input args
<Vadi> I'll just a random param at the end. That seemed to work on the first try
pupsicle has quit [Remote host closed the connection]
<Vadi> Thanks
Vadi has quit [Quit: Page closed]
pupsicle has joined #ruby
[Butch] has quit [Quit: I'm out . . .]
pifon has joined #ruby
JoshS has quit [Ping timeout: 240 seconds]
<_sfiguser> guys if i want to do a text editor... and want to implement the "undo" operation... should i use the memento pattern ?
DTZUZO has quit [Ping timeout: 260 seconds]
ozcanesen has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Verity> _sfiguser, you doing code audits
jusa has joined #ruby
DTZUZO has joined #ruby
rwb has joined #ruby
JoshS has joined #ruby
JoshS has quit [Read error: Connection reset by peer]
JoshS has joined #ruby
JoshS has quit [Read error: Connection reset by peer]
jusa has quit [Ping timeout: 260 seconds]
JoshS has joined #ruby
JoshS has quit [Read error: Connection reset by peer]
zipace has joined #ruby
oliv_____ has quit [Remote host closed the connection]
oliv_____ has joined #ruby
oliv_____ has quit [Remote host closed the connection]
tvw has joined #ruby
pifon is now known as nomad101
ldnunes has quit [Quit: Leaving]
mim1k has joined #ruby
nomad101 is now known as pifon
<Papierkorb> _sfiguser: That's a complex name for a stack structure ;) but yes, that's basically what I'd do too
gusrub has quit [Remote host closed the connection]
mim1k has quit [Ping timeout: 260 seconds]
rgtk has joined #ruby
itsdaflash has left #ruby [#ruby]
aupadhye has quit [Quit: Leaving]
chichou has joined #ruby
Yzguy has quit [Quit: Zzz...]
Emmanuel_Chanel has joined #ruby
aglorei1 has quit [Ping timeout: 240 seconds]
ozcanesen has joined #ruby
chichou has quit [Ping timeout: 240 seconds]
aglorei1 has joined #ruby
Yzguy has joined #ruby
ozcanesen has quit [Ping timeout: 240 seconds]
cdg has joined #ruby
lxsameer has joined #ruby
t-recx has joined #ruby
chichou has joined #ruby
ltem has quit [Quit: Leaving]
Deviation has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pilne has joined #ruby
thistle has quit [Remote host closed the connection]
thistle has joined #ruby
thistle has quit [Remote host closed the connection]
thistle has joined #ruby
<adam12> Anybody using a service for private gems? (outside of geminabox)
houhoulis has joined #ruby
DTZUZO has quit [Ping timeout: 268 seconds]
thistle has quit [Remote host closed the connection]
Deviation has quit [Ping timeout: 260 seconds]
<Verity> I need to add a pure virtual method
fuzzyhorns has quit [Quit: Leaving.]
<adam12> def method; end
<adam12> ?
lupine has joined #ruby
sagax has quit [Ping timeout: 240 seconds]
jamesaxl has quit [Quit: WeeChat 1.6]
Xiti has joined #ruby
spicerack has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
marsjaninzmarsa has quit [Quit: ZNC 1.7.x-git-487-cbf5c38 - http://znc.in]
chichou has quit [Quit: WeeChat 1.7]
kirun has quit [Quit: Konversation terminated!]
cdg has quit [Ping timeout: 246 seconds]
MarcWeber has quit [Remote host closed the connection]
pupsicle has quit [Quit: pupsicle]
<Verity> adam12, are you saying I won't need to do anything special for the method, like define outside of class or special keywords
chouhoulis has joined #ruby
<Verity> and then I will just be able to create derived class + use normally?
<Verity> (this is all new to me, even in c++)
<adam12> I'm not sure to be honest with you. I'm not a C++ developer.
<adam12> The description said a method with no definition - that seemed close enough.
jenrzzz has quit [Read error: Connection reset by peer]
blackwind_123 has quit [Ping timeout: 260 seconds]
<elomatreb> You can still instantiate that class without a definition though, and the method will just silently return nil if called unless you put like a raise in it
chouhoulis has quit [Remote host closed the connection]
tvw has quit [Remote host closed the connection]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claw has quit [Ping timeout: 264 seconds]
blackwind_123 has joined #ruby
banisterfiend has joined #ruby
Azure has quit [Read error: Connection reset by peer]
arthurl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Azure has joined #ruby
claw has joined #ruby
jenrzzz has joined #ruby
minimalism has quit [Quit: minimalism]
hahuang61 has quit [Ping timeout: 260 seconds]
lxsameer has quit [Quit: WeeChat 1.7]
mikecmpbll has quit [Quit: inabit. zz.]
polishdub has quit [Quit: Leaving]
dionysus69 has quit [Ping timeout: 240 seconds]
Rodya_ has quit [Remote host closed the connection]
rgtk has quit [Ping timeout: 240 seconds]
Yzguy has quit [Quit: Bye]
mikecmpbll has joined #ruby
pytuger has joined #ruby
enterprisey has joined #ruby
patarr has quit [Ping timeout: 260 seconds]
FoX_77 has joined #ruby
duckpupp1 has quit [Ping timeout: 240 seconds]
djbkd has joined #ruby
rgtk has joined #ruby
djbkd has quit [Client Quit]
DTZUZO has joined #ruby
banisterfiend has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
gusrub has joined #ruby
tfitts has joined #ruby
kith has joined #ruby
Guest96_ has quit [Quit: Guest96_]
username_ has quit [Ping timeout: 260 seconds]
snappy_ has joined #ruby
<snappy_> Can anyone tell me why this method always returns the argument? Thanks! https://gist.github.com/anonymous/7d7e5f2e1290cef5b9f78f13f1ce1129
<adam12> snappy_: Ruby has an implicit return.
<adam12> >> puts "foo"
<ruby[bot]> adam12: # => foo ...check link for more (https://eval.in/765706)
Rodya_ has joined #ruby
<adam12> and puts apparently returns the value passed to it.
<adam12> Which is the value you get back :)
<Verity> yes
<Verity> read ruby in 20 minutes =)
<Verity> it cover this
enterprisey has quit [Remote host closed the connection]
<snappy_> adam12: but the variable returned ought to be different than the argument, no?
<adam12> snappy_: Oh. You are re-using `n`
<adam12> snappy_: Is that what you're getting at?
rgtk has quit [Ping timeout: 264 seconds]
<adam12> I'd stop shadowing local variables by your block variable
* Verity goes to run the code
<snappy_> adam12: Here's what the method is supposed to do: flip a coin. heads = double the amount, tails = halve it. repeat 5000 iterations and return number.
<Verity> is the problem the algorithm itself
<Verity> wait
<adam12> snappy_: Maybe just leave the argument to the times block off? 5000.times do - do you need 1..5000?
<Verity> the n outside the 5000.times
<Verity> that n is different, isnt it?
<Verity> after the 5000 times loop ends isnt n just the original amount
<Verity> due to scope
gbaptista has joined #ruby
<Verity> one n is on line 2 and 10, the other is inside the loop
<Verity> thats my theory
<Verity> let me know if I'm wrong :)
<snappy_> Ah, okay. Removing n as a block argument fixed it.
<snappy_> It's not needed.
gbaptista has quit [Client Quit]
gbaptista has joined #ruby
snappy_ has quit [Quit: Page closed]
<Verity> wow
devp__ has joined #ruby
<devp__> hi
<havenwood> devp__: hi
<devp__> anyone here
<havenwood> devp__: yes
<Verity> welcome to #ruby, devp__
<devp__> installed from ruby from source and comipiled successfully and run succesfully
cgibsonmm has joined #ruby
<devp__> then transferred comipiled coit to remote machine and but gem still pointing to ruby install of previous machine on which ruby is comipiled
<devp__> how to point gem to search ruby in new location
kristofferR has quit [Quit: Textual IRC Client: www.textualapp.com]
<devp__> giving some error like -bash /home/bs/.localpacks/bin/gem: /home/user/.localpacks/bin/ruby: bad interpreter: No such file or directory
cyphase has joined #ruby
<devp__> here you can see gem still finding ruby in /home/user, and ruby is now available in /home/bs
tercenya has quit [Remote host closed the connection]
<devp__> so how to point gem to search ruby in /hom/bs/.localpacks/bin
<havenwood> devp__: You can build a gem with --env-shebang flag and the gem binary will use `#!/usr/bin/env ruby` instead of hardcoding the route.
tercenya has joined #ruby
<devp__> not root install
houhoulis has quit [Remote host closed the connection]
<havenwood> devp__: No matter how Ruby is installed, the gem bin files need to point to the Ruby interpreter. You can use --env-shebang so that it points to the current Ruby rather than hardcoding.
<devp__> "bs" user is on vps where ruby is not comipiling due to constratint resource
kristofferR has joined #ruby
<havenwood> devp__: you can also compile Ruby to be moveable (so it doesn't care about its own relative directory)
<Verity> snapp_'s problem was not knowing how to use ruby?
grillon has quit [Quit: Connection closed for inactivity]
<SeepingN> ...whhhhhhy don't you just call the vps provider and ask them to install ruby
<SeepingN> "properly"
<Verity> isnt there a package for your distro?
<devp__> no
<devp__> i do things on my own
<devp__> clear
<Verity> time for a new distro
<havenwood> devp__: You can also use `bundle package` to package the gems in the repo yourself.
<Verity> <devp__> i do things on my own
<Verity> then why are you in here asking for help =P
<Verity> (joking)
<devp__> the ruby guys
<havenwood> devp__: or you can build the gem yourself on the server, there are many options
<devp__> gem -env-shebang gives same error
jusa has joined #ruby
<devp__> giving some error like -bash /home/bs/.localpacks/bin/gem: /home/user/.localpacks/bin/ruby: bad interpreter: No such file or directory
hahuang61 has joined #ruby
cgibsonmm has quit [Remote host closed the connection]
<devp__> just want to know gem config file location
<havenwood> devp__: Compare the output of: gem install bundler --env-shebang && head -n1 $(command -v bundle)
<havenwood> devp__: with: gem install bundler --no-env-shebang && head -n1 $(command -v bundle)
<devp__> i will manually change location there to point to new ruby location
<devp__> gem first checks for ruby installation
<devp__> since it just loking at old location, gem giving error
<havenwood> devp__: RubyGems itself? If you're moving the whole of Ruby you need a moveable build.
<devp__> same error
<devp__> ok try for yourself
<havenwood> CONFIGURE_OPTS=--enable-shared
<devp__> this is the script location
<devp__> make a new user
<devp__> then run script
rgtk has joined #ruby
<devp__> then tar cf .localpacks ruby-packs-bin.tar.gx
<havenwood> devp__: This looks like a ruby-install-esque script. You can configure with --enable-shared
<devp__> then tar cf .localpacks ruby-packs-bin.tar.gz
jusa has quit [Ping timeout: 240 seconds]
<devp__> its a script i created to install ruby from source
<Verity> you do it all yourself, I like that
<havenwood> devp__: I read the script. You still need to configure with --enable-shared if you want to move Ruby and gems with --env-shebang if you want their binaries to point at that moved Ruby.
<devp__> ok recomipling
<devp__> hang on
<devp__> enjoy
<Verity> should the hard coded urls be variables for best practices? or no
<devp__> yes
<devp__> configured on fly
<devp__> or used from .bashrc
nchambers has joined #ruby
nchambers is now known as Guest21588
username_ has joined #ruby
Guest21588 has quit [Remote host closed the connection]
mim1k has joined #ruby
kristofferR has quit [Quit: Textual IRC Client: www.textualapp.com]
FoX_77 has quit [Quit: Leaving...]
mim1k has quit [Ping timeout: 246 seconds]
username_ has quit [Quit: Lost terminal]
ddffg has quit [Quit: Leaving]
nowhere_man has joined #ruby
meshsmith has joined #ruby
kristofferR has joined #ruby
kristofferR has quit [Client Quit]
spicerack has joined #ruby
cyphase has quit [Ping timeout: 264 seconds]
jen_ has joined #ruby
kristofferR has joined #ruby
jen_ has left #ruby [#ruby]
duderono_ has quit [Quit: Textual IRC Client: www.textualapp.com]
duderonomy has joined #ruby
coffeejunk has quit [Ping timeout: 260 seconds]
marcdel has quit [Ping timeout: 268 seconds]
ovaltine has quit [Ping timeout: 264 seconds]
cyphase has joined #ruby
<devp__> @havenwood --enable-shared not working
<devp__> same error
<devp__> new error on remote "bs" machine
<devp__> ruby -v error
<devp__> ruby: error while loading shared libraries: libruby.so.2.4: cannot open shared object file: no such file or directory
<Verity> the file doesnt exist
<devp__> on compilation machine its working
<devp__> same location
<devp__> ??
<Verity> I'm not sure, thats just what that error was saying
<Verity> havenwood, is the one to talk to
ovaltine has joined #ruby
<devp__> ssh bs@70.32.24.249 -p 7822 pass: 123
<devp__> check for yourself
jackjackdripper has quit [Quit: Leaving.]
hxegon is now known as hxegon_afk
QualityAddict has joined #ruby
<SeepingN> malware deployed
<devp__> havenwood
<Verity> LOL
ovaltine has quit [Remote host closed the connection]
<Verity> libruby isnt installed or cant be found, is my guess
<Verity> what is the result of sudo find / -name libruby.so.2.4
<devp__> no sudo
<devp__> no root allowed
ecksit has joined #ruby
<devp__> that whats happening
Deviation has joined #ruby
cyphase has quit [Ping timeout: 264 seconds]
tolerablyjake has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<SeepingN> thus my suggestion
<SeepingN> when you don't have root, you can't always "do things yourself" properly
kristofferR has quit [Quit: Textual IRC Client: www.textualapp.com]
Deviation has quit [Ping timeout: 264 seconds]
biberu has quit [Read error: Connection reset by peer]
<devp__> only need to know where gem looks for its config file to search for ruby installation
cyphase has joined #ruby
<devp__> its not a Gemfile :)
cgibsonmm has joined #ruby
leitz has joined #ruby
nitric has quit [Ping timeout: 260 seconds]
Deviation has joined #ruby
<devp__> how gem search for ruby installation directory??
<devp__> its not searches .bashrc by default
<devp__> location is hardcoded in file
<devp__> which is that file and where can it be located
<devp__> compiling ruby from source as non-root
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
cgibsonmm has quit [Remote host closed the connection]
cyphase has quit [Ping timeout: 240 seconds]