baweaver changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.6.3, 2.5.5, 2.4.6: 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!
houhoulis has quit [Remote host closed the connection]
<adam12> CableNinja: Can you share the code you're using?
<CableNinja> sure, one sec
sameerynho has quit [Ping timeout: 258 seconds]
jottr has joined #ruby
ngw has joined #ruby
skryking_ has joined #ruby
skryking__ has quit [Ping timeout: 245 seconds]
ngw has quit [Ping timeout: 245 seconds]
<adam12> CableNinja: And you're saying, when you run the server, openssl s_client works, Ruby doesn't.
<CableNinja> correct. one sec, I'll snippet the outputs
orbyt_ has joined #ruby
<CableNinja> as far as I can tell, it seems to be a problem with the client side code
jottr has quit [Ping timeout: 250 seconds]
<CableNinja> I've tried all sorts of variations on ssl/tls version as well as ciphers, nothing seems to make a difference
Swyper has joined #ruby
<adam12> CableNinja: There's a ton going on in here. I'd probably try to reduce it down into 2 small scripts to reproduce.
OneNeptune has joined #ruby
Swyper has quit [Remote host closed the connection]
orbyt_ has quit [Ping timeout: 246 seconds]
hightower2 has joined #ruby
krawchyk has joined #ruby
ngw has joined #ruby
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hightower2 has quit [Changing host]
hightower2 has joined #ruby
krawchyk has quit [Client Quit]
ngw has quit [Ping timeout: 246 seconds]
Swyper has joined #ruby
jottr has joined #ruby
ngw has joined #ruby
jottr has quit [Ping timeout: 258 seconds]
<CableNinja> adam12, alright, will do. do you have any info regarding what those SSL errors actually mean? (ssl errors are so unhelpful sometimes)
<adam12> CableNinja: Not really. I took the liberty of pulling out a bunch of your code into 2 smaller files and it _looks_ like it works, at least on my end.
<adam12> CableNinja: But I ripped out everything to do with threads and loops and connection handlers.
ngw has quit [Ping timeout: 246 seconds]
<adam12> CableNinja: OpenSSL errors are definitely unhelpful :\
<adam12> CableNinja: Maybe try my 2 small versions and see if they work? If they do, maybe we can see where your code differs from mine.
james382 has quit [Quit: Lost terminal]
<CableNinja> ok, I'll try the same here in a bit, about to eat dinner
ngw has joined #ruby
ngw has quit [Ping timeout: 250 seconds]
hightower2 has quit [Ping timeout: 245 seconds]
jottr has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
jottr has quit [Ping timeout: 246 seconds]
Swyper has joined #ruby
agent_white has quit [Quit: gnight]
ngw has joined #ruby
dviola has quit [Quit: WeeChat 2.4]
ngw has quit [Ping timeout: 244 seconds]
OneNeptune has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jottr has joined #ruby
seydar has joined #ruby
<seydar> what's the idiom i'm looking for here? `def search(query=nil, opts={})...`
<seydar> `search "str"` or `search :param => 3`. right now, passing a hash is greedily accepted as the `query` parameter
fphilipe has joined #ruby
jottr has quit [Ping timeout: 245 seconds]
DTZUZO has quit [Ping timeout: 258 seconds]
jmcgnh has quit [Ping timeout: 250 seconds]
fphilipe has quit [Ping timeout: 276 seconds]
<adam12> seydar: If you're _stuck_ with that style of method signature, you might have to get fancy and accept an array of args.
<adam12> seydar: If you're not stuck with that style of method signature, you might be able to make query a keyword argument and then capture the rest of the keyword arguments as options.
<adam12> seydar: If you're looking for a name of that style of method, I might call it polymorphic?
ngw has joined #ruby
ramfjord has quit [Ping timeout: 245 seconds]
<seydar> adam12: i feel so old, i disappeared right before keyword arguments became a thing
<adam12> seydar: They're mostly good, tho some parts are jank and Matz yearns to fix them.
<adam12> seydar: You might be able to do something like `def search(query: nil, **opts)` if you're on a reasonably new version of Ruby.
<adam12> seydar: Also, you should come back.
<seydar> adam12: ahh, i just discovered the **
<seydar> i'm rocking 2.6
ngw has quit [Ping timeout: 246 seconds]
jelera has joined #ruby
Puffball has joined #ruby
<seydar> adam12: okay, the double splat is exactly what i'm looking for. i'm convinced precedence changed at some point in the past five years, because i swear that was an idiom i used to use
dsmythe has joined #ruby
<seydar> thank you!
<adam12> seydar: I can't remember when it was introduced but it's wicked handy
<adam12> seydar: Also I screwed up; with kwargs, you can still use a nil-default positional param.
<adam12> seydar: So this signature is fine too if you want it: `def search(query=nil, **opts)`
OneNeptune has joined #ruby
sam_ has joined #ruby
sam_ has quit [Client Quit]
dsmythe_ has quit [Ping timeout: 276 seconds]
<seydar> adam12: yep, that's what i ended up going with
seydar has quit [Quit: leaving]
jottr has joined #ruby
tdy1 has joined #ruby
jottr has quit [Ping timeout: 245 seconds]
dsmythe has quit [Read error: Connection reset by peer]
ngw has joined #ruby
dsmythe has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ngw has quit [Ping timeout: 250 seconds]
jmcgnh has joined #ruby
tdy1 has quit [Ping timeout: 245 seconds]
SeepingN has joined #ruby
jottr has joined #ruby
AJA4350 has quit [Remote host closed the connection]
dviola has joined #ruby
jottr has quit [Ping timeout: 255 seconds]
ngw has joined #ruby
comet23 has quit [Quit: Connection closed for inactivity]
ngw has quit [Ping timeout: 258 seconds]
zacts has joined #ruby
zacts has quit [Quit: WeeChat 2.4]
zacts has joined #ruby
jelera has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zacts has quit [Client Quit]
tdy1 has joined #ruby
gnufied has quit [Remote host closed the connection]
OneNeptune has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Puffball has quit [Read error: Connection reset by peer]
ngw has joined #ruby
ngw has quit [Ping timeout: 250 seconds]
jelera has joined #ruby
noobineer has quit [Remote host closed the connection]
ngw has joined #ruby
ngw has quit [Ping timeout: 258 seconds]
braincrash has quit [Quit: bye bye]
ngw has joined #ruby
braincrash has joined #ruby
ngw has quit [Ping timeout: 244 seconds]
gix has joined #ruby
gix- has quit [Ping timeout: 268 seconds]
spacesuitdiver has joined #ruby
fphilipe has joined #ruby
ramfjord has joined #ruby
fphilipe has quit [Ping timeout: 250 seconds]
ramfjord has quit [Ping timeout: 245 seconds]
OneNeptune has joined #ruby
ngw has joined #ruby
duderonomy has joined #ruby
ngw has quit [Ping timeout: 255 seconds]
ngw has joined #ruby
ngw has quit [Ping timeout: 246 seconds]
ricekrispie has joined #ruby
ricekrispie2 has quit [Ping timeout: 250 seconds]
ngw has joined #ruby
ngw has quit [Ping timeout: 258 seconds]
ngw has joined #ruby
ngw has quit [Ping timeout: 245 seconds]
OneNeptune has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jelera has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Puffball has joined #ruby
stan_ has quit [Quit: No Ping reply in 180 seconds.]
OneNeptune has joined #ruby
stan has joined #ruby
ngw has joined #ruby
dellavg_ has joined #ruby
ngw has quit [Ping timeout: 250 seconds]
marmotini_ has joined #ruby
ngw has joined #ruby
Puffball has quit [Quit: Puffball]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
dellavg_ has quit [Ping timeout: 244 seconds]
ngw has quit [Ping timeout: 246 seconds]
OneNeptune has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ngw has joined #ruby
Swyper has quit [Remote host closed the connection]
reber has joined #ruby
ngw has quit [Ping timeout: 250 seconds]
Swyper has joined #ruby
conta has joined #ruby
Zeno_ has joined #ruby
Swyper has quit [Remote host closed the connection]
sauvin has joined #ruby
Zeno_ has quit [Quit: Textual IRC Client: www.textualapp.com]
ur5us has quit [Remote host closed the connection]
tdy1 has quit [Ping timeout: 246 seconds]
fphilipe has joined #ruby
dar123 has joined #ruby
Inline has quit [Quit: Leaving]
<quarters> woodruffw, thanks. I was wondering if some_hash.find or find_all will be a linear operation
cd has quit [Quit: cd]
fphilipe has quit [Ping timeout: 245 seconds]
hightower2 has joined #ruby
shah^ has quit []
DTZUZO has joined #ruby
m_antis_ has quit [Quit: m_antis_]
abaiste^ has joined #ruby
dar123 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dionysus69 has joined #ruby
fphilipe has joined #ruby
hightower2 has quit [Changing host]
hightower2 has joined #ruby
fphilipe has quit [Ping timeout: 246 seconds]
pwnd_nsfw` has joined #ruby
pwnd_nsfw has quit [Ping timeout: 250 seconds]
spacesuitdiver has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
fphilipe has joined #ruby
gix has quit [Ping timeout: 250 seconds]
marmotini_ has quit [Ping timeout: 244 seconds]
spacesuitdiver has joined #ruby
_whitelogger has joined #ruby
krandi has quit [Remote host closed the connection]
_whitelogger has joined #ruby
spacesuitdiver has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zapata has quit [Read error: Connection reset by peer]
zapata has joined #ruby
Tempesta has quit [Ping timeout: 255 seconds]
aupadhye has quit [Ping timeout: 250 seconds]
_whitelogger has joined #ruby
clemens3_ has joined #ruby
nowhere_man has quit [Ping timeout: 258 seconds]
aupadhye has joined #ruby
jefffrails35 has joined #ruby
ramfjord has joined #ruby
BH23 has joined #ruby
_whitelogger has joined #ruby
zacts has joined #ruby
MihaRekar has joined #ruby
_whitelogger has joined #ruby
donofrio_ has quit [Remote host closed the connection]
_whitelogger has joined #ruby
prestorium has quit [Client Quit]
pwnd_nsfw` has quit [Ping timeout: 245 seconds]
alem0lars has joined #ruby
waheedi has joined #ruby
teclator has quit [Ping timeout: 245 seconds]
MihaRekar has quit [Remote host closed the connection]
teclator has joined #ruby
dsmythe has quit [Remote host closed the connection]
dsmythe has joined #ruby
jottr has joined #ruby
jottr has quit [Ping timeout: 246 seconds]
lxsameer has joined #ruby
ur5us has joined #ruby
_joes_ has quit [Ping timeout: 258 seconds]
conta has quit [Ping timeout: 244 seconds]
ngw has joined #ruby
BH23 has quit [Ping timeout: 276 seconds]
jottr has joined #ruby
conta has joined #ruby
_joes_ has joined #ruby
BH23 has joined #ruby
_joes_ has quit [Remote host closed the connection]
_joes_ has joined #ruby
KeyJoo has joined #ruby
jottr has quit [Ping timeout: 268 seconds]
marmotini has joined #ruby
marmotini_ has quit [Ping timeout: 245 seconds]
galaxie has quit [Ping timeout: 256 seconds]
galaxie has joined #ruby
kyrylo has joined #ruby
MihaRekar has joined #ruby
jottr has joined #ruby
MihaRekar has quit [Ping timeout: 250 seconds]
jottr has quit [Ping timeout: 245 seconds]
dhollinger has quit [Ping timeout: 245 seconds]
GodFather has quit [Ping timeout: 258 seconds]
iMadUtilsMan has quit [Ping timeout: 245 seconds]
dhollinger has joined #ruby
kapil____ has joined #ruby
jottr has joined #ruby
Dbugger has joined #ruby
dviola has quit [Quit: WeeChat 2.4]
jottr has quit [Ping timeout: 255 seconds]
marmotini_ has joined #ruby
ech0s7 has joined #ruby
<ech0s7> hi
pwnd_nsfw` has joined #ruby
m_antis has joined #ruby
pwnd_nsfw has quit [Ping timeout: 255 seconds]
marmotini has quit [Ping timeout: 244 seconds]
<ech0s7> I'm redefining the to_json method of the Hash class, here: https://rextester.com/WFIS61395. But how can I call the default(super= to_json method from my method?
Jonopoly has joined #ruby
mwlang has joined #ruby
jottr has joined #ruby
jottr has quit [Ping timeout: 245 seconds]
imadper has joined #ruby
_joes_ has quit [Quit: _joes_]
_joes_ has joined #ruby
unmanbearpig has joined #ruby
ngw has quit [Quit: WeeChat 2.4]
conta has quit [Ping timeout: 245 seconds]
jottr has joined #ruby
teclator has quit [Ping timeout: 268 seconds]
teclator has joined #ruby
jottr has quit [Ping timeout: 246 seconds]
<phaul> ech0s7: you can prepend a module
<phaul> &ri Module#prepend
conta has joined #ruby
dviola has joined #ruby
jmcgnh has quit [Quit: ZNC 1.7.1 - https://znc.in]
jmcgnh has joined #ruby
hightower2 has quit [Ping timeout: 250 seconds]
jottr has joined #ruby
imadper` has joined #ruby
imadper has quit [Read error: Connection reset by peer]
jmcgnh has quit [Client Quit]
<ech0s7> phaul: do you have an example?
mwlang has quit [Quit: mwlang]
RedSnarf has joined #ruby
imadper` has quit [Remote host closed the connection]
jmcgnh has joined #ruby
<phaul> &>> class X ; def to_json; "orig"; end; end; module New; def to_json; "> #{super} <"; end; end; X.prepend(New); X.new.to_json
<rubydoc> # => "> orig <" (https://carc.in/#/r/6t8b)
gregf_ has joined #ruby
ur5us has quit [Remote host closed the connection]
jmcgnh has quit [Quit: ZNC 1.7.1 - https://znc.in]
ur5us has joined #ruby
jottr has quit [Ping timeout: 258 seconds]
jmcgnh has joined #ruby
ur5us has quit [Ping timeout: 255 seconds]
jmcgnh has quit [Quit: ZNC 1.7.1 - https://znc.in]
_joes_ has quit [Quit: _joes_]
_joes_ has joined #ruby
jmcgnh has joined #ruby
jottr has joined #ruby
jmcgnh has quit [Client Quit]
jottr has quit [Ping timeout: 246 seconds]
jmcgnh has joined #ruby
unmanbearpig has quit [Remote host closed the connection]
jmcgnh has quit [Client Quit]
jmcgnh has joined #ruby
jefffrails35 has quit [Remote host closed the connection]
jmcgnh has quit [Client Quit]
jefffrails35 has joined #ruby
jmcgnh has joined #ruby
dar123 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jmcgnh has quit [Client Quit]
jmcgnh has joined #ruby
<ech0s7> thanks phaul
ech0s7 has quit [Quit: Page closed]
AJA4350 has joined #ruby
jmcgnh has quit [Client Quit]
jottr has joined #ruby
jmcgnh has joined #ruby
weird_error has quit [Quit: weird_error]
GodFather has joined #ruby
jmcgnh has quit [Client Quit]
jottr has quit [Ping timeout: 246 seconds]
jmcgnh has joined #ruby
ramfjord has joined #ruby
_joes_ has quit [Ping timeout: 245 seconds]
BH23 has quit [Ping timeout: 246 seconds]
n13z_ is now known as n13z
ramfjord has quit [Ping timeout: 246 seconds]
jottr has joined #ruby
suukim has joined #ruby
jmcgnh has quit [Ping timeout: 245 seconds]
vondruch has quit [Ping timeout: 246 seconds]
jottr has quit [Ping timeout: 246 seconds]
prestorium has joined #ruby
jottr has joined #ruby
KeyJoo has quit [Remote host closed the connection]
jmcgnh has joined #ruby
jmcgnh has quit [Client Quit]
jmcgnh has joined #ruby
vondruch has joined #ruby
andikr has quit [Read error: Connection reset by peer]
andikr has joined #ruby
OneNeptune has joined #ruby
ldnunes has joined #ruby
jmcgnh has quit [Quit: ZNC 1.7.1 - https://znc.in]
troulouliou_dev has joined #ruby
RedSnarf has quit [Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org]
jmcgnh has joined #ruby
jmcgnh has quit [Remote host closed the connection]
_joes_ has joined #ruby
BH23 has joined #ruby
jmcgnh has joined #ruby
vondruch_ has joined #ruby
vondruch has quit [Ping timeout: 246 seconds]
vondruch_ is now known as vondruch
jmcgnh has quit [Quit: ZNC 1.7.1 - https://znc.in]
<woodruffw> quarters: yep, both should be linear/linear with some coefficient (since you're applying an additional test to the key)
teclator_ has joined #ruby
teclator has quit [Ping timeout: 258 seconds]
<towo> Is there a simple way I can combine a regexp match on a string with an if clause and parsing the match data? So e.g. 'if foo.match?(bar) then puts "#{2}" end'
jmcgnh has joined #ruby
hightower2 has joined #ruby
jmcgnh has quit [Client Quit]
<towo> To specify: yes, in my current instance I can reduce it to the string returned from the match, but this is assuming I actually wanted to parse the data; I could store the matchdata and do an if on it, of course, I was just wondering if there's a more elegant way to have it appropriately ephemeral
hightower2 has quit [Changing host]
hightower2 has joined #ruby
fphilipe_ has joined #ruby
vondruch has quit [Quit: vondruch]
fphilipe has quit [Ping timeout: 245 seconds]
vondruch has joined #ruby
ech0s7 has joined #ruby
alem0lars has quit [Remote host closed the connection]
alem0lars has joined #ruby
dsmythe has quit [Remote host closed the connection]
dsmythe has joined #ruby
jmcgnh has joined #ruby
bmurt has joined #ruby
jmcgnh has quit [Quit: ZNC 1.7.1 - https://znc.in]
fphilipe_ has quit [Ping timeout: 258 seconds]
queip has quit [Ping timeout: 245 seconds]
fphilipe_ has joined #ruby
houhoulis has joined #ruby
_joes_ has quit [Ping timeout: 276 seconds]
BH23 has quit [Ping timeout: 255 seconds]
jelera has joined #ruby
queip has joined #ruby
unmanbearpig has joined #ruby
unmanbearpig has quit [Excess Flood]
unmanbearpig has joined #ruby
unmanbearpig has quit [Excess Flood]
aupadhye has quit [Ping timeout: 268 seconds]
zacts has quit [Ping timeout: 276 seconds]
pupsikov has joined #ruby
OneNeptune has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
OneNeptune has joined #ruby
jmcgnh has joined #ruby
jmcgnh has quit [Client Quit]
Rapture has joined #ruby
zacts has joined #ruby
Dbugger has quit [Quit: Leaving]
zacts has quit [Client Quit]
zacts has joined #ruby
conta has quit [Ping timeout: 244 seconds]
OneNeptune has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
GodFather has quit [Ping timeout: 246 seconds]
gnufied has joined #ruby
spacesuitdiver has joined #ruby
<adam12> towo: I'm not sure if I followed exactly, but Regexp.match accepts a block to run if it matches.
<adam12> towo: bar.match(foo) { |m| puts m[2] }
jottr has quit [Ping timeout: 255 seconds]
marmotini_ has quit [Remote host closed the connection]
kkap has joined #ruby
alem0lars has quit [Ping timeout: 268 seconds]
jottr has joined #ruby
laaron- has quit [Quit: ZNC 1.7.1 - https://znc.in]
jottr has quit [Ping timeout: 258 seconds]
laaron has joined #ruby
jottr has joined #ruby
kkap has quit [Ping timeout: 256 seconds]
teclator_ has quit [Ping timeout: 250 seconds]
_joes_ has joined #ruby
BH23 has joined #ruby
Swyper has joined #ruby
conta1 has joined #ruby
aupadhye has joined #ruby
def_jam has joined #ruby
eb0t_ has joined #ruby
eblip has quit [Ping timeout: 250 seconds]
eb0t has quit [Ping timeout: 258 seconds]
teclator has joined #ruby
Inline has joined #ruby
polishdub has joined #ruby
lucasb has joined #ruby
def_jam is now known as eblip
eb0t_ is now known as ebot
ebot is now known as eb0t
jelera has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
jelera has joined #ruby
banko has joined #ruby
jelera has quit [Client Quit]
_joes_ has quit [Ping timeout: 246 seconds]
conta1 has quit [Quit: conta1]
_joes_ has joined #ruby
yuriii has quit [Quit: Konversation terminated!]
jelera has joined #ruby
donofrio has joined #ruby
jelera has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jelera has joined #ruby
jottr_ has joined #ruby
jelera has quit [Client Quit]
jottr has quit [Ping timeout: 246 seconds]
cliluw has quit [Ping timeout: 246 seconds]
skryking__ has joined #ruby
cliluw has joined #ruby
jelera has joined #ruby
skryking_ has quit [Ping timeout: 246 seconds]
aupadhye has quit [Quit: Leaving]
alem0lars has joined #ruby
tdy1 has joined #ruby
_joes_ has quit [Ping timeout: 268 seconds]
BH23 has quit [Ping timeout: 246 seconds]
zacts has quit [Quit: WeeChat 2.4]
jottr_ is now known as jottr
jottr has quit [Quit: WeeChat 2.4]
dellavg_ has joined #ruby
jelera has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jelera has joined #ruby
dar123 has joined #ruby
clemens3_ has quit [Ping timeout: 244 seconds]
lxsameer has quit [Quit: out]
jcarl43 has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
andikr has quit [Remote host closed the connection]
dionysus70 has joined #ruby
jelera has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
waheedi has quit [Quit: waheedi]
conta1 has joined #ruby
Jonopoly has quit [Quit: WeeChat 2.4]
comet23 has joined #ruby
<comet23> t/msg nickserv identify password
dar123 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
OneNeptune has joined #ruby
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
dar123 has joined #ruby
jelera has joined #ruby
zacts has joined #ruby
OneNeptune has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
spacesuitdiver has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zacts has quit [Quit: WeeChat 2.4]
alem0lars has quit [Ping timeout: 258 seconds]
conta1 has quit [Quit: conta1]
podlech has joined #ruby
podlech has quit [Client Quit]
podlech has joined #ruby
jelera has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
doodleb45 has quit [Ping timeout: 250 seconds]
waheedi has joined #ruby
mostlybadfly has quit [Quit: Connection closed for inactivity]
duderonomy has joined #ruby
Swyper has quit [Remote host closed the connection]
dar123 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jefffrails35 has quit [Remote host closed the connection]
Swyper has joined #ruby
nowhere_man has joined #ruby
dar123 has joined #ruby
elcontrastador has quit [Ping timeout: 246 seconds]
dellavg_ has quit [Ping timeout: 245 seconds]
dsmythe has quit [Remote host closed the connection]
dsmythe has joined #ruby
jmcgnh has joined #ruby
jelera has joined #ruby
kapil____ has quit [Quit: Connection closed for inactivity]
Swyper has quit [Remote host closed the connection]
cd has joined #ruby
jelera has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Swyper has joined #ruby
OneNeptune has joined #ruby
gix has joined #ruby
hightower2 has quit [Ping timeout: 250 seconds]
jmcgnh has quit [Quit: ZNC 1.7.1 - https://znc.in]
jmcgnh has joined #ruby
pupsikov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ech0s7 has quit [Ping timeout: 256 seconds]
jmcgnh has quit [Quit: ZNC 1.7.1 - https://znc.in]
sameerynho has joined #ruby
jmcgnh has joined #ruby
crawler has joined #ruby
<miah> all i saw was hunter2
crawler has quit [Client Quit]
jmcgnh has quit [Client Quit]
spacesuitdiver has joined #ruby
podlech has quit [Quit: WeeChat 2.5-dev]
mochiyoda_ is now known as mochiyoda
fphilipe has joined #ruby
fphilipe_ has quit [Read error: Connection reset by peer]
jelera has joined #ruby
ramfjord has joined #ruby
dar123 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Swyper has quit [Remote host closed the connection]
OneNeptune has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Swyper has joined #ruby
jelera has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jelera has joined #ruby
jelera has quit [Client Quit]
jelera has joined #ruby
jelera has quit [Client Quit]
jmcgnh has joined #ruby
jelera has joined #ruby
jelera has quit [Client Quit]
jelera has joined #ruby
jelera has quit [Client Quit]
jelera has joined #ruby
jelera has quit [Client Quit]
dar123 has joined #ruby
ldnunes has quit [Ping timeout: 268 seconds]
nowhere_man has quit [Ping timeout: 246 seconds]
ldnunes has joined #ruby
dante has joined #ruby
jmcgnh has quit [Quit: ZNC 1.7.1 - https://znc.in]
sauvin has quit [Read error: Connection reset by peer]
dionysus70 has quit [Ping timeout: 250 seconds]
jmcgnh has joined #ruby
pupsikov has joined #ruby
dar123 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jmcgnh has quit [Client Quit]
jmcgnh has joined #ruby
suukim has quit [Quit: Konversation terminated!]
jmcgnh has quit [Quit: ZNC 1.7.1 - https://znc.in]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
comet23 has quit [Quit: Connection closed for inactivity]
jmcgnh has joined #ruby
jmcgnh has quit [Client Quit]
dinfuehr has quit [Ping timeout: 244 seconds]
zEphiRo has joined #ruby
dinfuehr has joined #ruby
fphilipe has quit [Ping timeout: 245 seconds]
dsmythe has quit [Read error: Connection reset by peer]
dsmythe has joined #ruby
sparch has joined #ruby
sparch has quit [Client Quit]
fphilipe has joined #ruby
queip has quit [Ping timeout: 245 seconds]
ech0s7 has joined #ruby
<ech0s7> it is possible to replace a function of an object?
<phaul> in general yes. apart from that it's method not function.
<phaul> &>> a = 'cat'; def a.upcase; self + "!!!"; end; a.upcase
<rubydoc> # => "cat!!!" (https://carc.in/#/r/6tay)
hightower2 has joined #ruby
VG234 has joined #ruby
<phaul> but. for instance this fails:
<phaul> &>> a = 1; def a.double; self * 2; end; a.double
<rubydoc> # => can't define singleton (TypeError) stderr: -e:2:in `<main>': can't define singleton (TypeError) (https://carc.in/#/r/6tb0)
queip has joined #ruby
<phaul> it's not really replacing though, the original implementation still exists at the same place, just that a SingletonClass jumped in front of it that now catches the method lookup ( as the new class of the object is its singleton class whose parent is the original class ).
jmcgnh has joined #ruby
<phaul> very similar to module prepend, except that would affect all instances as opposed tojust one object
<ech0s7> phaul: but in case then I would call the original method from the "patched" one?
<VG234> When I try to load a file in to irb it just falls back to prompt: http://dpaste.com/08F01XT. Shouldn't it stay in irb?
<phaul> you can just call super. super just goes further up in the class hierarchy, it doesnt care if it's a singleton class, a prepended module, or any other class
<ech0s7> &>> a = 'cat'; def a.upcase; self + super.upcase; end; a.upcase
<rubydoc> # => "catCAT" (https://carc.in/#/r/6tb2)
fphilipe has quit [Read error: Connection reset by peer]
jmcgnh has quit [Quit: ZNC 1.7.1 - https://znc.in]
<phaul> one thing to note is that object.class lies in this case.
<phaul> &>> a = 'cat' ; def a.upcase 'xx'; end; a.class
<rubydoc> stderr: -e:2: syntax error, unexpected tSTRING_BEG, expecting ';' or '\n' (https://carc.in/#/r/6tb3)
jmcgnh has joined #ruby
<phaul> &>> a = 'cat' ; def a.upcase; 'xx'; end; a.class
<rubydoc> # => String (https://carc.in/#/r/6tb7)
<VG234> OK. found that I need quotes around the word. That is fixed.
<phaul> it's the singletonclass of object pointed by a really, but it just says String. Same with prepended modules
marmotini_ has joined #ruby
jmcgnh has quit [Client Quit]
cajone has quit [Quit: Leaving.]
gigetoo has quit [Ping timeout: 258 seconds]
prestorium has quit [Quit: prestorium]
jmcgnh has joined #ruby
spacesuitdiver has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gigetoo has joined #ruby
<ech0s7> phaul: imagine you define upcase in a function
<ech0s7> a = 'cat' ; def init; def a.upcase; 'xx'; end; end; a.class
<ech0s7> &>> a = 'cat' ; def init(obj); def a.upcase; 'xx'+obj; end; end; a.class
<rubydoc> # => String (https://carc.in/#/r/6tb8)
<phaul> a is not visible inside init as def is lexical scope for locals
jmcgnh has quit [Client Quit]
<phaul> you can use blocks with define_method, if you want to break that lexical scope
<phaul> &>> a = 'cat' ; define_method(:init) { |obj| a.define_method(:upcase) { 'xx' + obj } }
<rubydoc> # => :init (https://carc.in/#/r/6tb9)
spacesuitdiver has joined #ruby
jmcgnh has joined #ruby
<phaul> actually you would need a.define_singleton_method
<ech0s7> phaul: this is my case
<phaul> &>> a = 'cat' ; define_method(:init) { |obj| a.define_singleton_method(:upcase) { 'xx' + obj } }; init('!!!'); a.upcase
<rubydoc> # => "xx!!!" (https://carc.in/#/r/6tba)
<ech0s7> from line 9 I need to access to the field initialized in the outer function
<phaul> yeah, my last example is 1:1 applicable, just rename the variables
<phaul> str.define_singleton_method(:test) { @foobar } # it doesn't even have to be @, it can be just local var
<phaul> blocks let outer scope local variables through. or in other word they are closures
postmodern has joined #ruby
jmcgnh has quit [Ping timeout: 245 seconds]
OneNeptune has joined #ruby
jmcgnh has joined #ruby
<ech0s7> phaul: the problem with define_singleton_method() is that you cannot call the super
dionysus70 has joined #ruby
<phaul> &>> a = 'cat' ; define_method(:init) { |obj| a.define_singleton_method(:upcase) { super + obj } }; init('!!!'); a.upcase
<rubydoc> # => implicit argument passing of super from method defined by define_method() is not supported. Specify all... check link for more (https://carc.in/#/r/6tbn)
<phaul> &>> a = 'cat' ; define_method(:init) { |obj| a.define_singleton_method(:upcase) { super() + obj } }; init('!!!'); a.upcase
<rubydoc> # => "CAT!!!" (https://carc.in/#/r/6tbo)
<ech0s7> phaul: I'm getting this error: implicit argument passing of super from method defined by define_method() is not supported. Specify all arguments explicitly.
<ech0s7> calling super
<phaul> yeah just pass arguments explicitly ie super()
bmurt has joined #ruby
reber has quit [Read error: Connection reset by peer]
zacts has joined #ruby
<ech0s7> phaul: I'm passing the arguments
jmcgnh has quit [Quit: ZNC 1.7.1 - https://znc.in]
<ech0s7> super.test("aaa")
<phaul> no. super is a keyword that is calling the parent with matching name, so super("aaa")
jmcgnh has joined #ruby
<ech0s7> it works!!
<ech0s7> thanks phaul, really
<phaul> np, yw
jmcgnh has quit [Client Quit]
nowhere_man has joined #ruby
jmcgnh has joined #ruby
VG234 has quit [Ping timeout: 268 seconds]
jmcgnh has quit [Client Quit]
jmcgnh has joined #ruby
ech0s7 has quit [Ping timeout: 256 seconds]
VG234 has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zacts has quit [Quit: WeeChat 2.4]
VG234 has quit [Ping timeout: 246 seconds]
jmcgnh has quit [Quit: ZNC 1.7.1 - https://znc.in]
jmcgnh has joined #ruby
SuperL4g has joined #ruby
SuperLag has quit [Ping timeout: 258 seconds]
jmcgnh has quit [Quit: ZNC 1.7.1 - https://znc.in]
sticaz has joined #ruby
jmcgnh has joined #ruby
jmcgnh has quit [Quit: ZNC 1.7.1 - https://znc.in]
wildermind has joined #ruby
prestorium has joined #ruby
jmcgnh has joined #ruby
jmcgnh has quit [Client Quit]
jmcgnh has joined #ruby
dionysus70 has quit [Ping timeout: 250 seconds]
jmcgnh has quit [Client Quit]
SeepingN has joined #ruby
GodFather has joined #ruby
houhoulis has quit [Remote host closed the connection]
troulouliou_dev has quit [Quit: Leaving]
troulouliou_dev has joined #ruby
jmcgnh has joined #ruby
spacesuitdiver has quit [Quit: Textual IRC Client: www.textualapp.com]
<CableNinja> adam12, I think I sorted out my problem... I think... idk, I'm running on only a few hours of sleep. It seems that when using Threads/fork, you need to completely start the connection (TCPSocket/SSLSocket) within the thread, at least, thats what I think the problem ended up being. I stripped the entire start_client command into the loop that had the thread portion
jmcgnh has quit [Client Quit]
jmcgnh has joined #ruby
sp01nk has joined #ruby
OneNeptune has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ur5us has joined #ruby
nowhere_man has quit [Ping timeout: 257 seconds]
ldnunes has quit [Quit: Leaving]
jmcgnh has quit [Quit: ZNC 1.7.1 - https://znc.in]
sp01nk has quit [Quit: WeeChat 2.4]
sp01nk has joined #ruby
sp01nk has quit [Client Quit]
fphilipe has joined #ruby
prestorium has quit [Quit: prestorium]
prestorium has joined #ruby
fphilipe has quit [Ping timeout: 250 seconds]
prestorium has quit [Quit: prestorium]
jmcgnh has joined #ruby
troulouliou_dev has quit [Quit: Leaving]
jmcgnh has quit [Quit: ZNC 1.7.1 - https://znc.in]
jmcgnh has joined #ruby
jmcgnh has quit [Quit: ZNC 1.7.1 - https://znc.in]
jmcgnh has joined #ruby
CableNinja has quit [Quit: Leaving]
jmcgnh has quit [Client Quit]
waheedi has quit [Quit: waheedi]
jmcgnh has joined #ruby
jmcgnh has quit [Client Quit]
jefffrails35 has joined #ruby
jefffrails35 has quit [Remote host closed the connection]
jmcgnh has joined #ruby
mostlybadfly has joined #ruby
jmcgnh has quit [Client Quit]
jenrzzz has joined #ruby
endorama has joined #ruby
_swi7ch has quit [Quit: WeeChat 1.9.1]
Rakete1111 has joined #ruby
pupsikov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hightower3 has joined #ruby
gregf_ has quit [Ping timeout: 256 seconds]
hightower2 has quit [Ping timeout: 268 seconds]
marmotini_ has quit [Ping timeout: 255 seconds]
Rakete1111 has quit [Quit: leaving]
weird_error has joined #ruby
lucasb has quit [Quit: Connection closed for inactivity]
polishdub has quit [Quit: leaving]
SuperL4g is now known as SuperLag
endorama has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
houhoulis has joined #ruby
ramfjord_ has joined #ruby
ramfjord has quit [Ping timeout: 246 seconds]
zEphiRo has quit [Quit: zEphiRo]
zEphiRo has joined #ruby
zEphiRo has quit [Client Quit]
zEphiRo has joined #ruby
zEphiRo has quit [Client Quit]
zEphiRo has joined #ruby
zEphiRo has quit [Client Quit]
zEphiRo has joined #ruby
zEphiRo has quit [Client Quit]
jmcgnh has joined #ruby
jmcgnh has quit [Client Quit]
jmcgnh has joined #ruby
jmcgnh has quit [Client Quit]
jmcgnh has joined #ruby
jmcgnh has quit [Ping timeout: 250 seconds]
fphilipe has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
fphilipe has quit [Ping timeout: 258 seconds]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has joined #ruby
sameerynho has quit [Ping timeout: 246 seconds]
hightower3 has quit [Ping timeout: 246 seconds]
rubydoc has quit [Remote host closed the connection]
rubydoc has joined #ruby
bmurt has joined #ruby
wildermind has quit [Quit: Connection closed for inactivity]
Sina has quit [Quit: Connection closed for inactivity]
jmcgnh has joined #ruby