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]
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
<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>
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
<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…]