<shellie_>
could you not just do a map operation over it?
<Velizar>
done
<shellie_>
Radar: you beat me to it :)
<shellie_>
and that looks nice!
<Velizar>
Radar: yes that works, sorry I forgot to mention there were other things in the hash as well
<Radar>
shellie_: not by much
Pumukel has quit [Ping timeout: 264 seconds]
<Radar>
Velizar: And what would you like to do with those other things in the hash?
<Velizar>
Radar: Keep them as is. Just like in the code.
<Velizar>
(I updated the gist again to add other_stuff)
<Radar>
Velizar: And how does the code I show you do not do that?
Pumukel has joined #ruby
<Velizar>
ah, my bad
<Velizar>
wasn't there a nicer method? I recall .dig was similar
twe4ked has joined #ruby
<Velizar>
:outer and :inner are really long names in my case
Guest77375 is now known as minsky
<matthewd>
block = -> value { case value; when Hash; value.transform_values(&block); when Array; value.map(&block); else; value.to_s; end }; hash = block.(hash)
<matthewd>
(don't actually do that)
<Velizar>
guess not then. :D
beilabs has joined #ruby
Pumukel has quit [Ping timeout: 260 seconds]
meth has quit [Quit: Bye!]
ta_ has joined #ruby
wrkrcoop has joined #ruby
beilabs has quit [Ping timeout: 264 seconds]
TPug has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hipertracker has joined #ruby
zeroDivisible has quit [Ping timeout: 240 seconds]
ta_ has quit [Ping timeout: 260 seconds]
dagelf has quit [Read error: Connection reset by peer]
sleepee has quit [Quit: Leaving]
crystal77 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dagelf has joined #ruby
zeroDivisible has joined #ruby
replay has quit []
astrobun_ has joined #ruby
wrkrcoop has quit [Quit: wrkrcoop]
dandaman has joined #ruby
Pumukel has joined #ruby
haraigoshi has joined #ruby
astrobun_ has quit [Remote host closed the connection]
harai has joined #ruby
aibot has joined #ruby
wrkrcoop has joined #ruby
cwali has joined #ruby
jazzonmym11nd has joined #ruby
MyMind has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
davedev24 has joined #ruby
JeanCarloMachado has joined #ruby
griffindy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
galeido has quit [Ping timeout: 276 seconds]
tectonic has joined #ruby
haraigoshi has quit [Ping timeout: 240 seconds]
jazzonmym1nd has quit [Ping timeout: 264 seconds]
Pumukel has quit [Ping timeout: 264 seconds]
blackmesa has joined #ruby
flashpoint9 has joined #ruby
moeabdol1 has joined #ruby
JeanCarl1Machado has joined #ruby
tvw has quit [Ping timeout: 264 seconds]
Elvin_ has joined #ruby
ruby-lang330 has joined #ruby
blackmesa has quit [Ping timeout: 265 seconds]
ta_ has joined #ruby
RedNifre has joined #ruby
beilabs has joined #ruby
RedNifre_ has quit [Ping timeout: 250 seconds]
SeepingN has quit [Disconnected by services]
SeepingN_ has joined #ruby
Spami has joined #ruby
aries_liuxueyang has quit [Ping timeout: 240 seconds]
statelesscode has quit [Quit: statelesscode]
aries_liuxueyang has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
ta_ has quit [Ping timeout: 265 seconds]
SeepingN_ has quit [Client Quit]
beilabs has quit [Ping timeout: 240 seconds]
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jazzonmym111nd has joined #ruby
jbomo has joined #ruby
jazzonmym11nd has quit [Ping timeout: 276 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
tdy has quit [Read error: Connection reset by peer]
wrkrcoop has quit [Quit: wrkrcoop]
RegulationD has joined #ruby
leea has joined #ruby
arescorpio has joined #ruby
wuyin has quit [Ping timeout: 244 seconds]
wuyin has joined #ruby
youch has joined #ruby
statelesscode has joined #ruby
Robtop__ has quit [Read error: Connection reset by peer]
youch has quit [Client Quit]
ramfjord has quit [Ping timeout: 244 seconds]
RegulationD has quit [Ping timeout: 240 seconds]
jazzonmym1nd has joined #ruby
Robtop__ has joined #ruby
LoneHermit has joined #ruby
saneax is now known as saneax-_-|AFK
statelesscode has quit [Client Quit]
jazzonmym111nd has quit [Ping timeout: 258 seconds]
MyMind has quit [Read error: Connection reset by peer]
flashpoint9 has quit [Remote host closed the connection]
wuyin has quit [Ping timeout: 265 seconds]
daffy_duck_2 is now known as polkovnik_na_bel
dandaman has quit [Read error: Connection reset by peer]
polkovnik_na_bel is now known as polkovnik
wuyin has joined #ruby
MyMind has joined #ruby
moeabdol1 has quit [Ping timeout: 250 seconds]
statelesscode has joined #ruby
flashpoint9 has joined #ruby
Pumukel has joined #ruby
crystal77 has joined #ruby
tdy has joined #ruby
jazzonmym11nd has joined #ruby
jazzonmym1nd has quit [Ping timeout: 265 seconds]
MrBusiness2 has quit [Ping timeout: 250 seconds]
wuyin has quit [Ping timeout: 240 seconds]
Pumukel has quit [Ping timeout: 260 seconds]
flashpoint9 has quit [Remote host closed the connection]
polysics has joined #ruby
wuyin has joined #ruby
rsampaio_ has quit [Ping timeout: 265 seconds]
beilabs has joined #ruby
JeanCarloMachado has quit [Ping timeout: 244 seconds]
JeanCarl1Machado has quit [Ping timeout: 240 seconds]
nitric has quit [Ping timeout: 240 seconds]
segmond has joined #ruby
Ropeney has joined #ruby
jackjackdripper has quit [Ping timeout: 244 seconds]
shinnya has quit [Ping timeout: 244 seconds]
Elvin_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
amclain has quit [Quit: Leaving]
polysics has quit [Ping timeout: 276 seconds]
Pumukel has joined #ruby
pwnd_nsfw has joined #ruby
tdy has quit [Quit: tdy]
jackjackdripper has joined #ruby
etehtsea has joined #ruby
beilabs has quit [Ping timeout: 258 seconds]
Robtop__ has quit [Ping timeout: 250 seconds]
ruby-lang330 has quit [Quit: Page closed]
Pumukel has quit [Ping timeout: 265 seconds]
Pumukel has joined #ruby
karmatr0n has quit [Ping timeout: 276 seconds]
Coldblackice has quit [Read error: Connection timed out]
tsia has joined #ruby
Coldblackice has joined #ruby
Pumukel has quit [Ping timeout: 260 seconds]
yokel has quit [Ping timeout: 265 seconds]
genpaku has quit [Ping timeout: 250 seconds]
Pumukel has joined #ruby
yokel has joined #ruby
genpaku has joined #ruby
tsia has quit [Ping timeout: 276 seconds]
craysiii has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Pumukel has quit [Ping timeout: 260 seconds]
LoneHermit has quit [Ping timeout: 244 seconds]
dandaman has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
diprotic has joined #ruby
ahuman has quit [Ping timeout: 258 seconds]
monoprotic has quit [Ping timeout: 244 seconds]
ahuman has joined #ruby
diprotic is now known as monoprotic
beilabs has joined #ruby
blackmesa has joined #ruby
arashb has joined #ruby
mikecmpbll has joined #ruby
mikecmpbll has quit [Client Quit]
flashpoint9 has joined #ruby
_Rev has joined #ruby
nando293921 has joined #ruby
beilabs has quit [Ping timeout: 276 seconds]
TPug has joined #ruby
blackmesa has quit [Ping timeout: 260 seconds]
karmatr0n has joined #ruby
ahuman has quit [Ping timeout: 244 seconds]
hipertracker has quit [Quit: hipertracker]
arashb has quit [Ping timeout: 252 seconds]
jackjackdripper has quit [Quit: Leaving.]
tdy has joined #ruby
Pumukel has joined #ruby
TPug has quit [Read error: Connection reset by peer]
griffindy has joined #ruby
saneax-_-|AFK is now known as saneax
ahuman has joined #ruby
heelpmeplz has quit [Ping timeout: 258 seconds]
hahuang61 has joined #ruby
MrBusiness2 has joined #ruby
heelpmeplz has joined #ruby
Pumukel has quit [Ping timeout: 244 seconds]
jackjackdripper has joined #ruby
Pumukel has joined #ruby
hahuang61 has quit [Ping timeout: 250 seconds]
MrBusiness3 has joined #ruby
jazzonmym111nd has joined #ruby
jazzonmym11nd has quit [Ping timeout: 250 seconds]
TheHodge has quit [Quit: Connection closed for inactivity]
tmtwd has joined #ruby
astrobun_ has joined #ruby
Azure has quit [Ping timeout: 240 seconds]
MrBusiness2 has quit [Ping timeout: 250 seconds]
ahuman has quit [Ping timeout: 265 seconds]
Pumukel has quit [Ping timeout: 260 seconds]
raatiniemi has joined #ruby
crystal77 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jenrzzz has quit [Ping timeout: 244 seconds]
Coldblackice has quit [Ping timeout: 276 seconds]
_Rev has quit []
ahuman has joined #ruby
c355e3b has quit [Quit: Connection closed for inactivity]
BTRE has quit [Ping timeout: 244 seconds]
flashpoint9 has quit [Remote host closed the connection]
Torrieri has joined #ruby
Torrieri has quit [Changing host]
Torrieri has joined #ruby
beilabs has joined #ruby
Pumukel has joined #ruby
pwnd_nsfw` has joined #ruby
crystal77 has joined #ruby
wuyin has quit [Remote host closed the connection]
ta_ has joined #ruby
beilabs has quit [Ping timeout: 252 seconds]
pwnd_nsfw has quit [Ping timeout: 250 seconds]
Pumukel has quit [Ping timeout: 260 seconds]
polysics has joined #ruby
mostlybadfly has joined #ruby
coolboy has joined #ruby
wuyin has joined #ruby
ta_ has quit [Ping timeout: 240 seconds]
akerl has joined #ruby
Rodya_ has quit [Remote host closed the connection]
polysics has quit [Ping timeout: 244 seconds]
Pumukel has joined #ruby
<akerl>
Trying to sort out why `spawn({'PATH' => 'what'}, 'ssh -V')` doesn't do what I'd expect (error with "command not found"). Based on strace, looks like Ruby looks in standard paths, ignoring my env var. Confirmed that `spawn({'PATH' => 'what'}, 'env')` shows that I've modified PATH as expected. Also confirmed `spawn('PATH=what ssh -V')` does what I'd expect, though obviously that doesn't work as well for weird
<akerl>
inputs
wuyin has quit [Ping timeout: 260 seconds]
jackjackdripper has quit [Quit: Leaving.]
nando293921 has quit [Ping timeout: 250 seconds]
Pumukel has quit [Ping timeout: 250 seconds]
Vingador has joined #ruby
<adam12>
akerl: sounds like ssh -V is using a shell, which might be clobering your PATH
<adam12>
akerl: What about `spawn({'PATH' => 'what', 'ssh', '-V')`
Robtop__ has joined #ruby
AndyBotwin has quit [Ping timeout: 276 seconds]
<akerl>
works
<akerl>
ssh is also just a dummy command I picked; any command behaves similarly. Strace makes it look like Ruby is doing its own searching of PATH in the original PID before execve-ing to the new thing
wuyin has joined #ruby
<akerl>
this is the execve call from the spawn that should fail, but doesn't, where I set {'PATH' => 'what'}: [pid 18138] execve("/usr/sbin/ssh", ["ssh", "-V"], [/* 10 vars */] <unfinished ...>
<adam12>
Ah, I see.
<akerl>
above that, the original pid scans /usr/bin and friends, then execs into it with the path that it found
<akerl>
the one that fails as expected looks like this: [pid 18143] execve("/bin/sh", ["sh", "-c", "PATH=what ssh -V"], [/* 10 vars */]) = 0
pwnd_nsfw` has quit [Ping timeout: 250 seconds]
<akerl>
Ah, this is interesting
pulgolino has quit [Remote host closed the connection]
<akerl>
I can trick it into properly failing by prefixing my command with "A=1"
<akerl>
which appears to trick the ruby PATH-searching into falling through to the case where it invokes /bin/sh, which properly uses my PATH var
etehtsea has quit [Ping timeout: 240 seconds]
saneax is now known as saneax-_-|AFK
<akerl>
Unfortunately, that appears to only work with commands provided as a string ('A=1 ssh -V'), and fails with array-based (['A=1', 'ssh', '-V'])
sandroqz has joined #ruby
<matthewd>
Yeah, that sounds like expected behaviour
sandroqz has quit [Remote host closed the connection]
<akerl>
The A=1 in array part, yes
<akerl>
Not so much the "ignoring my PATH" bit :P
<matthewd>
Not necessarily very helpful-to-you-right-now behaviour, but expected nonetheless :)
jaequery has joined #ruby
jaequery has quit [Read error: Connection reset by peer]
jaequery has joined #ruby
jaequery has quit [Read error: Connection reset by peer]
<matthewd>
Ruby runs the command itself unless it decides the string looks too hard, in which case it will run it through a shell
nankyokusei has joined #ruby
<akerl>
Is there a way to have it not? It's not even that it's scanning my PATH and falling back to the system path; it never scans my PATH
jaequery has joined #ruby
jaequery has quit [Read error: Connection reset by peer]
<matthewd>
So the shell will get your new path and do what you want; with no shell involved, ruby has no special treatment of the environment variables being passed to the child process
BTRE has joined #ruby
jaequery has joined #ruby
jaequery has quit [Read error: Connection reset by peer]
Xiti has quit [Quit: Xiti]
jaequery has joined #ruby
jaequery has quit [Read error: Connection reset by peer]
jaequery has joined #ruby
jaequery has quit [Read error: Connection reset by peer]
<akerl>
I'd originally assumed this was some helpful thing ruby was doing, which I'd be able to opt out of with some option flag. but the docs I'm reading make it look like there's no way in ruby core for me to sanely run a command with a non-standard PATH
<matthewd>
Simplest thing that comes to mind is to run ['A=1', '/usr/bin/env', 'ssh', '-V']
jaequery has joined #ruby
speakingcode has joined #ruby
jaequery has quit [Read error: Connection reset by peer]
<akerl>
that fails, though, since in array form the first element has to be a valid command (since it's not shelling it out)
<matthewd>
Yeah, I just looked for an option to spawn, but apparently not
<akerl>
So I'd basically have to form whatever I need to run into a string param myself, and then prefix with A=1
<akerl>
Ah. So prefixing with /usr/bin/env so as to have that thing do the path lookup
nankyokusei has quit [Ping timeout: 264 seconds]
<matthewd>
If you want to go the single-string route, there's shellwords to help you put it together.. but yeah, I'd just use env
<akerl>
Downside of my current flexibility: I'll have to mod my code to support either (prefix with A=1 if the arg I receive is a string, push /usr/bin/env onto array if it's array)
<matthewd>
Via its use in #! lines, the idea of relying on env to do a path lookup is pretty well precedented, IMO
<matthewd>
Appending ';' is probably neater than inserting a confusing env var... I'm 99% sure that's enough to push it into "needs a shell" mode
<matthewd>
Or, do the fork+exec for yourself, and change ENV['PATH'] in between... that should Just Work
<akerl>
Honest question: this feels like if not a bug, certainly a suboptimal gap in the current spawn/popen/system family of things-that-create-subprocesses, where it would be preferrable to have some way to tell them "hey please don't parse path on my behalf". Does that seem sane?
<matthewd>
It has to parse the path to find something to run
<matthewd>
I could see overriding the path, as you can with chdir, though
coolboy has quit [Ping timeout: 250 seconds]
blackmesa has joined #ruby
davedev24 has quit []
<akerl>
True
Xiti has joined #ruby
<matthewd>
(in the extreme, it still has to search the path to find a shell to hand off to)
<matthewd>
I guess the closest you get to "leave the path to me" is just handing it an absolute path to begin with
<matthewd>
So, you could pre-search the path yourself, but that doesn't help much with your string-vs-array flexibility problem
ta_ has joined #ruby
<akerl>
Yea. I'm currently pondering whether my use case is simple enough that I could just accept "this isn't gonna be thread-safe, but also has no threads and is unlikely to" and modify / reset ENV before/after the spawn
<akerl>
The end result being that if one day I changed my mind, I'd have to revert to the fork/exec you described
Xiti has quit [Client Quit]
blackmesa has quit [Ping timeout: 265 seconds]
dandaman has quit [Quit: Leaving.]
jackjackdripper has joined #ruby
ta_ has quit [Ping timeout: 265 seconds]
aryaching has joined #ruby
Es0teric has quit [Quit: Computer has gone to sleep.]
etehtsea has joined #ruby
AvyTech has joined #ruby
Xiti has joined #ruby
karmatr0n has quit [Ping timeout: 260 seconds]
RegulationD has joined #ruby
dviola has quit [Quit: WeeChat 1.5]
BTRE has quit [Ping timeout: 264 seconds]
TheWhip has joined #ruby
Madplatypus has quit [Quit: Connection closed for inactivity]
BTRE has joined #ruby
rkazak has joined #ruby
coolboy has joined #ruby
qguv has quit [Quit: bye]
pokalyis has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
RegulationD has quit [Ping timeout: 244 seconds]
pokalyis has joined #ruby
pwnd_nsfw` has joined #ruby
coolboy has quit [Ping timeout: 240 seconds]
bronson_ has joined #ruby
braincrash has quit [Quit: bye bye]
tectonic has quit []
flashpoint9 has joined #ruby
Robtop__ has quit [Ping timeout: 250 seconds]
bronson has quit [Ping timeout: 250 seconds]
qguv has joined #ruby
jbomo has quit []
dreamyspell has joined #ruby
flashpoint9 has quit [Ping timeout: 250 seconds]
nando293921 has joined #ruby
pokalyis has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
beilabs has joined #ruby
pokalyis has joined #ruby
brent__ has joined #ruby
beilabs has quit [Remote host closed the connection]
beilabs has joined #ruby
tmtwd has quit [Ping timeout: 240 seconds]
CloCkWeRX has joined #ruby
jazzonmym1nd has joined #ruby
tectonic has joined #ruby
Pumukel has joined #ruby
rsampaio_ has joined #ruby
braincras has joined #ruby
rsampaio_ has quit [Client Quit]
hahuang61 has joined #ruby
rsampaio_ has joined #ruby
jazzonmym111nd has quit [Ping timeout: 265 seconds]
jhack has joined #ruby
Nahra has quit [Read error: Connection reset by peer]
Nahra has joined #ruby
beilabs has quit [Remote host closed the connection]
Pumukel has quit [Ping timeout: 264 seconds]
pokalyis has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
AvyTech has left #ruby [#ruby]
pokalyis has joined #ruby
gix has quit [Ping timeout: 250 seconds]
moei has quit [Quit: Leaving...]
nando293921 has quit [Ping timeout: 244 seconds]
hahuang61 has quit [Ping timeout: 250 seconds]
arashb has joined #ruby
Parko has joined #ruby
Coldblackice has joined #ruby
beilabs has joined #ruby
gix has joined #ruby
moeabdol1 has joined #ruby
nando293921 has joined #ruby
arashb has quit [Ping timeout: 265 seconds]
beilabs has quit [Remote host closed the connection]
kinduff has joined #ruby
beilabs has joined #ruby
craysiii has joined #ruby
craysiii has quit [Client Quit]
pokalyis has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Velizar has quit [Quit: Velizar]
moeabdol1 has quit [Ping timeout: 276 seconds]
conta has joined #ruby
pokalyis has joined #ruby
the_rhizo3 has joined #ruby
beilabs has quit [Ping timeout: 276 seconds]
jazzonmym11nd has joined #ruby
speakingcode has quit [Ping timeout: 276 seconds]
conta has quit [Ping timeout: 244 seconds]
jackjackdripper has quit [Quit: Leaving.]
wuyin has quit [Remote host closed the connection]
wuyin has joined #ruby
jazzonmym1nd has quit [Ping timeout: 250 seconds]
giz|work has quit [Ping timeout: 244 seconds]
async_prince has quit [Ping timeout: 260 seconds]
kinduff has quit [Ping timeout: 244 seconds]
djbkd has joined #ruby
programmerq has quit [Ping timeout: 252 seconds]
jhack has quit []
blackmesa has joined #ruby
pokalyis has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ta_ has joined #ruby
pokalyis has joined #ruby
wuyin has quit [Ping timeout: 240 seconds]
maloik has quit [Remote host closed the connection]
maloik has joined #ruby
blackmesa has quit [Ping timeout: 252 seconds]
ta_ has quit [Ping timeout: 265 seconds]
cyphase has quit [Ping timeout: 244 seconds]
cyphase has joined #ruby
Cohedrin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ta_ has joined #ruby
pokalyis has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
alfiemax has quit [Ping timeout: 276 seconds]
pokalyis has joined #ruby
M-mistake has quit [Remote host closed the connection]
M-shine has quit [Remote host closed the connection]
M-manveru has quit [Remote host closed the connection]
Vingador has quit [Remote host closed the connection]
s2013 has joined #ruby
Vingador has joined #ruby
s2013 has quit [Read error: Connection reset by peer]
qguv has quit [Ping timeout: 240 seconds]
ta_ has quit [Ping timeout: 264 seconds]
M-shine has joined #ruby
crystal77 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
flashpoint9 has joined #ruby
wuyin has joined #ruby
pwnd_nsfw has joined #ruby
pokalyis has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
hahuang61 has joined #ruby
beilabs has joined #ruby
pwnd_nsfw` has quit [Ping timeout: 250 seconds]
pokalyis has joined #ruby
woodruffw has quit [Ping timeout: 258 seconds]
pawnbox has joined #ruby
flashpoint9 has quit [Ping timeout: 250 seconds]
wuyin has quit [Ping timeout: 244 seconds]
wuyin has joined #ruby
polysics has joined #ruby
yeticry has quit [Ping timeout: 244 seconds]
jhooker has quit [Ping timeout: 276 seconds]
Cohedrin has joined #ruby
jhooker has joined #ruby
woodruffw has joined #ruby
woodruffw has quit [Excess Flood]
woodruffw has joined #ruby
woodruffw has quit [Excess Flood]
woodruffw has joined #ruby
woodruffw has quit [Excess Flood]
yeticry has joined #ruby
LoneHerm_ has joined #ruby
GodFather has quit [Ping timeout: 258 seconds]
woodruffw has joined #ruby
polysics has quit [Ping timeout: 250 seconds]
flashpoint9 has joined #ruby
Pumukel has joined #ruby
beilabs has quit [Remote host closed the connection]
pokalyis has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
leea has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pokalyis has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
giz|work has joined #ruby
nankyokusei has quit [Ping timeout: 244 seconds]
pokalyis has joined #ruby
hipertracker has joined #ruby
mark_66 has joined #ruby
wuyin has quit [Ping timeout: 276 seconds]
Pumukel has quit [Ping timeout: 264 seconds]
bugo has joined #ruby
griffindy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
firstdayonthejob has quit [Ping timeout: 260 seconds]
harai54 has joined #ruby
saneax-_-|AFK is now known as saneax
wuyin has joined #ruby
harai has quit [Ping timeout: 276 seconds]
dminuoso has quit [Remote host closed the connection]
craigp has quit [Ping timeout: 244 seconds]
craigp has joined #ruby
pokalyis has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
etehtsea has quit [Quit: Computer has gone to sleep.]
pokalyis has joined #ruby
Macaveli has joined #ruby
ukk has joined #ruby
giz|work has quit [Ping timeout: 244 seconds]
Macaveli has quit [Client Quit]
craysiii has joined #ruby
biberu has joined #ruby
craysiii has quit [Client Quit]
blackmesa has joined #ruby
qguv has joined #ruby
Macaveli has joined #ruby
heelpmeplz has quit [Read error: Connection reset by peer]
heelpmeplz has joined #ruby
dminuoso has joined #ruby
andikr has joined #ruby
giz|work has joined #ruby
pokalyis has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
blackmesa has quit [Ping timeout: 260 seconds]
pokalyis has joined #ruby
ta_ has joined #ruby
ninjaaron has joined #ruby
Bish_ has joined #ruby
<ninjaaron>
I've been thinking about "best tool for the job" a bit when it comes to scripting languages. We all know that Ruby, Python and Perl can all do the same jobs (though sometimes with more pain in Perl...), but I
<ninjaaron>
I'm trying to think of domains where each excell.
Parko has quit [Read error: Connection reset by peer]
ta__ has joined #ruby
async_prince has joined #ruby
etehtsea has joined #ruby
rkazak has quit [Quit: Sleep.....ing....]
Bish has quit [Ping timeout: 276 seconds]
<ninjaaron>
Python is great in numeric/scientific computing, Perl is great for text parsing and linguistics.
<ninjaaron>
oh, and system administration
<ninjaaron>
In which domains does Ruby really shine?
ta_ has quit [Ping timeout: 244 seconds]
watersoul has joined #ruby
submitnine has joined #ruby
agit0 has joined #ruby
<ninjaaron>
I sometimes here "web", but I'm not sure if that means "rails" or just in general.
wuyin has quit [Ping timeout: 276 seconds]
err_ok has quit [Ping timeout: 244 seconds]
djbkd has quit []
watersoul_ has quit [Ping timeout: 240 seconds]
<dminuoso>
ninjaaron: One thing where Ruby excels is elegant domain specific languages.
err_ok has joined #ruby
KINGSABRI_ has quit [Remote host closed the connection]
<ninjaaron>
dminuoso: for example?
<dminuoso>
ninjaaron: internal libraries such as rspec
<dminuoso>
Or even other tools such as Puppet.
wugy has joined #ruby
TomyWork has joined #ruby
exchgr has quit [Ping timeout: 250 seconds]
pokalyis has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Cohedrin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<dminuoso>
ninjaaron: In a nutshell stuff like this: expect { expr }.to raise_error(NameError)
pokalyis has joined #ruby
<ninjaaron>
I think I understand.
conah has quit [Ping timeout: 250 seconds]
<ninjaaron>
At first I thought you might mean Ruby was good for implementing domain specific languages.
<dminuoso>
ninjaaron: That too. ;)
<dminuoso>
You don't require a parser, since you can use the ruby language itself.
<dminuoso>
And it's fairly easy to do so too.
<ninjaaron>
Well, that isn't quite what I have in mind when I say "language implementation", but I think I get your point.
<ninjaaron>
more like a langauge for implementing frameworks.
hipertracker has quit [Quit: hipertracker]
wuyin has joined #ruby
qguv has quit [Quit: bye]
aganov has joined #ruby
k3rn31 has joined #ruby
edwinvdgraaf has joined #ruby
ukk has quit [Quit: WeeChat 1.5]
pokalyis has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
blackgoat has quit [Ping timeout: 260 seconds]
l4v2 has quit [Quit: l4v2]
pokalyis has joined #ruby
ukk has joined #ruby
l4v2 has joined #ruby
postmodern has quit [Quit: Leaving]
ec0 has quit [Ping timeout: 250 seconds]
SuperLag has quit [Ping timeout: 276 seconds]
l4v2 has quit [Ping timeout: 244 seconds]
SuperLag has joined #ruby
claudiuinberlin has joined #ruby
anisha has joined #ruby
pokalyis has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ta_ has joined #ruby
brent__ has quit [Quit: Connection closed for inactivity]
pokalyis has joined #ruby
antgel has joined #ruby
ta_ has quit [Ping timeout: 240 seconds]
atmosx has joined #ruby
ninjaaron has quit [Ping timeout: 265 seconds]
mooe has quit []
edwinvdgraaf has quit [Ping timeout: 276 seconds]
elementaru has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
pokalyis has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
zenspider has quit [Read error: Connection reset by peer]
zenspider has joined #ruby
craigp has quit [Ping timeout: 244 seconds]
pokalyis has joined #ruby
giz|work has quit [Ping timeout: 265 seconds]
tsia has joined #ruby
<Bish_>
latest jruby requires openjdk 7?
Bish_ is now known as Bish
ycon_ has quit [Remote host closed the connection]
dminuoso has quit [Read error: Connection reset by peer]
dminuoso has joined #ruby
TheWhip has quit [Remote host closed the connection]
ReK2 has quit [Remote host closed the connection]
blackmesa has joined #ruby
wuyin has quit [Ping timeout: 276 seconds]
Macaveli has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pawnbox has quit [Remote host closed the connection]
jgt3 has joined #ruby
TheWhip has joined #ruby
LoneHerm_ has joined #ruby
ninjaaron has joined #ruby
craigp has joined #ruby
beilabs has quit [Remote host closed the connection]
flashpoint9 has joined #ruby
beilabs has joined #ruby
ReK2 has joined #ruby
marr has joined #ruby
pokalyis has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pokalyis has joined #ruby
pawnbox_ has joined #ruby
lxsameer has joined #ruby
LoneHerm_ has quit [Ping timeout: 252 seconds]
qguv has joined #ruby
Snowy has joined #ruby
beilabs has quit [Ping timeout: 265 seconds]
flashpoint9 has quit [Ping timeout: 250 seconds]
pawnbox_ has quit [Ping timeout: 240 seconds]
hahuang61 has joined #ruby
mikecmpbll has joined #ruby
qguv has quit [Quit: bye]
cwali has quit [Ping timeout: 276 seconds]
jackjackdripper has quit [Quit: Leaving.]
jackjackdripper has joined #ruby
hahuang61 has quit [Ping timeout: 250 seconds]
edwinvdgraaf has joined #ruby
pokalyis has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
aalmenar_ has quit [Read error: Connection reset by peer]
aalmenar has joined #ruby
aalmenar has quit [Changing host]
aalmenar has joined #ruby
Burgestrand has quit [Read error: Connection reset by peer]
skweek has quit [Ping timeout: 260 seconds]
pandaant has joined #ruby
Pupp3tm4st3r has joined #ruby
moei has joined #ruby
shoto has quit [Ping timeout: 250 seconds]
shoto has joined #ruby
<leitz>
If a method requires certain options, and those aren't provided, what's the normal way to deal with it? I've been having the methods just return but that doesn't communicate anything.
<mikecmpbll>
leitz : raise an exception (ArgumentError)
Guest84730 has joined #ruby
Macaveli has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
danielius has joined #ruby
pwnd_nsfw` has joined #ruby
mtkd has quit [Ping timeout: 276 seconds]
mtkd has joined #ruby
pwnd_nsfw has quit [Ping timeout: 250 seconds]
hipertracker has joined #ruby
Burgestrand has joined #ruby
ElFerna has joined #ruby
ElFerna has quit [Client Quit]
jenrzzz has joined #ruby
wugy has quit []
<ukk>
leitz: I would question whether nil is an acceptable zero value for the method.
wugy has joined #ruby
<leitz>
ukk, understood. In this case a method changes a 6 character string. If there's no string, that's a problem.
tdy has quit [Ping timeout: 244 seconds]
zapata has joined #ruby
cibs has quit [Ping timeout: 240 seconds]
cibs has joined #ruby
<ukk>
leitz: duck typing
Pumukel has joined #ruby
blackgoat has joined #ruby
<leitz>
ukk, I'm not fond of that yet. My thought is that if is should be a 6 digit hexidecimal string in uppercase, then there's a problem if it doesn't match that.
<leitz>
I'd rather deal with the issue up front and push back instead of trying to code around it.
hahuang61 has joined #ruby
Pumukel has quit [Ping timeout: 260 seconds]
Pumukel has joined #ruby
harai54 has quit [Ping timeout: 258 seconds]
hipertracker has quit [Quit: hipertracker]
MrBusiness3 has quit [Ping timeout: 250 seconds]
edwinvdgraaf has quit [Ping timeout: 240 seconds]
hahuang61 has quit [Ping timeout: 250 seconds]
Pumukel has quit [Ping timeout: 260 seconds]
Burgestrand has quit [Ping timeout: 258 seconds]
arashb has joined #ruby
TheWhip has quit [Remote host closed the connection]
edwinvdg_ has joined #ruby
Burgestrand has joined #ruby
Pumukel has joined #ruby
TheWhip has joined #ruby
arashb has quit [Ping timeout: 276 seconds]
<leitz>
Okay, next question. Program P calls Module M, which now raises an exception for P to handle. However, M is intended for use outside P. Right now M prints an error and raises the exception. Tests pass, except that the error still gets printed.
Pumukel has quit [Ping timeout: 260 seconds]
<leitz>
what's the choice? Print the error or assume any program written to use M will catch all it's exceptions?
<leitz>
Running it gives the expected TypeError and prints the error line. However, the test case says "<TypeError> exception expected but none was thrown.<TypeError> exception expected but none was thrown."
<apeiros>
ConsoleFx: time to learn about it then. irb comes along with ruby. pry is a gem which does the same but a bit better. up to you which one you chose.
<apeiros>
fire it up, and test pack/unpack there.
<ConsoleFx>
apeiros, awesome then.. this much of help would be enough then
<ConsoleFx>
thanks a lot for the quick look up
<ConsoleFx>
:)
<mikecmpbll>
leitz : from the docs for .to_i(): "Returns the result of interpreting leading characters in str as an integer base base (between 2 and 36). Extraneous characters past the end of a valid number are ignored. If there is not a valid number at the start of str, 0 is returned. This method never raises an exception when base is valid."
tdy has quit [Ping timeout: 244 seconds]
Pumukel has quit [Ping timeout: 264 seconds]
<apeiros>
ConsoleFx: the other help is ri. it's also a console tool. for your case, you'd type `ri String#unpack` and `ri Array#pack`
<ruby[bot]>
mikecmpbll: # => invalid value for Integer(): "Z" (ArgumentError) ...check link for more (https://eval.in/627462)
<ConsoleFx>
great! got it solved :)
<ConsoleFx>
thanks a lot :)
<ConsoleFx>
Much appreciate your help! apeiros
<leitz>
mikecmpbll, I see the reason the test and the toy gave different results. In the toy (test_Character.rb) character.upp is never set. in the test case (tc_CharacterTools.rb), it's shnged to a bad string.
icey has joined #ruby
flashpoint9 has joined #ruby
<leitz>
Hmmm...back to the drawing board. The real goal is to make sure the options are the right type and format. In this case character.upp should be a 6 digit uppercase Hex number as a String.
<dminuoso>
apeiros: you need an additional tap after select
<apeiros>
though, can't chain since you have to get the length
<apeiros>
yupp
<apeiros>
that's another option
hightower has joined #ruby
<dminuoso>
Though honestly I learned when you start using tap to solve "one-liner quizes" - you are basically cheating.
ConsoleFx has quit [Quit: Leaving]
the_rhizo3 has quit [Read error: No route to host]
the_rhizo3 has joined #ruby
<apeiros>
you're also not creating readable code ;-)
mindaslab has joined #ruby
<apeiros>
clever coders manage to squeeze everything into a single statement
hanmac has joined #ruby
mindaslab has left #ruby [#ruby]
<apeiros>
wise coders split it up into multiple
eljimbo has quit [Quit: This computer has gone to sleep]
mindaslab has joined #ruby
sepp2k has joined #ruby
KaliLinuxGR has quit [Ping timeout: 260 seconds]
stamina has joined #ruby
giz|work has joined #ruby
<dminuoso>
apeiros: Oh my actual code is already done and well split.
<dminuoso>
I just regularly have these moments of "the most creative way to do this in a single line"
agit0 has joined #ruby
dstack has joined #ruby
<apeiros>
you can always cheat and use ";" ;-p
<dminuoso>
Huh.
frozengeek has joined #ruby
<dminuoso>
How did you type that character?
<dminuoso>
I cant find it on my keyboard. :S
<dstack>
Are there any statements that you can use to delay a function?
<apeiros>
copy & paste it then dminuoso ;-D
<dminuoso>
dstack: lambda/proc
tomchapi_ has joined #ruby
<apeiros>
here, have some: ;;;;;;;;;;;;;;;
<dminuoso>
apeiros: Those should do a while thanks.
<apeiros>
dstack: s/function/method/, ruby doesn't really have functions ;-)
edwinvd__ has joined #ruby
tomchapin has quit [Ping timeout: 252 seconds]
<apeiros>
dstack: and define "delay a method". you can sleep. you can start a thread and sleep in the thread. you can store a block and invoke it later (proc/lambda solution of dminuoso).
<apeiros>
depends on what exactly you want to achieve.
<apeiros>
no. you just have something pretending to be :-p
pokalyis has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<dminuoso>
>> class Function; def initialize(&block); @block = block; def call(*args); @block.call(*args); end; end; end; f = Function.new { |a| puts a }; puts "apeiros: f is a function" if f.is_a? Function
<ruby[bot]>
dminuoso: # => apeiros: f is a function ...check link for more (https://eval.in/627484)
<dminuoso>
It is_a? Function, not pretends_to_be_a? Function!
ldnunes has joined #ruby
<apeiros>
pffft
<dminuoso>
:P
pokalyis has joined #ruby
<dminuoso>
I like the pattern. I should fill my codebase with it
<dminuoso>
Just to give my successor really bad headaches.
edwinvdg_ has quit [Ping timeout: 276 seconds]
<apeiros>
sure. what other pleasures are there in life :D
ruby-lang918 has joined #ruby
<ruby-lang918>
Helo
<dminuoso>
apeiros: I dont know. Last week I had high fever, and when lying in bed I bad a strange dream - in that dream I was a compinler..
JeanCarloMachado has joined #ruby
JeanCarl1Machado has joined #ruby
<apeiros>
dminuoso: how did UBs feel like?
<apeiros>
hi ruby-lang918
<dminuoso>
apeiros: I dont know. I was stuck in an optimization loop.
<apeiros>
that sounds unoptimal
<dstack>
Does ruby have support for Gotos?
<apeiros>
dstack: only with a special compiler setting
<dminuoso>
dstack: Yes.
<dminuoso>
dstack: The next best thing is catch/throw.
<apeiros>
JOKE=true or something like that
galeido has joined #ruby
sameerynho has joined #ruby
Burgestrand has joined #ruby
<ruby-lang918>
I used middleman to create a static page, but this now needs to be portable. Is there a way to create a windows executable that basically runs middleman build in the specified directory without there being the need of having ruby etc. installed on the machine? I'm not sure OCRA can do that.
<apeiros>
ocra?
<apeiros>
I think there was some "ruby2exe" or somesuch. not a windows user, so no idea how good that thing is/was nor whether it's still maintained.
<apeiros>
but it's a static website - what do you need an executable for?
KaliLinuxGR has joined #ruby
<dstack>
ironruby
<apeiros>
ironruby is dead.
<dminuoso>
Sad panda.
<dminuoso>
No more .NETry
Pumukel has joined #ruby
<ruby-lang918>
it generates this page from simple markdown files you put in a directory
<apeiros>
yes. do you want to generate the page on windows too?
lxsameer has quit [Ping timeout: 276 seconds]
<apeiros>
or only view the result on windows?
<ruby-lang918>
It would need to be generated there as well
<apeiros>
ok. then you need the executable. well, what I said above.
interki has joined #ruby
<dminuoso>
apeiros: So how it is Switcherland.. just got a Job offer in Zurich. :|
<dminuoso>
Is this a place where one might want to live?
LoneHerm_ has quit [Remote host closed the connection]
<apeiros>
I've never been in switcherland :-p
<apeiros>
but I love my country
Pumukel has quit [Ping timeout: 264 seconds]
marr has quit [Ping timeout: 240 seconds]
<apeiros>
Can recommend, would live there again ;-)
<dminuoso>
Heh.
<dstack>
exerb
<dstack>
windows supports running bash scripts
tdy has joined #ruby
Nimonas has joined #ruby
d0nn1e has quit [Ping timeout: 264 seconds]
Bounga has joined #ruby
d0nn1e has joined #ruby
JeanCarl1Machado has quit [Quit: Lost terminal]
JeanCarloMachado has quit [Quit: Lost terminal]
Bounga has quit [Client Quit]
cyphase has quit [Ping timeout: 258 seconds]
<dstack>
When ever im on the wine website it says wine is not an emulator
dstack has left #ruby [#ruby]
tdy has quit [Ping timeout: 240 seconds]
k3rn31 has joined #ruby
jgt3 has quit [Ping timeout: 240 seconds]
Burgestrand has quit [Ping timeout: 252 seconds]
pokalyis has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
BrianJ has quit [Ping timeout: 240 seconds]
flashpoint9 has joined #ruby
cyphase has joined #ruby
LoneHermit has joined #ruby
Bounga has joined #ruby
Burgestrand has joined #ruby
s2013 has joined #ruby
moeabdol1 has joined #ruby
johnmilton has quit [Remote host closed the connection]
s2013 has quit [Client Quit]
flashpoint9 has quit [Ping timeout: 250 seconds]
hutch34 has joined #ruby
hahuang61 has joined #ruby
tulak has joined #ruby
IanMalcolm has joined #ruby
MrBusiness3 has joined #ruby
IanMalcolm has quit [Max SendQ exceeded]
LoneHermit has quit [Ping timeout: 240 seconds]
gnufied has joined #ruby
IanMalcolm has joined #ruby
moeabdol1 has quit [Client Quit]
IanMalcolm has quit [Client Quit]
eljimbo has joined #ruby
Ishido has quit [Remote host closed the connection]
hahuang61 has quit [Ping timeout: 250 seconds]
kies has quit [Ping timeout: 240 seconds]
SuperLag_ has joined #ruby
tyang has joined #ruby
akerl has left #ruby ["valete"]
SuperLag has quit [Ping timeout: 265 seconds]
exchgr has joined #ruby
jonoyeong has quit [Remote host closed the connection]
SuperLag has joined #ruby
SuperLag_ has quit [Ping timeout: 250 seconds]
beilabs has joined #ruby
Ishido has joined #ruby
exchgr has quit [Ping timeout: 258 seconds]
zenguy_pc has quit [Ping timeout: 264 seconds]
Silthias has quit [Ping timeout: 265 seconds]
blackmesa has joined #ruby
zenguy_pc has joined #ruby
synthroid has joined #ruby
yardenbar has joined #ruby
flashpoint9 has joined #ruby
MrBusiness3 has quit [Ping timeout: 250 seconds]
kies has joined #ruby
johnmilton has joined #ruby
ukk has quit [Quit: WeeChat 1.5]
pokalyis has joined #ruby
johnmilton has quit [Read error: Connection reset by peer]
sharkman has quit [Ping timeout: 250 seconds]
blackmesa has quit [Ping timeout: 265 seconds]
Burgestrand has quit [Ping timeout: 244 seconds]
ruby-lang918 has quit [Quit: Page closed]
johnmilton has joined #ruby
pulgolino has joined #ruby
mtkd has quit [Ping timeout: 250 seconds]
Bounga has quit [Read error: Connection reset by peer]
LoneHerm_ has joined #ruby
RegulationD has joined #ruby
lrojas has joined #ruby
<lrojas>
hi all
mtkd has joined #ruby
<lrojas>
does anybody knows if there pragprog is coming up with an updated version of the programming ruby book ? 4th editon covers 1.9 and 2.0 but seems a bit outdated ( since ruby is at 2.3 and getting ready to release 2.4 )
hipertracker has joined #ruby
<lrojas>
or ask another way.. is there a book on ruby that is current and favored by the comunity?
LoneHerm_ has quit [Remote host closed the connection]
<dminuoso>
lrojas: There are a few. Which level are you looking for?
<lrojas>
somewhere between beginner and intermediate
RegulationD has quit [Ping timeout: 240 seconds]
<dminuoso>
lrojas: If you have some decent prerequisites Eloquent Ruby is an excellent read.
<lrojas>
i have the current pragpub book ( Programming Ruby 4th edition ), i got it a few years ago when i was starting a project that used ruby, but the project got cancelled and i shelved it...
<dminuoso>
(It's one of the more widely recommended books in this channel)
nankyokusei has joined #ruby
<dminuoso>
We also have a books list on our webpage, but I think apeiros hinted that its somewhat outdated.
<lrojas>
i am coming back to ruby and since i really liked the format of that book i thougth there was an update version.. but it seems dead
<lrojas>
out of curiosity... what's your take on the book i am mentioning, just so i get a base line :p
<dminuoso>
Never read it.
beilabs has quit [Ping timeout: 276 seconds]
Burgestrand has joined #ruby
tulak has quit [Remote host closed the connection]
<dminuoso>
lrojas: Eloquent Ruby is more about patterns, while Well Grounded Rubyist rather discusses the language itself. Other books have other focuses.
<dminuoso>
It's really difficult to compare books in that way.
Non has joined #ruby
Bounga has joined #ruby
<lrojas>
dminuoso: fair enough
harai54 has joined #ruby
nankyokusei has quit [Ping timeout: 244 seconds]
griff has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<lrojas>
well grounded rubyst seems to be a tad outdated... :p ahh the pace of technology and why tech books should be a subscription.
mindaslab has quit [Ping timeout: 244 seconds]
arashb has quit [Ping timeout: 250 seconds]
colegatron has left #ruby ["Leaving"]
interki has quit [Quit: Going offline, see ya! (www.adiirc.com)]
ruby-lang140 has joined #ruby
tulak has joined #ruby
<dminuoso>
lrojas: The language has not really changed much.
<dminuoso>
Anything that's in that book still applies.
interki has joined #ruby
<lrojas>
ohh i thought 2.3 was going to be vastly different than 1.9 or even 2.0
<apeiros>
no. biggest change was 1.8 to 1.9
Pumukel has joined #ruby
arnonhongklay has joined #ruby
<lrojas>
sorry if i am a bit clueless, like i said.. a few years back, ruby was 1.9 and 2.0 was about to come out, that's when the book i had got written
<ruby-lang140>
how do i run a command like `bourbon install` (bourbon gem) from inside a ruby script without running the de facto shell command? more precisely how do i access this functionality from inside ruby?
the_rhizo3 has quit [Ping timeout: 250 seconds]
<dminuoso>
ruby-lang140: Look at what the binstub does.
Xiti has quit [Ping timeout: 244 seconds]
<dminuoso>
ruby-lang140: type "which bourbon", open the file and look at it.
interki has quit [Client Quit]
the_rhizo3 has joined #ruby
hipertracker has quit [Quit: hipertracker]
<dminuoso>
lrojas: The bulk of changes over the years are small changes that have no general impact on how Ruby facilities work or how to write code with them.
<lrojas>
dminuoso: thanks, that explains a lot why i keep seeing books that have not been updated :p i thought that ruby popularity was starting to fade, it seems the language just matured to a point where updates for the books are not needed as frequently.
Pumukel has quit [Ping timeout: 260 seconds]
anisha has quit [Quit: This computer has gone to sleep]
alfiemax has quit [Ping timeout: 265 seconds]
tlaxkit has joined #ruby
last_staff has quit [Quit: last_staff]
myntcake has joined #ruby
edwinvd__ has quit [Ping timeout: 264 seconds]
blackgoat has quit [Quit: WeeChat 1.5]
beilabs has joined #ruby
ta_ has joined #ruby
jgt3 has joined #ruby
etehtsea has quit [Ping timeout: 240 seconds]
flashpoint9 has quit [Remote host closed the connection]
flashpoint9 has joined #ruby
ta_ has quit [Ping timeout: 244 seconds]
exchgr has joined #ruby
<lrojas>
sorry for all the stupid questions.. but rbenv or rvm ? i remember there where some conflicting opinions on the approach of each, has that been resolved? is it just a matter of taste now or are there significant differences still?
<dminuoso>
lrojas: Neither.
<lrojas>
huh?
<dminuoso>
lrojas: The FOTY is chruby with possibly ruby-install
<lrojas>
FOTY?
<dminuoso>
They are super lightweight, non-intrusive and just work.
<dminuoso>
Flavor of the year.
<lrojas>
ahh
<lrojas>
jesus
<lrojas>
hehe
<dminuoso>
You can use rbenv/rvm though if you want.
<linduxed>
i still use rbenv and really like it
beilabs has quit [Remote host closed the connection]
<linduxed>
i get why people apperciate chruby, but rbenv makes things simple enough
beilabs has joined #ruby
edwinvdg_ has joined #ruby
<dminuoso>
linduxed: If you care about simplicity, then rbenv cant be your first choice.
<linduxed>
hmm, fair, i should have used "easy" instead of "simple"
<linduxed>
those are two different things
<dminuoso>
linduxed: 104 lines of code. That's all chruby is.
<dminuoso>
It cant get more simplistic or minimal than chruby.
<linduxed>
dminuoso: read my correctio
Bounga has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
<linduxed>
*correction
<dminuoso>
linduxed: That just makes it sound like chruby is more complicated to use.
Pumukel has joined #ruby
Bounga has joined #ruby
<linduxed>
for some, in practice, it becomes that
<linduxed>
if they value having a one-stop-shop-everything-included solution
<toretore>
it is more complicated to use, but that doesn't mean more difficult
Burgestrand has quit [Ping timeout: 264 seconds]
<linduxed>
it completely depends on whether you wish to limit the scope of the discussion to "what chruby does" or to "managing the need of bouncing between ruby version with all that that entails"
<linduxed>
if the discussion is about the latter, then chruby is just one piece of the puzzle
beilabs has quit [Ping timeout: 265 seconds]
<linduxed>
and that's what i'm referring to
<linduxed>
"easy enough"
Silthias has joined #ruby
beilabs has joined #ruby
<linduxed>
if you only have chruby, you might eventually feel that you need other tools to make certain workflows easier
<linduxed>
rbenv provides some tools for that
<linduxed>
chruby doesn't
<linduxed>
neither is better or worse, they're different
<linduxed>
but when choosing between the different tools available, i'd just recommend to consider whether one thinks that additional features that go beyond "pick ruby version" would be helpful
igniting has joined #ruby
Pumukel has quit [Ping timeout: 260 seconds]
Pumukel has joined #ruby
k3rn31 has quit [Quit: Computer has gone to sleep.]
ziyadb has joined #ruby
MrBusiness3 has joined #ruby
tlaxkit has quit [Quit: tlaxkit]
fmcgeough has joined #ruby
allcentury has quit [Ping timeout: 244 seconds]
Pumukel has quit [Ping timeout: 264 seconds]
Pumukel has joined #ruby
rkazak has joined #ruby
MrBusiness3 has quit [Ping timeout: 250 seconds]
Bish has quit [Ping timeout: 265 seconds]
ppat has joined #ruby
hutch34 has quit [Read error: Connection reset by peer]
Bish has joined #ruby
ChiefAlexander has joined #ruby
blackmesa has joined #ruby
Pumukel has quit [Ping timeout: 260 seconds]
jsaak_ has quit [Quit: leaving]
jsaak has joined #ruby
Pumukel has joined #ruby
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ppat has quit [Quit: Page closed]
Burgestrand has joined #ruby
ruby[bot] has joined #ruby
cwali has joined #ruby
Pumukel has quit [Ping timeout: 260 seconds]
blackmesa has quit [Ping timeout: 258 seconds]
dkam has quit [Quit: Be back later ...]
Pumukel has joined #ruby
anisha has joined #ruby
ukk has joined #ruby
ukk has quit [Client Quit]
sameerynho has quit [Quit: WeeChat 1.5]
anisha has quit [Client Quit]
tvw has joined #ruby
Rodya_ has joined #ruby
Rodya_ has quit [Remote host closed the connection]
k3rn31 has joined #ruby
Bounga has quit [Read error: Connection reset by peer]
Pumukel has quit [Ping timeout: 264 seconds]
Pumukel has joined #ruby
allcentury has joined #ruby
da3mon has joined #ruby
mostlybadfly has quit [Quit: Connection closed for inactivity]
diprotic has joined #ruby
flying has joined #ruby
Burgestrand has quit [Read error: Connection reset by peer]
Pumukel has quit [Ping timeout: 260 seconds]
crystal77 has joined #ruby
Pumukel has joined #ruby
monoprotic has quit [Ping timeout: 244 seconds]
agit0 has quit [Ping timeout: 252 seconds]
dinoangelov has joined #ruby
stamina has quit [Ping timeout: 252 seconds]
the_drow has joined #ruby
nando293921 has joined #ruby
hutch34 has joined #ruby
<the_drow>
When the benchmark module reports real time it's in seconds right?
flashpoint9 has quit [Remote host closed the connection]
flashpoint9 has joined #ruby
Pumukel has quit [Ping timeout: 260 seconds]
<apeiros>
the_drow: yes
<the_drow>
apeiros, great. thanks
<apeiros>
from the docs: „The unit of time is seconds.“
Pumukel has joined #ruby
<the_drow>
I searched for that multiple times. Must have missed it...
<apeiros>
it's in the module's toplevel docs.
Burgestrand has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
coolboy has quit [Remote host closed the connection]
pandaant has quit [Remote host closed the connection]
giz|work has quit [Ping timeout: 250 seconds]
coolboy has joined #ruby
plantfood has joined #ruby
<nebg>
hello everyone how can i search for gems by command line ? i know that by doing gem install moduleName i can install a module but what about searching ?
interki has joined #ruby
<plantfood>
test
jhooker has quit [Ping timeout: 276 seconds]
jhack has joined #ruby
<apeiros>
plantfood: test failed. please reboot.
<apeiros>
nebg: `gem help commands` and `gem help search`
jhooker has joined #ruby
Burgestrand has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
plantfood has quit [Remote host closed the connection]
<nebg>
ok it seems gem search nameTOSearch right ?
plantfood has joined #ruby
Pumukel has quit [Ping timeout: 260 seconds]
<apeiros>
yes. note that search does a partial match, but it accepts a regex too.
<apeiros>
e.g. `gem search rails` will find 1001 gems
<apeiros>
`gem search '^rails$'` will only find one
Pumukel has joined #ruby
* apeiros
wishes the defaults were different
ta__ has quit [Remote host closed the connection]
<nebg>
ok thanks
s2013 has joined #ruby
lightheaded has quit [Remote host closed the connection]
lightheaded has joined #ruby
Pumukel has quit [Ping timeout: 260 seconds]
Pumukel has joined #ruby
s2013 has quit [Client Quit]
skweek has joined #ruby
meth has joined #ruby
hahuang61 has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
lightheaded has quit [Ping timeout: 240 seconds]
ixti has joined #ruby
yardenbar has quit [Ping timeout: 244 seconds]
Pumukel has quit [Ping timeout: 264 seconds]
Pumukel has joined #ruby
shinnya has joined #ruby
cpruitt has joined #ruby
flashpoint9 has joined #ruby
<Mon_Ouie>
gem search rails | wc -l #=> 4655. I feel lied to.
hahuang61 has quit [Ping timeout: 258 seconds]
axl_ has joined #ruby
exchgr has joined #ruby
craigp has quit [Ping timeout: 258 seconds]
Pumukel has quit [Ping timeout: 260 seconds]
hhhhh has joined #ruby
Pumukel has joined #ruby
<linduxed>
Mon_Ouie: what were you told?
<dminuoso>
15:58 < apeiros> e.g. `gem search rails` will find 1001 gems
<linduxed>
ah
<dminuoso>
As do I, Mon_Ouie.
<linduxed>
i'm not surprised that what looks like an attempt at hyperbole resulted in the hyperbole being insufficient, when it comes to something related to rails
hey2 has joined #ruby
axl_ has quit [Ping timeout: 244 seconds]
<hhhhh>
What is the fastest ruby compiler you can use for number processing
axl_ has joined #ruby
SteenJobs has joined #ruby
axl_ has quit [Read error: Connection reset by peer]
Vingador has joined #ruby
Pumukel has quit [Ping timeout: 264 seconds]
tulak has quit [Remote host closed the connection]
arashb has joined #ruby
tulak has joined #ruby
craysiii has joined #ruby
axl_ has joined #ruby
s2013 has joined #ruby
tulak has quit [Read error: Connection reset by peer]
<linduxed>
hhhhh: you most likely wouldn't do number processing in ruby if you expect performance. on the other hand, you could make use of C-extensions to speed up the performance critical parts and do the rest in pure ruby
tulak has joined #ruby
<linduxed>
hhhhh: googling "ruby number processing" probably could give you some results as well
<apeiros>
hhhhh: probably jruby
kappy_ has quit [Remote host closed the connection]
<linduxed>
hhhhh: in general though, my guess would be that ruby isn't the right tool for the job, if you intend to do pure ruby
kappy has joined #ruby
<apeiros>
IMO ruby is the right tool until proven otherwise ;-p
<linduxed>
hhhhh: apeiros makes a good point that jruby might be faster than the others, but i would still be sceptical as to whether that's enough for hard number crunching
<linduxed>
apeiros: fair attitude to have
<apeiros>
jhass: is it reasonably simple to write crystal extensions for ruby?
arashb has quit [Ping timeout: 244 seconds]
<linduxed>
when you hit a wall one truly can't circumvent in ruby, there's always FFI
<apeiros>
that'd be another way to speed up performance…
* apeiros
still hasn't tried FFI… :-S
<linduxed>
apeiros: i've tried it, it does its job
<apeiros>
I mean I've written native extensions, but never with ffi
<linduxed>
apeiros: i've only tried it with Rust
<linduxed>
worked fine
<apeiros>
nice
Bish has quit [Read error: Connection reset by peer]
axl_ has left #ruby [#ruby]
Bish has joined #ruby
<apeiros>
I really need some time off. Rust, Go, Swift and Crystal are all languages I'd like to take a dive in…
blackmesa has joined #ruby
<linduxed>
to be fair though, i only did a trivial application that modified some string over in Rust, so nothing non-trivial
<hhhhh>
Is fortran the fastest language for number processing?
<apeiros>
I think the annoyance starts when you have to account for either GC or Threading
<apeiros>
hhhhh: COBOL!
<linduxed>
hhhhh: i don't know if it's the fastest, but it's still in the top IIRC
<apeiros>
no idea. but might well be fortran.
<linduxed>
hhhhh: are you going to be building a stock exchange or something?
<apeiros>
no cobol in the language shootout :-S
hipertracker has joined #ruby
dopamean_ has joined #ruby
exchgr has quit [Ping timeout: 264 seconds]
<hhhhh>
prototyping different ciphers
dkam has joined #ruby
Pumukel has joined #ruby
RegulationD has joined #ruby
cwali has quit [Ping timeout: 240 seconds]
<linduxed>
i would guess that you'd find something like Julia fast enough
tdy has joined #ruby
dminuoso has quit [Ping timeout: 260 seconds]
<linduxed>
and quite expressive
<linduxed>
and to be honest, try writing it in Ruby, as apeiros said
mikecmpb_ has joined #ruby
tyang has quit [Ping timeout: 264 seconds]
<linduxed>
getting the general logic out of the way quickly with Ruby might be beneficial, and when you hit a performance wall look into https://github.com/ffi/ffi
lightheaded has joined #ruby
mtkd has quit [Ping timeout: 240 seconds]
TheWhip has quit [Remote host closed the connection]
OTORelic3 has joined #ruby
Pumukel has quit [Ping timeout: 250 seconds]
mikecmpbll has quit [Ping timeout: 244 seconds]
RegulationD has quit [Ping timeout: 264 seconds]
mtkd has joined #ruby
Pumukel has joined #ruby
harai54 has quit [Ping timeout: 258 seconds]
Sammichmaker has quit [Ping timeout: 276 seconds]
tdy has quit [Ping timeout: 265 seconds]
plantfood has quit [Remote host closed the connection]
axsuul has joined #ruby
heelpmeplz has quit [Quit: Leaving]
jazzonmym1nd has joined #ruby
nankyokusei has joined #ruby
myntcake has quit [Ping timeout: 240 seconds]
Ropeney has joined #ruby
Ropeney has quit [Remote host closed the connection]
<dminuoso>
Well, there you have the two methods needed to complete the task.
amclain has joined #ruby
<havenwood>
A nice merge reduction with a side of marmalade.
da3mon has quit [Quit: Zzzz...]
mark_66 has quit [Remote host closed the connection]
dkam has quit [Ping timeout: 244 seconds]
<havenwood>
volcanix: If you can get merge working by calling it on one Hash and providing the other as an argument with the appropriate block then it's a small bit more to add in reduce so it works on the Array of Hashes.
<havenwood>
volcanix: I'd suggest looking at the merge docs first!
<aeruder>
ah, ok, hadn't seen that, but still evolving my ruby-style
<apeiros>
aeruder: some tools will warn about unused variables, and they'll ignore variables which start with _ (or are just a _)
<aeruder>
some tools like what?
<Mon_Ouie>
ruby implementations, for starters
<volcanix>
@havenwood is there a better reduce example..
<apeiros>
ruby, rubocop, rubymine f.ex.
frozengeek has joined #ruby
tulak_ has joined #ruby
TheWhip has quit [Ping timeout: 244 seconds]
WhiteMamba has quit [Ping timeout: 264 seconds]
flashpoint9 has quit [Remote host closed the connection]
Beams has joined #ruby
jobewan has joined #ruby
<jhass>
apeiros: not yet, some people are working on it. For now you need some magic to produce a shared library at all and initialize the GC. After that it's a matter of writing a binding to the C API. One major issue is the slowdown from converting between Ruby and Crystal types, in particular strings requiring a copy.
danielius has joined #ruby
<apeiros>
ok
<apeiros>
thanks for the info :)
<volcanix>
Im having trouble figuring out how best to iterate the external array.
hipertracker has joined #ruby
banisterfiend has quit [Ping timeout: 265 seconds]
Davedev28 has quit [Read error: Network is unreachable]
Derperperd has joined #ruby
<volcanix>
Is there any good examples of reduce ? I've actually never used it this way..
tyang has quit [Ping timeout: 260 seconds]
jazzonmym1nd has quit [Ping timeout: 240 seconds]
Lord_of_Life has quit [Ping timeout: 250 seconds]
<apeiros>
there are some in the docs
Davedev28 has joined #ruby
<Mon_Ouie>
>> [1, 2, 3, 4].reduce(0) { |sum, element| puts "Sum: #{sum} | Element: #{element}"; sum + element }
<ruby[bot]>
Mon_Ouie: # => Sum: 0 | Element: 1 ...check link for more (https://eval.in/627765)
<Mon_Ouie>
^ See the link to see what values are passed to the block
<volcanix>
I eventually got it.. ff.inject{|sum, e| sum.merge(e){|k,o,n| n+o} }
<Mon_Ouie>
Notice though that if the array is empty you'll get nil as a result
<volcanix>
Thanks everybody ;-:
<volcanix>
;-)
pokalyis has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Mon_Ouie>
You may want to pass an initial value as an argument to inject instead
<dminuoso>
volcanix: reject/inject basically reduces an Enumerable to a single value (SQL calls this aggregation) - the block just lets you control *how*
allcentury has quit [Ping timeout: 252 seconds]
jazzonmym111nd has joined #ruby
pmalyanne has quit [Ping timeout: 244 seconds]
pokalyis has joined #ruby
xpt has left #ruby ["WeeChat 1.4"]
xpt has joined #ruby
<volcanix>
In my case initializing inject's sum with a Hash .. is that needed? Seems anti rubish
<dminuoso>
volcanix: No it's perfectly fine.
<volcanix>
k, thanks all.
volcanix has quit [Quit: Page closed]
jazzonmym11nd has quit [Ping timeout: 260 seconds]
<wrkrcoop>
im dealing with a shitty endpoint and have to do some weird manipulation of this json string before i can send it
jhack has joined #ruby
exchgr has joined #ruby
da3mon has joined #ruby
da3mon has quit [Remote host closed the connection]
wrkrcoop has quit [Quit: wrkrcoop]
Rodya_ has joined #ruby
axl__ has joined #ruby
qguv has joined #ruby
binaryplease1 has joined #ruby
eljimbo has joined #ruby
arnonhongklay has joined #ruby
ghormoon has joined #ruby
naftilos76 has quit [Quit: Αποχώρησε]
binaryplease has quit [Ping timeout: 276 seconds]
Rodya_ has quit [Ping timeout: 250 seconds]
arnonhongklay has quit [Remote host closed the connection]
<ghormoon>
hi, has anyone seen this? http://pastebin.com/Qjc2e4S2 I've tried to build ruby 2.3 (stretch package) on debian jessie and got this funny test failure. is there anything I could have done wrong during the build (like if the tests require some specific timezone or something to be run under)
<ruby[bot]>
ghormoon: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
blackmes1 has joined #ruby
hutch34 has quit [Ping timeout: 244 seconds]
nitric has joined #ruby
hakunin_ is now known as hakunin
blackmesa has joined #ruby
gix has joined #ruby
binaryplease1 is now known as binaryplease
blackmes1 has quit [Ping timeout: 258 seconds]
redpants has quit [Ping timeout: 265 seconds]
edwinvdgraaf has joined #ruby
ziyadb has quit [Quit: Connection closed for inactivity]
hutch34 has joined #ruby
ramfjord has quit [Ping timeout: 265 seconds]
symm- has quit [Quit: Leaving...]
tulak has quit [Remote host closed the connection]
BTRE has quit [Read error: Connection reset by peer]
BTRE has joined #ruby
tulak has joined #ruby
tulak has quit [Read error: Connection reset by peer]
tulak has joined #ruby
Es0teric has quit [Quit: Computer has gone to sleep.]
nando293921 has quit [Quit: Lost terminal]
dkam has joined #ruby
kossae has quit [Quit: WeeChat 1.5]
firstdayonthejob has joined #ruby
TPug has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
yardenbar has joined #ruby
robfrawley has joined #ruby
dkam has quit [Ping timeout: 240 seconds]
tulak has quit []
<matthewd>
ghormoon: That does seem.. surprising
zacts has joined #ruby
edwinvdg_ has joined #ruby
edwinvdg_ has quit [Remote host closed the connection]
chee is now known as kbdkode
redpants has joined #ruby
spudowiar has quit [Quit: gtg]
Baffoon has joined #ruby
Baffoon has quit [Excess Flood]
kbdkode is now known as chee
rippa has quit [Read error: Connection reset by peer]
edwinvdgraaf has quit [Ping timeout: 244 seconds]
redpants has quit [Ping timeout: 244 seconds]
gnufied__ has joined #ruby
edwinvdgraaf has joined #ruby
gnufied__ has quit [Client Quit]
giz|work has quit [Ping timeout: 244 seconds]
edwinvdgraaf has quit [Remote host closed the connection]
hipertracker has joined #ruby
indistylo has joined #ruby
axl__ has quit [Ping timeout: 276 seconds]
jackjackdripper has joined #ruby
jackjackdripper has quit [Read error: Connection reset by peer]
jackjackdripper1 has joined #ruby
jackjackdripper1 has quit [Read error: Connection reset by peer]
jackjackdripper has joined #ruby
jgnagy has quit [Remote host closed the connection]
axl_ has joined #ruby
karmatr0n has quit [Ping timeout: 265 seconds]
robfrawley has quit [Quit: leaving]
rmf_ has joined #ruby
rmf_ is now known as robfrawley
hahuang61 has quit [Ping timeout: 240 seconds]
<drbrain>
That test is probably a day off because of a timezone offset that's not being accounted for
<drbrain>
If you set the release date field as a Time object RubyGems converts it to midnight UTC and uses that as the date
elastix has joined #ruby
<drbrain>
so the difference may only be half an hour, but with the conversion it becomes a day
Madplatypus has joined #ruby
jgnagy has joined #ruby
hotpancakes has joined #ruby
Spami has joined #ruby
SteenJobs has joined #ruby
zacts has quit [Ping timeout: 252 seconds]
ramfjord has joined #ruby
anisha has joined #ruby
stamina has joined #ruby
axl_ has quit [Quit: axl_]
al2o3-cr has quit [Ping timeout: 260 seconds]
johnmilton has quit [Remote host closed the connection]
spudowiar has joined #ruby
last_staff has joined #ruby
frozengeek has quit [Quit: frozengeek]
dkphenom has joined #ruby
c14367 has joined #ruby
zacts has joined #ruby
c14367 has quit []
indistylo has quit [Remote host closed the connection]
<matthewd>
Oh, oops.. I was looking at test_date_equals_string
C0deMaver1ck_ is now known as C0deMaver1ck
MrBusiness3 has joined #ruby
jackjackdripper1 has joined #ruby
jackjackdripper has quit [Read error: Connection reset by peer]
polishdub has quit [Quit: Leaving]
lrojas has quit []
MrBusiness3 has quit [Ping timeout: 260 seconds]
Rodya_ has joined #ruby
jgt3 has joined #ruby
johnmilton has joined #ruby
jaruga___ has joined #ruby
miqlas-H has quit [Ping timeout: 250 seconds]
jaruga___ has quit [Client Quit]
lupeke has joined #ruby
jaruga___ has joined #ruby
Rodya_ has quit [Ping timeout: 250 seconds]
jgt3 has quit [Ping timeout: 250 seconds]
zacts_pi has joined #ruby
arashb has joined #ruby
SeepingN has joined #ruby
blackgoat has joined #ruby
giz|work has joined #ruby
hahuang61 has joined #ruby
axl_ has joined #ruby
zacts has quit [Ping timeout: 276 seconds]
zacts_ has joined #ruby
arashb has quit [Ping timeout: 244 seconds]
tvon_ has joined #ruby
tvon_ has quit [Client Quit]
zacts_pi has quit [Ping timeout: 258 seconds]
kentnl has joined #ruby
kentnl has quit [Changing host]
kentnl has joined #ruby
zacts__ has joined #ruby
roflmyeggo has joined #ruby
elephants has quit [Quit: Leaving...]
hotpancakes has quit [Remote host closed the connection]
kent\n has quit [Ping timeout: 250 seconds]
zacts has joined #ruby
Lucky_ABA has quit [Ping timeout: 260 seconds]
zacts_ has quit [Ping timeout: 244 seconds]
jphase has joined #ruby
tvon has quit [Quit: System is sleeping...]
Lucky_ABA has joined #ruby
lupeke_ has joined #ruby
Vingador has quit [Ping timeout: 244 seconds]
zacts__ has quit [Ping timeout: 276 seconds]
tvon has joined #ruby
dkam has joined #ruby
conta has quit [Ping timeout: 264 seconds]
axl_ has quit [Quit: axl_]
ramfjord has quit [Ping timeout: 240 seconds]
lupeke_ has quit [Ping timeout: 264 seconds]
ramfjord has joined #ruby
spudowiar has quit [Quit: gtg]
tomchapin has joined #ruby
dkam has quit [Ping timeout: 240 seconds]
howard_ has joined #ruby
hotpancakes has joined #ruby
jbomo has quit [Ping timeout: 276 seconds]
anisha has quit [Quit: This computer has gone to sleep]
shoto has quit [Ping timeout: 240 seconds]
Dimik has joined #ruby
jackjackdripper has joined #ruby
jackjackdripper1 has quit [Ping timeout: 250 seconds]
hotpancakes has quit [Ping timeout: 250 seconds]
teclator_ has joined #ruby
teclator has quit [Ping timeout: 264 seconds]
allcentury has quit [Ping timeout: 244 seconds]
hotpancakes has joined #ruby
Fernando-Basso has quit [Quit: Leaving]
spudowiar has joined #ruby
Azure|dc has joined #ruby
exchgr has quit [Ping timeout: 250 seconds]
tvon has quit [Quit: System is sleeping...]
Azure has quit [Ping timeout: 258 seconds]
lightheaded has quit [Remote host closed the connection]
cdg has joined #ruby
nclbr has quit [Quit: Leaving...]
craigp has joined #ruby
zacts has quit [Quit: WeeChat 1.4]
zacts has joined #ruby
lupeke has quit [Remote host closed the connection]
exchgr has joined #ruby
JediMaster has joined #ruby
harai54 has joined #ruby
<JediMaster>
Hi guys, complete Ruby newbee here, I'm a sysadmin/PHP developer, I need to alter a chef recipe, and just want to check the syntax
d5sx43 has joined #ruby
<JediMaster>
Will this work? if (node.chef_environment=='production' || node.chef_environment=='staging') && (if !node.roles.include?('standalone') && node.roles.include?('master'))
<baweaver>
Have you tried it?
lupeke has joined #ruby
<JediMaster>
Not yet =)
<baweaver>
That may be a good first step to see if its working
<baweaver>
we tend to make rather horrid REPLs
<JediMaster>
Just want a quick syntax check =)
<baweaver>
that being said, no, it won't
d5sx43 has quit [Client Quit]
dopamean_ has quit [Ping timeout: 265 seconds]
<JediMaster>
I want either production or staging environments, AND has master role and NOT standalone
wrkrcoop has joined #ruby
<baweaver>
that if there will break it
<baweaver>
but try running it and see
d5sx43 has joined #ruby
<JediMaster>
Ugh yes, that's my bad
<JediMaster>
apart from that?
<baweaver>
give it a shot and see
Xiti has quit [Quit: Xiti]
doublemalt_ has joined #ruby
<JediMaster>
will the !node work to negate it?
BrianJ has joined #ruby
<baweaver>
this seems a tinge repetitive.
skweek has joined #ruby
lupeke has quit [Client Quit]
<JediMaster>
It's not one I want to get wrong as it's a pain in the neck to fix manually
yardenbar has quit [Ping timeout: 250 seconds]
<baweaver>
not trying to be rude, but the best way to test something is to try it
<baweaver>
that doesn't necessarily mean executing the exact code either.
<wrkrcoop>
i kno i can’t interpolate in single quotes …
claudiuinberlin has quit [Remote host closed the connection]
coolboy has quit [Ping timeout: 250 seconds]
d5sx43 has quit [Quit: Leaving...]
Davedev28 has quit [Ping timeout: 250 seconds]
k3rn31 has quit [Quit: Computer has gone to sleep.]
<matthewd>
wrkrcoop: You had a substantial discussion about the difference between a string's value and its representation yesterday.. this seems like retreading the same ground
<matthewd>
brendan-: What do you believe ||= does?
Xiti has joined #ruby
<wrkrcoop>
matthewd: yeah … looks like the problem is on their side. thanks
<brendan->
my thought was that if ENV['AWS_DEFAULT_REGION'] wasn't set, region would be set to 'us-east-1'
<brendan->
matthewd: ^
<brendan->
same logic applying to the bucket var
skweek has quit [Ping timeout: 250 seconds]
whathappens has quit [Read error: Connection reset by peer]
SteenJobs has quit [Quit: SteenJobs]
whathappens has joined #ruby
<matthewd>
brendan-: `a ||= b` means `a || (a = b)`
haraigo has joined #ruby
<brendan->
right
<brendan->
hmm
<matthewd>
So what is `a` in each of those two lines?
<brendan->
environment variables
<brendan->
well, the first one is
<matthewd>
Yes, the first one is
<brendan->
2nd line is a string that has an env var as part of it
<matthewd>
Indeed. Hard to assign to that.
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
harai54 has quit [Ping timeout: 244 seconds]
<havenwood>
brendan-: consider something like: bucket = "#{ENV['MH_ENV'] or 'dev'}-terraform-state"
whathappens has quit [Read error: Connection reset by peer]
<brendan->
is it because ruby isn't aware of whether or not ENV['MH_ENV'] is set at the time of ||=
whathappens has joined #ruby
<havenwood>
brendan-: You need a variable to the left of ||=, it's assignment.
<brendan->
not a dynamic string?
<matthewd>
brendan-: This is an error: "foo" = "bar"
jhack has quit [Quit: jhack]
nankyokusei has joined #ruby
<brendan->
bucket is attempting to be set to a string of "blah-#{ENV['test']}-boom" or default to "blah-nonono-boom"
jhack has joined #ruby
<brendan->
nor could i set:
<brendan->
test = ENV['test'] ||= 'blah2'
<brendan->
then try bucket = "test1-#{test}-test" ||= "test1-test2-test"
Rodya_ has joined #ruby
<matthewd>
brendan-: You are trying to assign a string to another string.
mikeliss has joined #ruby
<matthewd>
That is not a thing you can do.
<brendan->
in place of
jgt3 has joined #ruby
<brendan->
i guess without comparing that string ruby has 0 idea what i'm trying to do
<brendan->
:D
<matthewd>
brendan-: Can you agree that this won't work? a + 1 = 7
<brendan->
yes
nankyokusei has quit [Ping timeout: 264 seconds]
<matthewd>
So nor will: a + "z" = "xyz"
<matthewd>
Thus: "#{a}z" = "xyz"
<matthewd>
And finally, nor: "#{a}z" || ("#{a}z" = "xyz")
Spami has quit [Quit: Leaving]
Rodya_ has quit [Ping timeout: 250 seconds]
claudiuinberlin has joined #ruby
moos3 has quit [Quit: leaving]
jgt3 has quit [Ping timeout: 252 seconds]
axsuul has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<brendan->
true enough. ty matthewd & havenwood
tvon has joined #ruby
<matthewd>
So, in the first one, you probably just want ||, if you aren't deliberately setting the env var
exchgr has quit [Ping timeout: 250 seconds]
exchgr has joined #ruby
last_staff has quit [Quit: l8erz]
elastix has quit [Quit: elastix]
aryaching has quit [Ping timeout: 250 seconds]
pwnd_nsfw` has quit [Read error: Connection reset by peer]
mtkd has quit [Ping timeout: 250 seconds]
flashpoint9 has quit [Remote host closed the connection]
Rodya_ has joined #ruby
myntcake has joined #ruby
flashpoint9 has joined #ruby
mtkd has joined #ruby
Rodya__ has joined #ruby
<brendan->
i agree matthewd
<brendan->
what do you think about the 2nd one? needs to be handled differently or going with havenwood's suggestion?
whathappens has quit [Remote host closed the connection]
hipertracker has quit [Quit: hipertracker]
pwnd_nsfw has joined #ruby
whathappens has joined #ruby
<matthewd>
Yeah, what havenwood said (I'd use `||` over `or`, but it's fine either way here)
okrasi_ has quit [Quit: Konversation terminated!]
dkphenom has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
skweek has joined #ruby
CloCkWeRX has joined #ruby
Rodya_ has quit [Ping timeout: 250 seconds]
hipertracker has joined #ruby
Rodya__ has quit [Remote host closed the connection]
SteenJobs has joined #ruby
flashpoint9 has quit [Ping timeout: 250 seconds]
<brendan->
ok
<brendan->
ty
Rodya_ has joined #ruby
whathappens has quit [Read error: Connection reset by peer]
Derperperd has quit [Quit: Derperperd]
sepp2k has quit [Quit: Leaving.]
whathappens has joined #ruby
eljimmy has quit [Read error: Connection reset by peer]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
skweek has joined #ruby
lightheaded has quit [Ping timeout: 258 seconds]
coolboy has joined #ruby
elastix has quit [Quit: elastix]
ajsharma has joined #ruby
nitric has quit [Read error: Connection reset by peer]
nitric_ has joined #ruby
tyang has quit [Quit: Leaving]
tyang has joined #ruby
CloCkWeRX has quit [Quit: Leaving.]
fmcgeough has quit [Quit: fmcgeough]
biberu has quit []
jonoyeong has joined #ruby
tyang has quit [Ping timeout: 265 seconds]
nitric_ has quit [Read error: Connection reset by peer]
jhack has quit [Quit: jhack]
jhack has joined #ruby
jhack has quit [Client Quit]
haraigoshi has joined #ruby
CloCkWeRX has joined #ruby
MrBusiness3 has joined #ruby
CloCkWeRX has quit [Client Quit]
haraigo has quit [Ping timeout: 250 seconds]
CloCkWeRX1 has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
OTORelic3 has quit [Ping timeout: 244 seconds]
flashpoint9 has joined #ruby
wrkrcoop has quit [Quit: wrkrcoop]
moonythedwarf_ has joined #ruby
jgt3 has joined #ruby
vuoto has joined #ruby
CloCkWeRX1 has left #ruby [#ruby]
CloCkWeRX has joined #ruby
[Butch] has quit [Quit: I'm out . . .]
marr has joined #ruby
wrkrcoop has joined #ruby
tomchapin has joined #ruby
doublemalt_ has quit [Ping timeout: 250 seconds]
flashpoint9 has quit [Ping timeout: 250 seconds]
dkam has joined #ruby
CloCkWeRX1 has joined #ruby
jgt3 has quit [Ping timeout: 250 seconds]
skweek has quit [Ping timeout: 250 seconds]
CloCkWeRX has quit [Ping timeout: 264 seconds]
dkam has quit [Ping timeout: 240 seconds]
cpruitt has quit [Quit: cpruitt]
giz|work has quit [Ping timeout: 276 seconds]
nando293921 has joined #ruby
tlaxkit has joined #ruby
CloCkWeRX1 has quit [Quit: Leaving.]
ta_ has quit [Remote host closed the connection]
youch has quit [Quit: WeeChat 1.5]
<ineb>
this URI behaviour caught me by suprise https://paste.xinu.at/etD/rb . any explanation for this? and is there a elegant way to get what i want here?
TPug has joined #ruby
zacts has joined #ruby
ChiefAlexander has quit [Remote host closed the connection]
roflmyeggo has quit [Ping timeout: 240 seconds]
blackwind_123 has quit [Ping timeout: 258 seconds]