baweaver changed the topic of #ruby to: Rules & more: https://ruby-community.com || Ruby 2.5.0, 2.4.3, 2.3.6: https://www.ruby-lang.org || Paste >3 lines of text to: https://gist.github.com || Rails questions? Ask in: #RubyOnRails || Logs: https://irclog.whitequark.org/ruby || Books: https://goo.gl/wpGhoQ
gary_ has joined #ruby
gary_ is now known as Guest59106
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
dviola has quit [Quit: WeeChat 2.0.1]
ShekharReddy has quit [Quit: Connection closed for inactivity]
sameerynho has joined #ruby
Guest59106 has quit [Ping timeout: 260 seconds]
apricant_ has joined #ruby
chouhoulis has quit [Ping timeout: 256 seconds]
rwb has joined #ruby
herbmillerjr has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jaequery has joined #ruby
byte512_ has joined #ruby
<baweaver> dminuoso: Oh I'm much worse in person
marxarelli is now known as marxarelli|afk
byte512 has quit [Ping timeout: 256 seconds]
bijan_ has quit [Quit: System has gone to sleep. ZZZzzz…]
sameerynho has quit [Ping timeout: 256 seconds]
jaequery has quit [Quit: Textual IRC Client: www.textualapp.com]
crankharder has quit [Remote host closed the connection]
pablo__ has joined #ruby
eckhardt has joined #ruby
bijan_ has joined #ruby
gary has joined #ruby
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gary is now known as Guest22024
Guest22024 has quit [Ping timeout: 276 seconds]
karapetyan has quit [Remote host closed the connection]
Psybur_ has quit [Ping timeout: 256 seconds]
karapetyan has joined #ruby
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
guacamole has joined #ruby
guacamole has joined #ruby
guacamole has quit [Changing host]
gary_ has joined #ruby
gary_ is now known as Guest71114
willmichael has quit [Ping timeout: 256 seconds]
Guest71114 has quit [Ping timeout: 256 seconds]
arescorpio has joined #ruby
eckhardt has joined #ruby
willmichael has joined #ruby
Phate has quit [Remote host closed the connection]
xelkarin has quit [Quit: WeeChat 1.9.1]
Psybur_ has joined #ruby
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<miah> we should have a #ruby sf lunch/dinner meet up some time
<miah> (in oakland though because sf is dumb)
hdb2 has joined #ruby
govg has quit [Ping timeout: 265 seconds]
guacamole has joined #ruby
guacamole has joined #ruby
guacamole has quit [Changing host]
<baweaver> miah: you get to suggest locale then
hdb2 has quit [Ping timeout: 248 seconds]
Psybur_ has quit [Ping timeout: 256 seconds]
govg has joined #ruby
aspiers has quit [Quit: ZNC - http://znc.sourceforge.net]
ogres has joined #ruby
govg has quit [Ping timeout: 260 seconds]
gary has joined #ruby
RougeR has quit [Ping timeout: 256 seconds]
bijan_ is now known as bijan_awaaaay
gary is now known as Guest97738
cdg_ has joined #ruby
cdg__ has joined #ruby
nowhereman_ has joined #ruby
nowhere_man has quit [Ping timeout: 265 seconds]
dnewkerk has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cdg has quit [Ping timeout: 256 seconds]
Guest97738 has quit [Ping timeout: 248 seconds]
cdg_ has quit [Ping timeout: 240 seconds]
willmichael has quit [Ping timeout: 256 seconds]
cdg__ has quit [Ping timeout: 256 seconds]
Gnut has quit [Remote host closed the connection]
govg has joined #ruby
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
willmichael has joined #ruby
govg has quit [Ping timeout: 240 seconds]
jcarl43 has quit [Quit: WeeChat 2.0.1]
s3nd1v0g1us has quit [Ping timeout: 265 seconds]
RougeR has joined #ruby
s3nd1v0g1us has joined #ruby
s3nd1v0g1us has quit [Max SendQ exceeded]
kapil___ has quit [Quit: Connection closed for inactivity]
bigblind has joined #ruby
sanscoeu_ has joined #ruby
marr has quit [Ping timeout: 248 seconds]
bijan_awaaaay is now known as bijan_
sanscoeur has quit [Ping timeout: 276 seconds]
sanscoeu_ has quit [Ping timeout: 248 seconds]
vutral|kali has quit [Ping timeout: 265 seconds]
cthulchu has quit [Remote host closed the connection]
cthulchu has joined #ruby
shortdudey123 has quit [Ping timeout: 268 seconds]
kapil___ has joined #ruby
vutral|kali has joined #ruby
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
bijan_ is now known as bijan_awaaaay
shortdudey123 has joined #ruby
weaksauce has quit [Quit: Textual IRC Client: www.textualapp.com]
cthulchu has quit [Ping timeout: 256 seconds]
gary_ has joined #ruby
gary_ is now known as Guest68859
bijan_awaaaay is now known as bijan_
jenrzzz has quit [Ping timeout: 256 seconds]
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Guest68859 has quit [Ping timeout: 268 seconds]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
n0m4d1c has joined #ruby
cthulchu has joined #ruby
vutral|kali has quit [Ping timeout: 268 seconds]
weaksauce has joined #ruby
herbmillerjr has quit [Ping timeout: 268 seconds]
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
vutral|kali has joined #ruby
snath has joined #ruby
bijan_ is now known as bijan_awaaaay
sylario has quit [Quit: Connection closed for inactivity]
apricant_ has quit [Ping timeout: 264 seconds]
cthulchu has quit [Ping timeout: 240 seconds]
karapetyan has quit [Remote host closed the connection]
shortdudey123 has quit [Ping timeout: 264 seconds]
karapetyan has joined #ruby
n0m4d1c has quit [Remote host closed the connection]
cthulchu has joined #ruby
bigblind has quit [Ping timeout: 260 seconds]
shortdudey123 has joined #ruby
bijan_awaaaay is now known as bijan_
vutral|kali has quit [Ping timeout: 240 seconds]
Dimik has quit [Ping timeout: 240 seconds]
vutral|kali has joined #ruby
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
gary has joined #ruby
cthulchu has quit [Ping timeout: 268 seconds]
gary is now known as Guest851
orbyt_ has joined #ruby
_aeris_ has quit [Ping timeout: 255 seconds]
Guest851 has quit [Ping timeout: 256 seconds]
bijan_ has quit [Quit: System has gone to sleep. ZZZzzz…]
sumobob has quit [Ping timeout: 265 seconds]
_aeris_ has joined #ruby
shortdudey123 has quit [Ping timeout: 268 seconds]
John_Ivan has quit [Remote host closed the connection]
shortdudey123 has joined #ruby
dnewkerk has joined #ruby
bigblind has joined #ruby
AJA4350 has quit [Quit: AJA4350]
memo1 has joined #ruby
konsolebox has quit [Ping timeout: 260 seconds]
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gizmore|2 has joined #ruby
kmacleod has joined #ruby
houhoulis has joined #ruby
konsolebox has joined #ruby
gizmore has quit [Ping timeout: 256 seconds]
ecuanaso has joined #ruby
alfiemax has joined #ruby
karapetyan has quit [Remote host closed the connection]
karapetyan has joined #ruby
morenoh149 has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cthulchu has joined #ruby
ecuanaso has joined #ruby
darkhanb has joined #ruby
gary_ has joined #ruby
gary_ is now known as Guest17786
cthulchu has quit [Ping timeout: 276 seconds]
Guest17786 has quit [Ping timeout: 256 seconds]
kmacleod has left #ruby ["Leaving"]
cadillac_ has quit [Quit: I quit]
Olipro has quit [Ping timeout: 256 seconds]
karapetyan has quit [Remote host closed the connection]
karapetyan has joined #ruby
karapetyan has quit [Remote host closed the connection]
cthulchu has joined #ruby
Olipro has joined #ruby
cthulchu has quit [Ping timeout: 268 seconds]
nowhere_man has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
morenoh149 has quit [Ping timeout: 256 seconds]
nowhereman_ has quit [Ping timeout: 256 seconds]
howdoi has joined #ruby
ramfjord has quit [Ping timeout: 256 seconds]
gary has joined #ruby
gary is now known as Guest87688
sumobob has joined #ruby
BTRE has joined #ruby
goatish has quit [Quit: Hibernating]
Guest87688 has quit [Ping timeout: 256 seconds]
sumobob has quit [Ping timeout: 265 seconds]
instrud has quit [Ping timeout: 276 seconds]
govg has joined #ruby
sanscoeur has joined #ruby
willmichael has quit [Read error: Connection reset by peer]
willmichael has joined #ruby
RougeR has quit [Ping timeout: 256 seconds]
sumobob has joined #ruby
raynold has joined #ruby
gary_ has joined #ruby
gary_ is now known as Guest95858
sumobob has quit [Ping timeout: 260 seconds]
cthulchu has joined #ruby
ogres has quit [Quit: Connection closed for inactivity]
willmichael has quit [Ping timeout: 248 seconds]
dnewkerk has quit [Quit: Textual IRC Client: www.textualapp.com]
Guest95858 has quit [Ping timeout: 276 seconds]
apricant_ has joined #ruby
cthulchu has quit [Ping timeout: 256 seconds]
gary__ has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
gary__ has quit [Ping timeout: 268 seconds]
milardovich has quit [Remote host closed the connection]
willmichael has joined #ruby
sumobob has joined #ruby
cthulchu has joined #ruby
sumobob has quit [Ping timeout: 240 seconds]
cthulchu has quit [Ping timeout: 240 seconds]
pablo__ has quit [Quit: Leaving]
sumobob has joined #ruby
sumobob has quit [Ping timeout: 240 seconds]
trautwein has quit [Quit: ZNC 1.6.5 - http://znc.in]
trautwein has joined #ruby
willmichael has quit [Read error: Connection reset by peer]
willmichael has joined #ruby
herbmillerjr has joined #ruby
herbmillerjr has quit [Client Quit]
morenoh149 has joined #ruby
alfiemax has quit [Read error: Connection reset by peer]
willmichael has quit [Ping timeout: 256 seconds]
alfiemax has joined #ruby
nopoliti1 has joined #ruby
nopoliti1 has quit [Client Quit]
gary has joined #ruby
gary is now known as Guest39282
nopolitica has quit [Ping timeout: 264 seconds]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
konsolebox has quit [Ping timeout: 248 seconds]
konsolebox has joined #ruby
alfiemax_ has joined #ruby
willmichael has joined #ruby
alfiemax has quit [Ping timeout: 264 seconds]
morenoh149 has quit [Ping timeout: 256 seconds]
xenops has quit [Ping timeout: 240 seconds]
arescorpio has quit [Excess Flood]
alfiemax has joined #ruby
SuperLag has joined #ruby
alfiemax_ has quit [Ping timeout: 268 seconds]
houhoulis has quit [Remote host closed the connection]
morenoh149 has joined #ruby
Abhijit has joined #ruby
<Abhijit> whats the recommended way to run shell commands from ruby, when my program needs to make decision based upon output of that shell command and not just execute it?
alfiemax has quit [Remote host closed the connection]
gix has joined #ruby
milardovich has joined #ruby
cthulchu has joined #ruby
gix- has quit [Ping timeout: 260 seconds]
Tagami[m] has left #ruby ["User left"]
hdb2 has joined #ruby
milardovich has quit [Ping timeout: 248 seconds]
willmichael has quit [Ping timeout: 276 seconds]
cthulchu has quit [Ping timeout: 240 seconds]
willmichael has joined #ruby
Abhijit has quit [Quit: Leaving]
hdb2 has quit [Ping timeout: 265 seconds]
morenoh149 has quit [Ping timeout: 268 seconds]
cthulchu has joined #ruby
cthulchu has quit [Ping timeout: 256 seconds]
alfiemax has joined #ruby
willmichael has quit [Ping timeout: 248 seconds]
mistergibson has quit [Ping timeout: 260 seconds]
s2013 has joined #ruby
alfiemax has quit [Remote host closed the connection]
kapil___ has quit [Quit: Connection closed for inactivity]
alfiemax has joined #ruby
willmichael has joined #ruby
cthulchu has joined #ruby
alfiemax has quit [Remote host closed the connection]
troys has quit [Quit: Bye]
cthulchu has quit [Ping timeout: 252 seconds]
kapil___ has joined #ruby
willmichael has quit [Read error: Connection reset by peer]
sidx64 has joined #ruby
cthulchu has joined #ruby
willmichael has joined #ruby
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
darkhanb has joined #ruby
darkhanb has quit [Client Quit]
instrud has joined #ruby
cthulchu has quit [Ping timeout: 240 seconds]
aspiers has joined #ruby
willmichael has quit [Ping timeout: 240 seconds]
memo1 has quit [Ping timeout: 265 seconds]
milardovich has joined #ruby
milardovich has quit [Ping timeout: 256 seconds]
cagmz has quit [Quit: Leaving]
marxarelli|afk is now known as marxarelli
jnyw has quit [Ping timeout: 256 seconds]
naprimer2 has quit [Ping timeout: 248 seconds]
naprimer has joined #ruby
ramfjord has joined #ruby
ramfjord has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
faces has quit [Ping timeout: 248 seconds]
dionysus69 has joined #ruby
aufi has joined #ruby
ta_ has quit [Remote host closed the connection]
sanscoeur has quit [Remote host closed the connection]
cthulchu has joined #ruby
mtkd has joined #ruby
LocaMocha has joined #ruby
darkhanb has joined #ruby
d5sx43 has joined #ruby
d5sx43 has quit [Client Quit]
cthulchu has quit [Ping timeout: 256 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
apeiros has quit [Remote host closed the connection]
reber has joined #ruby
cthulchu has joined #ruby
DTZUZO has joined #ruby
armyriad has quit [Quit: Leaving]
cthulchu has quit [Ping timeout: 276 seconds]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
n008f4g_ has joined #ruby
andikr has joined #ruby
karapetyan has joined #ruby
marxarelli is now known as marxarelli|afk
willmichael has joined #ruby
Guest39282 has quit [Ping timeout: 248 seconds]
sumobob has joined #ruby
alfiemax has joined #ruby
alfiemax_ has joined #ruby
alex`` has joined #ruby
alex`` has quit [Client Quit]
gary has joined #ruby
gary is now known as Guest19522
alfiemax has quit [Ping timeout: 240 seconds]
sumobob has quit [Ping timeout: 260 seconds]
anisha has joined #ruby
apeiros has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sidx64 has joined #ruby
milardovich has joined #ruby
ShekharReddy has joined #ruby
conta has joined #ruby
milardovich has quit [Ping timeout: 260 seconds]
agent_white has joined #ruby
clemens3 has joined #ruby
maum has joined #ruby
alex`` has joined #ruby
ta_ has joined #ruby
cthulchu has joined #ruby
alex`` has quit [Client Quit]
Q--- has joined #ruby
alex`` has joined #ruby
Q--- has quit [Client Quit]
alex`` is now known as alexherbo2
timmow has quit [Ping timeout: 374 seconds]
gmcintire has quit [Ping timeout: 374 seconds]
RushPL has quit [Remote host closed the connection]
orbyt_ has joined #ruby
gmcintire has joined #ruby
alexherbo2 is now known as alex``
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
RushPL has joined #ruby
orbyt_ has quit [Client Quit]
willmichael has quit [Ping timeout: 240 seconds]
shortdudey123 has quit [Ping timeout: 240 seconds]
cthulchu has quit [Ping timeout: 265 seconds]
timmow has joined #ruby
iNs has quit [Ping timeout: 240 seconds]
bokayio has quit [Ping timeout: 240 seconds]
sidx64 has joined #ruby
bokayio has joined #ruby
shortdudey123 has joined #ruby
iNs has joined #ruby
n008f4g_ has quit [Ping timeout: 248 seconds]
Dimik has joined #ruby
clemens3 has quit [Ping timeout: 265 seconds]
cthulchu has joined #ruby
Guest19522 has quit [Ping timeout: 260 seconds]
cthulchu has quit [Ping timeout: 240 seconds]
kapil___ has quit [Quit: Connection closed for inactivity]
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
DaniG2k has joined #ruby
gary has joined #ruby
gary is now known as Guest10752
mtkd has quit [Read error: Connection reset by peer]
mtkd has joined #ruby
Guest10752 has quit [Ping timeout: 276 seconds]
gary_ has joined #ruby
gary_ is now known as Guest94264
anisha_ has joined #ruby
anisha has quit [Ping timeout: 264 seconds]
Guest94264 has quit [Remote host closed the connection]
claudiuinberlin has joined #ruby
gary__ has joined #ruby
aupadhye has joined #ruby
vutral|kali has quit [Ping timeout: 268 seconds]
maum has quit [Remote host closed the connection]
devil_tux has joined #ruby
vutral|kali has joined #ruby
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
quobo has quit [Quit: Connection closed for inactivity]
mello has joined #ruby
mello is now known as Guest66178
cthulchu has joined #ruby
sylario has joined #ruby
marr has joined #ruby
<dminuoso> >> f = -> (r, name, url) { r.map { |i| [name % i, url % i ] } }; f[1..5, "a-%s", "b-%s"]
<ruby[bot]> dminuoso: # => [["a-1", "b-1"], ["a-2", "b-2"], ["a-3", "b-3"], ["a-4", "b-4"], ["a-5", "b-5"]] (https://eval.in/959992)
bigblind has quit [Ping timeout: 265 seconds]
gary__ has quit [Ping timeout: 256 seconds]
<dminuoso> >> spr = -> s, v { s % v }; 1.step.lazy.zip(&spr["a-%s"])
<ruby[bot]> dminuoso: # => wrong number of arguments (given 1, expected 2) (ArgumentError) ...check link for more (https://eval.in/959993)
<dminuoso> >> spr = -> s, v { s % v }.curry; 1.step.lazy.zip(&spr["a-%s"])
<ruby[bot]> dminuoso: # => (https://eval.in/959994)
<dminuoso> Oh
<dminuoso> >> spr = -> s, v { s % v }.curry; 1.step.lazy.map(&spr["a-%s"]).take(10).force
<ruby[bot]> dminuoso: # => ["a-1", "a-2", "a-3", "a-4", "a-5", "a-6", "a-7", "a-8", "a-9", "a-10"] (https://eval.in/959995)
gary__ has joined #ruby
kapil___ has joined #ruby
guille-moe has joined #ruby
cthulchu has quit [Ping timeout: 240 seconds]
willmichael has joined #ruby
mikecmpbll has joined #ruby
hdb2 has joined #ruby
willmichael has quit [Ping timeout: 240 seconds]
Azure has quit [Read error: Connection reset by peer]
Azure has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
gary__ has quit [Ping timeout: 256 seconds]
hdb2 has quit [Ping timeout: 276 seconds]
<dminuoso> apeiros: How would you like a fixed tuple type?
<dminuoso> Something like
<dminuoso> Array without push/pop
cthulchu has joined #ruby
<apeiros> like Tuple = Struct.new(:a, :b) ?
tomphp has joined #ruby
RougeR has joined #ruby
RougeR has joined #ruby
RougeR has quit [Changing host]
<dminuoso> apeiros: Well imagine you could write: <1, "foo">
DTZUZO has quit [Ping timeout: 276 seconds]
<dminuoso> But deconstruct in blocks.
vutral|kali has quit [Ping timeout: 240 seconds]
<dminuoso> grammar issues aside
tomphp has quit [Client Quit]
<dminuoso> apeiros: My main problem with Struct is just that you lose that easy access to .map { |(fst, snd)| ... }
<apeiros> so you're asking whether I'd like syntax for that?
<dminuoso> Yea
<apeiros> sure, I'd like syntax for that. but my list of priorities re literals is different.
<apeiros> I'd want date & datetime first
<dminuoso> What do you mean?
<apeiros> re .map: easy enough, no?
sidx64 has joined #ruby
<dminuoso> Why? This is not exposed in userland api is it?
<apeiros> Tuple = Struct.new(:a, :b) do include Enumerable; def each; return enum_for(__method__) unless block_given?; yield(a); yield(b); end; end; end
<dminuoso> No way. It is exposed?
<dminuoso> TIL.
<dminuoso> That is absolutely great. You may have instantly triggered a gitlab issue "REFACTOR ALL THE THINGS"
<apeiros> oh actually map is even in there already
<apeiros> but maybe not the way you want it, looking at your example
<apeiros> seems like you want the .map to yield all members?
<dminuoso> apeiros: Let me approach it differently because I think I can show you with an implementation.
<dminuoso> Where is this documented?
vutral|kali has joined #ruby
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
cthulchu has quit [Ping timeout: 256 seconds]
<dminuoso> Im guessing (a, b) simply uses .each to produce the values?
<dminuoso> >> def Pair a, b; Pair.new(a, b); end; Pair = Struct.new(:a, :b) do include Enumerable; def each; return enum_for(__method__) unless block_given?; yield(a); yield(b); end; end; end; [Pair(1, 2), Pair(3, 4)].map { |(fst, snd)| fst + snd }
<ruby[bot]> dminuoso: # => /tmp/execpad-fc153388ce96/source-fc153388ce96:3: syntax error, unexpected keyword_rescue, expecting ...check link for more (https://eval.in/960008)
<dminuoso> >> def Pair a, b; Pair.new(a, b); end; Pair = Struct.new(:a, :b) do; include Enumerable; def each; return enum_for(__method__) unless block_given?; yield(a); yield(b); end; end; [Pair(1, 2), Pair(3, 4)].map { |(fst, snd)| fst + snd }
<ruby[bot]> dminuoso: # => undefined method `+' for #<struct Pair a=1, b=2> (NoMethodError) ...check link for more (https://eval.in/960011)
Dimik has quit [Ping timeout: 256 seconds]
<dminuoso> apeiros: ^- mm this is what I want.
<dminuoso> Except for the "not working part"
willmichael has joined #ruby
gary has joined #ruby
<dminuoso> >> class A; def each; puts "called"; end; end [A.new].map { |(e)| }
<ruby[bot]> dminuoso: # => no implicit conversion of A into Integer (TypeError) ...check link for more (https://eval.in/960017)
<dminuoso> o.i
gary is now known as Guest40377
tvw has joined #ruby
<dminuoso> >> class A; def each; puts "called"; end; end; [A.new].map { |(e)| }
<ruby[bot]> dminuoso: # => [nil] (https://eval.in/960019)
<dminuoso> >> class A; def each; puts "called"; end; end; [A.new].map { |(e, v)| }
<ruby[bot]> dminuoso: # => [nil] (https://eval.in/960020)
<dminuoso> >> class A; def each; raise "called"; end; end; [A.new].map { |(e, v)| }
vutral|kali has quit [Ping timeout: 276 seconds]
<dminuoso> asm>> *a
<ruby[bot]> dminuoso: I have disassembled your code, the result is at https://eval.in/960023
<dminuoso> asm>> q = *a
<ruby[bot]> dminuoso: I have disassembled your code, the result is at https://eval.in/960024
<tbuehlmann> le spam
<dminuoso> tbuehlmann: Its not like there's any discussion going on anyway
Guest40377 has quit [Ping timeout: 248 seconds]
gary_ has joined #ruby
gary_ is now known as Guest25259
beauby has joined #ruby
<dminuoso> >> class Array; def each; raise; end; end; ->((a, b)) {}[[1,2]]
<ruby[bot]> dminuoso: # => nil (https://eval.in/960036)
<dminuoso> >> class Array; def to_ary; raise; end; end; ->((a, b)) {}[[1,2]]
<ruby[bot]> dminuoso: # => nil (https://eval.in/960037)
<dminuoso> >> Tuple = Struct.new(:a, :b) do def to_ary; [a, b]; end end; [Tuple.new(1,2), Tuple.new(3,4)].map { |(fst, snd)| fst + snd }
<ruby[bot]> dminuoso: # => [3, 7] (https://eval.in/960038)
<dminuoso> apeiros: Lovely! Thanks!
riotjones has joined #ruby
<dminuoso> >> Tuple = Struct.new(:a, :b) do def to_ary; [a, b]; end end; [Tuple.new(1,2), Tuple.new(3,4)].map { |(fst)| fst }
<ruby[bot]> dminuoso: # => [1, 3] (https://eval.in/960039)
<dminuoso> This is great.
Tempesta has quit [Read error: Connection reset by peer]
mikecmpbll has joined #ruby
Tempesta has joined #ruby
Tempesta has quit [Changing host]
Tempesta has joined #ruby
wnd has quit [Excess Flood]
JoshS has joined #ruby
wnd has joined #ruby
milardovich has joined #ruby
willmichael has quit [Ping timeout: 256 seconds]
yonahw has quit [Read error: Connection reset by peer]
jshjsh has quit [Ping timeout: 276 seconds]
minimalism has quit [Ping timeout: 240 seconds]
milardovich has quit [Ping timeout: 276 seconds]
yonahw has joined #ruby
karapetyan has quit [Remote host closed the connection]
Guest25259 has quit [Ping timeout: 248 seconds]
alfiemax_ has quit [Remote host closed the connection]
willmichael has joined #ruby
bijan_ has joined #ruby
bijan_ is now known as bijan_awaaaay
bijan_awaaaay has quit [Client Quit]
bijan_ has joined #ruby
willmichael has quit [Ping timeout: 256 seconds]
alfiemax has joined #ruby
vutral|kali has joined #ruby
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
tomphp has joined #ruby
gary__ has joined #ruby
apricant_ has quit [Ping timeout: 256 seconds]
willmichael has joined #ruby
cthulchu has joined #ruby
gary__ has quit [Ping timeout: 240 seconds]
gary__ has joined #ruby
Mia has quit [Read error: Connection reset by peer]
cthulchu has quit [Ping timeout: 240 seconds]
Guest66178 has quit [Ping timeout: 240 seconds]
mello has joined #ruby
Beams has joined #ruby
mello is now known as Guest15827
Puffball has quit [Remote host closed the connection]
bijan_ is now known as bijan_awaaaay
<dionysus69> hey all
<dionysus69> I have a rescue > retry confusion going on
vutral|kali has quit [Ping timeout: 248 seconds]
<dionysus69> in here, if wallet is locked it throws exception with code 12
gary__ has quit [Ping timeout: 260 seconds]
bijan_awaaaay has quit [Quit: System has gone to sleep. ZZZzzz…]
<dionysus69> but after it unlocks, and reties, it still throws 12
<dionysus69> if I terminate script and rerun, then it doesn't throw 12 anymore and executes the main part of program
Guest15827 has quit [Remote host closed the connection]
gary__ has joined #ruby
<dionysus69> so why isn't it unlocking on runtime without terminating and rerunning ?
<dionysus69> doesn't make sense :S
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
user2 has joined #ruby
cthulchu has joined #ruby
vutral|kali has joined #ruby
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
gary__ has quit [Ping timeout: 255 seconds]
gary__ has joined #ruby
mtkd has quit []
cthulchu has quit [Ping timeout: 268 seconds]
<apeiros> dionysus69: probably cached information somewhere?
vutral|kali has quit [Ping timeout: 248 seconds]
mtkd has joined #ruby
vutral|kali has joined #ruby
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
jaruga has joined #ruby
ecuanaso has joined #ruby
gary__ has quit [Ping timeout: 248 seconds]
workmad3 has quit [Quit: Lost terminal]
user2 has quit [Quit: WeeChat 2.0.1]
bngsudheer has left #ruby ["Leaving"]
AJA4350 has joined #ruby
apeiros has quit []
np4433 has joined #ruby
bijan_ has joined #ruby
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ramfjord has joined #ruby
yohji has joined #ruby
lesce has quit [Ping timeout: 260 seconds]
gary has joined #ruby
sidx64 has joined #ruby
gary is now known as Guest47803
ramfjord has quit [Ping timeout: 240 seconds]
lesce has joined #ruby
sidx64 has quit [Client Quit]
karapetyan has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Guest47803 has quit [Ping timeout: 240 seconds]
sidx64 has joined #ruby
gary_ has joined #ruby
gary_ is now known as Guest79168
karapetyan has quit [Remote host closed the connection]
karapetyan has joined #ruby
adlerdias has joined #ruby
GodFather has quit [Read error: Connection reset by peer]
GodFather has joined #ruby
Guest79168 has quit [Ping timeout: 256 seconds]
cthulchu has joined #ruby
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mozzarella has quit [Ping timeout: 240 seconds]
Mike11 has joined #ruby
sidx64 has joined #ruby
cthulchu has quit [Ping timeout: 256 seconds]
milardovich has joined #ruby
milardovich has quit [Remote host closed the connection]
milardovich has joined #ruby
cthulchu has joined #ruby
sumobob has joined #ruby
gary__ has joined #ruby
DaniG2k has quit [Quit: leaving]
cthulchu has quit [Ping timeout: 256 seconds]
goatish has joined #ruby
sumobob has quit [Ping timeout: 276 seconds]
Mia has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
jnollette has quit [Remote host closed the connection]
jnollette has joined #ruby
gary__ has quit [Ping timeout: 260 seconds]
gary__ has joined #ruby
Cavallari has joined #ruby
vutral|kali has quit [Ping timeout: 248 seconds]
alex`` has quit [Ping timeout: 256 seconds]
bijan_ has quit [Quit: System has gone to sleep. ZZZzzz…]
gary__ has quit [Ping timeout: 248 seconds]
vutral|kali has joined #ruby
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
gary has joined #ruby
gary is now known as Guest13065
Guest13065 has quit [Ping timeout: 240 seconds]
gary_ has joined #ruby
gary_ is now known as Guest11876
np4433 has quit [Quit: WeeChat 2.0.1]
karapetyan has quit [Remote host closed the connection]
Serpent7776 has joined #ruby
ldnunes has joined #ruby
amatas_ has joined #ruby
apparition has joined #ruby
amatas__ has joined #ruby
tomphp has joined #ruby
Guest11876 has quit [Ping timeout: 265 seconds]
amatas_ has quit [Ping timeout: 264 seconds]
gary__ has joined #ruby
vutral|kali has quit [Ping timeout: 265 seconds]
cthulchu has joined #ruby
karapetyan has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
adlerdias has left #ruby [#ruby]
discopatrick has joined #ruby
ecuanaso has joined #ruby
raynold has quit [Quit: Connection closed for inactivity]
cthulchu has quit [Ping timeout: 240 seconds]
apeiros_ has joined #ruby
gary__ has quit [Ping timeout: 256 seconds]
gary__ has joined #ruby
despai has joined #ruby
Psybur_ has joined #ruby
nowhereman_ has joined #ruby
ziso has joined #ruby
nowhere_man has quit [Ping timeout: 240 seconds]
cthulchu has joined #ruby
despai has quit [Ping timeout: 268 seconds]
<ziso> Can anyone recommend an alternative to basically just using Classes as namespaces for methods? No experience in OOP, so it just seems like a verbose way to use methods.
vutral|kali has joined #ruby
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
<apeiros_> ziso: then I'd recommend you to get familiar with OO instead of trying to write COBOL in ruby.
apeiros_ is now known as apeiros
<tobiasvl> ziso: an alternative to using classes as namespaces? well, what about using namespaces as namespaces
<ziso> I just took that from Steve Yegge's argument against using singletons, realizing that's basically all I was using classes for
<apeiros> that's a good realization. however, your "fix" of the perceived problem is terrible.
cthulchu has quit [Ping timeout: 268 seconds]
<apeiros> you realized "I wrote badly architected code". your fix is "how can I write badly architected code in a different way?". IMO the proper approach is "how can I use OO to have better architecture."
<ziso> my project is constrained to only use one global module, so would it make more sense to use sub modules for namespacing where necessary?
<ziso> you're right
Mike11 has quit [Ping timeout: 256 seconds]
<apeiros> you can nest modules and classes as deeply as you want
<apeiros> and restricting toplevel surface of a project/library to a single module (or class) is a good idea.
gregf_ has quit [Ping timeout: 260 seconds]
tomphp has joined #ruby
<apeiros> and if you need help with how to structure your non-OO code into classes, you can always create a gist or link your repository here and ask for help.
<ziso> thank you. POODR went a bit over my head but i would like to slowly move an in-production project over to somethiing more easily maintainable
bijan_awaaaay has joined #ruby
vutral|kali has quit [Ping timeout: 276 seconds]
<apeiros> it's entirely possible that OO isn't a style which fits you. it might be worth considering e.g. functional languages and see whether that style matches your way of thinking.
ta_ has quit [Remote host closed the connection]
<apeiros> it's not like OO was "the one true way". it's just that I think it's a bad idea to use ruby in a non-OO way (note that OO and functional can mix to a degree)
ta_ has joined #ruby
mtkd has quit [Ping timeout: 268 seconds]
alex`` has joined #ruby
bijan_awaaaay is now known as bijan_
bijan_ is now known as bijan_awaaaay
mtkd has joined #ruby
bijan_awaaaay is now known as bijan_
willmichael has quit [Read error: Connection reset by peer]
willmichael has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
DTZUZO has joined #ruby
cabotto has joined #ruby
Nightmare has quit [Ping timeout: 255 seconds]
ta_ has quit [Ping timeout: 240 seconds]
gregf_ has joined #ruby
thinkpad has quit [Quit: lawl]
adlerdias has joined #ruby
ramfjord has joined #ruby
lvmbdv has joined #ruby
Nightmare has joined #ruby
alfiemax has quit [Remote host closed the connection]
cabotto has quit []
alfiemax has joined #ruby
vutral|kali has joined #ruby
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
workmad3 has joined #ruby
Psybur__ has joined #ruby
ramfjord has quit [Ping timeout: 255 seconds]
gary__ has quit [Ping timeout: 276 seconds]
alfiemax_ has joined #ruby
Psybur_ has quit [Ping timeout: 256 seconds]
darix has joined #ruby
alfiemax has quit [Ping timeout: 256 seconds]
alex`` has quit [Quit: WeeChat 2.0.1]
alex`` has joined #ruby
karapetyan has quit [Remote host closed the connection]
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
thinkpad has joined #ruby
alfiemax_ has quit [Ping timeout: 276 seconds]
vutral|kali has quit [Ping timeout: 276 seconds]
alfiemax has joined #ruby
jaruga has quit [Ping timeout: 276 seconds]
jaruga has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
LenPayne has quit [Ping timeout: 240 seconds]
gary has joined #ruby
LenPayne has joined #ruby
karapetyan has joined #ruby
gary is now known as Guest52279
karapetyan has quit [Remote host closed the connection]
alfiemax has quit [Remote host closed the connection]
karapetyan has joined #ruby
Cyrus has quit [Ping timeout: 255 seconds]
ldnunes has quit [Ping timeout: 240 seconds]
RougeR has quit [Ping timeout: 256 seconds]
Cyrus has joined #ruby
jaruga has quit [Client Quit]
vutral|kali has joined #ruby
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
jaruga has joined #ruby
Cyrus is now known as Guest9258
alfiemax has joined #ruby
minimalism has joined #ruby
vutral|kali has quit [Excess Flood]
shinnya has joined #ruby
minimalism has quit [Client Quit]
houhoulis has joined #ruby
goatish has quit [Quit: Hibernating]
sidx64 has joined #ruby
jordanm has quit [Ping timeout: 240 seconds]
sidx64 has quit [Client Quit]
jordanm has joined #ruby
vutral|kali has joined #ruby
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
Guest52279 has quit [Ping timeout: 248 seconds]
Psybur__ has quit [Ping timeout: 255 seconds]
amatas__ has quit [Ping timeout: 256 seconds]
sidx64 has joined #ruby
Guest80262 has joined #ruby
nadir has quit [Quit: Connection closed for inactivity]
ldnunes has joined #ruby
vutral|kali has quit [Ping timeout: 260 seconds]
cthulchu has joined #ruby
vutral|kali has joined #ruby
vutral|kali has joined #ruby
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
John_Ivan has joined #ruby
John_Ivan has joined #ruby
John_Ivan has quit [Changing host]
Guest80262 has quit [Ping timeout: 260 seconds]
<dionysus69> thanks apeiros, class variable was being cached with ||= assignment, I was using it not to recreate connection object multiple times :)
gary__ has joined #ruby
sidx64 has joined #ruby
synthroid has joined #ruby
jeffreylevesque has quit [Ping timeout: 240 seconds]
cthulchu has quit [Ping timeout: 268 seconds]
houhoulis has quit [Remote host closed the connection]
nowhere_man has joined #ruby
hdb2 has joined #ruby
jaruga has quit [Ping timeout: 240 seconds]
memo1 has joined #ruby
<apeiros> dionysus69: yay, my psychic tele-debugging capabilities are unmatched ;-D
nowhereman_ has quit [Ping timeout: 256 seconds]
<dionysus69> xD
RougeR has joined #ruby
RougeR has joined #ruby
RougeR has quit [Changing host]
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
milardovich has quit []
gary__ has quit [Ping timeout: 264 seconds]
jaruga has joined #ruby
hdb2 has quit [Ping timeout: 255 seconds]
vutral|kali has quit [Ping timeout: 255 seconds]
amatas_ has joined #ruby
gary__ has joined #ruby
vutral|kali has joined #ruby
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
goatish has joined #ruby
cthulchu has joined #ruby
vutral|kali has quit [Excess Flood]
<dminuoso> Stupid arel :(
<dminuoso> I hate you
vutral|kali has joined #ruby
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
amatas__ has joined #ruby
SuperL4g has joined #ruby
amatas_ has quit [Ping timeout: 240 seconds]
desperek has joined #ruby
SuperLag has quit [Ping timeout: 256 seconds]
rwb has quit [Ping timeout: 256 seconds]
cthulchu has quit [Ping timeout: 240 seconds]
amatas__ has quit [Quit: amatas__]
mcr1 has quit [Ping timeout: 276 seconds]
cabotto has joined #ruby
ta_ has joined #ruby
vondruch_ has joined #ruby
gary__ has quit [Ping timeout: 240 seconds]
gary has joined #ruby
ta_ has quit [Remote host closed the connection]
gary is now known as Guest94497
ta_ has joined #ruby
vondruch has quit [Ping timeout: 240 seconds]
vondruch_ is now known as vondruch
willmichael has quit [Ping timeout: 256 seconds]
willmichael has joined #ruby
bijan_ is now known as bijan_awaaaay
willmichael has quit [Read error: Connection reset by peer]
willmichael has joined #ruby
Puffball has joined #ruby
<ziso> I'm sure I'm doing this wrong. Trying to access an instance variable from a module using attr_reader fails with "undefined method". But defining my own succeeds. any ideas? https://gist.github.com/anonymous/8827267302ae6498cff3bf6ded9f37c6
andikr has quit [Remote host closed the connection]
minimalism has joined #ruby
<tbuehlmann> `attr_reader :special` defines the getter for instance variables (for instances), whereas you're defining @special as a class instance variable (for the class)
Guest94497 has quit [Ping timeout: 255 seconds]
gary_ has joined #ruby
gary_ is now known as Guest26555
ecuanaso has joined #ruby
<ziso> tbuehlmann: Right, so there's no instance of a module, unless you use it as a mixin, correct?
Papierkorb has joined #ruby
cdg has joined #ruby
<tbuehlmann> in this case defining instance variables only makes sense when including/extending the module, right
bmurt has joined #ruby
<apeiros> ziso: the module itself is an object too, though. and https://gist.github.com/anonymous/8827267302ae6498cff3bf6ded9f37c6#file-inner_module-rb-L6 accesses that object's @special ivar
<apeiros> and you can create an accessor for that via:
<apeiros> class << self; attr_reader :special; end (within Inner)
Papierkorb has left #ruby ["Konversation terminated!"]
Guest26555 has quit [Ping timeout: 240 seconds]
cthulchu has joined #ruby
amatas_ has joined #ruby
oroborous has joined #ruby
oroborous has joined #ruby
oroborous has quit [Changing host]
amatas_ has quit [Remote host closed the connection]
amatas_ has joined #ruby
cthulchu has quit [Ping timeout: 240 seconds]
Psybur has joined #ruby
gary__ has joined #ruby
tomphp has joined #ruby
tomphp has quit [Client Quit]
vutral|kali has quit [Ping timeout: 240 seconds]
bijan_awaaaay is now known as bijan_
EnderMB has joined #ruby
EnderMB has quit [Client Quit]
bijan_ is now known as bijan_awaaaay
nowhereman_ has joined #ruby
nowhere_man has quit [Ping timeout: 255 seconds]
tcopeland has quit [Quit: tcopeland]
cthulchu has joined #ruby
apeiros has quit []
<dionysus69> I want to do something super custom dunno if it's possible or if it makes sense
<dionysus69> I want to call a method on some class lets say Classs.method_name(param)
Junaos_ has quit [Quit: ZNC - http://znc.in]
<dionysus69> and param needs to be constructed depending on what the method name is
<dionysus69> with a custructor method, which takes a method name as a param
<dionysus69> so I want to something like this Class.method_name(param(method_name_as_variable))
vutral|kali has joined #ruby
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
Mike11 has joined #ruby
Junaos has joined #ruby
<rabajaj> hey, i am new to ruby. having issues understanding symbols! i understood that they are unique and always have the same object_id but not clear with where to use it and why to use it.
hdb2 has joined #ruby
<rabajaj> can they store some value like a variable?
gary__ has quit [Ping timeout: 260 seconds]
<rabajaj> any links or articles related to this will be a great help :)
<ziso> apeiros: Thanks! that works. Is there a name for that pattern I can research further?
shinnya has quit [Ping timeout: 240 seconds]
Tempesta has quit [Ping timeout: 248 seconds]
cthulchu has quit [Ping timeout: 256 seconds]
EnderMB has joined #ruby
jcalla has joined #ruby
gary__ has joined #ruby
bijan_awaaaay is now known as bijan_
Psybur_ has joined #ruby
Tempesta has joined #ruby
xfbs has joined #ruby
devil_tux has quit [Ping timeout: 255 seconds]
hdb2 has quit [Quit: leaving]
dionysus69 has quit [Ping timeout: 248 seconds]
memo1 has quit [Ping timeout: 264 seconds]
Psybur has quit [Ping timeout: 268 seconds]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rwb has joined #ruby
kapil___ has quit [Quit: Connection closed for inactivity]
vutral|kali has quit [Ping timeout: 260 seconds]
amatas_ has quit [Ping timeout: 248 seconds]
<Bish> rabajaj: symbols don't differ in any way from immutable strings EXCEPT the object_id stays static
<Bish> they're mostly used to have quick acccess in hashes
<Bish> and ofcourse their type is different
<rabajaj> Bish, i have been it being passed to the a method as a parameter, if it is passed what will it do ?
mtkd has quit [Ping timeout: 240 seconds]
<rabajaj> s/been/seen
<Bish> it will be the same thing inside the method, ofcourse
<Bish> as i said, only thing that differs, is that they're immutable/have always the same object_>d
<Bish> (and type)
jeffreylevesque has joined #ruby
mtkd has joined #ruby
<Bish> the only benefits you have is speed & abstraction
ecuanaso has joined #ruby
<rabajaj> Bish, can they be used as a method name ?
adlerdias has left #ruby [#ruby]
<Bish> if you create a method they are already a symbol.. in the set of methods of current object
<rabajaj> so you mena i can call a method by using its symbol ?
<rabajaj> s/mena/mean
<Bish> yes
<Bish> >> 1.method(:+).call(1)
ramfjord has joined #ruby
<Bish> >> 1.method(:+).call(1)
<ruby[bot]> Bish: # => 2 (https://eval.in/960335)
vutral|kali has joined #ruby
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
<Bish> i took the + method of the number 1, and called it with the parameter 1
<Bish> you can always access the methods of an object with
<Bish> Object.method(:methodNameAsASymbol)
<rabajaj> ah!
<Bish> you can't have symbols (using the literal) that begin with 1
<Bish> the reason is that, you can't have methods beginning with a number
<Bish> >> def 1method;end;
<ruby[bot]> Bish: # => /tmp/execpad-ffba1356f94d/source-ffba1356f94d:2: syntax error, unexpected tINTEGER ...check link for more (https://eval.in/960336)
<Bish> >> :1illegalsymbol
<ruby[bot]> Bish: # => /tmp/execpad-e95689d74b6c/source-e95689d74b6c:2: syntax error, unexpected tINTEGER, expecting tSTRIN ...check link for more (https://eval.in/960337)
<rabajaj> oh
<Bish> (you can craft symbols that begin with numbers, but then you must know what you're doing
<rabajaj> ohkay, is a chance that i want to print hello world in a def and then want to call that method using symbol ?
<rabajaj> is there a chance*
<Bish> sure, just the way i did it
<rabajaj> ohkay, let me try it.
<Bish> you can even use symbols to create methods
Psybur_ is now known as Psybur
<Bish> that way you can do really nice metaprogramming
Psybur has quit [Changing host]
Psybur has joined #ruby
spiette has joined #ruby
ramfjord has quit [Ping timeout: 256 seconds]
<Bish> for example.. you could write a JSON parser, that parses '{"hello":"world"}' that then dynamicially gets the method "hello" which returns "world"
<rabajaj> Bish, thanks. i just got cleared with the whole symbols thing!
<Bish> :) that makes me happy
DLSteve has joined #ruby
vutral|kali has quit [Ping timeout: 248 seconds]
apeiros_ has joined #ruby
gary__ has quit [Ping timeout: 268 seconds]
alex`` has quit [Quit: WeeChat 2.0.1]
mozzarella has joined #ruby
bijan_ has quit [Quit: System has gone to sleep. ZZZzzz…]
RougeR has quit [Ping timeout: 240 seconds]
krawchyk has joined #ruby
vutral|kali has joined #ruby
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
gregf_ has quit [Ping timeout: 260 seconds]
alex`` has joined #ruby
gary has joined #ruby
vutral|kali has quit [Excess Flood]
gary is now known as Guest3502
willmichael has quit [Ping timeout: 276 seconds]
devil_tux has joined #ruby
cthulchu has joined #ruby
<apeiros_> >> define_method(:"1") do "I'm the one!" end; send(:"1")
<ruby[bot]> apeiros_: # => "I'm the one!" (https://eval.in/960338)
<apeiros_> Bish: ^ there, a method named 1 :D
apeiros_ is now known as apeiros
xfbs has quit []
alex`` is now known as alexherbo2
alexherbo2 is now known as alex``
vondruch_ has joined #ruby
cthulchu has quit [Ping timeout: 240 seconds]
vutral|kali has joined #ruby
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
Guest3502 has quit [Ping timeout: 256 seconds]
gary_ has joined #ruby
alex`` has quit [Quit: WeeChat 2.0.1]
gary_ is now known as Guest34280
workmad3 has quit [Ping timeout: 276 seconds]
vondruch has quit [Ping timeout: 252 seconds]
vondruch_ is now known as vondruch
morenoh149 has joined #ruby
k0mpa has joined #ruby
workmad3 has joined #ruby
cpruitt has joined #ruby
lxsameer has quit [Quit: WeeChat 1.9.1]
vutral|kali has quit [Ping timeout: 265 seconds]
<Mike11> hello all, I am new ruby
<Mike11> if I have a function that has this signature:
<Mike11> how can I call it?
<Mike11> def pass_var_to_block(var, &block)
<Mike11> I am just looking for the right syntax to call it
<apeiros> pass_var_to_block(123) do …your block… end
<apeiros> Mike11: also it's method, not function ;-)
<Mike11> apeiros: aha, thanks. btw what is the difference between a method and a function?
<apeiros> alternatively, if you have a Proc instance, or anything which responds to to_proc in a variable named 'your_proc_instance': pass_var_to_block(123, &your_proc_instance)
<apeiros> there's no formal definition. but commonly methods are attached to objects and are aware of a "self" (or "this" in some languages), whereas functions are not attached to an object and are "pure", i.e. get all their input from params and all their output is the return value
lxsameer has joined #ruby
Guest34280 has quit [Ping timeout: 268 seconds]
<Mike11> apeiros: I get that, thank you very much :D
<apeiros> the self/this being the main differentiator. there are plenty of languages which have functions which can access/manipulate global state, or which can mutate the passed arguments (those things are called "side effects")
<Mike11> and if my example was a method defined globally, it would be a method too, since this makes it associated with the ruby Object class
<Mike11> apeiros: is that right? ^^
<apeiros> actually with main, which is an instance of Object and slightly special. but yes, it still has a self.
<apeiros> > ruby -e 'p [self.equal?(Object), self.is_a?(Object)]' --> [false, true]
<cpruitt> Mike11: I could be wrong about the details but there are also some subtleties in ruby that won't make much difference to you now but may later be beneficial. Your method is never "called" directly. Instead a "message" is sent to the object the method is associated with telling it to execute the method. In most cases you'll never notice, but it's worth noting that you can send the message yourself using someobj.send(:method_name).
chouhoulis has joined #ruby
<cpruitt> (That's regarding the function vs method question)
vutral|kali has joined #ruby
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
<Mike11> cpruitt: I am actually interested in these subtleties whether they are beneficial for me now or not :)
<Mike11> but I am still boggling at apeiros's last example :p
<cpruitt> Mike11: I assumed so which is why I mentioned it. :-) I just wouldn't recommend getting too hung up on them. In most cases they don't have any tangible impact on your code.
Cavallari has quit [Quit: Cavallari]
<apeiros> cpruitt: you should do the example with public_send
alex`` has joined #ruby
<apeiros> using send directly is a bad habit and shouldn't be started with :)
alex`` is now known as alexherbo2
<apeiros> Mike11: my code simply queries the toplevel self for whether it is the "Object class" object (false), and whether it is an instance of Object (true)
<Mike11> I am guessing public_send causes the object to call a public method, while send causes it to call any method, right?
<apeiros> yes. send can bypass private/protected
morenoh149 has quit [Ping timeout: 252 seconds]
alexherbo2 is now known as alex``
<cpruitt> apeiros: Unfortunately it's a bad habit that plagues my own code so I'd feel better if more people made the mistake. (j/k) Mike11, use #public_send. lol
<apeiros> public_send otoh does not. it'll behave the same as if you called it literally.
<apeiros> cpruitt: :-p
<apeiros> cpruitt: global search and replace :-D
<apeiros> s/\bsend\b/public_send/
ta_ has quit [Read error: Connection reset by peer]
ta_ has joined #ruby
gary__ has joined #ruby
safetypin has joined #ruby
<Mike11> apeiros: I can understand the "is an instance of" relationship, but not the "whethere it is the "Object class" object
<Mike11> certainly self is not a Class object, right?
<apeiros> it can be
<apeiros> >> class Foo; p self.equal?(Foo); end
<ruby[bot]> apeiros: # => true ...check link for more (https://eval.in/960352)
morenoh149 has joined #ruby
<apeiros> classes are objects in ruby. they follow mostly the same rules as other objects.
n0m4d1c has joined #ruby
<apeiros> the differences being class and module specific behaviors, like being able to serve as a namespace (module behavior), and being able to be inherited from and instantiated (class behaviors)
<cpruitt> Mike11: In Ruby *everything* is an object so everything is an instance of something. What you probably think of as a "class definition" creates a constant. The value of that constant is an instance of a Class object. (or something along those lines)
tcopeland has joined #ruby
<Mike11> isn't that somehow similar to Java's java.lang.Class?
* apeiros inserts an "almost" in front of the *everything*
<cpruitt> apeiros: What isn't?
chouhoul_ has joined #ruby
<dminuoso> cpruitt: blocks.
<dminuoso> cpruitt: constants
<dminuoso> cpruitt: variables
exchgr has quit [Ping timeout: 264 seconds]
<dminuoso> cpruitt: methods are not objects either
<cpruitt> dminuoso: I thought methods were instances of Method ?
Rapture has joined #ruby
k0mpa has quit [Remote host closed the connection]
jamiejackson has joined #ruby
<cpruitt> Blocks I'd agree with. Constants & variables... I'm not sure how you'd address them in and of themselves. They're elements of source code but not really "things". They just reference something.
<apeiros> cpruitt: code isn't. variables aren't. blocks aren't. methods aren't (but you can create objects from the latter too)
<apeiros> well, dminuoso already up for the task. got to go :D
chouhoulis has quit [Ping timeout: 256 seconds]
<Mike11> apeiros: I am sorry I was still staring at your last example :p
<Mike11> class Foo; p self.equal?(Foo); end
<Mike11> what is the semi-colon here called? I googled ruby semi-colon operator and I couldn't find any results
<cpruitt> Mike11: It terminates a statement, same as C or JS
<cpruitt> Those are three statements on one line.
<Mike11> I was barking the wrong tree I guess
n0m4d1c has quit [Read error: Connection reset by peer]
<Mike11> so any line of code that is executed inside the "definition" of a class, has the self pointing to a Class object, right?
n0m4d1c has joined #ruby
<cpruitt> Define "inside the definition"?
<Mike11> mm, well, what is that called then?
<Mike11> class Foo; p self.equal?(Foo); end
<apeiros> in the class body, yes
<apeiros> and yes, the ; are just like newlines. convenient to write multiple lines in one.
<Bish> apeiros: i just asked mysself if that's possible
<Bish> why the fuck is it
<Mike11> thank you guys very much, I can understand a bit more now :) sorry for my noob questions :D
<Bish> cpruitt: are blocks objects?
* Bish runs
* apeiros gtg, cya
ramfjord has joined #ruby
snath has quit [Ping timeout: 256 seconds]
tcopeland has quit [Quit: tcopeland]
sumobob has joined #ruby
tcopeland has joined #ruby
<dminuoso> cpruitt: methods are not. you can reify a method, but natively they are not objects
<dminuoso> just like blocks are not objects, even though you can reify them with Proc
vutral|kali has quit [Ping timeout: 276 seconds]
apeiros has quit [Read error: Connection reset by peer]
ramfjord has quit [Ping timeout: 256 seconds]
<cpruitt> dminuoso: Was just googling and found the same thing. Blocks I'd read about in the past (though forgot till now) but not methods. I always understood them to be object instances so thanks for the clarification. :-)
riotjoe has joined #ruby
vutral|kali has joined #ruby
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
sumobob has quit [Ping timeout: 256 seconds]
riotjones has quit [Ping timeout: 240 seconds]
gary__ has quit [Ping timeout: 260 seconds]
soniya29 has joined #ruby
n0m4d1c has quit [Remote host closed the connection]
gary has joined #ruby
gary is now known as Guest85397
soniya29 has quit [Remote host closed the connection]
chouhoul_ has quit [Remote host closed the connection]
chouhoulis has joined #ruby
soniya29 has joined #ruby
krawchyk has quit [Quit: krawchyk]
andygeorge has joined #ruby
soniya29_ has joined #ruby
soniya29__ has joined #ruby
sumobob has joined #ruby
soniya29__ has quit [Remote host closed the connection]
soniya29__ has joined #ruby
Guest85397 has quit [Ping timeout: 255 seconds]
gary_ has joined #ruby
vutral|kali has quit [Ping timeout: 256 seconds]
gary_ is now known as Guest69392
soniya29 has quit [Ping timeout: 256 seconds]
soniya29__ has quit [Remote host closed the connection]
soniya29 has joined #ruby
rippa has joined #ruby
soniya29_ has quit [Ping timeout: 268 seconds]
soniya29 has quit [Remote host closed the connection]
kapil___ has joined #ruby
soniya29 has joined #ruby
soniya29 has quit [Remote host closed the connection]
NightMonkey has joined #ruby
soniya29 has joined #ruby
soniya29_ has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
apparition has quit [Quit: Bye]
soniya29_ has quit [Remote host closed the connection]
soniya29 has quit [Remote host closed the connection]
xfbs has joined #ruby
vutral|kali has joined #ruby
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
Guest69392 has quit [Ping timeout: 268 seconds]
xfbs has quit [Client Quit]
s2013 has joined #ruby
gary__ has joined #ruby
troys has joined #ruby
devil_tux has quit [Ping timeout: 265 seconds]
RougeR has joined #ruby
RougeR has joined #ruby
RougeR has quit [Changing host]
devil_tux has joined #ruby
vondruch has quit [Remote host closed the connection]
tomphp has joined #ruby
mtkd has quit []
devil_tu1 has joined #ruby
conta has quit [Ping timeout: 265 seconds]
vondruch has joined #ruby
maxyz_ has joined #ruby
jamiejackson has quit [Ping timeout: 240 seconds]
yohji has quit [Ping timeout: 248 seconds]
dinfuehr has quit [Ping timeout: 240 seconds]
dinfuehr has joined #ruby
brodul has quit [Quit: My hovercraft is full of eels!!]
dionysus69 has joined #ruby
dviola has joined #ruby
vondruch has quit [Client Quit]
vondruch has joined #ruby
brodul has joined #ruby
gary__ has quit [Remote host closed the connection]
bmurt has joined #ruby
mtkd has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
maxyz_ has quit [Ping timeout: 260 seconds]
krawchyk has joined #ruby
gary__ has joined #ruby
tomphp has joined #ruby
cabotto has quit [Remote host closed the connection]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bmurt has joined #ruby
yohji has joined #ruby
synthroid has quit [Remote host closed the connection]
tcopeland has quit [Quit: tcopeland]
SirOliver has joined #ruby
tcopeland has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gary__ has quit [Ping timeout: 240 seconds]
tomphp has joined #ruby
gary has joined #ruby
gary is now known as Guest54135
seal_ has joined #ruby
<seal_> hi
<seal_> What's better Django or Ror?
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Bish> seal_: there is no better and they're both pretty old already
<Bish> i, for one, don't like either
<Bish> and i played around alot
<lvmbdv> where did the "soft typing" entry go, from https://github.com/rubygsoc/rubygsoc/wiki/Ideas-for-MRI-(Matz-Ruby-Interpreter) ?
bmurt has joined #ruby
<seal_> Guys I nothing can say to #linux comunity :( I registred, but I cant write anything :( Why?
synthroid has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<llua> did you auth after registering?
Guest54135 has quit [Ping timeout: 264 seconds]
ziso has quit [Ping timeout: 260 seconds]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
adlerdias has joined #ruby
rubycoder38 has joined #ruby
<rubycoder38> hi
infernix has quit [Ping timeout: 252 seconds]
<rubycoder38> I have to make some jsonrpc call to some servre, can I just use a http library for this?
<rubycoder38> it works with curl in the command line
bmurt has joined #ruby
<rubycoder38> server*
gary_ has joined #ruby
gary_ is now known as Guest81586
<seal_> @llua All ok, I had to verefy my account with command of I get in the email :3
Guest81586 has quit [Ping timeout: 240 seconds]
tomphp has joined #ruby
gary__ has joined #ruby
<Bish> seal_: you're sealed out
<Bish> rubycoder38: just use net/http
<Bish> mechanize is also pretty good
pastorinni has joined #ruby
<Bish> im out, cya!
cabotto has joined #ruby
rsilor has joined #ruby
rrutkowski has joined #ruby
<rsilor> Hey. Anyone tried to do Grusman's boo
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<rubycoder38> Bish: thanks
<rubycoder38> I'll use net/http
X-Jester has joined #ruby
<rsilor> Book 'machifrom scratch
<X-Jester> if you were trying to map a trigger to particular code path, say receiving the text "hello", how stupid is it to store a collection of triggers to procs as opposed to trying to do a method callback?
seal_ has left #ruby [#ruby]
<rsilor> Ehem.. what I meant to ask was: have any of you worked through Grusman's text 'data science from scratch', you
<rsilor> But adapted his python examples to Ruby
gary__ has quit [Ping timeout: 256 seconds]
<rsilor> I'd like to attempt that, thought I would ask if anyone else had attempted it. Thx
ogres has joined #ruby
rrutkowski has quit [Client Quit]
rrutkowski has joined #ruby
Mike11 has quit [Quit: Leaving.]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cdg has quit [Remote host closed the connection]
cdg has joined #ruby
snath has joined #ruby
raynold has joined #ruby
cabotto has quit [Remote host closed the connection]
dyyylan has quit [Quit: ZNC 1.6.3+deb1 - http://znc.in]
cabotto has joined #ruby
claudiuinberlin has quit [Read error: Connection reset by peer]
n0m4d1c has joined #ruby
tvw has quit [Remote host closed the connection]
claudiuinberlin has joined #ruby
cdg has quit [Ping timeout: 276 seconds]
cagomez has joined #ruby
yohji has quit [Ping timeout: 264 seconds]
rrutkowski has quit [Remote host closed the connection]
rrutkowski has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
cthulchu has joined #ruby
dinfuehr has quit [Ping timeout: 248 seconds]
s2013 has joined #ruby
riotjoe has quit [Remote host closed the connection]
marr has quit [Ping timeout: 260 seconds]
riotjones has joined #ruby
aupadhye has quit [Ping timeout: 256 seconds]
aufi has quit [Quit: Leaving]
tomphp has joined #ruby
tomphp has quit [Client Quit]
bmurt has joined #ruby
infernix has joined #ruby
riotjones has quit [Ping timeout: 256 seconds]
yohji has joined #ruby
apricant_ has joined #ruby
SirOliver has quit [Quit: ZZZzzz…]
Serpent7776 has quit [Quit: Leaving]
n0m4d1c has quit [Remote host closed the connection]
guille-moe has quit [Ping timeout: 256 seconds]
Silthias has joined #ruby
gary has joined #ruby
gary is now known as Guest3607
SirOliver has joined #ruby
rsilor has quit [Quit: Page closed]
guacamole has joined #ruby
tomphp has joined #ruby
tomphp has quit [Client Quit]
Silthias1 has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
darkhanb has joined #ruby
Silthias has quit [Ping timeout: 255 seconds]
<garyserj> I've heard that perl has equivalents to rails, and that perl is faster than ruby. what advantages(if any), does Ruby have over Perl?
Guest3607 has quit [Ping timeout: 256 seconds]
<havenwood> garyserj: Are you talking about Perl 5 or Perl 6?
<dminuoso> lvmbdv: It's heading into 3x3
<garyserj> havenwood: either
<dminuoso> X-Jester: not at all.
<dminuoso> X-Jester: a proc is just a reified block
<dminuoso> X-Jester: and rubyists really have no problem passing blocks absolutely everywhere
<dminuoso> So you might as well reify them and make it easier to use.
tomphp has joined #ruby
<havenwood> garyserj: There's a lot of performance work going on in Ruby right now so it's probably a good bet.
karapetyan has quit [Remote host closed the connection]
karapetyan has joined #ruby
<havenwood> garyserj: A very recent step forward for Ruby performance is the introduction of a JIT for the reference implementation: https://medium.com/@k0kubun/the-method-jit-compiler-for-ruby-2-6-388ee0989c13
Beams has quit [Quit: .]
<havenwood> garyserj: There's also a high performance implementation of Ruby called TruffleRuby that's heading towards being production ready.
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Guest9258 is now known as Cyrus
Cyrus has quit [Changing host]
Cyrus has joined #ruby
goatish has quit [Quit: Hibernating]
<havenwood> garyserj: What are you doing that you're considering Rails for?
mikecmpbll has quit [Quit: inabit. zz.]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jcarl43 has joined #ruby
cpruitt has quit [Remote host closed the connection]
lacour has joined #ruby
tomphp has joined #ruby
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
bmurt has joined #ruby
SirOliver has quit [Quit: ZZZzzz…]
bigblind has joined #ruby
__semper__ has quit [Ping timeout: 240 seconds]
tomphp has quit [Client Quit]
rrutkowski has quit [Ping timeout: 240 seconds]
rrutkowski_ has joined #ruby
<garyserj> havenwood: I've used rails just to learn rails.
<garyserj> for what it's for.. writing a website particularly one involving CRUD operations.
rrutkowski_ has quit [Remote host closed the connection]
<havenwood> garyserj: Rails is quite nice for sane conventions around a CRUD website. Sounds like a good choice.
<garyserj> havenwood: but ruby performing faster than before isn't an advantage over perl though
<garyserj> which is what i'm asking about
<havenwood> garyserj: I was just addressing the "perl is faster than ruby" comment, which I don't think is particularly true anymore.
EnderMB has quit [Quit: Page closed]
cdg has joined #ruby
<havenwood> garyserj: As far as reasons why to use Rails versus [Perl framework here], you might want to ask in the #RubyOnRails channel.
sanscoeur has joined #ruby
<havenwood> garyserj: There's a huge community of smart people working on Rails and they tend to lead. Lots of languages have nicely copied Sinatra and Rails.
<havenwood> garyserj: Ruby is closer to Perl 6 in terms of beauty of the language, in my opinion.
<havenwood> garyserj: In Ruby you'll find battle tested HTTP 1.1 tooling. In Perl 6 there's a lot more room to create tools that others might adopt.
vutral|kali has quit [Ping timeout: 276 seconds]
eckhardt has joined #ruby
eckhardt has quit [Client Quit]
clemens3 has joined #ruby
eckhardt has joined #ruby
eckhardt has quit [Client Quit]
<garyserj> so perl's version of sinatra might be less battle tested?
<havenwood> garyserj: It looks like Dancer is a Sinatra-esque Perl 5 framework.
tomphp has joined #ruby
<havenwood> garyserj: My favorite along those lines in Ruby is Roda: http://roda.jeremyevans.net/'
n0m4d1c has joined #ruby
nfsnobody has quit [Ping timeout: 260 seconds]
eckhardt has joined #ruby
cpruitt has joined #ruby
<havenwood> garyserj: It looks like Bailador is a Perl 6 option: https://github.com/Bailador/Bailador#readme
<havenwood> garyserj: I'd vote Roda between those. ;-)
<havenwood> You compose the framework you need with Roda by just enabling relevant plugins.
nfsnobody has joined #ruby
vutral|kali has joined #ruby
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
<havenwood> Speaking of which... would four people here please star Roda on Github!! A fork with fewer than 1,000 stars doesn't get properly indexed on Github. >.>
gary_ has joined #ruby
gary_ is now known as Guest74681
<havenwood> garyserj: This is Roda's garden of plugins: https://github.com/jeremyevans/roda/tree/master/lib/roda/plugins
<havenwood> garyserj: It's just a routing tree, and you add the plugins you actually need to compose the framework for your project.
<havenwood> garyserj: (There's a #roda channel for Roda and #sinatra for Sinatra as well.)
<havenwood> They're both very well maintained.
Psybur_ has joined #ruby
<tbuehlmann> havenwood: have my star!
guille-moe has joined #ruby
larissa has quit [Quit: bye]
Guest74681 has quit [Ping timeout: 248 seconds]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Psybur has quit [Ping timeout: 276 seconds]
cabotto has quit [Remote host closed the connection]
<dminuoso> havenwood: but
yohji has quit [Remote host closed the connection]
<dminuoso> havenwood: that required like
<dminuoso> writing code.
dinfuehr has joined #ruby
anisha_ has quit [Quit: This computer has gone to sleep]
kies has quit [Ping timeout: 252 seconds]
<havenwood> dminuoso: That does often seem to be the choice, spend time 1) debugging the *just works* automagical code, or 2) writing code.
<dminuoso> havenwood: By debugging you mean posting in IRC and Stackoverflow until someone tells you how to fix it right?
n0m4d1c has quit [Remote host closed the connection]
<havenwood> dminuoso: Yes. Ask in IRC every 30 minutes but disconnect immediately after asking and never read backlogs.
<dminuoso> Anyway. After 2 days of debugging a bug that caused my Automaton to produce garbage result...
<dminuoso> I finally nailed it to.. guess what - an off-by-one error in the one function I thought "I dont need a test for this, I formally proved correctness in my head"
char_var[buffer] has joined #ruby
n0m4d1c has joined #ruby
n0m4d1c has quit [Remote host closed the connection]
willmichael has joined #ruby
sumobob has quit [Read error: Connection reset by peer]
vutral|kali_ has joined #ruby
vutral|kali has quit [Ping timeout: 240 seconds]
karapetyan has quit [Remote host closed the connection]
clemens3 has quit [Ping timeout: 255 seconds]
larissa has joined #ruby
armyriad has joined #ruby
moei has joined #ruby
vutral|kali_ has quit [Ping timeout: 255 seconds]
sumobob_ has joined #ruby
anisha_ has joined #ruby
alex`` has quit [Quit: WeeChat 2.0.1]
alex`` has joined #ruby
beauby has quit [Ping timeout: 248 seconds]
n0m4d1c has joined #ruby
vutral|kali has joined #ruby
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
beauby has joined #ruby
mikecmpbll has joined #ruby
ramfjord has joined #ruby
n0m4d1c has quit [Remote host closed the connection]
gary has joined #ruby
n0m4d1c has joined #ruby
gary is now known as Guest2704
marxarelli|afk is now known as marxarelli
bigblind has quit [Ping timeout: 256 seconds]
n0m4d1c has quit [Remote host closed the connection]
lytol has joined #ruby
karapetyan has joined #ruby
beauby has quit [Ping timeout: 276 seconds]
devil_tux has quit [Ping timeout: 256 seconds]
alfiemax has quit [Read error: Connection reset by peer]
anisha_ has quit [Quit: Leaving]
sol__ has joined #ruby
alfiemax has joined #ruby
Guest2704 has quit [Ping timeout: 255 seconds]
devil_tux has joined #ruby
cabotto has joined #ruby
karapetyan has quit [Ping timeout: 276 seconds]
clemens3 has joined #ruby
sol__ has left #ruby [#ruby]
anisha has joined #ruby
anisha has quit [Remote host closed the connection]
alfiemax_ has joined #ruby
cabotto has quit [Ping timeout: 240 seconds]
n008f4g_ has joined #ruby
n0m4d1c has joined #ruby
cabotto has joined #ruby
rocx has quit [Ping timeout: 252 seconds]
alfiemax has quit [Ping timeout: 256 seconds]
n0m4d1c has quit [Remote host closed the connection]
vutral|kali_ has joined #ruby
jamesaxl has quit [Read error: Connection reset by peer]
vutral|kali_ has quit [Read error: Connection reset by peer]
vutral|kali has quit [Ping timeout: 264 seconds]
jamesaxl has joined #ruby
netherwolfe has joined #ruby
Nicmavr has joined #ruby
rocx has joined #ruby
Nicmavr is now known as Guest32855
tomphp has joined #ruby
cabotto has quit [Ping timeout: 256 seconds]
n0m4d1c has joined #ruby
mcr1 has joined #ruby
cabotto has joined #ruby
karapetyan has joined #ruby
roshanavand has joined #ruby
vutral|kali has joined #ruby
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
kies has joined #ruby
karapetyan has quit [Ping timeout: 252 seconds]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #ruby
cagomez has quit [Remote host closed the connection]
bmurt has joined #ruby
cagomez has joined #ruby
willmichael has quit [Read error: Connection reset by peer]
willmichael has joined #ruby
cabotto has quit [Ping timeout: 276 seconds]
vutral|kali has quit [Ping timeout: 256 seconds]
cabotto has joined #ruby
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
vutral|kali has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
apeiros has joined #ruby
gary_ has joined #ruby
gary_ is now known as Guest82994
bigblind has joined #ruby
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
morenoh149 has quit [Ping timeout: 260 seconds]
Guest82994 has quit [Ping timeout: 256 seconds]
cabotto has quit [Remote host closed the connection]
n0m4d1c has quit [Remote host closed the connection]
mtkd has quit []
cabotto has joined #ruby
cabotto has quit [Client Quit]
cdg has quit [Remote host closed the connection]
krawchyk has quit [Quit: krawchyk]
tomphp has joined #ruby
mtkd has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jaruga has quit [Quit: jaruga]
ldepandis has joined #ruby
SeepingN has joined #ruby
buyfn has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
cagomez has quit [Remote host closed the connection]
krawchyk has joined #ruby
cthulchu has quit [Read error: Connection reset by peer]
LocaMocha has quit [Ping timeout: 256 seconds]
workmad3 has quit [Ping timeout: 248 seconds]
Asher has quit [Quit: Leaving.]
n0m4d1c has joined #ruby
Asher has joined #ruby
\void has joined #ruby
workmad3 has joined #ruby
krawchyk has quit [Quit: krawchyk]
morenoh149 has joined #ruby
dyyylan has joined #ruby
n0m4d1c has quit [Remote host closed the connection]
vutral|kali has quit [Ping timeout: 252 seconds]
vutral|kali has joined #ruby
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
gary has joined #ruby
theSolTrain has joined #ruby
gary is now known as Guest29956
morenoh149 has quit [Ping timeout: 256 seconds]
alfiemax_ has quit [Remote host closed the connection]
buyfn has quit [Remote host closed the connection]
buyfn has joined #ruby
alfiemax has joined #ruby
Guest29956 has quit [Ping timeout: 240 seconds]
theSolTrain has quit [Ping timeout: 248 seconds]
cthulchu has joined #ruby
devil_tux has quit [Ping timeout: 240 seconds]
devil_tu1 has quit [Ping timeout: 256 seconds]
guille-moe has quit [Ping timeout: 265 seconds]
alfiemax has quit [Ping timeout: 240 seconds]
nowhereman_ has quit [Ping timeout: 256 seconds]
pastorinni has quit [Ping timeout: 248 seconds]
nadir has joined #ruby
nowhere_man has joined #ruby
<dminuoso> Folks, do you consider integers real objects?
<dminuoso> >> 1.singleton_class
<ruby[bot]> dminuoso: # => can't define singleton (TypeError) ...check link for more (https://eval.in/960482)
ecuanaso has joined #ruby
<dminuoso> Guess it boils down to what one means by "is it an object"
Pisuke has quit [Read error: Connection reset by peer]
morenoh149 has joined #ruby
Pisuke has joined #ruby
cpruitt has quit []
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
segy has quit [Ping timeout: 256 seconds]
buyfn has left #ruby ["Textual IRC Client: www.textualapp.com"]
ramfjord has quit [Ping timeout: 240 seconds]
discopatrick has quit [Quit: Connection closed for inactivity]
vutral|kali has quit [Ping timeout: 256 seconds]
Dimik has joined #ruby
jrafanie has joined #ruby
Psybur_ has quit [Ping timeout: 256 seconds]
ramfjord has joined #ruby
apricant_ has quit [Remote host closed the connection]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
adlerdias has quit [Quit: adlerdias]
<rubycoder38> any ideas how I can refactor this code? https://gist.github.com/anonymous/8e7d5886efea16172e1cbca8a1507b98
ramfjord has quit [Ping timeout: 240 seconds]
<rubycoder38> my #create method creates the transaction and #broadcast broadcasts it
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<apeiros> rubycoder38: I guess I'd factor out the http post part
marr has joined #ruby
<apeiros> and parametrize it with method & params
synthroid has quit []
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<apeiros> i.e.: `def create(to, amount); api_post "payto", destination: to, amount: amount, password: @wallet_password; end
<apeiros> `
griffindy has joined #ruby
<apeiros> and `def broadcast(to, amount); api_post 'broadcast', tx: result['hex']; end`
<apeiros> oh, forgot a line there to get `result`
<rubycoder38> apeiros: nice, thanks for your nice idea
<apeiros> and an if, though that should IMO have an explicit else.
vutral|kali has joined #ruby
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
ecuanaso has joined #ruby
Mike11 has joined #ruby
gary_ has joined #ruby
dionysus69 has quit [Quit: dionysus69]
gary_ is now known as Guest76146
bmurt has joined #ruby
bmurt has quit [Client Quit]
Guest76146 has quit [Ping timeout: 276 seconds]
griffindy has quit [Quit: Textual IRC Client: www.textualapp.com]
sumobob_ has quit [Ping timeout: 276 seconds]
bmurt has joined #ruby
sameerynho has joined #ruby
cagomez_ has joined #ruby
reber has quit [Remote host closed the connection]
Mike111 has joined #ruby
Mike111 has quit [Client Quit]
Mike11 has quit [Ping timeout: 256 seconds]
phaul has joined #ruby
alfiemax has joined #ruby
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alfiemax has quit [Ping timeout: 276 seconds]
Guest32855 has quit [Changing host]
Guest32855 has joined #ruby
sumobob_ has joined #ruby
Guest32855 is now known as Nicmavr
bonhoeffer has joined #ruby
cdg has joined #ruby
shinnya has joined #ruby
drewmcmillan has joined #ruby
tomphp has joined #ruby
alfiemax has joined #ruby
tomphp has quit [Client Quit]
gary has joined #ruby
kiltzman has quit [Ping timeout: 256 seconds]
gary is now known as Guest55141
phaul has quit [Quit: WeeChat 2.0.1]
kiltzman has joined #ruby
kiltzman has quit [Max SendQ exceeded]
andygeorge has quit []
kiltzman has joined #ruby
kiltzman has quit [Max SendQ exceeded]
kiltzman has joined #ruby
alfiemax has quit [Ping timeout: 268 seconds]
Guest55141 has quit [Ping timeout: 256 seconds]
vutral|kali has quit [Ping timeout: 260 seconds]
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
vutral|kali has joined #ruby
mrBen2k2k2k__ has quit [Ping timeout: 256 seconds]
bonhoeffer has quit [Ping timeout: 260 seconds]
segy has joined #ruby
vutral|kali has quit [Ping timeout: 260 seconds]
Mike11 has joined #ruby
alfiemax has joined #ruby
mistergibson has joined #ruby
<rubycoder38> I don't like this if command == "payto"
<rubycoder38> I've been brainwashed by sandi metz, ffs!
<apeiros> that's one of the things I suggested to parametrize. then you wouldn't need it.
<apeiros> gimme a sec
<rubycoder38> apeiros: thanks
<apeiros> btw., you can just update your old gist. then we can see the revisions.
<rubycoder38> oh
anjen has joined #ruby
alfiemax has quit [Ping timeout: 256 seconds]
troulouliou_div2 has joined #ruby
<apeiros> though probably it'd be better to just make params a required kwarg
troulouliou_div2 has quit [Changing host]
troulouliou_div2 has joined #ruby
guacamole has joined #ruby
guacamole has joined #ruby
guacamole has quit [Changing host]
\void has quit [Remote host closed the connection]
miskatonic has joined #ruby
nowhere_man has quit [Ping timeout: 255 seconds]
\void has joined #ruby
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
vutral|kali has joined #ruby
\void has quit [Client Quit]
anjen has quit [Quit: anjen]
<rubycoder38> nice
phaul has joined #ruby
<rubycoder38> apeiros: thanks a lot!
Gnut has joined #ruby
vutral|kali has quit [Ping timeout: 240 seconds]
<Gnut> Is there a way to create an instance method used for sorting an array of the object
cagomez_ has quit [Remote host closed the connection]
cagomez has joined #ruby
<Gnut> e.g. I have an array of objects and when i call sort on them, I want them to be sorted using a sort method i specify in the class
despai has joined #ruby
vutral|kali has joined #ruby
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
<apeiros> Gnut: sort uses <=>
ramfjord has joined #ruby
<apeiros> and if you define <=>, it's a good idea to include Comparable
<Gnut> aperios: That's a mixin?
<apeiros> ?tabnick Gnut
<ruby[bot]> Gnut: pro-tip - use tab completion for nicks. avoids typos in nicks.
eckhardt has joined #ruby
<apeiros> yes, that's a module. you can only include modules.
cagomez has quit [Ping timeout: 240 seconds]
* dminuoso accepts apeiros' challenge
<Gnut> son-of-a-gun, irssi has auto-completion :the_more_ya_know:
* apeiros feels dminuoso fiddling around
<apeiros> (pun intended)
<Gnut> apeiros: Thanks, that's exactly what i'm looking for
* dminuoso . o O (pun already understood)
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<apeiros> dminuoso: that was more a collateral announcement. from you I expected to understand :D
<apeiros> Gnut: for more complex comparisons, sort and sort_by both take a block
gary_ has joined #ruby
gary_ is now known as Guest96384
despai has quit [Quit: ...]
cdg_ has joined #ruby
rwb has quit [Ping timeout: 240 seconds]
alex`` has quit [Ping timeout: 256 seconds]
Guest96384 has quit [Ping timeout: 240 seconds]
cdg has quit [Ping timeout: 276 seconds]
pastorinni has joined #ruby
alfiemax has joined #ruby
vutral|kali has quit [Ping timeout: 240 seconds]
vutral|kali has joined #ruby
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
ecuanaso has joined #ruby
marr has quit [Ping timeout: 248 seconds]
marr has joined #ruby
alfiemax has quit [Ping timeout: 240 seconds]
remix2000 has quit [Ping timeout: 240 seconds]
clemens3 has quit [Ping timeout: 240 seconds]
lagweezl1_away is now known as lagweezle
miskatonic has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
lagweezle has left #ruby [#ruby]
despai has joined #ruby
eckhardt_ has joined #ruby
nowhere_man has joined #ruby
willmichael has quit [Ping timeout: 256 seconds]
eckhardt has quit [Ping timeout: 276 seconds]
cagomez has joined #ruby
cdg_ has quit [Remote host closed the connection]
willmichael has joined #ruby
vutral|kali has quit [Ping timeout: 256 seconds]
vutral|kali has joined #ruby
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
orbyt_ has joined #ruby
cagomez has quit [Ping timeout: 260 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
ldepandis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
vutral|kali has quit [Ping timeout: 264 seconds]
amatas has quit [Quit: amatas]
gary has joined #ruby
gary is now known as Guest43237
alfiemax has joined #ruby
despai has quit [Quit: ...]
_aeris_ has quit [Ping timeout: 255 seconds]
jeffreylevesque_ has joined #ruby
Guest43237 has quit [Ping timeout: 256 seconds]
<Gnut> Probably more of a philosophical question, but where should I put my object instantiation methods?
_aeris_ has joined #ruby
alfiemax has quit [Ping timeout: 264 seconds]
<apeiros> Gnut: I don't get your question
<Gnut> e.g. I have a class called `Guest` and i have a method that creates Guest objects based off a puppet query
<Gnut> It doesn't feel like it belongs in the class since how I create those guests shouldn't be tied to the behavior of the Guests
jeffreylevesque has quit [Ping timeout: 276 seconds]
<apeiros> sounds like you should have a class handling your puppet queries
jcalla has quit [Quit: Leaving]
<apeiros> but it's a bit too little information to make any meaningful statement
<apeiros> and I got to go. there are certainly others around who can help. good night :)
cagomez has joined #ruby
xelkarin has joined #ruby
jeffreylevesque_ has quit [Ping timeout: 268 seconds]
drewmcmillan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
\void has joined #ruby
mtkd has quit []
bijan_ has joined #ruby
bijan_ is now known as bijan_awaaaay
_aeris_ has quit [Remote host closed the connection]
_aeris_ has joined #ruby
<Gnut> apeiros: Thanks, that's how i figured i'd do it. Just didn't know if i should add another module to the Guest class.
remix2000 has joined #ruby
prutheus has joined #ruby
<prutheus> Hello. I have two arrays a = [[1,2],[3,4]] and b = [[5,6],[7,8]] and need a function which converts them to c = [[1,2,5,6],[3,4,7,8]]
<prutheus> any ideas?
<dminuoso> prutheus: zip and flatten
<prutheus> hm and how combined? i dont get it
<dminuoso> >> [[1,2],[3,4]].zip [[5,6],[7,8]]
<ruby[bot]> dminuoso: # => [[[1, 2], [5, 6]], [[3, 4], [7, 8]]] (https://eval.in/960494)
<dminuoso> prutheus: Ill let you figure out the rest.
<prutheus> yeah
<dminuoso> or rather
<dminuoso> well
<prutheus> i dont get the rest, that is the problem :/
kireevco has joined #ruby
<dminuoso> prutheus: I see.
<prutheus> not at least without a loop
<dminuoso> prutheus: How do you turn [[1,2],[3,4]] into [1,2,3,4] ?
<Radar> >> [[1,2],[3,4]].zip([[5,6],[7,8]]).map(&:flatten)
<ruby[bot]> Radar: # => [[1, 2, 5, 6], [3, 4, 7, 8]] (https://eval.in/960495)
<Radar> ?next
<dminuoso> ruby[bot]: Shhh!
* dminuoso spanks Radar
<ruby[bot]> Radar: I don't know anything about next
<dminuoso> Hah
<Radar> ruby[bot]: I don't even know why I bother.
<prutheus> oh yeah i forget the map function so often :/
<dminuoso> prutheus: Whenever you want to interact with the elements inside, you use `map`
<Radar> prutheus: it's a loop, technically
karapetyan has joined #ruby
<dminuoso> prutheus: `map` basically takes a function, and applies it to every element inside the list, and returns the new list.
<prutheus> yeah but not like i meant it
<prutheus> i know
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rwb has joined #ruby
prutheus has quit [Quit: Page closed]
snath has quit [Ping timeout: 256 seconds]
goatish has joined #ruby
karapetyan has quit [Ping timeout: 265 seconds]
devil_tux has joined #ruby
devil_tu1 has joined #ruby
gary has joined #ruby
gary is now known as Guest58107
beauby has joined #ruby
<havenwood> Just an aside, but funny non-map solution taking advantage of zip's weird block form: result = []; a.zip(b) { |a, b| result << a + b }; result
Asher has quit [Quit: Leaving.]
<dminuoso> What?
<dminuoso> havenwood: HOnestly, when I started reading I kind of expected some lazy enum answer.
<dminuoso> Was a bit disappointed.
<havenwood> dminuoso: i'd have provided one if #zip wasn't so odd
sparr has joined #ruby
drewmcmillan has joined #ruby
sparr has quit [Changing host]
sparr has joined #ruby
Guest58107 has quit [Ping timeout: 276 seconds]
dogweather has quit []
beauby has quit [Ping timeout: 264 seconds]
sparr has quit [Client Quit]
sparr has joined #ruby
sparr has quit [Changing host]
sparr has joined #ruby
Asher has joined #ruby
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
drewmcmillan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
ramfjord has quit [Ping timeout: 276 seconds]
alfiemax has joined #ruby
ramfjord has joined #ruby
Mike11 has quit [Quit: Leaving.]
<cagomez> is it bad practice to curry an object instantiation?
_aeris_ has quit [Remote host closed the connection]
alfiemax has quit [Ping timeout: 248 seconds]
_aeris_ has joined #ruby
bijan_awaaaay is now known as bijan_
ramfjord has quit [Ping timeout: 264 seconds]
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ramfjord has joined #ruby
willmichael has quit [Ping timeout: 256 seconds]
willmichael has joined #ruby
JoshS has quit [Ping timeout: 268 seconds]
tcopeland has quit [Quit: tcopeland]
jrafanie has quit [Ping timeout: 268 seconds]
sumobob_ has quit [Ping timeout: 256 seconds]
snath has joined #ruby
xfbs has joined #ruby
gary_ has joined #ruby
gary_ is now known as Guest96893
goatish has quit [Quit: bye]
xfbs has quit [Max SendQ exceeded]
xfbs has joined #ruby
pastorin_ has joined #ruby
pastorinni has quit [Ping timeout: 256 seconds]
Guest96893 has quit [Ping timeout: 268 seconds]
safetypin has quit [Ping timeout: 260 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
morenoh149 has quit [Ping timeout: 240 seconds]
jamesaxl has quit [Quit: WeeChat 2.0.1]
hahuang65 has quit [Quit: WeeChat 2.0.1]
AgentVenom has quit [Quit: Textual IRC Client: www.textualapp.com]
Psybur_ has joined #ruby
sumobob_ has joined #ruby
mitt3ns has joined #ruby
<dminuoso> cagomez: What does that mean
<dminuoso> cagomez: Do you mean a curried function that will eventually produce an object?
<dminuoso> NO.
<dminuoso> Currying is a good thing. The fact that Ruby makes it kind of hard and annoying is a sad fact.
<dminuoso> I generally curry all my lambdas.
<cagomez> scratch that ^. I have a class with keyword arguments, and need to add another argument. is there a way to add the new arg without it also being required?
<dminuoso> cagomez: Ruby allows you to define optional parameters.
agent_white has quit [Ping timeout: 265 seconds]
\void has quit [Quit: So long, and thanks for all the fish.]
moei has quit [Quit: Leaving...]
sunrunner20 has quit [Quit: So Long and Thanks for All the fish]
alfiemax has joined #ruby
Psybur__ has joined #ruby
mitt3ns has quit [Ping timeout: 252 seconds]
morenoh149 has joined #ruby
jnollette has quit [Ping timeout: 255 seconds]
alfiemax has quit [Ping timeout: 256 seconds]
Psybur_ has quit [Ping timeout: 264 seconds]
guacamole has joined #ruby
guacamole has joined #ruby
guacamole has quit [Changing host]
bijan_ has quit [Quit: System has gone to sleep. ZZZzzz…]
Xeago has quit [Ping timeout: 265 seconds]
morenoh149 has quit [Ping timeout: 256 seconds]
mitt3ns has joined #ruby
ldnunes has quit [Quit: Leaving]
Xeago has joined #ruby
zapata has joined #ruby
gary has joined #ruby
gary is now known as Guest63637
jnollette has joined #ruby
sumobob_ has quit [Ping timeout: 252 seconds]
jeffreylevesque has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
netherwolfe has quit [Ping timeout: 256 seconds]
Guest63637 has quit [Ping timeout: 240 seconds]
elphe has joined #ruby
orbyt_ has joined #ruby
orbyt_ has quit [Client Quit]
ResidentBiscuit has joined #ruby
minimalism has quit [Quit: minimalism]
sanscoeu_ has joined #ruby