havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.6.4, 2.5.6, 2.7.0-preview1: 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!
dasher00 has quit [Ping timeout: 276 seconds]
teclator has quit [Ping timeout: 246 seconds]
teclator has joined #ruby
poontangmessiah has quit [Ping timeout: 276 seconds]
ap4y has quit [Ping timeout: 245 seconds]
Guest77382 has quit [Ping timeout: 240 seconds]
_whitelogger has joined #ruby
bambanx has quit [Quit: Leaving]
reber has quit [Read error: Connection reset by peer]
cliluw has quit [Ping timeout: 268 seconds]
rsenic has quit [Remote host closed the connection]
poontangmessiah has joined #ruby
goez has quit [Ping timeout: 250 seconds]
also_uplime has joined #ruby
also_uplime has left #ruby ["/me scurries away"]
dviola has quit [Quit: WeeChat 2.6]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ap4y has joined #ruby
SirFunk has quit [Quit: ZNC - http://znc.in]
heyqule has joined #ruby
r29v has joined #ruby
poontangmessiah has quit [Remote host closed the connection]
involans has quit [Read error: Connection reset by peer]
SirFunk has joined #ruby
tdy has joined #ruby
cthulchu has quit [Ping timeout: 245 seconds]
Azure has quit [Ping timeout: 246 seconds]
tdy has quit [Ping timeout: 245 seconds]
cyclonis_ has joined #ruby
cyclonis has quit [Read error: Connection reset by peer]
Azure has joined #ruby
gell5 has joined #ruby
ukd1_ has joined #ruby
duderonomy has joined #ruby
cyclonis_ has quit [Ping timeout: 244 seconds]
ukd1 has quit [Ping timeout: 246 seconds]
duderonomy has quit [Client Quit]
aloy has quit [Ping timeout: 250 seconds]
fphilipe has joined #ruby
spacesuitdiver has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tdy has joined #ruby
gix has quit [Ping timeout: 240 seconds]
fphilipe has quit [Ping timeout: 246 seconds]
GodFather has joined #ruby
aloy has joined #ruby
AJA4350 has quit [Quit: AJA4350]
ramfjord has quit [Read error: Connection reset by peer]
witlesswonder has joined #ruby
ramfjord has joined #ruby
duderonomy has joined #ruby
ramfjord has quit [Ping timeout: 276 seconds]
cycloni30 has joined #ruby
cliluw has joined #ruby
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
tdy has quit [Ping timeout: 245 seconds]
hutch has quit [Ping timeout: 246 seconds]
esrse has joined #ruby
r29v has quit [Quit: r29v]
spacesuitdiver has joined #ruby
tdy has joined #ruby
ap4y has quit [Ping timeout: 246 seconds]
GodFather has quit [Ping timeout: 268 seconds]
gell5 has quit [Remote host closed the connection]
gell5 has joined #ruby
gell5 has quit [Remote host closed the connection]
kssm has quit [Quit: leaving]
dinfuehr_ has quit [Ping timeout: 258 seconds]
barg has quit [Ping timeout: 258 seconds]
dinfuehr has joined #ruby
fphilipe has joined #ruby
KnownSyntax has quit [Read error: Connection reset by peer]
Argorok has quit [Read error: Connection reset by peer]
fphilipe has quit [Ping timeout: 276 seconds]
podman has quit [Read error: Connection reset by peer]
pwillard has quit [Ping timeout: 252 seconds]
rann has quit [Ping timeout: 264 seconds]
kapilp_ has quit [Ping timeout: 276 seconds]
victorqueiroz has quit [Ping timeout: 252 seconds]
cycloni30 has quit [Quit: -a- IRC for Android 2.1.54]
Guest12048 has quit [Read error: Connection reset by peer]
peteretep has quit [Ping timeout: 250 seconds]
Guest12048 has joined #ruby
rann has joined #ruby
peteretep has joined #ruby
pwillard has joined #ruby
victorqueiroz has joined #ruby
Argorok has joined #ruby
kapil_ has joined #ruby
KnownSyntax has joined #ruby
podman has joined #ruby
ramfjord has joined #ruby
ramfjord has quit [Ping timeout: 246 seconds]
evdubs_ has quit [Remote host closed the connection]
tdy has quit [Ping timeout: 240 seconds]
tdy1 has joined #ruby
evdubs_ has joined #ruby
evdubs_ is now known as evdubs
spacesuitdiver has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
[rg] has joined #ruby
kapil_ is now known as kapil
gell5 has joined #ruby
x86sk has joined #ruby
jmcgnh has quit [Ping timeout: 245 seconds]
jmcgnh_ has joined #ruby
jmcgnh_ is now known as jmcgnh
gell5 has quit [Ping timeout: 276 seconds]
fphilipe has joined #ruby
fphilipe has quit [Ping timeout: 276 seconds]
heyqule has quit [Remote host closed the connection]
tdy1 has quit [Ping timeout: 258 seconds]
Nicmavr has quit [Read error: Connection reset by peer]
Nicmavr has joined #ruby
gell5 has joined #ruby
oetjenj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gell5 has quit [Ping timeout: 240 seconds]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
emptyflask has quit [Ping timeout: 246 seconds]
cyclonis has joined #ruby
schne1der has joined #ruby
sauvin has joined #ruby
greypack has quit [Ping timeout: 246 seconds]
fphilipe has joined #ruby
absolutejam4 has joined #ruby
greypack has joined #ruby
howdoi has joined #ruby
oetjenj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
schne1der has quit [Ping timeout: 276 seconds]
ur5us has quit [Remote host closed the connection]
schaerli has joined #ruby
cyclonis has quit [Read error: Connection reset by peer]
queip has quit [Ping timeout: 276 seconds]
cyclonis has joined #ruby
queip has joined #ruby
gell5 has joined #ruby
cyclonis has quit [Read error: Connection reset by peer]
cyclonis has joined #ruby
openCircuit__ has joined #ruby
involans has joined #ruby
gell5 has quit [Ping timeout: 276 seconds]
[rg] has quit [Quit: Leaving]
LtHummus has quit [Read error: Connection reset by peer]
LtHummus has joined #ruby
openCircuit__ has quit [Ping timeout: 268 seconds]
ravenousmoose has joined #ruby
envex has quit []
Emmanuel_Chanel_ has quit [Read error: Connection reset by peer]
ravenousmoose has quit [Ping timeout: 246 seconds]
openCircuit__ has joined #ruby
shansen has quit [Quit: ZNC 1.7.4+deb0+bionic0 - https://znc.in]
shansen has joined #ruby
shtirlic has quit [Read error: Connection reset by peer]
openCircuit__ has quit [Ping timeout: 258 seconds]
shtirlic has joined #ruby
gell5 has joined #ruby
Emmanuel_Chanel has joined #ruby
gell5 has quit [Ping timeout: 268 seconds]
absolutejam4 has quit [Ping timeout: 240 seconds]
openCircuit__ has joined #ruby
fphilipe has quit [Ping timeout: 276 seconds]
x86sk has quit [Quit: Connection closed for inactivity]
openCircuit__ has quit [Ping timeout: 268 seconds]
dionysus69 has joined #ruby
fphilipe has joined #ruby
TomyWork has joined #ruby
tdy1 has joined #ruby
openCircuit__ has joined #ruby
openCircuit__ has quit [Ping timeout: 268 seconds]
x86sk has joined #ruby
gix has joined #ruby
tpanarch1st has joined #ruby
markand has left #ruby [#ruby]
gix has quit [Ping timeout: 245 seconds]
schne1der has joined #ruby
nowhere_man has quit [Ping timeout: 276 seconds]
absolutejam4 has joined #ruby
gell5 has joined #ruby
gell5 has quit [Ping timeout: 240 seconds]
Intelo has joined #ruby
jmcgnh has quit [Ping timeout: 240 seconds]
jmcgnh_ has joined #ruby
jmcgnh_ is now known as jmcgnh
ramfjord has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ramfjord has quit [Ping timeout: 240 seconds]
absolutejam4 has quit [Ping timeout: 240 seconds]
Huck777 has quit [Ping timeout: 244 seconds]
throstur has joined #ruby
absolutejam4 has joined #ruby
<throstur> I'm trying to do some simple regex parsing in ruby but having growing pains. I have a line like 'cowboyxx: Key: MATCH_THIS\n' (the \n is a literal backslash n and not a newline) and I want to capture MATCH_THIS. So far I've found I probably want scan, more precisely myline.scan(myregex), but I haven't come up with a working regex
<throstur> so far I've got 'Key: (\w*)\n'
zapata has quit [Quit: WeeChat 2.5]
<throstur> well, seems to work with slashes instead of ticks
involans has quit [Quit: involans]
involans has joined #ruby
SuperL4g has joined #ruby
gell5 has joined #ruby
SuperLag has quit [Ping timeout: 246 seconds]
gell5 has quit [Ping timeout: 246 seconds]
tpanarch1st has quit [Ping timeout: 258 seconds]
ur5us has joined #ruby
absolutejam4 has quit [Ping timeout: 246 seconds]
involans has quit [Quit: involans]
involans has joined #ruby
absolutejam4 has joined #ruby
tdy1 has quit [Ping timeout: 268 seconds]
Intelo has quit [Remote host closed the connection]
MrCrackPotBuilde has joined #ruby
fphilipe has quit [Ping timeout: 276 seconds]
MrCrackPotBuilde has quit [Max SendQ exceeded]
MrCrackPotBuilde has joined #ruby
dasher00 has joined #ruby
MrCrackPot has quit [Ping timeout: 240 seconds]
MrCrackPotBuilde has quit [Max SendQ exceeded]
MrCrackPotBuilde has joined #ruby
bruce_lee has joined #ruby
bruce_lee has quit [Changing host]
bruce_lee has joined #ruby
thexa4 has joined #ruby
involans has quit [Quit: involans]
goez has joined #ruby
involans has joined #ruby
involans has quit [Client Quit]
involans has joined #ruby
ur5us has quit [Remote host closed the connection]
d^sh has quit [Ping timeout: 244 seconds]
tcurdt has left #ruby ["Later!"]
d^sh has joined #ruby
gell5 has joined #ruby
kapil has quit []
kapil_ has joined #ruby
hightower2 has quit [Changing host]
hightower2 has joined #ruby
gell5 has quit [Ping timeout: 276 seconds]
pwnd_nsfw` has quit [Ping timeout: 244 seconds]
NL3limin4t0r_afk is now known as NL3limin4t0r
<NL3limin4t0r> throstur: If the key value is always followed by a '\n' you can simply use `/(?<=Key: )(?:[^\\]|\\(?!n))/`
<NL3limin4t0r> There should be a start at the end ^
<NL3limin4t0r> `/(?<=Key: )(?:[^\\]|\\(?!n))*/`
<NL3limin4t0r> It simply says after `Key: ` match anything that is not an `\` character or an ``
<NL3limin4t0r> It simply says after `Key: ` match anything that is not an `\` character or an `\` character not followed by an `n` zero or more times.
_Joes_ has joined #ruby
tsujp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gell5 has joined #ruby
fphilipe has joined #ruby
gell5 has quit [Ping timeout: 276 seconds]
fphilipe has quit [Ping timeout: 246 seconds]
queip has quit [Ping timeout: 268 seconds]
tsujp has joined #ruby
DTZUZO has quit [Ping timeout: 258 seconds]
queip has joined #ruby
<throstur> Thanks NL3limin4t0r
<throstur> I want to try something different now, maybe you can point me in the right direction, but it requires capturing key,value pairs
_Joes_ has quit [Ping timeout: 252 seconds]
<throstur> EXAMPLE LINE: `match_line_str.cfg: KEY1: VALUE1 \n + KEY2: VALUE2\n + KEY3: VALUE3\n + <ignore>
<throstur> do I do it in 2 steps, i.e. capture <key_regex>: <value_regex>\n and then capture key and value separately or is there some smart way to go about this?
<throstur> by the way, the regex you provided only captured the first character of the value
<throstur> `/Key: (\w+)\\n/` seems to do it though
<NL3limin4t0r> Yeah, my third message fixes that. There should be an `*` at the end of the regex.
tsujp has quit [Read error: Connection reset by peer]
<throstur> ah, or a + I suppose
<NL3limin4t0r> Yeah, if you expect no empty values.
<throstur> so how can I adjust the ?<=Key: to capture "any key name"?
<throstur> I've been trying to fiddle with it but I get an error about invalid lookbehind value
<throstur> s/value/pattern
<NL3limin4t0r> Do keys have restrictions? Can they contain spaces?
<throstur> not as far as I can tell
<throstur> the values can though
<throstur> but they always end with a `\n` literal or EOL
tsujp has joined #ruby
<NL3limin4t0r> Is there always a space for a key?
chalkmonster has quit [Quit: WeeChat 2.5]
<throstur> looks like it
<throstur> if for=>before
<NL3limin4t0r> `(?<= )(\w+): ((?:[^\\]|\\(?!n))*)`
<NL3limin4t0r> Assuming key can only contains `[a-zA-Z0-9_]`
Jonopoly has joined #ruby
<throstur> looks perfect to me
AJA4350 has joined #ruby
<NL3limin4t0r> capturing the key in group 1 and value in group 2
<throstur> works on small test set too
<throstur> even beautifully works to .to_h on the result!
<throstur> man ruby is wonderful
<throstur> now I'm wondering, can I convert a string to an atom? like if I have "mykey" in the capture, could I make it a :mykey ?
<throstur> ah I see there's a method .to_sym, I probably want that
<NL3limin4t0r> If a string can begin with a key you might want to change `(?<= )` to `(?<=\A|=)` wich means that it can come right after the start of the string or followed upon a space.
<NL3limin4t0r> Oops, I mean `(?<=\A| )`
<NL3limin4t0r> Yea can that do after though.
<NL3limin4t0r> If you're running a newer version of Ruby simply `result.to_h.transform_keys(&:to_sym)`
<NL3limin4t0r> Calling `.to_sym` on all the keys.
<NL3limin4t0r> Hash#transform_keys is introduced in 2.5.0
cyclonis has quit [Ping timeout: 246 seconds]
involans has quit [Read error: Connection reset by peer]
<throstur> cool, let me check my jruby version *embarassed face*
<throstur> 2.5.3 ! thank the heavens
<throstur> OK, so I end up with this monster: https://dpaste.de/vegd it works great, but I'm wondering if there are some best practices or things you would do to make the code prettier, more readable, or anything like that
openCircuit__ has joined #ruby
involans has joined #ruby
openCircuit__ has quit [Ping timeout: 245 seconds]
tsujp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
vondruch_ has joined #ruby
meinside has quit [Quit: Connection closed for inactivity]
vondruch has quit [Ping timeout: 246 seconds]
vondruch_ is now known as vondruch
DTZUZO has joined #ruby
DTZUZO has quit [Ping timeout: 246 seconds]
tsujp has joined #ruby
VladGh has quit [Read error: Connection reset by peer]
VladGh has joined #ruby
hutch has joined #ruby
elphe has joined #ruby
stryek has joined #ruby
GodFather has joined #ruby
esrse has quit [Ping timeout: 244 seconds]
lucasb has joined #ruby
tsujp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
x86sk has quit [Quit: Connection closed for inactivity]
arahael3 is now known as Arahael
greypack has quit [Read error: Connection reset by peer]
greypack has joined #ruby
ramfjord has joined #ruby
ramfjord has quit [Ping timeout: 240 seconds]
ravenous_ has joined #ruby
gell5 has joined #ruby
fphilipe has joined #ruby
ravenous_ has quit [Ping timeout: 252 seconds]
gell5 has quit [Ping timeout: 276 seconds]
planigan has quit [Read error: Connection reset by peer]
<NL3limin4t0r> Nah, you could question yourself why you do the first #transform_keys on a different like than the other.
<NL3limin4t0r> You could also considder using the mutating version #transform_keys! instead, assuming you don't need the previous result.
<NL3limin4t0r> throstur: https://dpaste.de/E0uG
<NL3limin4t0r> fyi `%i[downcase to_sym]` equals `[:downcase, :to_sym]`
banisterfiend has joined #ruby
<NL3limin4t0r> I think I would go for the last since it's the fastest in iterations and doesn't need throw away variables.
<NL3limin4t0r> https://dpaste.de/FPZH
<NL3limin4t0r> Would be my choise
fphilipe has quit [Ping timeout: 246 seconds]
tsujp has joined #ruby
queip has quit [Ping timeout: 258 seconds]
GodFather has quit [Read error: No route to host]
<NL3limin4t0r> You could also shorten the regex further to `/ (\w+): (.*?)\\n/m` since you only care about the groups and not the entire match.
<NL3limin4t0r> But I'm not the biggest fan of lazy quantifiers myself.
chalkmonster has joined #ruby
queip has joined #ruby
grilix has joined #ruby
involans has quit [Read error: Connection reset by peer]
involans has joined #ruby
arahael1 has joined #ruby
Arahael has quit [Ping timeout: 276 seconds]
jrafanie has joined #ruby
<throstur> thanks again NL3limin4t0r, I ended up with this: https://dpaste.de/634w seems much nicer and reduces useless variables
<throstur> I feel that the ! is unneeded though, because I'm getting the end result in one rval
<throstur> perhaps it is faster, but it wouldn't matter
chalkmonster has quit [Quit: WeeChat 2.5]
ravenous_ has joined #ruby
<NL3limin4t0r> In your current case the ! is indeed unneeded. I used it to skip variable assignment.
<NL3limin4t0r> You could also use `line.scan(capture_regex).map { |key, value| [key.downcase.to_sym, value.strip] }.to_h`
<NL3limin4t0r> Depending on what you find more readable.
<NL3limin4t0r> &>> [[1, 2], [3, 4]].map { |v1, v2| [v1 + 1, v2 * v2] }
<rubydoc> # => [[2, 4], [4, 16]] (https://carc.in/#/r/7jka)
<throstur> I think it is more readable, thank you
<throstur> don't I need the .to_h before map and after line.scan though?
<throstur> why do you put it after?
<throstur> it seems to work at least
<NL3limin4t0r> Because the result of map is going to be: `[[key1, value1], [key2, value2], ...]` and I assume you want: `{key1: value1, key2: value2, ...}`
<throstur> ahhhh
<throstur> but can't you map on a hash too?
<NL3limin4t0r> yes you can, but the result is an array
<throstur> # => { 1 => 2, 3 => 4}.map { |v1, v2| [v1 + 1, v2 * v2] }
<throstur> &>> { 1 => 2, 3 => 4}.map { |v1, v2| [v1 + 1, v2 * v2] }
<rubydoc> # => [[2, 4], [4, 16]] (https://carc.in/#/r/7jkc)
<throstur> right
<throstur> I get it now
<throstur> &>> { 1 => 2, 3 => 4}.map { |v1, v2| [v1 + 1, v2 * v2] }.to_h
<rubydoc> # => {2=>4, 4=>16} (https://carc.in/#/r/7jkd)
GodFather has joined #ruby
<NL3limin4t0r> The reason I don't call #to_h before #map is because you can use array decomposistion in blocks.
<NL3limin4t0r> Basically you have an array with other arrays (the regex groups).
<NL3limin4t0r> Meaning that every element is an array by itself.
<NL3limin4t0r> &>> [['key1', 'value1'], ['key2', 'value2']].all?(/Array/)
<rubydoc> # => false (https://carc.in/#/r/7jke)
<NL3limin4t0r> oops
<NL3limin4t0r> &>> [['key1', 'value1'], ['key2', 'value2']].all?(Array)
<rubydoc> # => true (https://carc.in/#/r/7jkf)
openCircuit__ has joined #ruby
<NL3limin4t0r> aka `[['key1', 'value1'], ['key2', 'value2']].all? { |item| item.is_a? Array }`
<NL3limin4t0r> when you put a comma in the block it breaks down the array
<NL3limin4t0r> &>> [['key1', 'value1'], ['key2', 'value2']].map { |item,| item } # note the comma
<rubydoc> # => ["key1", "key2"] (https://carc.in/#/r/7jkg)
GodFather has quit [Ping timeout: 245 seconds]
fphilipe has joined #ruby
<NL3limin4t0r> So you can get the first and second value of the current item by simply using the destruction assignment (basically treating it as a hash)
openCircuit__ has quit [Ping timeout: 240 seconds]
<NL3limin4t0r> I hope my explenation is not to confusing.
emptyflask has joined #ruby
<throstur> that makes sense
<throstur> I'm fairly well versed in other languages but haven't really reached guru status in any one since I keep moving around languages on a per-project basis
<throstur> quick question about globals, if script A has a global $logger, and I import script B, can I use $logger in script B for debugging purposes or must I pass it as a parameter?
<NL3limin4t0r> You should be able to use $logger in script B.
reber has joined #ruby
<throstur> cool, thank you
emptyflask has quit [Ping timeout: 258 seconds]
<throstur> in my specific case this time I refactored my class in script B to create the payload and the next method accepts the payload because it makes sense for future class expansion but it's nice to know I can hotplug some debugs in there if I need
emptyflask has joined #ruby
schne1der has quit [Ping timeout: 258 seconds]
<NL3limin4t0r> Considder implementing a null pattern for your $logger. That way you don't have to check if `$logger` is set before logging. You can simply assue that it's there, if the null pattern logger is set it simply discards everything.
<NL3limin4t0r> s/assue/assume/
netcrash has left #ruby [#ruby]
AJA4350 has quit [Ping timeout: 245 seconds]
gell5 has joined #ruby
chalkmonster has joined #ruby
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gell5 has quit [Ping timeout: 240 seconds]
emptyflask has quit [Ping timeout: 246 seconds]
emptyflask has joined #ruby
fphilipe has quit [Ping timeout: 245 seconds]
banisterfiend has joined #ruby
chalkmonster has quit [Client Quit]
spiette has quit [Quit: ZNC 1.7.3 - https://znc.in]
chalkmonster has joined #ruby
chalkmonster has quit [Client Quit]
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
spiette has joined #ruby
<NL3limin4t0r> You could for example use $stdout by default in your logger, but allow the user to give their own output stream. This way you can provide `File.open(File::NULL, 'w')` as output stream if you don't want any logging.
<NL3limin4t0r> &>> File::NULL
<rubydoc> # => "/dev/null" (https://carc.in/#/r/7jku)
ravenous_ has quit [Ping timeout: 246 seconds]
Inline has joined #ruby
openCircuit__ has joined #ruby
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
x86sk has joined #ruby
IGnorAND has quit [Ping timeout: 244 seconds]
IGnorAND has joined #ruby
snk has quit [Remote host closed the connection]
AJA4350 has joined #ruby
fphilipe has joined #ruby
croberts has joined #ruby
krawchyk has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
krawchyk has quit [Client Quit]
Huck777 has joined #ruby
emptyflask has quit [Ping timeout: 246 seconds]
jacksoow_ has joined #ruby
jacksoow has quit [Ping timeout: 246 seconds]
emptyflask has joined #ruby
spacesuitdiver has joined #ruby
SuperL4g is now known as SuperLag
szulak has quit [Ping timeout: 250 seconds]
Milos has quit [Ping timeout: 246 seconds]
Milos has joined #ruby
chalkmonster has joined #ruby
fphilipe has quit [Ping timeout: 246 seconds]
openCircuit__ has quit [Ping timeout: 246 seconds]
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
absolutejam4 has quit [Ping timeout: 268 seconds]
salinasc has joined #ruby
AJA4350 has quit [Ping timeout: 240 seconds]
gell5 has joined #ruby
Guest77382 has joined #ruby
lollipopman has joined #ruby
jrafanie has joined #ruby
gell5 has quit [Ping timeout: 240 seconds]
Nicmavr has quit [Read error: Connection reset by peer]
Nicmavr has joined #ruby
poontangmessiah has joined #ruby
salinasc has quit [Ping timeout: 276 seconds]
MrCrackPotBuilde has quit [Ping timeout: 244 seconds]
schaerli has quit [Ping timeout: 268 seconds]
dbugger has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.5]
TomyWork has quit [Ping timeout: 246 seconds]
ellcs has quit [Ping timeout: 246 seconds]
lollipopman has quit [Remote host closed the connection]
planigan has joined #ruby
rippa has joined #ruby
rippa has quit [Read error: Connection reset by peer]
tiax has joined #ruby
tiax has quit [Client Quit]
rippa has joined #ruby
gix has joined #ruby
Jonopoly has quit [Quit: WeeChat 2.5]
tiax has joined #ruby
fphilipe_ has joined #ruby
fphilipe_ has quit [Ping timeout: 252 seconds]
fphilipe_ has joined #ruby
Furai has quit [Quit: WeeChat 2.6]
DTZUZO has joined #ruby
dionysus69 has quit [Ping timeout: 246 seconds]
AJA4350 has joined #ruby
Furai has joined #ruby
dinfuehr has quit [Ping timeout: 246 seconds]
dinfuehr has joined #ruby
schne1der has joined #ruby
dinfuehr has quit [Ping timeout: 244 seconds]
dinfuehr has joined #ruby
rafadc has quit [Ping timeout: 258 seconds]
rafadc has joined #ruby
vondruch has quit [Ping timeout: 246 seconds]
hutch has quit [Ping timeout: 246 seconds]
hutch has joined #ruby
SeepingN has joined #ruby
thexa4 has quit [Quit: My computer has gone to sleep. ZZZzzz…]
ellcs has joined #ruby
ellcs has quit [Max SendQ exceeded]
oetjenj has joined #ruby
thexa4 has joined #ruby
phaul has quit [Quit: :wq]
involans has quit [Read error: Connection reset by peer]
involans_ has joined #ruby
involans_ is now known as involans
ellcs has joined #ruby
ellcs has quit [Max SendQ exceeded]
x86sk has quit [Quit: Connection closed for inactivity]
phaul has joined #ruby
ellcs has joined #ruby
ellcs has quit [Max SendQ exceeded]
cthulchu has joined #ruby
ellcs has joined #ruby
ellcs has quit [Max SendQ exceeded]
salinasc has joined #ruby
ellcs has joined #ruby
ellcs has quit [Max SendQ exceeded]
MrCrackPot has joined #ruby
ellcs has joined #ruby
salinasc has quit [Remote host closed the connection]
<havenwood> This is super neat: https://github.com/ruby/ruby/pull/2450
<havenwood> This only makes me more eager to cache gem bytecode on install. :)
banisterfiend has joined #ruby
ellcs has quit [Ping timeout: 276 seconds]
<havenwood> (It reduces RubyVM::InstructionSequence#to_binary output to be a quarter of the previous size.)
duderonomy has joined #ruby
hiroaki has joined #ruby
suukim has joined #ruby
dretnx has joined #ruby
dionysus69 has joined #ruby
gell5 has joined #ruby
troulouliou_dev has joined #ruby
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 268 seconds]
AJA4351 is now known as AJA4350
gell5 has quit [Ping timeout: 268 seconds]
ramfjord has joined #ruby
dionysus69 has quit [Remote host closed the connection]
dionysus69 has joined #ruby
leah2 has quit [Remote host closed the connection]
leah2 has joined #ruby
throstur has quit [Ping timeout: 276 seconds]
ramfjord has quit [Ping timeout: 246 seconds]
throstur has joined #ruby
throsturt has joined #ruby
dretnx has quit [Quit: Going offline, see ya! (www.adiirc.com)]
throstur has quit [Ping timeout: 245 seconds]
<NL3limin4t0r> Is there a way to call the `||=` operator upon a dynamic attribute. I'm guessing `obj.public_send("attr||=", val)` is not going to work.
thexa4 has quit [Quit: My computer has gone to sleep. ZZZzzz…]
<phaul> I thought it was just a shorthand for attr = attr || val. so semantically it's not the attr||= but the attr=
leah2 has quit [Remote host closed the connection]
<NL3limin4t0r> Technically it's a shorthand for `attr || attr = val`
ramfjord has joined #ruby
<phaul> then it doesn't match the rest like += and so on
troulouliou_dev has quit [Quit: Leaving]
<NL3limin4t0r> So simply translate it to `obj.public_send("attr") or obj.public_send("attr", val)` I guess
<NL3limin4t0r> That last part should be `obj.public_send("attr=", val)` (forgot the =)
leah2 has joined #ruby
<NL3limin4t0r> phaul: That's correct. &&= has the same behaviour though.
<phaul> yeah. I found it being a "common misconception" http://www.rubyinside.com/what-rubys-double-pipe-or-equals-really-does-5488.html at least I'm not alone :)
thexa4 has joined #ruby
<NL3limin4t0r> Nah, I also assumed it to be `attr = attr || val` until I stumbled upon this fact once. But normally it doesn't really matter, only in some edge cases.
<leftylink> oh.
<leftylink> well, you got me. I didn't know.
sameerynho has joined #ruby
dubuc has joined #ruby
<Eiam> hmm, my `gem env` shows my gem path as - /usr/local/lib/ruby/gems/2.6.0 and /users/me/.gem/ruby/2.6.0, but when i fire up pry and try to 'gem `blah`' it cannot find the gem because it looked in gem_path= <none of the places listed above>
<Eiam> irb finds it no problem though
ravenous_ has joined #ruby
<havenwood> Eiam: Do you have Pry installed for the current Ruby?
<havenwood> Eiam: gem which pry
involans has quit [Read error: Connection reset by peer]
<Eiam> /usr/local/lib/ruby/gems/2.6.0/gems/pry-0.12.2/lib/pry.rb
<havenwood> Eiam: And nothing funky in your .pryrc?
<Eiam> no such
<havenwood> Eiam: And the IRB you're using is also the current Ruby? Nothing in .irbrc?
<Eiam> no such file
<havenwood> Eiam: What paths does Pry show?
<Eiam> so pry, require "mygem" from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
<Eiam> irb require "mygem" ==> true
<havenwood> Eiam: So that's System Ruby it's showing.
sauvin has quit [Read error: Connection reset by peer]
<havenwood> Eiam: What do you get for?: which -a pry
<Eiam> right, pry is searching on the system ruby
<Eiam> /usr/local/bin/pry
<havenwood> Eiam: head -n1 /usr/local/bin/pry
<leftylink> I forgot to thank havenwood for the good idea of group_by(&:last) that one time. thanks.
<Eiam> ha!
<Eiam> #!/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby
<Eiam> pry y u do this
<havenwood> leftylink: :)
<leftylink> (for multi-value invert)
ramfjord has quit [Ping timeout: 245 seconds]
<havenwood> Eiam: gem pristine pry
<Eiam> hmm, pry still says the same thing after pristine
<havenwood> Eiam: head -n1 /usr/local/bin/pry
<Eiam> its still the same thing #!/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby
<Eiam> after gem pristine pry
<havenwood> Eiam: Just to confirm, your Ruby 2.6 is brew Ruby? Is its GEM_PATH in your PATH?
ramfjord has joined #ruby
<Eiam> /usr/local/opt/ruby/bin/ruby
<Eiam> yeah brew
queip has quit [Ping timeout: 258 seconds]
<Eiam> havenwood: https://dpaste.de/yRzm
cyclonis has joined #ruby
cyclonis has quit [Max SendQ exceeded]
<havenwood> Eiam: export PATH="$(gem env gemdir)/bin:$PATH"
<Eiam> that fixed it
<Eiam> hmmmm
<Eiam> my bash profile already exports paths
<havenwood> Eiam: Then check: which -a pry
<havenwood> Eiam: Homebrew doesn't give proper instructions on setting up PATH for gems on install.
<Eiam> source /usr/local/opt/chruby/share/chruby/chruby.sh
<havenwood> Eiam: If I had time, I'd fix that.
<Eiam> export PATH="/usr/local/opt/ruby/bin:$PATH"
<Eiam> interesting
<Eiam> havenwood: yeah it has it /usr/local/lib/ruby/gems/2.6.0/bin/pry
ramfjord has quit [Ping timeout: 276 seconds]
queip has joined #ruby
<havenwood> Eiam: That's ^ my recommended setup for folk using chruby with brew Ruby.
<havenwood> There are other ways to do it and happy to help with one of those if you prefer.
oetjenj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
oetjenj has joined #ruby
elphe has quit [Ping timeout: 246 seconds]
<Eiam> when i get some time honestly im going to move all my dev into containers
sagax has quit [Quit: Konversation terminated!]
cyclonis has joined #ruby
cyclonis has quit [Max SendQ exceeded]
<Eiam> i just hate the mental overhead of paging all that shit in when i just want to type 'pry' and poke at some stuff.
sagax has joined #ruby
<Eiam> thanks for your help
suukim has quit [Quit: Konversation terminated!]
dinfuehr has quit [Ping timeout: 244 seconds]
absolutejam4 has joined #ruby
AJA4350 has quit [Ping timeout: 240 seconds]
cyclonis has joined #ruby
dinfuehr has joined #ruby
cyclonis has quit [Max SendQ exceeded]
cyclonis has joined #ruby
cyclonis has quit [Max SendQ exceeded]
hightower2 has quit [Ping timeout: 245 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
cyclonis has joined #ruby
cyclonis has quit [Max SendQ exceeded]
cyclonis has joined #ruby
cyclonis has quit [Max SendQ exceeded]
dubuc has quit [Ping timeout: 276 seconds]
cyclonis has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
cyclonis has quit [Max SendQ exceeded]
hightower2 has joined #ruby
NL3limin4t0r is now known as NL3limin4t0r_afk
hightower2 has quit [Changing host]
hightower2 has joined #ruby
jenrzzz has joined #ruby
cyclonis has joined #ruby
thexa4 has quit [Quit: My computer has gone to sleep. ZZZzzz…]
cyclonis has quit [Max SendQ exceeded]
ravenous_ has quit [Remote host closed the connection]
ravenous_ has joined #ruby
FernandoBasso has joined #ruby
pwnd_nsfw has joined #ruby
tpanarch1st has joined #ruby
jud has joined #ruby
jud has joined #ruby
jud has quit [Changing host]
cyclonis has joined #ruby
cyclonis has quit [Max SendQ exceeded]
ua_ has quit [Ping timeout: 245 seconds]
ravenous_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gell5 has joined #ruby
gell5 has quit [Ping timeout: 246 seconds]
cyclonis has joined #ruby
cyclonis has quit [Max SendQ exceeded]
dubuc has joined #ruby
ellcs has joined #ruby
ellcs has quit [Max SendQ exceeded]
ua_ has joined #ruby
ellcs has joined #ruby
dubuc has quit [Ping timeout: 276 seconds]
xtolid has quit [Ping timeout: 246 seconds]
cyclonis has joined #ruby
cyclonis has quit [Max SendQ exceeded]
xtolid has joined #ruby
dubuc has joined #ruby
hightower2 has quit [Ping timeout: 240 seconds]
Intelo has joined #ruby
throsturt has quit [Ping timeout: 240 seconds]
throsturt has joined #ruby
dionysus69 has quit [Ping timeout: 276 seconds]
dubuc has quit [Ping timeout: 268 seconds]
dubuc has joined #ruby
schne1der has quit [Ping timeout: 268 seconds]
hightower2 has joined #ruby
hightower2 has quit [Changing host]
hightower2 has joined #ruby
ramfjord has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cthulchu has quit [Quit: Leaving]
cthulchu has joined #ruby
dubuc has quit [Ping timeout: 245 seconds]
dubuc has joined #ruby
tpanarch1st has quit [Ping timeout: 258 seconds]
evdubs_ has joined #ruby
evdubs has quit [Ping timeout: 246 seconds]
Azure has quit [Read error: Connection reset by peer]
dbugger has quit [Quit: Leaving]
FernandoBasso has quit [Remote host closed the connection]
<Norrin> how do folks feel about resque?
BTRE has quit [Ping timeout: 245 seconds]
<ramfjord> I used it a couple of years ago and had no problems with it. I did find it a bit difficult to debug whether a job had ever existed, and we were using it for non-idempotent jobs (and relatively few) so redis in general wasn't really any more suited for our use case as a queue than the postgres database we were also connected to
<ramfjord> resque the library seemed fine though!
<ramfjord> didn't dig too deeply in any parts of the code
<havenwood> Norrin Good.
ellcs has quit [Ping timeout: 276 seconds]
ferhaty has joined #ruby
ferhaty has quit [Client Quit]
jordanm has quit [Remote host closed the connection]
ur5us has joined #ruby
jordanm has joined #ruby
BTRE has joined #ruby
spacesuitdiver has quit [Quit: Textual IRC Client: www.textualapp.com]
tdy1 has joined #ruby
drincruz has joined #ruby
<Norrin> Thanks
AJA4350 has joined #ruby
tdy2 has joined #ruby
grilix has quit [Ping timeout: 246 seconds]
ap4y has joined #ruby
tdy1 has quit [Ping timeout: 268 seconds]
lucasb has quit [Quit: Connection closed for inactivity]
dubuc has quit [Read error: Connection reset by peer]
dubuc has joined #ruby
dubuc has quit [Client Quit]
jrafanie has joined #ruby
gell5 has joined #ruby
gell5 has quit [Ping timeout: 240 seconds]
jacksoow has joined #ruby
jacksoow_ has quit [Ping timeout: 264 seconds]
Azure has joined #ruby
ellcs has joined #ruby
thexa4 has joined #ruby
livcd has quit [Remote host closed the connection]
Fernando-Basso has joined #ruby
absolutejam4 has quit [Ping timeout: 240 seconds]
absolutejam4 has joined #ruby
jacksoow_ has joined #ruby
jacksoow has quit [Ping timeout: 276 seconds]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
throsturt has quit [Ping timeout: 244 seconds]
jrvlima has joined #ruby
absolutejam has joined #ruby
throsturt has joined #ruby
absolutejam4 has quit [Ping timeout: 245 seconds]
tpanarch1st has joined #ruby
tpanarch1st has quit [Remote host closed the connection]
fredolinhares has joined #ruby
jrvlima has quit [Read error: Connection reset by peer]
tdy2 has quit [Remote host closed the connection]
fig-le-deunch has joined #ruby
absolutejam1 has joined #ruby
absolutejam has quit [Ping timeout: 246 seconds]
elphe has joined #ruby
drincruz has quit [Ping timeout: 246 seconds]
reber has quit [Read error: Connection reset by peer]
absolutejam1 has quit [Ping timeout: 245 seconds]
tdy has joined #ruby
cthulchu has quit [Ping timeout: 246 seconds]
sh7d has quit [Quit: meh]
rubydoc has quit [Remote host closed the connection]
rubydoc_ has joined #ruby
insolentworm has quit [Quit: ZNC 1.7.3 - https://znc.in]
LenPayne has quit [Quit: ZNC 1.7.3 - https://znc.in]
RiPuk has quit [Quit: ZNC 1.7.4 - https://znc.in]
sh7d has joined #ruby
insolentworm has joined #ruby
RiPuk has joined #ruby
LenPayne has joined #ruby
MrBismuth has quit [Ping timeout: 250 seconds]
MrBusiness3 has joined #ruby
Yojimble has joined #ruby
Guest77382 has quit [Ping timeout: 240 seconds]
ltd has joined #ruby
ltd has quit [Quit: leaving]
Guest77382 has joined #ruby
cnsvc has quit [Ping timeout: 260 seconds]
gell5 has joined #ruby
fig-le-deunch has quit [Quit: Konversation terminated!]
fig-le-deunch has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gell5 has quit [Ping timeout: 245 seconds]
jenrzzz has quit [Ping timeout: 258 seconds]
jenrzzz has joined #ruby
xtolid has left #ruby ["Leaving"]
xtolid has joined #ruby
DaRock has quit [Ping timeout: 276 seconds]
r3m has quit [Remote host closed the connection]
r3m has joined #ruby
r3m has quit [Client Quit]
r3m has joined #ruby
r3m has quit [Client Quit]
r3m has joined #ruby
r3m has quit [Remote host closed the connection]
r3m has joined #ruby
r3m has quit [Remote host closed the connection]
<Eiam> i have used resque for years and im very used to connecting in and destroying alll my workers and restarting it
r3m has joined #ruby
r3m has quit [Client Quit]
<Eiam> in fact I've got these handy SO pages https://stackoverflow.com/questions/7416318/how-do-i-clear-stuck-stale-resque-workers that I turned into jobs because I got so tired of manually doing it.
<SeepingN> !
bitwinery has joined #ruby
<SeepingN> sending this to my ops team :D
<Eiam> so i can clear my queues too.
<Eiam> 100% if I connect into one of my containers i can guarantee that there will be stuck workers.
jenrzzz has quit [Ping timeout: 246 seconds]
<Eiam> i also got so tired of doing THAT, now I just redeploy the app every week to destroy it all and re-create it.
<Eiam> dont @ me leave me alone. also I don't use resque on new projects.
<SeepingN> kinda like rebooting windows daily was easier than reegnineering teh disaster underneath
<Eiam> SeepingN: I'm willing to accept the code underneath is a disaster. its also paid a lot of bills.
<SeepingN> indeed