<mozzarella>
thought the behavior had changed… glad to know I'm not crazy
n0m4d1c has quit [Ping timeout: 264 seconds]
<garyserj>
thanks
houhoulis has quit []
_aeris_ has joined #ruby
cadillac_ has quit [Ping timeout: 255 seconds]
cadillac_ has joined #ruby
jameser has joined #ruby
cschneid_ has joined #ruby
alfiemax has quit [Remote host closed the connection]
rkazak has joined #ruby
chocoelho_ has quit [Quit: Konversation terminated!]
jameser has quit [Client Quit]
alfiemax has joined #ruby
cschneid_ has quit [Ping timeout: 256 seconds]
alfiemax_ has joined #ruby
xuanrui has joined #ruby
alfiemax has quit [Ping timeout: 256 seconds]
cadillac_ has quit [Quit: I quit]
cadillac_ has joined #ruby
cthu| has joined #ruby
AJA4350 has quit [Quit: AJA4350]
cthulchu_ has quit [Ping timeout: 240 seconds]
ipee has quit [Read error: Connection reset by peer]
bmurt has joined #ruby
nielsk_ has quit [Quit: So Long, and Thanks for All the Fish]
quobo has quit [Quit: Connection closed for inactivity]
chris349 has joined #ruby
chris349 has quit [Client Quit]
Cyrus has joined #ruby
chris349 has joined #ruby
<chris349>
I have a rake task that runs fine from a crontab, but its getting to complex so I want to move it to a shell script. I copy all the env variables from my crontab, such as RAILS_ENV, but when I run the script it errors out because its not running in the right RAILS_ENV
<chris349>
Why is it ignoring this from a shell script but working fine in a crontab?
Dimik has joined #ruby
nielsk has joined #ruby
cadillac_ has quit [Ping timeout: 268 seconds]
alfiemax_ has quit [Ping timeout: 250 seconds]
<elomatreb>
Are you absolutely sure you're setting the rails env correctly? (i.e. is it actually exported?)
cadillac_ has joined #ruby
arekushi has joined #ruby
<chris349>
eldritch, I dont export it in the crontab. Whats the right way to export it in a shell script?
ta_ has joined #ruby
mroutis has quit [Remote host closed the connection]
sanscoeur has joined #ruby
jacky has joined #ruby
cadillac_ has quit [Ping timeout: 250 seconds]
cadillac_ has joined #ruby
rkazak has quit [Quit: Sleep.....ing....]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
caleBOT_ has joined #ruby
caleBOT has joined #ruby
gix has joined #ruby
cadillac_ has quit [Ping timeout: 260 seconds]
cadillac_ has joined #ruby
gix- has quit [Ping timeout: 240 seconds]
RougeR has quit [Ping timeout: 260 seconds]
dinfuehr has quit [Ping timeout: 240 seconds]
dinfuehr has joined #ruby
govg has joined #ruby
ta_ has quit [Ping timeout: 240 seconds]
dinfuehr has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Ping timeout: 264 seconds]
dinfuehr has joined #ruby
twe4ked has quit [Ping timeout: 265 seconds]
twe4ked has joined #ruby
kapil___ has quit [Quit: Connection closed for inactivity]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dinfuehr has quit [Ping timeout: 268 seconds]
cadillac_ has quit [Ping timeout: 260 seconds]
dinfuehr has joined #ruby
cadillac_ has joined #ruby
Asher has joined #ruby
sanscoeur has quit [Remote host closed the connection]
papajo has joined #ruby
<elomatreb>
chris349: Sorry, missed your reply. You need to either call it in the line where you invoke rails (RAILS_ENV=something rake sometask), or export the variable in general (export RAILS_ENV=something). Otherwise it's local to your shell script, and spawned child processes do not know about it
ciscam has quit [Ping timeout: 256 seconds]
ciscam has joined #ruby
shynoob has joined #ruby
<shynoob>
what's the best linux distro to run on server for rails deployment??
cadillac_ has quit [Ping timeout: 256 seconds]
cadillac_ has joined #ruby
roamingdog has joined #ruby
darkhanb has quit [Ping timeout: 256 seconds]
roamingdog has quit [Ping timeout: 268 seconds]
jameser has joined #ruby
donofrio has quit [Remote host closed the connection]
lytol has quit [Remote host closed the connection]
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tacoboy has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
shynoob has quit [Quit: Leaving]
xuanrui has quit [Quit: Leaving]
cadillac_ has quit [Read error: Connection reset by peer]
cadillac_ has quit [Read error: Connection reset by peer]
Janky has quit []
cadillac_ has joined #ruby
zautomata1 has quit [Quit: WeeChat 1.9.1]
ta_ has joined #ruby
tomphp has joined #ruby
rkazak has quit [Quit: Sleep.....ing....]
ryzokuken has quit [Remote host closed the connection]
emilford has joined #ruby
biberu has joined #ruby
TomyLobo has joined #ruby
conta has joined #ruby
ur5us has quit [Remote host closed the connection]
jamesaxl has joined #ruby
ur5us has joined #ruby
mikecmpbll has joined #ruby
tvw has quit []
ur5us has quit [Ping timeout: 240 seconds]
ta_ has quit [Ping timeout: 240 seconds]
DTZUZO_ has joined #ruby
DTZUZO_ has quit [Ping timeout: 255 seconds]
minimalism has quit [Quit: minimalism]
qnaal has joined #ruby
Quentinius has joined #ruby
<apeiros>
hanmac: I'm aware this exists, but I've never used it and I don't remember seeing it in use. I think I'd use String#include? instead of String#[String] (at least I can't imagine a use case where it's not a test for inclusion)
ellcs has joined #ruby
gr33n7007h has joined #ruby
gr33n7007h is now known as al2o3-cr
<apeiros>
otoh I don't see a reason to remove it just because somebody got confused
<dminuoso>
apeiros: A language shouldn't clean up its mess and toss out old and bad garbage?
* dminuoso
eyeballs C and JavaScript
<apeiros>
dminuoso: it should. but I wouldn't call String#[String] a high priority target in that
Quentinius has quit [Ping timeout: 255 seconds]
cadillac_ has quit [Read error: Connection reset by peer]
cadillac_ has joined #ruby
dionysus69 has quit [Ping timeout: 276 seconds]
amar has joined #ruby
plexigras has joined #ruby
roamingdog has joined #ruby
emilford has quit [Quit: Lost terminal]
joro_ has joined #ruby
ineb has quit [Remote host closed the connection]
<joro_>
hi guys, does anyone know how network_interface gem works ?
ineb has joined #ruby
roamingdog has quit [Ping timeout: 256 seconds]
<joro_>
the problem is that it returns the wrong network interface
ciscam has quit [Ping timeout: 260 seconds]
RedNifre has joined #ruby
caleBOT_ has joined #ruby
caleBOT__ has joined #ruby
ciscam has joined #ruby
c_nick has joined #ruby
cschneid_ has joined #ruby
cschneid_ has quit [Ping timeout: 256 seconds]
mohsen_1 has joined #ruby
conta has quit [Ping timeout: 264 seconds]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tomphp has joined #ruby
caleBOT__ has quit [Ping timeout: 246 seconds]
caleBOT_ has quit [Ping timeout: 246 seconds]
<al2o3-cr>
joro_: how so?
<al2o3-cr>
NetworkInterface.interfaces returns an array of interfaces names.
sameerynho has joined #ruby
jnollette has quit [Remote host closed the connection]
<ruby[bot]>
joro_: we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
<joro_>
#{interface} return wlp1s0 which is wrong due to fact that ip addr returns wlp2s0
<al2o3-cr>
joro_: that isn't even using the network_interface gem. that is loading yaml with returns a hash then accessing the key network_interface from the secrets hash.
<al2o3-cr>
*which
<joro_>
i was just guessing, but any idea why does it return wlp1s0 ?
<al2o3-cr>
take a look at the secrets.yml
<joro_>
ok, i found it, thanks you
<al2o3-cr>
what a useless use of cat
karapetyan has joined #ruby
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<joro_>
how else...can you get the nameserver except from resolv.conf then ?
RedNifre has joined #ruby
<apeiros>
joro_: eh, cat | grep -> just grep the file directly
apparition has quit [Quit: Bye]
<apeiros>
or in plain ruby: File.read("/etc/resolv.conf").scan(/^nameserver (.*)/).map(&:first) # there may be nicer solutions than this
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<joro_>
will that work if resolv.conf requires root ?
<apeiros>
if your shellout works, this will work too
<apeiros>
unless you setuid'ed your cat, which would be a terrible idea.
<joro_>
vim /etc/resolv.conf doesnt work
<apeiros>
"doesn't work" is a useless description.
<joro_>
it requires sudo
ellcs has quit [Ping timeout: 240 seconds]
karapetyan has quit [Remote host closed the connection]
karapetyan has joined #ruby
<apeiros>
I don't know what vim tries to do. but apparently more than just read the file.
<joro_>
it depends on the mode
<apeiros>
anyway, your subshell does not have more rights than the application running the subshell. so again: if your shellout works, this will work too
<apeiros>
and I mean you can just like… try it?
<joro_>
it's not a big deal... i was just asking al2o3-cr about the useless cat... i am not familliar with ruby at all
kies^ has quit [Ping timeout: 264 seconds]
<apeiros>
…
<apeiros>
I explained you?
<apeiros>
12:27 apeiros: joro_: eh, cat | grep -> just grep the file directly
<joro_>
apeiros, thanks you :) why do you need to be mad ?
<apeiros>
mostly because I know ~70%+ of ruby devs would have to consult docs to understand the first
alex has quit [Quit: WeeChat 2.1]
<apeiros>
falls into the category: don't write clever code.
qnaal has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
RougeR has joined #ruby
RougeR has joined #ruby
RougeR has quit [Changing host]
za1b1tsu_ has joined #ruby
houhoulis has joined #ruby
ta_ has quit [Ping timeout: 240 seconds]
<konsolebox>
apeiros: you honestly find that clever and never wrote a code like that? because i find that very basic when it comes to scripting.
<konsolebox>
it also has similar "cleverness" to ||=. actually, it's less.
za1b1tsu_ has quit [Ping timeout: 260 seconds]
amar has quit [Ping timeout: 256 seconds]
Asher has joined #ruby
nickjj has joined #ruby
dstrunk has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ramfjord has joined #ruby
<al2o3-cr>
it's not clever code it's ruby ;)
caleBOT_ has joined #ruby
caleBOT has joined #ruby
caleBO___ has joined #ruby
caleBOT__ has joined #ruby
nickjj has quit [Read error: Connection reset by peer]
kmurphy4_ has joined #ruby
gheegh has joined #ruby
caleBOT_ has quit [Ping timeout: 264 seconds]
caleBOT has quit [Ping timeout: 264 seconds]
goepsilongo has joined #ruby
nickjj has joined #ruby
amar has joined #ruby
RedNifre has quit [Ping timeout: 276 seconds]
qnaal has joined #ruby
<konsolebox>
al2o3-cr: both methods are ruby and are well-documented. one is just frowned upon by the "community" because of a collective philosophy or myth, or laziness to learn complete ruby programming knowledge. like a tribunal, they try to define how ruby should work.
<al2o3-cr>
konsolebox: aye, and i'd agree String#[] has my vote :p
<al2o3-cr>
but each to their own.
dstrunk has joined #ruby
<al2o3-cr>
but not that it matters.
gheegh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<al2o3-cr>
if they're a ruby dev they should know this shit tbqf
<Omnilord>
If the language provides a useful tool, and new developers don't know how to use it, then yes, they will have to reach for the docs. How else will they learn the language?
<havenwood>
>> hay = 'xyz'; needle = 'y'; hay[needle].equal? needle
<apeiros>
konsolebox: ||= is an established idiom. String#[String] is not.
<konsolebox>
al2o3-cr: i think i misread what you said. i thought you referred to ||= not being clever but ruby, hence i tried to explain that ||= is as documented as ||, in the sense that || can be used to define a fallback value..
<al2o3-cr>
konsolebox: no worries, yeah was slightly confused there for a minute
<konsolebox>
apeiros: yes obviously, but i compared not by how one is established or not, but the complexity on their mechanism.
<havenwood>
Cleverness aside, it's allocating new Strings.
<al2o3-cr>
havenwood: i see your point now
<konsolebox>
*compared them
<apeiros>
konsolebox: in that case, you're missing the point completely
<apeiros>
code readability vs cleverness is not depending on the complexity of the involved mechanism.
<apeiros>
or rather, not only
<al2o3-cr>
obviously String#[] return a new sub-string.
<konsolebox>
apeiros: because one became more popular?
<apeiros>
konsolebox: still missing the point
<apeiros>
you can use concise clever constructs if they're popular
<konsolebox>
yeah, whatever you think i'm missing is trivial
<apeiros>
if it's not popular, be explicit
<apeiros>
and String#[String] is not popular and everything else than explicit.
<al2o3-cr>
anyway discussion aside, it's a beutiful day to today :)
<apeiros>
yupp, that's why I was just jogging :D
<konsolebox>
apeiros: well popularity is not the only factor in my opinion. it's also about the requirement for being a basic ruby programmer, and how easy it is to follow code. especially if they are just using basic syntax. it doesn't even involve multiple methods.
za1b1tsu_ has quit [Ping timeout: 248 seconds]
<al2o3-cr>
apeiros: keep it up, you'll be running marathons soon ;P
<apeiros>
al2o3-cr: I already ran half marathons
<apeiros>
but I don't think I'll ever run marathons
<al2o3-cr>
apeiros: what's that 13 mile?
<apeiros>
what's a mile? :-p
<apeiros>
21km
<al2o3-cr>
impressive ;)
<apeiros>
I plan to finally run it <2h this year
<al2o3-cr>
yeah 21km is roughly 13 mile ;P
<apeiros>
ok :)
<apeiros>
1.6km/mile, right?
<al2o3-cr>
aye.
<apeiros>
konsolebox: yes, I'd expect any halfway decent ruby programmer to be able to follow it. but code where I have to look up half of the methods in order to understand it is - even if I can perfectly follow it - not readable code.
robertot1 has joined #ruby
<apeiros>
that's also one reason while extracting into methods is a great pattern (and another where I don't know whether it's even got a name: assign to well named local variables). it gives information about intent. which means even if I don't know one or two methods, I can infer from context.
qnaal has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<havenwood>
I'd not use String#[match_str] unless I meant to create a new substring object.
redlegion has quit [Remote host closed the connection]
<havenwood>
We could patch it to return match_str, but that'd be breaking behavior.
redlegion has joined #ruby
<apeiros>
havenwood: you mean when you want a copy?
<havenwood>
ya
<konsolebox>
havenwood: yeah, i admit you got a winning point about the new instance
<apeiros>
out of curiosity: do you have examples where you used it like that?
<havenwood>
apeiros: no, i'd probably end up writing it more explicitly
<apeiros>
:D
<apeiros>
ok, I did giggle a bit there
* apeiros
brb
gheegh has joined #ruby
dstrunk has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]