havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.5.1, 2.4.4, 2.3.7, 2.6.0-preview2: https://www.ruby-lang.org | Paste 4+ lines of text to https://gist.github.com | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
apeiros has joined #ruby
jrafanie has joined #ruby
jrafanie has quit [Client Quit]
Andrevan has quit [Quit: WeeChat 2.1]
kmurphy4 has joined #ruby
kmurphy4 has quit [Client Quit]
TomyLobo2 has quit [Ping timeout: 245 seconds]
kmurphy4 has joined #ruby
Azure has joined #ruby
BlopMonster has joined #ruby
agent_white has quit [Quit: leaving]
chamar has joined #ruby
sytherax has joined #ruby
ur5us has quit [Read error: No route to host]
ur5us has joined #ruby
Mia has quit [Read error: Connection reset by peer]
orbyt_ has joined #ruby
Es0teric has joined #ruby
chamar has quit [Quit: Leaving]
BlopMonster has quit [Ping timeout: 256 seconds]
sytherax has quit [Remote host closed the connection]
sytherax has joined #ruby
Es0teric has quit [Quit: Computer has gone to sleep.]
dipnlik has quit [Quit: Connection closed for inactivity]
thadtheman has joined #ruby
<thadtheman> Does any one know if there is a way for gem simple_install to install a scecific branch of a gem?
BlopMonster has joined #ruby
andrewray has joined #ruby
Dimik has quit [Ping timeout: 265 seconds]
neohunter has joined #ruby
akaiiro has quit [Remote host closed the connection]
nythalcrow has quit [Quit: This computer has gone to sleep]
Azure|dc has joined #ruby
shinnya has quit [Ping timeout: 265 seconds]
BlopMonster has quit [Ping timeout: 264 seconds]
Azure has quit [Ping timeout: 265 seconds]
tty has quit [Quit: tty]
tty has joined #ruby
apeiros has quit [Ping timeout: 245 seconds]
andrewray has quit [Quit: andrewray]
konsolebox has quit [Ping timeout: 276 seconds]
konsolebox has joined #ruby
face has quit [Read error: Connection reset by peer]
coffeecu_ has joined #ruby
coffeecu_ has quit [Client Quit]
kmurphy4 has quit [Quit: kmurphy4]
orbyt_ has quit [Ping timeout: 265 seconds]
RougeR has quit [Ping timeout: 264 seconds]
dviola has quit [Quit: WeeChat 2.1]
AJA4350 has quit [Quit: AJA4350]
nythalcrow has joined #ruby
coffeecupp__ has joined #ruby
amar has joined #ruby
amar has quit [Ping timeout: 248 seconds]
nythalcrow has quit [Quit: Leaving]
nicht has joined #ruby
nicht has quit [Max SendQ exceeded]
nicht has joined #ruby
akaiiro has joined #ruby
fs0ciety_ has quit [Quit: WeeChat 2.1]
cadillac_ has quit [Quit: I quit]
cadillac_ has joined #ruby
neohunter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
coffeecupp__ has quit [Ping timeout: 256 seconds]
<henoc> how can I use this project? https://github.com/taskrabbit/makara
braincrash has quit [Quit: bye bye]
<Zarthus> it looks like it has a README.md.
<Zarthus> There's even a header "basic usage"
coffeecupp__ has joined #ruby
braincrash has joined #ruby
ciscam has quit [Ping timeout: 265 seconds]
ciscam has joined #ruby
aceruser has quit [Ping timeout: 265 seconds]
coffeecupp__ has quit [Ping timeout: 260 seconds]
gix- has joined #ruby
gix has quit [Disconnected by services]
jamesaxl has quit [Quit: WeeChat 2.1]
BlopMonster has joined #ruby
BlopMonster has quit [Ping timeout: 256 seconds]
coffeecupp__ has joined #ruby
coffeecupp__ has quit [Ping timeout: 240 seconds]
ciscam has quit [Ping timeout: 276 seconds]
ciscam has joined #ruby
cyberg has quit [Quit: Leaving]
sytherax has quit [Remote host closed the connection]
psprint has quit [Ping timeout: 256 seconds]
psprint has joined #ruby
Immune has joined #ruby
Immune has left #ruby [#ruby]
sytherax has joined #ruby
sytherax has quit [Ping timeout: 265 seconds]
darkhanb has joined #ruby
Es0teric has joined #ruby
Es0teric has quit [Ping timeout: 240 seconds]
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
ur5us has quit [Ping timeout: 276 seconds]
akaiiro has quit [Remote host closed the connection]
nicht has quit [Ping timeout: 245 seconds]
Yxhuvud has quit [Ping timeout: 240 seconds]
shinnya has joined #ruby
andrewray has joined #ruby
aupadhye has joined #ruby
reber has joined #ruby
<dminuoso> arne: You should use SizedQueue. This STM is about the most naive implementation I've seen.
armando has quit [Ping timeout: 256 seconds]
Yxhuvud has joined #ruby
pskosinski has quit [Ping timeout: 264 seconds]
pskosinski has joined #ruby
conta has joined #ruby
andrewray has quit [Ping timeout: 240 seconds]
armando has joined #ruby
kapil___ has joined #ruby
biberu has joined #ruby
dionysus69 has joined #ruby
conta has quit [Quit: conta]
<havenwood> wkoszek: If I recall, I was saying Ruby can be statically linked against dependencies instead of dynamically linked. That's what RVM and Travis, etc, do when they ship "precompiled" Ruby.
snickers has joined #ruby
<havenwood> An aside, but Ruby Packer is a fairly new tool that's pretty nifty: https://github.com/pmq20/ruby-packer
<havenwood> wkoszek: There's also Traveling Ruby: https://phusion.github.io/traveling-ruby/
sudorobo has quit [Read error: Connection reset by peer]
amar has joined #ruby
andikr has joined #ruby
za1b1tsu has joined #ruby
clemens3_ has joined #ruby
mjolnird has joined #ruby
yohji has joined #ruby
saTchymoto has joined #ruby
cgfbee has joined #ruby
vondruch has quit [Ping timeout: 240 seconds]
sysvalve has joined #ruby
TomyWork has joined #ruby
eelster has quit [Ping timeout: 256 seconds]
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
yohji has quit [Ping timeout: 268 seconds]
Sembei has quit [Ping timeout: 265 seconds]
cadillac_ has quit [Ping timeout: 260 seconds]
cadillac_ has joined #ruby
amar has quit [Remote host closed the connection]
envex has quit []
amar has joined #ruby
elomatreb has quit [Quit: ZNC - https://znc.in]
Es0teric has joined #ruby
Sembei has joined #ruby
amar has quit [Ping timeout: 265 seconds]
yohji has joined #ruby
ren0v0 has quit [Quit: cya!]
amar has joined #ruby
cdr255 has quit [Read error: Connection reset by peer]
clemens3 has joined #ruby
elomatreb has joined #ruby
amar has quit [Remote host closed the connection]
amar has joined #ruby
zmo has quit [Ping timeout: 264 seconds]
psprint has left #ruby ["WeeChat 2.1"]
amar has quit [Ping timeout: 256 seconds]
BlopMonster has joined #ruby
zmo has joined #ruby
mikecmpbll has joined #ruby
mikecmpbll has quit [Client Quit]
BlopMonster has quit [Ping timeout: 245 seconds]
venmx has joined #ruby
conta has joined #ruby
vondruch has joined #ruby
mikecmpbll has joined #ruby
ellcs has joined #ruby
venmx has quit [Ping timeout: 264 seconds]
schleppel has joined #ruby
ellcs has quit [Ping timeout: 240 seconds]
amar has joined #ruby
amar has quit [Remote host closed the connection]
amar has joined #ruby
Burgestrand has joined #ruby
nibbo has quit [Ping timeout: 255 seconds]
Beams has joined #ruby
archedice has quit [Ping timeout: 240 seconds]
rippa has joined #ruby
xuyuheng has joined #ruby
braindead_ has joined #ruby
ren0v0 has joined #ruby
chat has joined #ruby
chat_ has quit [Ping timeout: 264 seconds]
archedice has joined #ruby
nibbo has joined #ruby
conta has quit [Quit: conta]
paraxial has quit [Ping timeout: 264 seconds]
soniya29 has joined #ruby
<arne> uhm, when i do something like
<arne> class Test;some_method;def some_method;"hello";end;end
paraxial has joined #ruby
<arne> it works, why is that exactly, does ruby honor definitions first?
apeiros has joined #ruby
<arne> asm>> class Test;some_method;def some_method;"hello";end;end
arne is now known as Bish
<Bish> asm>> class Test;some_method;def some_method;"hello";end;end
<ruby[bot]> Bish: I have disassembled your code, the result is at https://eval.in/1018658
za1b1tsu has quit [Quit: WeeChat 2.1]
lxsameer has quit [Quit: WeeChat 2.1]
<elomatreb> arahael: I don't think that works? some_method should be undefined in that scope (since it's an instance method=
herbmillerjr has quit [Read error: Connection reset by peer]
<elomatreb> Bish: ^ (sorry)
<Bish> elomatreb: well i have code running like this
<Bish> and i expected it to break
<Bish> then it didn't, i would like to understand hwy it doesn't
<Bish> i mean ruby has some oddities, which are good to know
<elomatreb> That example like that throws an error, it might be more useful if you do share your actual code
<Bish> hm, right it does..
<Bish> but it doesn.t seem to do it in production
<Bish> im confused
<elomatreb> Is there some metaprogramming/method_missing stuff going on?
herbmillerjr has joined #ruby
<Bish> une seconde, i will just share my code
herbmillerjr has quit [Client Quit]
<tbuehlmann> is this rails?
<Bish> nope
_yohji_ has joined #ruby
yohji has quit [Ping timeout: 248 seconds]
<elomatreb> To answer your original question: Ruby does not hoist definitions
<Bish> yeah i figure
Beams has quit [Quit: .]
<apeiros> Bish: place a `method(:some_method).source_location` in front of the call (and if its in prod, log the result away)
Beams has joined #ruby
TomyWork has quit [Remote host closed the connection]
TomyWork has joined #ruby
<Bish> apeiros: nono, i guess it's just a fuckup on my part
<Bish> i mean, it can't be that it works
<Bish> i will just place the call behind the definition
venmx has joined #ruby
ur5us has joined #ruby
jottr has joined #ruby
coffeecupp__ has joined #ruby
Es0teric has quit [Quit: Computer has gone to sleep.]
Mia has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
jottr has quit [Ping timeout: 240 seconds]
plexigras has joined #ruby
NL3limin4t0r has joined #ruby
herbmillerjr has joined #ruby
<NL3limin4t0r> Does Ruby have destruction assignment for hashes?
FernandoBasso has joined #ruby
<NL3limin4t0r> destructing*
dreamthese has quit [Remote host closed the connection]
dreamthese has joined #ruby
<elomatreb> destructuring? Not for hashes, no.
<Bish> you could write something like that, i guess
<dminuoso> NL3limin4t0r: you can fake it with values_at
herbmillerjr has quit [Ping timeout: 256 seconds]
<dminuoso> >> hash = {a:1, b:2, c:3}; a, b = hash.values_at(:a, :b)
<ruby[bot]> dminuoso: # => [1, 2] (https://eval.in/1018670)
<Bish> ohyeah, does ruby have deconstruction?
Nussi has quit [Quit: WeeChat 2.1]
<dminuoso> NL3limin4t0r: and you can splat onto methods
<Bish> does hash use values_at when using []?
<elomatreb> Bish: For arrays, yes: `a, b = [1, 2]` (and you can nest)
herbmillerjr has joined #ruby
<dminuoso> It should be using to_ary
<dminuoso> asm>> a, b = [1,2]
<ruby[bot]> dminuoso: I have disassembled your code, the result is at https://eval.in/1018674
<dminuoso> oh that looks magical
<dminuoso> asm>> a, b = c
<ruby[bot]> dminuoso: I have disassembled your code, the result is at https://eval.in/1018677
<Bish> how do i get the C code to the method with pry?
<dminuoso> Bish: you need pry-doc
<dminuoso> Bish: then you can use `show-source`
<Bish> great
<Bish> i read the code of pry recently, fun stuff with the piping to less etc
<dminuoso> Bish: especially when you ^C while in the pager
dr3w_ has joined #ruby
<Bish> is it what breaks the thing?
<dminuoso> It's at least one way. But you can `stty echo/stty sane` it bacjk
<Bish> good to know, happens quite often to me, but not because of ctrl-c
<Bish> working on a "eierlegende-wollmichsau"-project where i want to do the same
lxsameer has joined #ruby
<Bish> but with remote processes via ssh & docker
<elomatreb> I read that as "Eier-Legende" (egg legend)
<Bish> elomatreb: do you know what it means though :D?
<elomatreb> yeah, and my one is spelled wrong :)
<NL3limin4t0r> ty for the answers. Too bad destructing hashes isn't in Ruby yet, but I can move on for now.
<Bish> elomatreb: but you aren't german?
<Bish> NL3limin4t0r: it's not in there yet, it likely never will
<NL3limin4t0r> Bish: You'll never know for sure. Keyword arguments got also added later on.
chmurifree is now known as chmuri
<Bish> that's a whole different thing entirely, i mean what is hash deconstructing anyways?
za1b1tsu has joined #ruby
<Bish> some sort of callback the gets invoked if something isn't connected to the hash anymore?
<NL3limin4t0r> Something like `{label:} = {id: 1, label: 'item label'}` seems plausible (same syntax as keyword arguments).
<Bish> when i google hash destruturing i just find marihuana recipes
<za1b1tsu> hello anyone using rubymine?
<Bish> NL3limin4t0r: oh, i totally got you wrong
<Bish> yeah something like that may come, i like how javascript es6 did that
<Bish> sometimes i wish ruby had it too, yes
<Bish> i guess you could write a method that does something like that
<NL3limin4t0r> I'm good for now though, I was just wondering if it was in Core.
<Bish> well not really.
<elomatreb> It's basically the toned-down imperative version of pattern matching from functional languages
<Bish> isn't everything a toned-down imperative version of something in functional language
<elomatreb> (mmmh the words lined up)
<Bish> can you do something like.. have a callback in a binding, that gets called when a lvar get's referenced/used?
<Bish> i guess then you could do what he wants with
chmuri has quit [Excess Flood]
<Bish> magic_hash ( [a,b,c] )
<za1b1tsu> I'm trying out IDEs to see what I'm missing with vim, but is this: https://i.imgur.com/cSl355G.png
<elomatreb> That's lazy evaluation, another thing from functional languages :P
herbmillerjr has quit [Ping timeout: 256 seconds]
soniya29 has quit [Ping timeout: 255 seconds]
<Bish> huh, i think i found a bug in pry
<Bish> _file_ is hash.c for me (i guess because i read the show-src of Hash.new.values_at"
chmurifree has joined #ruby
herbmillerjr has joined #ruby
nfk has joined #ruby
<NL3limin4t0r> za1b1tsu: Yep 🙋
ellcs has joined #ruby
snickers has quit [Quit: Textual IRC Client: www.textualapp.com]
<za1b1tsu> dumb
<za1b1tsu> it's not just session[. it does not find session
<za1b1tsu> had to go in terminal with grep :D
rabajaj_ has quit [Ping timeout: 268 seconds]
Zaab1t has joined #ruby
rabajaj has joined #ruby
ur5us has quit [Remote host closed the connection]
BlopMonster has joined #ruby
apparition has joined #ruby
ur5us_ has joined #ruby
rabajaj_ has joined #ruby
rabajaj_ has quit [Client Quit]
ur5us_ has quit [Read error: Connection reset by peer]
ur5us has joined #ruby
<NL3limin4t0r> za1b1tsu: Try Ctrl+Shift+F
rabajaj has quit [Ping timeout: 260 seconds]
BlopMonster has quit [Ping timeout: 276 seconds]
<NL3limin4t0r> Shift+Shift is just for finding filenames or classes
<NL3limin4t0r> The navigation shortcuts I'll use most are Ctrl+N for navigating classes, Ctrl+Shift+N for navigating plain file names and Ctrl+Shift+F to find content of files in the whole project.
kapil___ has quit [Quit: Connection closed for inactivity]
jottr has joined #ruby
GodFather has quit [Ping timeout: 268 seconds]
AJA4350 has joined #ruby
heftig_ is now known as heftig
amar has quit [Ping timeout: 260 seconds]
donofrio has joined #ruby
RougeR has joined #ruby
jottr has quit [Ping timeout: 240 seconds]
jrafanie has joined #ruby
ciscam has quit [Ping timeout: 245 seconds]
ciscam has joined #ruby
workmad3 has joined #ruby
micutzu has quit [Ping timeout: 260 seconds]
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #ruby
gigetoo has quit [Ping timeout: 256 seconds]
micutzu has joined #ruby
jottr has joined #ruby
ramfjord has quit [Ping timeout: 268 seconds]
konsolebox has quit [Ping timeout: 248 seconds]
kt has joined #ruby
za1b1tsu has quit [Ping timeout: 256 seconds]
za1b1tsu has joined #ruby
xuyuheng has quit [Ping timeout: 276 seconds]
patteh_ has quit [Remote host closed the connection]
patteh has joined #ruby
gigetoo has joined #ruby
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
sleetdrop has joined #ruby
ur5us has quit [Ping timeout: 264 seconds]
patteh has quit [Remote host closed the connection]
patteh has joined #ruby
ellcs has quit [Ping timeout: 248 seconds]
Aleeious has joined #ruby
xuyuheng has joined #ruby
Aleeious has quit [Client Quit]
Aleeious has joined #ruby
cyberg has joined #ruby
xuyuheng has quit [Ping timeout: 256 seconds]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
fmcgeough has joined #ruby
kt has quit [Ping timeout: 256 seconds]
jamesaxl has joined #ruby
kt has joined #ruby
Aleeious has quit [Remote host closed the connection]
Aleeious has joined #ruby
Aleeious has quit [Remote host closed the connection]
Aleeious has joined #ruby
amatas has joined #ruby
amatas has quit [Client Quit]
beefjoe has joined #ruby
amatas has joined #ruby
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
amatas has quit [Ping timeout: 240 seconds]
xuyuheng has joined #ruby
xuyuheng has quit [Ping timeout: 240 seconds]
jottr has quit [Ping timeout: 256 seconds]
megamos has joined #ruby
kliq has joined #ruby
loveablelobster has joined #ruby
megamosaren has joined #ruby
megamos has quit [Client Quit]
megamosaren is now known as megamos
cliq has joined #ruby
za1b1tsu has quit [Quit: WeeChat 2.1]
kliq has quit [Ping timeout: 240 seconds]
kliq has joined #ruby
cliq has quit [Ping timeout: 240 seconds]
loveablelobster has quit [Quit: Textual IRC Client: www.textualapp.com]
xuyuheng has joined #ruby
conta has joined #ruby
gigetoo has quit [Ping timeout: 240 seconds]
bmurt has joined #ruby
gigetoo has joined #ruby
megamos has quit [Ping timeout: 260 seconds]
jcalla has joined #ruby
kapil___ has joined #ruby
conta has quit [Quit: conta]
micutzu has quit [Ping timeout: 240 seconds]
jottr has joined #ruby
conta has joined #ruby
synthroid has joined #ruby
vondruch has quit [Ping timeout: 264 seconds]
jcalla has quit [Ping timeout: 256 seconds]
jottr has quit [Ping timeout: 264 seconds]
sleetdrop has quit [Quit: Computer has gone to sleep.]
Es0teric has joined #ruby
raynold has quit [Quit: Connection closed for inactivity]
GodFather has joined #ruby
megamos has joined #ruby
karapetyan has joined #ruby
jottr has joined #ruby
gigetoo has quit [Ping timeout: 255 seconds]
pacorro2000 has quit [Quit: leaving]
jcalla has joined #ruby
ta_ has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
kt has quit [Ping timeout: 256 seconds]
kliq has quit [Quit: Leaving]
kt has joined #ruby
<eising> If I have a string that ends with a \r\n, am I right to suspect that this will not be matched by regex '$'?
<heftig> eising: the \r is a problem, yes
<eising> looks like I have to .chomp then
<heftig> .chomp("\r\n")
cyberg has quit [Ping timeout: 256 seconds]
<heftig> ah, nvm, bare .chomp does recognize \r\n
cyberg has joined #ruby
kt has quit [Ping timeout: 245 seconds]
t0xik has quit [Quit: Connection closed for inactivity]
<braindead_> scrooloose, also with the path its not working
<scrooloose> braindead_: what is the error?
<braindead_> bundle not found
<braindead_> if i ssh in the path, can i check the bundle there somehow?
<braindead_> if i just type bundle exec ruby script/mail_new_activity something should happen, right?
<braindead_> because there is no feedback at all
<braindead_> no error but no success either
aupadhye has quit [Ping timeout: 264 seconds]
<scrooloose> braindead_: Yeah you should be able to ssh in and run the command and then sub in the full path to bundler for cron
Es0teric has quit [Quit: Computer has gone to sleep.]
amatas has joined #ruby
<scrooloose> so the crontab entry command will be something like `cd /path/to/app/dir && /path/to/bundle exec the-command`
Rapture has joined #ruby
<braindead_> i tried this, but its the same result. bundle not found
<braindead_> cd /var/www/vhosts/domain/httpdocs && env RAILS_ENV=production sh -c '/var/www/vhosts/domain/httpdocs/bundle exec ruby script/mail_new_activity; /var/www/vhosts/domain/httpdocs/bundle exec ruby script/post_to_twitter'
face has joined #ruby
<braindead_> but bundle is not a folder.. do i need to make a space between the path and bundle?
<dminuoso> The uglifyify transform removes development imports. Make it global too (-g).
<dminuoso> What the..
<scrooloose> braindead_: what does `which bundle` return?
mikecmpbll has quit [Quit: inabit. zz.]
<braindead_> i did it like this now and no errors returned
<braindead_> cd /var/www/vhosts/domain/httpdocs && env RAILS_ENV=production sh -c 'cd /var/www/vhosts/domain/httpdocs bundle exec ruby script/mail_new_activity; cd /var/www/vhosts/domain/httpdocs bundle exec ruby script/post_to_twitter'
mikecmpbll has joined #ruby
kt has joined #ruby
<scrooloose> result!
k0mpa has joined #ruby
<scrooloose> I guess 2/3rds of those `cd /var/www/...httpdocs` commands are redundant?
micutzu has joined #ruby
nfk has quit [Quit: Try memory.free_dirty_pages=true in about:config]
amatas has quit [Ping timeout: 264 seconds]
<braindead_> it dont returns anything because i am running it in plesk
<braindead_> but the server is not running. at least i cant reach the app in browser
<braindead_> it just returns "command here" successfully completed in 0 seconds.
<braindead_> can i somehow check if the app is running in the background?
amar has joined #ruby
amelliaa has joined #ruby
<scrooloose> braindead_: you can ssh onto the machine right? why not just search/grep the output of `ps -eF` or similar? or `lsof -nPi` and see what is listening
vondruch has joined #ruby
dhollin3 is now known as dhollinger
<braindead_> thanks. it seems like nothing is started
<wkoszek> havenwood: Thanks.
<braindead_> when i paste this into shell nothing happens as well: cd /var/www/vhosts/domain/httpdocs && env RAILS_ENV=production sh -c 'cd /var/www/vhosts/domain/httpdocs bundle exec ruby script/mail_new_activity; cd /var/www/vhosts/domain/httpdocs bundle exec ruby script/post_to_twitter'
<braindead_> normally i start the server like this: rails s -e production
sinduck has joined #ruby
<braindead_> do i maybe need to add this before the &&
<scrooloose> braindead_: are these just periodic tasks you are wanting to run?
<braindead_> i am trying the last part of this install guide: https://github.com/lobsters/lobsters
<braindead_> app is running and all but i need to do it manually right now
<braindead_> this cronjob seems to automate the task
<scrooloose> well, I see the script files in question load the rails env, so you dont need to do that yourself
gnufied has joined #ruby
<braindead_> but nothing happens or at least i cant see a result. app is not available too
<henoc> hello friends
<henoc> does anybody here that can helps me to use this project? https://github.com/taskrabbit/makara
<scrooloose> if you run the command, does it output to any log files? try running then look at `find / -mmin -5` and see if it changed any files
<henoc> What I need to do for use it ?
amatas has joined #ruby
<henoc> for execute this
<henoc> to execute this
<scrooloose> braindead_: other than that I would say to start sticking `puts` commands inside the scripts and see what is happening
<braindead_> find / -mmin -5 results in an huge output. cant see if there changes something.
<braindead_> i just opened one of the scripts. where would i stick puts in? just at the beginning?
dviola has joined #ruby
jrafanie has joined #ruby
venmx has quit [Ping timeout: 276 seconds]
gnufied has quit [Quit: Leaving]
gnufied has joined #ruby
BlopMonster has joined #ruby
gigetoo has joined #ruby
thebetrayer has joined #ruby
conta has quit [Quit: conta]
saTchymoto has quit []
workmad3 has quit [Ping timeout: 260 seconds]
<braindead_> scrooloose: maybe you have an idea
arekushi has quit [Quit: Gateway shutdown]
<braindead_> if i ssh to the path and run ->> rails s && env RAILS_ENV=production sh -c 'bundle exec ruby script/mail_new_activity' it works
<braindead_> but when i stay at the same path and type ->> cd /var/www/vhosts/domain/httpdocs rails s && env RAILS_ENV=production sh -c 'bundle exec ruby script/mail_new_activity' nothing happens. no error, no server start
chouhoulis has joined #ruby
workmad3 has joined #ruby
pwnd_nsfw` has quit [Read error: Connection reset by peer]
gizmore has joined #ruby
<mnemon> braindead_: cd fails with 3 arguments, nothing after && will be run.
arekushi has joined #ruby
<mnemon> cd /var/www/vhosts/domain/httpdocs; rails s && ...
<braindead_> that worked! thank you mnemon
<mnemon> np
ellcs has joined #ruby
BlopMonster has quit [Ping timeout: 255 seconds]
millerti has joined #ruby
biberu has quit []
karapetyan has quit [Remote host closed the connection]
dionysus69 has quit [Ping timeout: 256 seconds]
xuyuheng has quit [Remote host closed the connection]
za1b1tsu has joined #ruby
xuyuheng has joined #ruby
<_aeris_> hello!
<_aeris_> i have this strange behaviour on Hash with a default value to empty array
<_aeris_> how is it possible to have .keys returning empty, but having real not default value for a key ? ><
<_aeris_> even f.has_key? :foo return false ><
stairmast0r has quit [Quit: bye]
stairmast0r has joined #ruby
troys has joined #ruby
karapetyan has joined #ruby
xuyuheng has quit [Ping timeout: 256 seconds]
xuyuheng has joined #ruby
sleetdrop has joined #ruby
pwnd_nsfw has joined #ruby
apparition has quit [Quit: Bye]
GodFather_ has joined #ruby
GodFather has quit [Read error: Connection reset by peer]
amatas has quit [Ping timeout: 240 seconds]
kapil___ has quit [Quit: Connection closed for inactivity]
karapetyan has quit [Remote host closed the connection]
grilix has joined #ruby
synthroid has quit [Remote host closed the connection]
yokel has quit [Ping timeout: 264 seconds]
karapetyan has joined #ruby
<cdunklau> _aeris_: heh. the default is shared
yokel has joined #ruby
karapetyan has quit [Remote host closed the connection]
<darix> _aeris_: next time use something like https://gist.github.com/ - then people dont have to type all the stuff again
<_aeris_> :D
<darix> cdunklau: I would still expect f.keys to return something. dont you?
BlopMonster has joined #ruby
<cdunklau> darix: sure, it's odd
<cdunklau> darix: looks like f[:foo] << :bar doesn't care that the left side is a hash access whateveryoucallit
shinnya has quit [Ping timeout: 264 seconds]
<cdunklau> it just does f[:foo], which returns the default array. and then appends to it
synthroid has joined #ruby
<scrooloose> i.e. none of that code is actually setting a value for f[:foo]
<darix> so pass in a block to Hash.new, that returns an array instance
<cdunklau> _aeris_: the solution appears to be Hash.new { [] }
<cdunklau> right that
<_aeris_> cdunklau > nope, doesn't work too
<cdunklau> reminds me of the `def foo(arg=[]):` trap in python
<pabs> Hash.new { |h, k| h[k] = [] }
<cdunklau> _aeris_: sure it does. you just can't append to an array for a key that doesn't exist yet
<cdunklau> at least not like that
whippythellama has joined #ruby
gigetoo has quit [Ping timeout: 245 seconds]
<pabs> >> %w{a s d f}.each_with_object(Hash.new { |h, k| h[k] = [] }) { |c, h| h[c] << c }
<ruby[bot]> pabs: # => {"a"=>["a"], "s"=>["s"], "d"=>["d"], "f"=>["f"]} (https://eval.in/1018897)
<pabs> => {"a"=>["a"], "s"=>["s"], "d"=>["d"], "f"=>["f"]}
<cdunklau> _aeris_: you could do it with f[:foo] <<= :bar
<cdunklau> _aeris_: if you use the basic Hash.new { [] }
gigetoo has joined #ruby
<cdunklau> are method default args evaluated on call or on definition?
<cdunklau> wait, i could easily TIAS nm
amar has quit [Ping timeout: 256 seconds]
andikr has quit [Remote host closed the connection]
BlopMonster has quit [Ping timeout: 268 seconds]
za1b1tsu has quit [Quit: WeeChat 2.1]
tty has quit [Quit: tty]
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
venmx has joined #ruby
<gizmore> expect(mod).to(not_equal(mod2))
<gizmore> # undefined method not_equal
asio has joined #ruby
Burgestrand has quit [Quit: Closing time!]
ellcs has quit [Ping timeout: 264 seconds]
chouhoulis has quit [Ping timeout: 256 seconds]
xuyuheng has quit [Quit: Quit: My MacBook Pro has gone to sleep. ZZZzzz?]
grilix has quit [Ping timeout: 240 seconds]
MyMind has joined #ruby
dionysus69 has joined #ruby
Sembei has quit [Ping timeout: 276 seconds]
GodFather_ has quit [Ping timeout: 268 seconds]
gigetoo has quit [Ping timeout: 264 seconds]
Beams has quit [Quit: .]
konsolebox has joined #ruby
mikecmpbll has quit [Read error: Connection reset by peer]
sysvalve has quit [Quit: Leaving]
mikecmpbll has joined #ruby
joast has quit [Quit: Leaving.]
clemens3 has quit [Ping timeout: 276 seconds]
gigetoo has joined #ruby
joast has joined #ruby
grilix has joined #ruby
jcarl43 has joined #ruby
andrewray has joined #ruby
amelliaa has quit [Ping timeout: 260 seconds]
karapetyan has joined #ruby
_yohji_ has quit [Remote host closed the connection]
cthulchu has joined #ruby
thebetrayer has quit [Ping timeout: 255 seconds]
darkhanb has joined #ruby
jottr has quit [Ping timeout: 245 seconds]
karapetyan has quit [Ping timeout: 256 seconds]
za1b1tsu has joined #ruby
eckhardt has joined #ruby
eckhardt has quit [Client Quit]
eckhardt has joined #ruby
gigetoo has quit [Ping timeout: 264 seconds]
Jiao has quit [Ping timeout: 260 seconds]
amar has joined #ruby
kmurphy4 has joined #ruby
akaiiro has joined #ruby
gigetoo has joined #ruby
amar has quit [Ping timeout: 256 seconds]
Eiam has joined #ruby
drale2k_ has joined #ruby
Zladivliba has joined #ruby
andrewray has quit [Quit: andrewray]
bbobb has joined #ruby
conta has joined #ruby
chouhoulis has joined #ruby
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
<baweaver> >> %w(a b c c c).group_by(&:itself) # pabs / _aeris_
<ruby[bot]> baweaver: # => {"a"=>["a"], "b"=>["b"], "c"=>["c", "c", "c"]} (https://eval.in/1018977)
<baweaver> gizmore: where'd you find that syntax?
<baweaver> It's to_not
<gizmore> baweaver: its mine.... ended up with:
<gizmore> expect(mod != mod2).to be_truthy
<baweaver> Y'might want to read through the Relish docs for RSpec, it'll be easier. The matchers also give better errors when something goes wrong
mikecmpbll has quit [Ping timeout: 264 seconds]
sanscoeur has joined #ruby
BlopMonster has joined #ruby
<baweaver> cdunklau: <<= doesn't exist.
<baweaver> This is how hash constructors work - https://medium.com/@baweaver/abusing-hash-constructors-65d59c0a5b27
<gizmore> baweaver: please read my specfile :) ...... https://github.com/gizmore/gdo/blob/master/spec/gdo_spec.rb
<gizmore> it's trusty site... from microsoft
herbmillerjr has quit [Quit: Konversation terminated!]
gregf_ has joined #ruby
cadillac_ has quit [Read error: Connection reset by peer]
Azure|dc has quit [Ping timeout: 264 seconds]
<gizmore> baweaver: gotta go.... feedback on my stuff is welcome... might query me if you like... baba
Azure has joined #ruby
gigetoo has quit [Ping timeout: 276 seconds]
<Zladivliba> hey everyone
<Zladivliba> fd.write("%s: \"%s\"\n" % [key.gsub(/comment_/,''), value])
<Zladivliba> I need to remove " in %s
<Zladivliba> any idea how i can do that ?
cadillac_ has joined #ruby
[Butch] has joined #ruby
[Butch] has quit [Client Quit]
mjolnird has quit [Remote host closed the connection]
venmx has quit [Ping timeout: 256 seconds]
<baweaver> >> %(String with "a lot" 'of' """"quotes"""").delete(%('"))
<ruby[bot]> baweaver: # => "String with a lot of quotes" (https://eval.in/1018994)
sleetdrop has quit [Quit: Computer has gone to sleep.]
<Zladivliba> baweaver: i don't speek ruby at all... i'm just editing a file to make something work
<Zladivliba> so that would be value.delete... right ?
<baweaver> Give it a try.
<Zladivliba> will it work if i do that : fd.write("%s: \"%s\"\n" % [key.gsub(/comment_/,''), value.delete(%('"))])
<baweaver> try it
<Zladivliba> you're removing ' also right ?
<Zladivliba> actually i need '
<baweaver> then remove that
soniya29 has joined #ruby
soniya29_ has joined #ruby
venmx has joined #ruby
<Zladivliba> baweaver: ok thanks, i'm trying... (taking a while...)
<Zladivliba> baweaver: `block (3 levels) in <top (required)>': undefined method `delete' for nil:NilClass (NoMethodError)
<baweaver> What do you think went wrong?
[Butch] has joined #ruby
akaiiro has quit [Remote host closed the connection]
<Zladivliba> hum i don't know... The value should apply to the second %s, so it's possible it's an array ?
<Zladivliba> not a string
gigetoo has joined #ruby
<Zladivliba> baweaver: was that the case ?
<baweaver> Read that error
<baweaver> only what's after the :
<Zladivliba> i tried
<Zladivliba> search online but can't find result that makes sense
<Zladivliba> (i don't program in ruby...)
tpendragon has quit [Remote host closed the connection]
Guest75834 has quit [Remote host closed the connection]
<baweaver> NoMethodError
<baweaver> undefined method `delete'
<baweaver> What do those two indicate to you?
chouhoul_ has joined #ruby
<Zladivliba> nothing
<Zladivliba> like GDPR article 6.1.a
<baweaver> ironically you're correct
<Zladivliba> i don't understnad what it means
<Zladivliba> that's why i'm here
<baweaver> and I'm trying to help you understand
<Zladivliba> otherwise i would solve the problem and not bother anyone about it
<baweaver> that's why I'm here.
<Zladivliba> ok but you're too cryptic about it for me to understnad anything
<Zladivliba> like i understnad i have an value/key
<Zladivliba> and it's trying to write that
<baweaver> A method is a function called on an object
<Zladivliba> okey
<Zladivliba> i follow
<baweaver> Now if something says undefined method and NoMethodError, what do you think that means
<Zladivliba> hum there's no function
<Zladivliba> so no object
<Zladivliba> ?
<baweaver> Close.
<baweaver> the second part tells us
<baweaver> "for nil:NilClass"
<Zladivliba> that's like chineese to me
<baweaver> nil is an object, but it's also "nothing"
<Zladivliba> ok what is for ?
<baweaver> Zladivliba: waxing about how things aren't understandable isn't going to do you any good. Ask questions about it instead.
<Zladivliba> so 'there's no method for no method...'
<Zladivliba> i don't get it
<baweaver> There's no method for nil
<baweaver> >> nil.delete
<ruby[bot]> baweaver: # => undefined method `delete' for nil:NilClass (NoMethodError) ...check link for more (https://eval.in/1019009)
<Zladivliba> ok so what is inside my valye ?
<Zladivliba> is it a string ?
chouhoulis has quit [Ping timeout: 240 seconds]
<baweaver> It's nil
<baweaver> >> ''.delete
<ruby[bot]> baweaver: # => "" (https://eval.in/1019010)
amar_ has joined #ruby
<baweaver> So one of your values is nil, which means it has no idea what you mean by "delete"
<Zladivliba> check the code
<Zladivliba> ok so i don't understand any of the code you sent it's like way to advanced for me
<baweaver> questions, not complaints.
<baweaver> I can't do anything with "too advanced"\
<Zladivliba> ok so what's the value inside value
<Zladivliba> is it a string ?
<Zladivliba> i can't understand that - that' would be my first point of entry
<Zladivliba> in the code i sent
<baweaver> If it were a string that delete would have worked
<Zladivliba> okeyyyyy
<baweaver> what happened when I called it on nil?
<Zladivliba> first thing
<Zladivliba> i don't undesrtand your nil
<Zladivliba> it's GDPR to me
<Zladivliba> actually i understand gdpr better
<Zladivliba> :)
<Zladivliba> ok so second question : why isn't it a string
<Zladivliba> ?
<Zladivliba> there should be some data inside
amar_ has quit [Ping timeout: 256 seconds]
<Zladivliba> is there some data inside ? and if yes why it's not a string ?
<baweaver> There's no data inside.
<Zladivliba> wow
<Zladivliba> i got it, it's failing because inside my array - originally - some of the data is empty
<Zladivliba> so if I add a test if string() it should work right ?
gigetoo has quit [Ping timeout: 260 seconds]
apeiros has quit [Remote host closed the connection]
apeiros has joined #ruby
<baweaver> Or use that, less of a mess than the original script
<baweaver> Anyways, off I go.
venmx has quit [Ping timeout: 256 seconds]
apeiros has quit [Ping timeout: 265 seconds]
chouhoul_ has quit [Remote host closed the connection]
chouhoulis has joined #ruby
NL3limin4t0r has quit [Quit: WeeChat 1.9.1]
TomyWork has quit [Ping timeout: 240 seconds]
nfk has joined #ruby
<Zladivliba> baweaver: thanks. It's a script to export wp comments i found online, i'm trying to migrate to Jekyll
<Zladivliba> baweaver: your code doesn't work, same problem
<Zladivliba> undefined method `[]' for nil:NilClass (NoMethodError)
<cdunklau> baweaver: my ruby isn't good enough yet to grok the madness in that post. <<= definitely does work though https://bpaste.net/show/dbeef5e8a1a3
<cdunklau> baweaver: but i guess i don't understand what exactly that's _doing_
gigetoo has joined #ruby
jrich523 has joined #ruby
spiette has quit [Quit: ZNC 1.7.0 - https://znc.in]
spiette has joined #ruby
ta_ has quit [Quit: Leaving...]
giraffe has joined #ruby
giraffe is now known as Guest9306
tpendragon has joined #ruby
<jrich523> that makes my eyes bleed.. there has to be a better way right?
<audy> jrich523: try?
gigetoo has quit [Ping timeout: 256 seconds]
<jrich523> ahh cool, thanks!
<audy> jrich523: but that's a rails thing and works for attributes not hash keys
<audy> jrich523: you can do hash.dig(:key1, :key2, ...) in plain ruby
<jrich523> let me try it
noron99 has joined #ruby
soniya29 has quit [Quit: Leaving]
soniya29_ has quit [Quit: Leaving]
<jrich523> if i try, nodes[0].dig(:facts, :kvm) i get nil
<noron99> Hello, does anyone use Sinatra?
<havenwood> noron99: Yes, they sure do!
<noron99> Do you know the documentation to create an API?
kmurphy4 has quit [Remote host closed the connection]
<jrich523> looks like you just define routes
<jrich523> so should be super easy to make an API interface
sphenxes has joined #ruby
gigetoo has joined #ruby
dionysus69 has quit [Quit: dionysus69]
chouhoul_ has joined #ruby
<noron99> Okay, it happens that it's my first API
agent_white has joined #ruby
<jrich523> well
<jrich523> the readme covers most topics
<jrich523> but really its just a method (get/post/ not sure what else is supporteD)
<jrich523> and then a path
za1b1tsu has quit [Ping timeout: 240 seconds]
<jrich523> they even show you how to use variables in the path and such
<jrich523> its just a set of paths and actions for those paths, easiest api you'll ever create (probably)
<noron99> ok, thank you very much, I thought it was much more
<jrich523> nah its really basic
<noron99> what routes
<jrich523> its the front end thats hard :)
<jrich523> routes are what query strings use to be lol
<jrich523> you use to do stuff like
wontruefree has joined #ruby
<jrich523> api/entrypoint?option1=something
<jrich523> now its more like
chouhoulis has quit [Ping timeout: 260 seconds]
<jrich523> api/action/optionValue
<jrich523> each part of the url is info to the API
<jrich523> get '/hello/:name' do
<jrich523> which is what they are showing there
<jrich523> the route is hello and then an a name
<jrich523> routes usually sort of tier down so to speak
<jrich523> a better example woudl be
<noron99> All right, it happens that I'm also just learning ruby
<jrich523> get 'users'
<jrich523> vs
dbugger_ has joined #ruby
amatas has joined #ruby
<jrich523> get '/users/:name'
<jrich523> which would get all users vs get one users
<jrich523> checkout the readme, it shows examples of the route types
<noron99> magific
<jrich523> you've got wildcards too
<jrich523> yeah mostly magic, you dont have to worry about anything other than your actions... pretty simple :)
<noron99> thanks bro
<noron99> Have you used grappe?
<jrich523> nope
<jrich523> i actually dont do much ruby
<jrich523> im just dumped on to random things, and am told to figure it out
<jrich523> just recently happens to be ruby puppet/foreman stuff :)
<al2o3-cr> doing `f[:foo] <<= 1` is the same as doing `f[:foo] = f[:foo] << 1`
<noron99> Which framework do you recommend to create API, SInatra or Rails::API?
<noron99> XD
<jrich523> just taking a look at sinatra, it looks pretty solid and extensive
<jrich523> but probably not as extensive or customizable as rails
<jrich523> so in your case, probably stick with sinatra?
TomyLobo has joined #ruby
k0mpa has quit [Remote host closed the connection]
<noron99> I am a programmer and they told me to study ruby
<noron99> if I stay with Sinatra
<darix> noron99: learn the basics. and apply them to what ever framework will be the best for that task at hand
<noron99> It is said to be the best option for API
<al2o3-cr> >> s = "hell"; s <<= 111
<ruby[bot]> al2o3-cr: # => "hello" (https://eval.in/1019057)
<darix> noron99: that can matter a lot on the case
<darix> someone else posted the other day here how they prefer a framework hasomething nowadays
Zladivliba has quit [Remote host closed the connection]
<noron99> Así es, incluso estoy pensando que el APIS, hacer un rack con grape
<darix> gitlab uses grape
<noron99> yes
<noron99> but I do not know whether to make the apis also with grape, so as not to use too much framework
<darix> noron99: lets say someone asks you do add an API for an existing app.
eckhardt_ has joined #ruby
<darix> and the existing app is rails. but you only learned sinatra
<darix> would you write the api in sinatra?
<noron99> Puede ser integrado
<noron99> It can be integrated
<noron99> I plan to integrate it with Rails
za1b1tsu has joined #ruby
eckhardt has quit [Ping timeout: 276 seconds]
grilix has quit [Ping timeout: 256 seconds]
orbyt_ has joined #ruby
dr3w_ has joined #ruby
sauvin has quit [Read error: Connection reset by peer]
clemens3 has joined #ruby
sepp2k has joined #ruby
amar has joined #ruby
Burgestrand has joined #ruby
megamos has quit [Ping timeout: 264 seconds]
<jrich523> audy dig works, but i have to use strings and not symbols .dig("facts","kvm")
ramfjord has joined #ruby
<audy> jrich523: 'cause your keys are strings and not symbols
<jrich523> yeah, not much of a choice, its the return of the puppetdb module (json)
gigetoo has quit [Ping timeout: 264 seconds]
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
za1b1tsu has quit [Ping timeout: 268 seconds]
amar has quit [Remote host closed the connection]
grilix has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
conta has quit [Quit: conta]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
headius has joined #ruby
Burgestrand has quit [Quit: Closing time!]
Burgestrand has joined #ruby
chouhoul_ has quit [Remote host closed the connection]
chouhoulis has joined #ruby
drale2k_ has joined #ruby
orbyt_ has joined #ruby
za1b1tsu has joined #ruby
gigetoo has joined #ruby
solocshaw has joined #ruby
<henoc> guys
<henoc> does anybody here that can helps me to use this project? https://github.com/taskrabbit/makara
<henoc> What I need to do for run it ?
<henoc> :)
za1b1tsu has quit [Ping timeout: 264 seconds]
<Zarthus> deja u
<Zarthus> didn't i answer this
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
solocshaw has quit [Quit: solocshaw]
<noron99> right there tells you how to install it
solocshaw has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
solocshaw has quit [Client Quit]
solocshaw has joined #ruby
amar has joined #ruby
weird_error has joined #ruby
lytol has joined #ruby
drale2k_ has joined #ruby
Neptu has joined #ruby
plexigras has quit [Ping timeout: 240 seconds]
plexigras has joined #ruby
<henoc> noron99: yes, I do it, but How can I run it
<henoc> rails server <-- ?
<noron99> yesd
<gizmore> # Hook i18n into all objects? (good idea?)
<gizmore> class Object; def t(key, *args); ::GDO::Lang::Trans.instance.translate(key, *args); end; end
dviola has quit [Quit: WeeChat 2.1]
<havenwood> gizmore: bad idea ;-P
<gizmore> havenwood: you should look at my event class.... it is one page and works Oo
<noron99> xd
<gizmore> the global t() function also "works" :D
<gizmore> i love ruby.... totally different than php tho :/ (the apache mod stuff)
<gizmore> a ruby app is long living
<gizmore> a php app is one page all new all kill
<gizmore> btw, i am doing a completely new approach to the dba / entitiy stuff
<gizmore> activerecord and laravel is outdated
<havenwood> gizmore: Defining your global method on Kernel would be slightly better. Better yet, you can use refinements.
<gizmore> Like "class Kernel" for a monkeypatch would work?
<havenwood> gizmore: module Kernel
<gizmore> this gets mixed into Object?
<havenwood> gizmore: yup
<gizmore> comments very welcome
<havenwood> >> module Kernel; def gizmore; :gizmore end end; gizmore
<ruby[bot]> havenwood: # => :gizmore (https://eval.in/1019114)
GodFather has joined #ruby
<gizmore> >> module Kernel; def gizmore; :gizmore end end; gizmore; Object.new.gizmore
<havenwood> gizmore: This is what a refinement might look like: https://gist.github.com/havenwood/3c6329429e91c6703f5e86fc97be0e8e
<gizmore> never heard of refine
<havenwood> gizmore: The `using T` can then be put at the top of the class where you want `t` available.
<havenwood> gizmore: That way it's lexically scoped, and only happens in the file where it's used.
<gizmore> thank you
<gizmore> btw, i am coding an own ActiveRecord. i would like to discuss the approach with someone... we can do this in #gdo :P
<jrich523> what is the ruby 1.9 hash syntax? (i wish rubocop had id's i could lookup)
<gizmore> jrich523: { key: val } should work?
<henoc> gizmore: :)
<havenwood> gizmore: #RubyOnRails sounds like the right place for that.
<havenwood> gizmore: oh, coding your own - gotcha
<havenwood> nvm then, here is probably a better place
<gizmore> havenwood: no... activerecord was just an example..... the activerecord dba is horrible slow
<havenwood> gizmore: Sequel ftw.
<jrich523> it works fine, just wondering why rubocop is complainig about..
<jrich523> kvms.push({:site => n['ss_site'], :hostname => n['hostname'], :guestcount => (n.dig('facts', 'kvm', 'guests') || []).count })
<gizmore> i am doing an own dba.... (i am porting my own dba from php)
<jrich523> basically its that now
<gizmore> jrich523: what is the exact exception? (and don't swallow)
<henoc> havenwood: thank you
<havenwood> jrich523: kvms.push site: n['ss_site'], hostname: n['hostname'], guest_count: n.dig('facts', 'kvm', 'guests').to_i
<havenwood> >> nil.to_i
<ruby[bot]> havenwood: # => 0 (https://eval.in/1019115)
<jrich523> oddly that removed other "issues" but the "use ruby 1.9 hash syntax" is still there
<jrich523> Style/HashSyntax: Use the new Ruby 1.9 hash syntax. (convention:Style/HashSyntax)
<havenwood> jrich523: It must be another line. Search for: =>
<RougeR> i need to an active record query join request not quite sure how. ive got tables called climbs, routes, gyms
<havenwood> jrich523: a `=>` is a "Hash rocket". If you use a Hash rocket with a Symbol key, Rubocop will whine.
<jrich523> the :site => has the green underline
<RougeR> i want to find which gym a climb belongs to
<jrich523> ahh thats probably it :)
<havenwood> jrich523: Note how I wrote that.
<RougeR> there are relations between climb and route
<gizmore> havenwood: thanks for your support all the years! i remember your nick since ages. thx
<RougeR> and route and gym
<havenwood> gizmore: You're welcome!
<RougeR> but not betwen climb and gym
<jrich523> gotcha! thanks
<jrich523> that was somewhere in my memory too... damn recall problems :-/
<al2o3-cr> they've aliased yield_self -> then
<havenwood> 42.then(&:itself) #=> 42
<al2o3-cr> i kinda like it
za1b1tsu has joined #ruby
anisha has joined #ruby
<havenwood> ?rails RougeR
<ruby[bot]> RougeR: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
<RougeR> its always so dead there, but yeah will do
dviola has joined #ruby
<jrich523> hmm so it doesnt seem like that syntax likes to be spread across lines..
mantak has joined #ruby
dviola has quit [Client Quit]
<jrich523> nvm
za1b1tsu has quit [Ping timeout: 245 seconds]
<jrich523> havenwood the change in syntax for the count doesnt fly, since it cant to_i a set of child hashes
<havenwood> jrich523: How do you count those?
dviola has joined #ruby
<jrich523> :guestcount => (n.dig('facts', 'kvm', 'guests') || []).count })
<jrich523> i did that cuz i dont know what im doing, but the guest key is a set of guest objects (hash of a few simple params)
<havenwood> jrich523: What does this return?: n.dig('facts', 'kvm', 'guests')
<havenwood> #=> ?
<jrich523> a hash, where the key is the guest name, and the value is a hash of properties
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood> jrich523: And you're trying to count the properties? Or?
<jrich523> jsut the number of guests (key count?)
<jrich523> guests.count which was fine, until some returned nil, which made me write that funkiness
<havenwood> jrich523: n.dig('facts', 'kvm', 'guests')&.size.to_i
<jrich523> testing
telmac has joined #ruby
anisha has quit [Quit: This computer has gone to sleep]
<telmac> so let's say I want to do something equivalent to like, performing a test on every element in the cartesian product of two sets
<telmac> my first intution was do two nested while loops, but, and this I don't understand, resulted in the function ending too soon? so it would do the first iteration of the first while loop
<telmac> and all of the iterations of the second while loop, and then just end
<telmac> when I tried two nested for loops, this *did* work, but for in ruby returns an array at the end, which I don't want
ramfjord_ has joined #ruby
orbyt_ has joined #ruby
<havenwood> telmac: What are you doing inside the loop?
plexigras2 has joined #ruby
<havenwood> telmac: finding or filtering or mapping or other?
ramfjord has quit [Ping timeout: 240 seconds]
<havenwood> telmac: I was just looking at a slightly dated but still nice gem yesterday called combinatorics: https://github.com/postmodern/combinatorics
<havenwood> telmac: require 'combinatorics/cartesian_product'; Set.new(%w[a b c]).cartesian_product(Set.new([1, 2, 3])).select { |a, b| b > 2 } #=> [["a", 3], ["b", 3], ["c", 3]]
plexigras2 has left #ruby [#ruby]
<telmac> ah, a friend of mine explained the problem
<telmac> I wasn't resetting the second iterated variable to 0
<telmac> so when I iterated the first one, the while loop for the second one just ended immediately
<havenwood> telmac: ah
plexigras has quit [Ping timeout: 256 seconds]
drale2k_ has joined #ruby
dendazen has joined #ruby
solocshaw has quit [Quit: solocshaw]
<zenspider> anyone currently on ubuntu or have one nearby?
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood> zenspider: yerp
telmac has left #ruby [#ruby]
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<zenspider> havenwood: why a gem for that? just so it works on set?
<zenspider> >> [1,2,3].to_a.product(%w[a b c]).select { |n,s| n > 2 }
<havenwood> zenspider: want a sanity check on something?
<zenspider> havenwood: yeah. I can't get a repro on my mac for this report: https://github.com/jbarnette/hoe-git/issues/13#issuecomment-396363699
<havenwood> zenspider: I didn't really look into it, but there's a benchmark/ directory so I was assuming yeah performance
<zenspider> man... I cannot stand the way postmodern structures their gems. ugh. I'm done digging
<havenwood> zenspider: #=> 66
<zenspider> meaning you can't repro either?
Burgestrand has quit [Quit: Closing time!]
jokke1 has quit [Disconnected by services]
<zenspider> did you use LANG=fr_FR.UTF-8 ruby blahblah ?
jokke1 has joined #ruby
orbyt_ has joined #ruby
<zenspider> oooh... maybe I need to install git under that lang to get the proper locale?
<havenwood> zenspider: Yeah, I can't reproduce with just the LANG export.
<havenwood> I don't have FR installed.
<zenspider> kk. I'll have to try this the hard way
<havenwood> I mean, I didn't install git under FR.
<havenwood> zenspider: gl!
<zenspider> I would THINK that it doesn't selectively install langs... but who knows?
drale2k_ has joined #ruby
eckhardt has joined #ruby
grilix_ has joined #ruby
eckhardt_ has quit [Ping timeout: 256 seconds]
grilix has quit [Ping timeout: 240 seconds]
za1b1tsu has joined #ruby
workmad3 has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
zenspider has quit [Changing host]
zenspider has joined #ruby
workmad3 has quit [Ping timeout: 256 seconds]
apeiros_ has joined #ruby
RougeR has quit [Ping timeout: 264 seconds]
RougeR has joined #ruby
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<zenspider> trying to install ubuntu in french... this is going poorly
RougeR has quit [Ping timeout: 256 seconds]
<mozzarella> la baguette le fromage
jenrzzz has quit [Ping timeout: 256 seconds]
<dviola> zenspider: what's the issue?
jenrzzz has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
drale2k_ has joined #ruby
\void has joined #ruby
dbugger__ has joined #ruby
Azure|dc has joined #ruby
<eam> the computer went on strike
<mozzarella> I don't think it's a good idea to rely on the output of git status like that…
dbugger_ has quit [Ping timeout: 245 seconds]
<braindead_> cross posting this question from #rubyonrails because i think its also valid in ruby
<braindead_> in my rails app there is a view template where the text is rendered like this: render :html => ("<div class=\"box wide\">" << "text here" << i can add html tags like br, strong and so on there but run into errors while trying to include a img tag. is there a workaround?
karapetyan has joined #ruby
Azure has quit [Ping timeout: 240 seconds]
<dviola> zenspider: try `locale -a'?
beefjoe has quit [Remote host closed the connection]
<dviola> on my system I would have to uncomment the locale in /etc/locale.gen, run locale-gen and set LANG=fr_FR.UTF-8 in /etc/locale.conf, in ubuntu there must be a GUI somewhere
orbyt_ has joined #ruby
synthroid has quit []
mantak has quit [Quit: Leaving]
kmurphy4 has joined #ruby
dr3w_ has quit [Read error: Connection reset by peer]
dr3w_ has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
neohunter has joined #ruby
noron99 has quit [Remote host closed the connection]
neohunter has quit [Client Quit]
Zaab1t has quit [Quit: Zaab1t]
<zenspider> dviola: HOW THE HELL DO YOU TYPE @ IN AZERTY?!?
<zenspider> STUPID GIT REQUIRES AN EMAIL
<zenspider> ARGH
<zenspider> I'm mostly there tho... I have ruby and git installed. I'm making a bogus git repo. Then I should be able to reproduce this error
<zenspider> tho it might be worth it to do what you said so I have qwerty (or better, dvorak) but have the locales installed and working
sameerynho has joined #ruby
<zenspider> yeah. fuck it. this is too hard.
<kspencer> zenspider: AltGr+0
<zenspider> I honestly don't even know what that means :P
<zenspider> I just nuked it. Reinstalling w/ dvorak so I can type like a human.
<zenspider> shouldn't take too long
<kspencer> how bout qwerty so you can type like a human
<zenspider> mmmm... no
<dviola> you could change the keyboard layout with setxkbmap
<dviola> setxkbmap dvorak
<dviola> setxkbmap us
<dviola> :P
<zenspider> it's fine. this should only be another minute or two
<zenspider> does that work in non-x11? I'm only in console (vmware)
<zenspider> (I'm more of a freebsd / osx guy)
<dviola> setxkbmap is X11 specific, iirc
<zenspider> yeah. that's what I thought. tho I usually used xmodmap... but I'm old school
<dviola> there must be something for the linux console
schleppel has quit [Quit: Konversation terminated!]
<zenspider> in freebsd it is keymap
<kspencer> whats your aversion to qwerty
<zenspider> it utterly sucks and I don't type in it.
sameerynho has quit [Ping timeout: 264 seconds]
<darix> azerty is real pita though :P
<kspencer> sucks, objective, but yeah I guess I'm on the other boat, I've typed in qwerty all my life, not wanting to go dvorak or azerty because it would be hell trying to learn it and switch between it depending on the computer
<zenspider> emacs ... git ... ruby ... almost there
<zenspider> kspencer: I generally don't have to switch. ever. I refused to get good at something designed to be bad so I never touchtyped qwerty
neohunter has joined #ruby
Hobbyboy has joined #ruby
ur5us has joined #ruby
<dviola> zenspider: I think it's loadkeys
<zenspider> dviola: hrm... I don't have either of those files in /etc/
<dviola> sudo loadkeys dvorak
<dviola> sudo loadkeys us
BlopMonster has quit [Ping timeout: 268 seconds]
neohunter has quit [Client Quit]
<dviola> it works here, except that I can't type with dvorak :P
<zenspider> you can type "mama" just fine :P
<dviola> ha :P
<zenspider> `locale -a` only lists en_* entries
megamos has joined #ruby
t0xik has joined #ruby
<dviola> try: sudo locale-gen fr_FR.UTF-8
<dviola> then locale-a again
grilix_ has quit [Ping timeout: 276 seconds]
<dviola> sudo locale-gen fr_FR.UTF-8 && sudo update-locale
cyberg has quit [Ping timeout: 245 seconds]
<zenspider> ok. that works... but my git doesn't change its messages even with LC_MESSAGES
<zenspider> no such file or directory when I try to export that
<zenspider> this might not be worth my effort in the long run
cyberg has joined #ruby
sepp2k has quit [Read error: Connection reset by peer]
<dviola> zenspider: have you tried with LANG?
schneider has joined #ruby
<dviola> like LANG=fr_FR.UTF-8 git foo
<dviola> hrm
<zenspider> yeah. and I did localectl set-locale LANG=fr_blahblah as well. nothing
<zenspider> I did notice that the package source had ".fr." in the url for my french install
<zenspider> I'd probably have to figure out how to do that, uninstall git, and reinstall from the french source
shenghi has quit [Ping timeout: 264 seconds]
<zenspider> hah. I get french man pages tho
<zenspider> not exactly helpful
jnollette has joined #ruby
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
<dviola> zenspider: check if there are french packages for git and what not? maybe we missed some step
shenghi has joined #ruby
<dviola> sudo apt-get install language-pack-XX
ramfjord_ has quit [Ping timeout: 240 seconds]
sanscoeu_ has joined #ruby
<zenspider> perfect. thank you
BlopMonster has joined #ruby
<zenspider> aaand I still can't reproduce! huh.
<zenspider> I'm getting french output... but no
[Butch] has quit [Quit: Textual IRC Client: www.textualapp.com]
sanscoeur has quit [Ping timeout: 240 seconds]
sanscoeu_ has quit [Remote host closed the connection]
orbyt_ has quit [Quit: Textual IRC Client: www.textualapp.com]
reber has quit [Read error: Connection reset by peer]
amar has quit [Remote host closed the connection]
akaiiro has joined #ruby
amar has joined #ruby
chouhoul_ has joined #ruby
timmow has joined #ruby
jenrzzz_ has joined #ruby
amar has quit [Ping timeout: 240 seconds]
karapetyan has quit [Remote host closed the connection]
<zenspider> dviola: thank you. that helped. And I think showed that his PR is also bad.
chouhoulis has quit [Ping timeout: 240 seconds]
BlopMonster has quit [Ping timeout: 260 seconds]
schneider- has joined #ruby
desperek has joined #ruby
schneider has quit [Ping timeout: 240 seconds]
chouhoul_ has quit [Ping timeout: 265 seconds]
jenrzzz has quit [Ping timeout: 276 seconds]
karapetyan has joined #ruby
akaiiro has quit [Remote host closed the connection]
dbugger__ has quit [Ping timeout: 276 seconds]
<zenspider> uuuugh linux is a horrible monster
<zenspider> such an unusable mess
<zenspider> guess it makes sense that two of my most hated tools are done by the same person... he just shouldn't be allowed to make things that humans interface with
sanscoeur has joined #ruby
<havenwood> zenspider: Looking at the, ahem >.>, git status emoji script i wrote for my prompt, i check if it's latest commit differently: https://gist.github.com/havenwood/6d32985ceee909d8c1da6bebbe94d5de
cseder has quit [Quit: Textual IRC Client: www.textualapp.com]
megamos has quit [Remote host closed the connection]
<havenwood> zenspider: No promise it's sane. ;-P
megamos has joined #ruby
workmad3 has joined #ruby
sanscoeur has quit [Remote host closed the connection]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
amatas has quit [Quit: amatas]
workmad3 has quit [Ping timeout: 265 seconds]
<FernandoBasso> Are there any ruby books that don't teach using examples that print strings on the terminal only? Something that teaches 'ruby paradigms' using somewhat more realist examples?
sanscoeur has joined #ruby
sphenxes has quit [Quit: Leaving]
ramfjord has joined #ruby
<dviola> zenspider: yw
akaiiro has joined #ruby
weird_error has quit [Quit: weird_error]
braindead_ has quit [Quit: Page closed]
sanscoeur has quit [Remote host closed the connection]
sanscoeur has joined #ruby
weird_error has joined #ruby
GodFather has quit [Ping timeout: 256 seconds]
desperek has quit [Quit: xoxo]
wontruefree has quit [Quit: this is not the client you are looking for]
BlopMonster has joined #ruby
mikecmpbll has joined #ruby
<cthulchu> folks, I'm sorry for asking, but what's the difference between require and require_parent?
<cthulchu> I have a subtle feeling that require_parent has a hint of OOP to it
<havenwood> cthulchu: The latter isn't a thing in Ruby itself.
<cthulchu> ooooh
<cthulchu> weeeeeird
<cthulchu> what is it?
<havenwood> cthulchu: Are you thinking require_relative maybe?
<cthulchu> oh, yes, sorry
<cthulchu> it's _relative
<cthulchu> ha, it's not the relative I was thinking about :)
<cthulchu> ahahah
<havenwood> chamunks: require will go through $LOAD_PATH directories and try to find the file
<havenwood> oops, MT
<cthulchu> that's for me
<cthulchu> aha!
<havenwood> cthulchu: require_relative ignores the $LOAD_PATH and is instead relative to the path of the file
<cthulchu> got it!
<cthulchu> thanks!
<cthulchu> will use relative then
<cthulchu> so cool
<havenwood> cthulchu: For fun, here's a require_relative that enables tail call optimization for the file you're requiring: https://gist.github.com/havenwood/3c5a5e1476c811460992
nicht has joined #ruby
<cthulchu> ha
<havenwood> I should change that to an optional kwarg: with_tco: true
<havenwood> Or maybe?: with_tailcall_optimization: true
<cthulchu> you should add a few lines of readme
<cthulchu> and comments
<havenwood> I guess tail and call are two words.
<havenwood> cthulchu: good points
<cthulchu> I don't know what tail call is
<havenwood> cthulchu: If you do recursive calls, where a method calls itself, the Ruby stack only goes so deep.
<cthulchu> yes
<cthulchu> only goes so deep?
<havenwood> cthulchu: So if you say implement a recursive fibonacci sequence, it'll explode when it gets too deep.
<cthulchu> how deep does it go?
<cthulchu> it's unfair
<havenwood> cthulchu: That depends on the implementation of Ruby.
<cthulchu> how does it explode?
<cthulchu> stack overflow?
<havenwood> cthulchu: Stack Level Too Deep, STACK OVERFLOW!
<cthulchu> okay
<havenwood> Your stack runneth over.
<cthulchu> it happens everywhere
<cthulchu> what relation does it have to require though?
<havenwood> cthulchu: That little method I wrote requires but then loads the required code with trace disabled and tco enabled.
<cthulchu> okay, it's too complex to comprehend.
<havenwood> cthulchu: So you can recurse over and over and it'll use constant stack space.
<cthulchu> doesn't it use constant stack space anyway?
<havenwood> sec, I'll write an example
<cthulchu> you should write it right there for other peeps to see
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sanscoeu_ has joined #ruby
<cthulchu> if I require A and don't create an object of A in this class B (although I can) and then I extend B with C, will I have access to A in C?
venmx has joined #ruby
eckhardt has joined #ruby
<cthulchu> or should I create an object of A in B to refer to A when in C?
sanscoeur has quit [Ping timeout: 268 seconds]
sanscoeu_ has quit [Ping timeout: 264 seconds]
schneider- has quit [Quit: WeeChat 2.0.1]
clemens3_ has quit [Ping timeout: 256 seconds]
clemens3 has quit [Ping timeout: 245 seconds]
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
za1b1tsu has quit [Ping timeout: 240 seconds]
nicht has quit [Ping timeout: 256 seconds]
<cthulchu> okay, I will have an object.
<cthulchu> Just in case.
jenrzzz_ has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
akaiiro has quit [Ping timeout: 276 seconds]
eckhardt has joined #ruby
venmx has quit [Ping timeout: 248 seconds]
akaiiro has joined #ruby
wontruefree has joined #ruby
<cthulchu> ok, folks, help me to understand this code...
whippythellama has quit [Quit: WeeChat 1.4]
<ruby[bot]> cthulchu: 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
<cthulchu> mkay
<cthulchu> wonderful...
<cthulchu> use pastebin instead
<ruby[bot]> cthulchu: as I told you already, please use https://gist.github.com
weird_error has quit [Quit: weird_error]
amatas has joined #ruby
<cthulchu> I don't understand how the Driver_wrapper is being set
<cthulchu> okay
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nicht has joined #ruby
akaiiro has quit [Ping timeout: 264 seconds]
<cthulchu> how do we continue after binding.pry
kmurphy4 has quit [Quit: kmurphy4]
<cthulchu> I guess we don't continue
<cthulchu> not cool
BlopMonster has quit [Ping timeout: 240 seconds]
za1b1tsu has joined #ruby
za1b1tsu has quit [Ping timeout: 248 seconds]
eckhardt has joined #ruby
gix- has quit [Ping timeout: 260 seconds]
wontruefree has quit [Quit: bye]
wontruefree has joined #ruby
GodFather has joined #ruby
megamos has quit [Remote host closed the connection]
megamos has joined #ruby
jrafanie has joined #ruby
karapetyan has quit [Remote host closed the connection]
<cthulchu> okay, I'll ask about it tomorrow
karapetyan has joined #ruby
gix has joined #ruby
karapetyan has quit [Remote host closed the connection]
karapetyan has joined #ruby
nicht_ has joined #ruby
megamos has quit [Ping timeout: 264 seconds]