havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.7.0, 2.6.5, 2.5.7: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select Ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
cschneid has quit [Ping timeout: 256 seconds]
cschneid_ has joined #ruby
markopasha has quit [Ping timeout: 260 seconds]
lucasb has quit [Quit: Connection closed for inactivity]
LDonoughe has joined #ruby
LDonoughe has quit [Ping timeout: 264 seconds]
advorak has joined #ruby
fluxAeon has joined #ruby
drincruz_ has quit [Ping timeout: 264 seconds]
TCZ has joined #ruby
fluxAeon has quit [Ping timeout: 260 seconds]
ur5us has joined #ruby
drincruz_ has joined #ruby
drincruz_ has quit [Ping timeout: 265 seconds]
dasher00 has quit [Ping timeout: 258 seconds]
TCZ has quit [Quit: Leaving]
TCZ has joined #ruby
advorak has quit [Quit: Leaving]
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
troulouliou_dev has joined #ruby
drincruz_ has joined #ruby
drincruz_ has quit [Ping timeout: 264 seconds]
KeyJoo has quit [Remote host closed the connection]
DTZUZU2 has joined #ruby
ur5us has quit [Ping timeout: 256 seconds]
DTZUZU has quit [Ping timeout: 256 seconds]
ellcs has quit [Ping timeout: 240 seconds]
cschneid has joined #ruby
cschneid_ has quit [Ping timeout: 240 seconds]
alfiemax has joined #ruby
alfiemax has quit [Ping timeout: 256 seconds]
sergioro has quit [Quit: leaving]
Arkantos has joined #ruby
sergioro has joined #ruby
ellcs has joined #ruby
johnny56_ has joined #ruby
TCZ is now known as jealousy
johnny56 has quit [Ping timeout: 265 seconds]
fluxAeon has joined #ruby
romanlevin has quit [Quit: Ping timeout (120 seconds)]
romanlevin has joined #ruby
drincruz_ has joined #ruby
ChmEarl has quit [Quit: Leaving]
drincruz_ has quit [Ping timeout: 260 seconds]
pandakekok9 has joined #ruby
gix has quit [Ping timeout: 256 seconds]
braincrash has quit [Quit: bye bye]
braincrash has joined #ruby
siery has quit [Ping timeout: 250 seconds]
jealousy has quit [Quit: Leaving]
duderonomy has quit [Ping timeout: 256 seconds]
LDonoughe has joined #ruby
Arkantos has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
LDonoughe has quit [Ping timeout: 265 seconds]
schne1der has quit [Ping timeout: 240 seconds]
gdonald has quit [Ping timeout: 256 seconds]
gdonald has joined #ruby
LDonoughe has joined #ruby
evdubs has quit [Remote host closed the connection]
LDonoughe has quit [Ping timeout: 256 seconds]
evdubs has joined #ruby
duderonomy has joined #ruby
regreg_ has joined #ruby
cschneid_ has joined #ruby
cschneid has quit [Ping timeout: 264 seconds]
troulouliou_dev has quit [Quit: Leaving]
polishdub has joined #ruby
akem_ has joined #ruby
akem_ has quit [Max SendQ exceeded]
akem_ has joined #ruby
drincruz_ has joined #ruby
akem has quit [Ping timeout: 264 seconds]
drincruz_ has quit [Ping timeout: 265 seconds]
nchamber- has quit [Ping timeout: 240 seconds]
nchambers has joined #ruby
pandakekok9 has quit [Ping timeout: 250 seconds]
_whitelogger has joined #ruby
dinfuehr has quit [Ping timeout: 264 seconds]
dinfuehr has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
davispuh has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
jmcgnh has quit [Read error: Connection reset by peer]
jmcgnh has joined #ruby
polishdub has quit [Quit: leaving]
alexherbo2 has joined #ruby
GeissT has joined #ruby
cschneid_ has quit [Ping timeout: 264 seconds]
cschneid has joined #ruby
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
_whitelogger has joined #ruby
sphex has quit [Read error: Connection reset by peer]
sphex has joined #ruby
GeissT has quit [Ping timeout: 264 seconds]
drincruz_ has joined #ruby
drincruz_ has quit [Ping timeout: 256 seconds]
roadie has joined #ruby
LDonoughe has joined #ruby
LDonoughe has quit [Ping timeout: 256 seconds]
tpanarch1st has quit [Quit: Thanks for your help, nice to see you, take care.]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
_whitelogger has joined #ruby
t3hyoshi has joined #ruby
xco has joined #ruby
jmcgnh has quit [Read error: Connection reset by peer]
fluxAeon has quit [Ping timeout: 256 seconds]
fluxAeon has joined #ruby
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jmcgnh has joined #ruby
xco has joined #ruby
ur5us has joined #ruby
cschneid_ has joined #ruby
cschneid has quit [Ping timeout: 265 seconds]
conta has joined #ruby
CrazyEddy has quit [Ping timeout: 250 seconds]
chalkmonster has joined #ruby
chalkmonster has quit [Client Quit]
drincruz_ has joined #ruby
drincruz_ has quit [Ping timeout: 256 seconds]
cschneid_ has quit [Quit: ZNC 1.7.5 - https://znc.in]
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cschneid has joined #ruby
xco has joined #ruby
regreg__ has joined #ruby
ur5us has quit [Ping timeout: 240 seconds]
regreg_ has quit [Ping timeout: 272 seconds]
code_zombie has quit [Quit: Leaving]
conta has quit [Quit: conta]
rippa has joined #ruby
dionysus69 has joined #ruby
chalkmonster has joined #ruby
drincruz_ has joined #ruby
chalkmonster has quit [Client Quit]
drincruz_ has quit [Ping timeout: 256 seconds]
hassox has joined #ruby
hassox has quit [Ping timeout: 265 seconds]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dasher00 has joined #ruby
roadie has quit [Ping timeout: 256 seconds]
sergioro has quit [Quit: leaving]
cd has joined #ruby
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
crisfm has joined #ruby
TCZ has joined #ruby
akem_ has quit [Read error: Connection reset by peer]
akem has joined #ruby
akem has quit [Max SendQ exceeded]
akem has joined #ruby
cschneid_ has joined #ruby
cschneid has quit [Ping timeout: 265 seconds]
roadie has joined #ruby
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
markopasha has joined #ruby
markopasha has quit [Max SendQ exceeded]
markopasha has joined #ruby
chalkmonster has joined #ruby
conta has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.7.1]
chalkmonster has joined #ruby
TCZ is now known as DiamondPrincess
conta has quit [Quit: conta]
schne1der has joined #ruby
gix has joined #ruby
alexherbo29 has joined #ruby
alexherbo2 has quit [Ping timeout: 250 seconds]
alexherbo29 is now known as alexherbo2
Technodrome has joined #ruby
arcaos has joined #ruby
arcaos has quit [Quit: Leaving]
banisterfiend has joined #ruby
arcaos has joined #ruby
dviola has joined #ruby
DiamondPrincess has quit [Quit: Leaving]
alexherbo2 has quit [Read error: Connection reset by peer]
alexherbo2 has joined #ruby
gix has quit [Ping timeout: 264 seconds]
cschneid has joined #ruby
cschneid_ has quit [Ping timeout: 256 seconds]
KeyJoo has joined #ruby
jamessan has joined #ruby
<jamessan> I have some code that looks like "def foo(callback=Proc.new)". In ruby 2.7, this emits the "Capturing the given block using Proc.new is deprecated" warning. What's the right way to fix this?
regreg__ is now known as regreg
gix has joined #ruby
lucasb has joined #ruby
marz_d`ghostman has joined #ruby
brendan- has joined #ruby
<marz_d`ghostman> Has anyone worked with rrd files before?
<_phaul> jamessan: "def doo(&callback)" ...
TCZ has joined #ruby
davispuh has joined #ruby
marz_d`ghostman has quit [Read error: Connection reset by peer]
marz_d`ghostman has joined #ruby
Arkantos has joined #ruby
ccooke has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.7.1]
yelloB has joined #ruby
alexherbo2 has quit [Quit: The Lounge - https://thelounge.chat]
yelloB has quit [Remote host closed the connection]
TCZ has quit [Quit: Leaving]
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
Arkantos has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Hien has joined #ruby
Hien has quit [Client Quit]
Hien has joined #ruby
marz_d`ghostman has left #ruby [#ruby]
dinfuehr has quit [Ping timeout: 240 seconds]
dinfuehr has joined #ruby
<jamessan> _phaul: that would still be optional?
Arkantos has joined #ruby
<_phaul> yes it would be, blocks are always optional.
ChmEarl has joined #ruby
fluxAeon has quit [Ping timeout: 250 seconds]
mikecmpbll has quit [Ping timeout: 256 seconds]
<_phaul> meaning, their presence or absence wouldn't causes argument error, but the code in the method might stil fail, so you would handle error cases there
<_phaul> you can call block_given? to check
fluxAeon has joined #ruby
TCZ has joined #ruby
mikecmpbll has joined #ruby
<_phaul> &>> def foo(callback = Proc.new); end; foo
<rubydoc> stderr: -e:4:in `new': tried to create Proc object without a block (ArgumentError)... check link for more (https://carc.in/#/r/8sdg)
<_phaul> interestingly with Proc.new it wasn't optional
<_phaul> now it is
<_phaul> &>> def foo(&callback); end; foo
<rubydoc> # => nil (https://carc.in/#/r/8sdh)
TCZ has quit [Quit: Leaving]
regreg has quit [Read error: Connection reset by peer]
Arkantos has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
fluxAeon has quit [Ping timeout: 256 seconds]
cschneid_ has joined #ruby
cschneid has quit [Ping timeout: 264 seconds]
leah2 has quit [Remote host closed the connection]
leah2 has joined #ruby
Cope has quit [Ping timeout: 268 seconds]
roadie has quit [Read error: Connection reset by peer]
yelloB has joined #ruby
yelloB has quit [Remote host closed the connection]
DTZUZU2 has quit [Quit: WeeChat 2.7]
DTZUZU has joined #ruby
LDonoughe has joined #ruby
LDonoughe has quit [Ping timeout: 240 seconds]
<xco> anyone use the persist gem before?
<xco> i stored an array
<xco> exited the terminal expecting the array back
<xco> got an error
<xco> NameError (undefined local variable or method `store' for main:Object)
<xco> where "store" is the hash name i used
<xco> store.path gives ".db.pstore"
drincruz_ has joined #ruby
<xco> i'm wondering i should explicitly set a file path
<xco> :/
mheld has joined #ruby
drincruz_ has quit [Ping timeout: 264 seconds]
_whitelogger has joined #ruby
CrazyEddy has joined #ruby
factormystic has quit [Read error: Connection reset by peer]
Azure has quit [Ping timeout: 264 seconds]
factormystic has joined #ruby
sergioro has joined #ruby
Azure has joined #ruby
alfiemax has joined #ruby
Azure has quit [Read error: Connection reset by peer]
Azure has joined #ruby
chalkmonster has joined #ruby
alfiemax has quit [Ping timeout: 256 seconds]
cschneid has joined #ruby
cschneid_ has quit [Ping timeout: 256 seconds]
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
cschneid has quit [Quit: ZNC 1.7.5 - https://znc.in]
ice9 has joined #ruby
<ice9> how can I uninstall scout apm?
orbyt_ has joined #ruby
sauvin has quit [Read error: Connection reset by peer]
cschneid has joined #ruby
factormystic has quit [Read error: Connection reset by peer]
gix has quit [Ping timeout: 256 seconds]
gix has joined #ruby
factormystic has joined #ruby
Arkantos has joined #ruby
sauvin has joined #ruby
<havenwood> ice9: Remove it from your Gemfile and run `bundle`.
<havenwood> xco: Each time you restart the terminal, you'll need to: store = Persist.new
<havenwood> xco: There's almost nothing to this gem, so you might prefer to use PStore from the stdlib directly. Here's what `Persist.new` does: https://github.com/havenwood/persist/blob/master/lib/persist.rb#L41-L45
ice99 has joined #ruby
ice9 has quit [Read error: Connection reset by peer]
<havenwood> xco: It's kinda similar to YAML::DBM from the stdlib—just a helper wrapper. https://github.com/ruby/ruby/blob/master/lib/yaml/dbm.rb
<havenwood> xco: It should work to do a new `store = Persist.new` though to get at the saved data. :)
<havenwood> xco: You could also just use File.write and File.read along with #to_json and JSON.parse.
<havenwood> xco: Or pick your favorite serialization format. YAML, JSON, and Marshal are in the stdlib.
<havenwood> xco: PStore is transactions with marshal and YAML::Store is the same but with YAML.
<havenwood> xco: Or YAML::DBM really is a pretty nice way to get a Hash-like DB with String keys, rather than using a flat file.
<havenwood> xco: I guess not all Ruby installs have a working DBM.
<havenwood> xco: You might consider where it's best to cache this file. Do you want a /tmp or ~/.kovid convention?
ice9 has joined #ruby
ice9 has quit [Max SendQ exceeded]
ice9 has joined #ruby
ice99 has quit [Ping timeout: 250 seconds]
arcaos has quit [Read error: Connection reset by peer]
chalkmonster has quit [Quit: WeeChat 2.7.1]
arcaos has joined #ruby
Arkantos has quit [Ping timeout: 252 seconds]
Arkantos has joined #ruby
kinduff has quit [Read error: Connection reset by peer]
lineus_ has quit [Remote host closed the connection]
kinduff has joined #ruby
madduck has quit [Quit: leaving]
lineus has joined #ruby
chalkmonster has joined #ruby
Arkantos has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
roadie has joined #ruby
foxxx0 has quit [Quit: foxxx0]
foxxx0 has joined #ruby
SeepingN has joined #ruby
dinfuehr has quit [Ping timeout: 250 seconds]
dinfuehr has joined #ruby
brendan- has quit [Ping timeout: 256 seconds]
chalkmonster has quit [Quit: WeeChat 2.7.1]
brendan- has joined #ruby
cschneid_ has joined #ruby
cschneid has quit [Ping timeout: 250 seconds]
jmcgnh has quit [Ping timeout: 256 seconds]
ur5us has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
Arkantos has joined #ruby
jmcgnh has joined #ruby
alfiemax has joined #ruby
alfiemax has quit [Ping timeout: 240 seconds]
<havenwood> xco: I'd suggest adding a `--help` and `--version` flag, which are standard for GNU programs. Your current Thor subcommands could be replaced with option flags, since you don't have subflags. Maybe that was forward looking? You might consider switching to optionparser from the stdlb.
<xco> havenwood you're talk about kovid right?
<havenwood> xco: Yup!
<xco> there's a "version" command
<xco> there's a --help command
jmcgnh has quit [Read error: Connection reset by peer]
<xco> perhaps you mean doing it another way?
<havenwood> xco: Ah, I tried --version and assumed no --help either. Good point. The GNU rule is a --version and --help flag are mandatory.
<havenwood> xco: Usually, Thor is for commands like `git` where there are subcommands that have flags.
<havenwood> xco: Like: git pull --all
<xco> :D
<xco> --help works i think it's automatic i didn't add it
<havenwood> xco: I *think* kovid could use OptionParser for a bit simpler options.
<xco> version, someone contributed to add it :P it was there but i deleted it then someone added it :p
<xco> ok let me check the documentation on optionparser
<xco> i saw it but ignored it
<xco> havenwood btw did you see my preview comments on the persist gem?
<havenwood> xco: It has some nice features that aren't documented too.
<xco> it doesn't persist
<xco> havenwood like?
<havenwood> xco: Yes, did you see my response?
jmcgnh has joined #ruby
<xco> havenwood It should work to do a new `store = Persist.new` though to get at the saved data. :) < just saw this comment. i actually did store = Persist.new after getting back into the REPL
<havenwood> xco: Then why is the error?: undefined local variable or method `store'
<havenwood> xco: Double check?
<xco> havenwood sec i'll show you by commands right now
<xco> havenwood btw can you help me here, 2 people complained about this https://github.com/siaw23/kovid/issues/77 and it works for me. TBH, honest i have no idea why they are getting that error
<xco> :/
<havenwood> xco: Here are some option parser examples, some of which aren't really covered in the docs: https://gist.github.com/havenwood/02123198a79447543a3ea053e7e592fd
<havenwood> xco: #merge only took one argument in older Rubies.
<havenwood> xco: They're using an old Ruby.
<havenwood> xco: You could rewrite the merge to support old merge.
<xco> havenwood interesting
<xco> been thinking about this for 2 days came up with nothing
<xco> didn't know how #merge behaves in older rubies
<havenwood> xco: Ruby 2.6 added multiple argument merge.
<xco> i see!
<xco> didn't know that
<xco> :D
<xco> i see that guy is using Ruby 2.5.0
<havenwood> xco: You can either use backports gem to get the feature in older Rubies or probably just add a double splat.
<xco> so this line would be ..... merge(**tail) https://github.com/siaw23/kovid/blob/master/lib/kovid/request.rb#L188
<havenwood> xco: Hrmm.
<havenwood> xco: No, I think you'd need to double splat each one there. I guess you could: reduce(&:merge) but you have a more complex merge.
<havenwood> xco: One option is to use the backports gem so you get the Ruby 2.6 feature: https://github.com/marcandre/backports#ruby-26-backports
chalkmonster has joined #ruby
<havenwood> xco: You can "cherry pick" that single feature.
<havenwood> xco: require 'backports/2.6.0/hash/merge'
<havenwood> xco: That's ^ the whole implementation.
<xco> havenwood so basically opening the Hash class and adding that bit
<havenwood> xco: Yeah, using the backports gem does that.
<havenwood> xco: You can pretty easily just rewrite this one method to merge in a different way or get the backport.
<havenwood> xco: I think the other day I may have shown a version that works in 2.5 and before. Falling asleep at the moment. There should be SO or someone who can help on merging multiple hashes pre-2.6 or I'd be happy to show you later.
<xco> yup no worried get some rest, i'll try to figure it out, if i fail we can talk about it another day
<xco> no worries*
ellcs has quit [Ping timeout: 256 seconds]
ritalinona has quit [Quit: bleep]
ritalinona has joined #ruby
ritalinona has quit [Client Quit]
ritalinona has joined #ruby
dhollinger has quit [Quit: WeeChat 2.3]
chalkmonster has quit [Quit: WeeChat 2.7.1]
<al2o3-cr> xco: instead of doing head, *tail ... country_array.inject { |acc, other| acc.merge(other) { |_, l, r| ... } } this should work. hope this helps.
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<al2o3-cr> use the key aswell.
roadie has quit [Ping timeout: 250 seconds]
Arkantos has quit [Quit: Textual IRC Client: www.textualapp.com]
Arkantos has joined #ruby
dhollinger has joined #ruby
<xco> al2o3-cr let me try that
chalkmonster has joined #ruby
orbyt_ has joined #ruby
chalkmonster has quit [Client Quit]
dionysus69 has quit [Ping timeout: 250 seconds]
ec is now known as super_annoyued
super_annoyued is now known as ec
MadLamb has joined #ruby
ice9 has quit [Quit: Leaving]
phaul has joined #ruby
_phaul has quit [Ping timeout: 256 seconds]
drincruz_ has joined #ruby
code_zombie has joined #ruby
zapata has quit [Read error: Connection reset by peer]
zapata has joined #ruby
jmcgnh has quit [Remote host closed the connection]
schne1der has quit [Ping timeout: 260 seconds]
roadie has joined #ruby
drincruz_ has quit [Ping timeout: 250 seconds]
<MadLamb> how can I pretty print 'Rails::configuration` with rails runner?
<havenwood> MadLamb: rails runner "pp Rails.configuration"
<havenwood> xco: +1 reduce/inject like al2o3-cr showed.
<xco> havenwood yeap i'll go for that, fixing a few small things then will add that fix <3
<al2o3-cr> xco: so your aggregator method should look like this: https://gist.github.com/gr33n7007h/69ded10e271252346501f2ba42ec590f
<xco> perfect :)
roadie has quit [Ping timeout: 252 seconds]
<al2o3-cr> :)
LDonoughe has joined #ruby
<MadLamb> havenwood, undefined method `pp' for main:Object
<havenwood> MadLamb: Looks like you're using an older Ruby, since pretty print is required automatically these days. Just require 'pp'
<al2o3-cr> MadLamb: require 'pp'
<MadLamb> how I do that single line?
Arkantos has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<MadLamb> ruby -v "ruby 2.3.0p0"
<havenwood> MadLamb: rails runner "require 'pp'; Rails.configuration"
<havenwood> MadLamb: rails runner "require 'pp'; pp Rails.configuration"
<havenwood> MadLamb: Or upgrade your Ruby version.
cschneid has joined #ruby
<MadLamb> that worked
<MadLamb> thanks
cschneid_ has quit [Ping timeout: 260 seconds]
nofxx_ has quit [Remote host closed the connection]
nofxx_ has joined #ruby
<havenwood> you're welcome
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
Arkantos has joined #ruby
creat has quit [Quit: ZNC - http://znc.in]
creat has joined #ruby
lucasb has quit [Quit: Connection closed for inactivity]
LDonoughe has quit [Ping timeout: 252 seconds]
kashike has quit [Ping timeout: 246 seconds]
roadie has joined #ruby
kashike has joined #ruby
titanbiscuit has quit [Quit: ZNC 1.7.4 - https://znc.in]
TCZ has joined #ruby
titanbiscuit has joined #ruby
roadie has quit [Ping timeout: 256 seconds]
arcaos has quit [Ping timeout: 252 seconds]
TCZ has quit [Quit: Leaving]
jmcgnh has joined #ruby
orbyt_ has quit [Quit: Textual IRC Client: www.textualapp.com]
arekushi has quit [Read error: Connection timed out]
markopasha has quit [Remote host closed the connection]
brendan- has quit [Ping timeout: 240 seconds]
roadie has joined #ruby
brendan- has joined #ruby
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
Arkantos has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
roadie has quit [Ping timeout: 246 seconds]
alfiemax has joined #ruby
chromis has left #ruby [#ruby]
alfiemax has quit [Ping timeout: 256 seconds]
brendan- has quit [Ping timeout: 256 seconds]
ur5us has quit [Ping timeout: 240 seconds]
brendan- has joined #ruby
gigetoo has quit [Ping timeout: 260 seconds]