baweaver changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.5.1, 2.4.4, 2.3.7, 2.6.0-preview2: https://www.ruby-lang.org | Paste 4+ lines of text to https://gist.github.com | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
apeiros has joined #ruby
jcarl43 has quit [Quit: WeeChat 2.2]
apeiros has quit [Ping timeout: 268 seconds]
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
ivanskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mistergibson has joined #ruby
alfiemax_ has joined #ruby
alfiemax has quit [Read error: Connection reset by peer]
ivanskie has joined #ruby
cagomez has quit [Remote host closed the connection]
cagomez has joined #ruby
cagomez has quit [Ping timeout: 248 seconds]
Freshnuts has joined #ruby
apeiros has joined #ruby
apeiros has quit [Ping timeout: 260 seconds]
chouhoulis has joined #ruby
alem0lars has quit [Quit: Leaving]
venmx has quit [Ping timeout: 256 seconds]
apeiros has joined #ruby
codymj has quit [Quit: Leaving]
apeiros has quit [Ping timeout: 240 seconds]
chouhoulis has quit [Ping timeout: 256 seconds]
chouhoulis has joined #ruby
apeiros has joined #ruby
apeiros has quit [Ping timeout: 244 seconds]
m27frogy has quit [Ping timeout: 248 seconds]
m27frogy has joined #ruby
apeiros has joined #ruby
apeiros has quit [Ping timeout: 240 seconds]
m27frogy has quit [Ping timeout: 264 seconds]
m27frogy has joined #ruby
white_lilies has joined #ruby
dstrunk has joined #ruby
SeepingN has joined #ruby
chouhoulis has quit [Remote host closed the connection]
agent_white has quit [Quit: brb]
AndroidKitKat is now known as androidkitt
za1b1tsu has joined #ruby
dstrunk has quit [Read error: Connection reset by peer]
Puffball has quit [Quit: Puffball]
androidkitt has quit []
stewp has quit [Remote host closed the connection]
agent_white has joined #ruby
za1b1tsu has quit [Ping timeout: 264 seconds]
apeiros has joined #ruby
bmurt has joined #ruby
AndroidKitKat has joined #ruby
Puffball has joined #ruby
apeiros has quit [Ping timeout: 244 seconds]
white_lilies has quit [Ping timeout: 268 seconds]
diego1 has joined #ruby
scrptktty has quit [Quit: Connection closed for inactivity]
dviola is now known as Guest66205
diego1 is now known as dviola
Guest66205 has quit [Quit: WeeChat 2.2]
apeiros has joined #ruby
tdy has quit [Ping timeout: 256 seconds]
apeiros has quit [Ping timeout: 256 seconds]
meinside has quit []
wilbert has joined #ruby
meinside has joined #ruby
alfiemax_ has quit [Ping timeout: 244 seconds]
Freshnuts has quit [Ping timeout: 260 seconds]
Freshnuts has joined #ruby
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
krawchyk has joined #ruby
AndroidKitKat has quit [Quit: Got ZNC?]
redlegion has quit [Max SendQ exceeded]
xenops has quit [Ping timeout: 245 seconds]
redlegion has joined #ruby
Tempesta has joined #ruby
apeiros has joined #ruby
kapil___ has joined #ruby
ivanskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cadillac_ has quit [Quit: I quit]
cadillac_ has joined #ruby
apeiros has quit [Ping timeout: 268 seconds]
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
white_lilies has joined #ruby
AndroidKitKat has joined #ruby
braincrash has quit [Quit: bye bye]
braincrash has joined #ruby
Sainfuw has quit []
za1b1tsu has joined #ruby
wilbert has quit [Ping timeout: 240 seconds]
apeiros has joined #ruby
gnufied has quit [Quit: Leaving]
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
apeiros has quit [Ping timeout: 240 seconds]
krawchyk has quit [Quit: krawchyk]
apeiros has joined #ruby
apeiros has quit [Ping timeout: 256 seconds]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tdy has joined #ruby
redlegion has quit [Remote host closed the connection]
redlegion has joined #ruby
scrptktty has joined #ruby
dellavg has joined #ruby
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
apeiros has joined #ruby
apeiros has quit [Ping timeout: 264 seconds]
dellavg has quit [Ping timeout: 248 seconds]
Freshnuts has quit [Remote host closed the connection]
Freshnuts has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
Freshnuts has quit [Max SendQ exceeded]
Freshnuts has joined #ruby
apeiros has joined #ruby
apeiros has quit [Ping timeout: 256 seconds]
SeepingN has joined #ruby
howdoi has joined #ruby
reber has joined #ruby
sagax has joined #ruby
<sagax> hi all!
apeiros has joined #ruby
white_lilies has quit [Ping timeout: 240 seconds]
<sagax> in "rake" we have operator "namespace"
<sagax> but what in? just syntax sugar, pseudo code?
cadillac_ has quit [Ping timeout: 256 seconds]
apeiros has quit [Ping timeout: 240 seconds]
cadillac_ has joined #ruby
ur5us has quit [Remote host closed the connection]
apeiros has joined #ruby
<Radar> sagax: I don't understand your questions.
<sagax> https://gist.github.com/noonat/1649543 237 line and below
<sagax> we have "namespace"
<sagax> it's syntax sugar, pseudo code, rake dsl?
<Radar> rake method
Puffball has quit [Read error: Connection reset by peer]
apeiros has quit [Remote host closed the connection]
Eiam has quit [Ping timeout: 260 seconds]
jp has quit [Ping timeout: 240 seconds]
jp has joined #ruby
sauvin has joined #ruby
conta has joined #ruby
za1b1tsu has quit [Ping timeout: 248 seconds]
tcurdt has quit [Ping timeout: 265 seconds]
jokke1 has quit [Ping timeout: 256 seconds]
jokke1 has joined #ruby
\void has quit [Quit: So long, and thanks for all the fish.]
akaiiro has quit [Ping timeout: 268 seconds]
dviola has quit [Quit: WeeChat 2.2]
bak1an has joined #ruby
jp has joined #ruby
apeiros has joined #ruby
snickers has joined #ruby
biberu has joined #ruby
p4p0l0 has joined #ruby
<arahael> I'm trying to run some ruby code, and it say: Ignoring ffi-1.9.21 because its extensions are not built. Try: gem pristine ffi --version 1.9.21
<arahael> But when I do, nothing changes.
<sagax> when {"a": "b"} i got {:a=>"b"}
<sagax> when {"a" => "b"} i got {"a"=>"b"}
<sagax> strange
<arahael> I'm on a fairly old ruby (2.3.3, actually), but I expect to be able to *install* ffi, and then to be able to *use* ffi, or to have a different error.
za1b1tsu has joined #ruby
sinclair has joined #ruby
<sinclair> hi all, i have a general ruby question
<sinclair> changed = changed | (fields[:bar] != foo.bar)
<sinclair> just curious about the meaning of | in this line.
moei has quit [Quit: Leaving...]
za1b1tsu has quit [Ping timeout: 248 seconds]
za1b1tsu has joined #ruby
moei has joined #ruby
alfiemax has joined #ruby
scrptktty has quit [Quit: Connection closed for inactivity]
lytol_ has joined #ruby
alfiemax has quit [Ping timeout: 260 seconds]
<havenwood> sinclair: what is?: changed
<sinclair> havenwood: a boolean
<havenwood> sinclair: TrueClass#| and FalseClass#| methods
<havenwood> sinclair: On true, it returns: true
<havenwood> sinclair: On false, it returns `true`, unless the argument is falsey (false or nil)
<havenwood> >> false | nil
<ruby[bot]> havenwood: # => false (https://eval.in/1041954)
<havenwood> sinclair: The docs point out a way it differs from logical or: https://docs.ruby-lang.org/en/2.5.0/TrueClass.html#method-i-7C
cagomez has joined #ruby
venmx has joined #ruby
cagomez has quit [Ping timeout: 268 seconds]
Tempesta has quit [Quit: See ya!]
crankharder has joined #ruby
crankharder has quit [Ping timeout: 248 seconds]
quobo has quit [Quit: Connection closed for inactivity]
schneider has joined #ruby
<apeiros> sagax: why is that strange?
yohji has joined #ruby
schneider has quit [Client Quit]
p4p0l0 has quit [Remote host closed the connection]
akaiiro has joined #ruby
TomyWork has joined #ruby
* apeiros will be back in a bit
apeiros has quit []
SeepingN has quit [Quit: The system is going down for reboot NOW!]
<havenwood> >> :"a".class # sagax
<ruby[bot]> havenwood: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
<havenwood> #=> Symbol
<havenwood> :a == :"a"
<havenwood> #=> true
apeiros_ has joined #ruby
akaiiro has quit [Ping timeout: 260 seconds]
lxsameer has joined #ruby
redlegion has quit [Max SendQ exceeded]
deathwishdave has joined #ruby
redlegion has joined #ruby
apeiros_ has quit [Read error: Connection reset by peer]
conta has quit [Read error: Connection reset by peer]
mikecmpbll has joined #ruby
sysvalve has joined #ruby
quobo has joined #ruby
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
apeiros_ has joined #ruby
conta has joined #ruby
nertzy has joined #ruby
venmx has quit [Ping timeout: 248 seconds]
za1b1tsu has quit [Ping timeout: 244 seconds]
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
sameerynho has joined #ruby
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
Freshnuts has quit [Quit: Leaving]
dr3w_ has joined #ruby
psychicist__ has joined #ruby
TinkerT has quit [Read error: Connection reset by peer]
za1b1tsu has joined #ruby
DTZUZO has quit [Ping timeout: 244 seconds]
Beams has joined #ruby
cadillac_ has quit [Ping timeout: 256 seconds]
cadillac_ has joined #ruby
konsolebox has joined #ruby
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
conta has quit [Quit: conta]
deathwishdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
deathwishdave has joined #ruby
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
alfiemax has joined #ruby
alfiemax has quit [Ping timeout: 264 seconds]
sarna has joined #ruby
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
lxsameer has quit [Read error: Connection reset by peer]
lxsameer has joined #ruby
sameerynho has quit [Ping timeout: 248 seconds]
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
agent_white has quit [Quit: gnight]
c0ncealed2 has quit [Remote host closed the connection]
c0ncealed2 has joined #ruby
wget has quit [Ping timeout: 245 seconds]
xuyuheng has joined #ruby
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
za1b1tsu has quit [Ping timeout: 255 seconds]
cliluw has quit [Read error: Connection reset by peer]
apeiros_ has quit []
postmodern has quit [Quit: Leaving]
kapil___ has quit [Quit: Connection closed for inactivity]
jottr has joined #ruby
za1b1tsu has joined #ruby
apeiros_ has joined #ruby
cadillac_ has quit [Ping timeout: 248 seconds]
banisterfiend has joined #ruby
kapil___ has joined #ruby
redlegion has quit [Max SendQ exceeded]
Dbugger has joined #ruby
redlegion has joined #ruby
xuyuheng has quit [Ping timeout: 265 seconds]
xuyuheng has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
<sarna> hey, is Poignant Guide to Ruby still a good resource?
sagax has quit [Remote host closed the connection]
<TheBrayn> I don't think it has ever been a good resource but that's just from my personal experience
sleetdrop has joined #ruby
bak1an has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Mike11 has joined #ruby
banisterfiend has quit [Ping timeout: 264 seconds]
beefjoe has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
<sarna> TheBrayn: oh well. which resources would you recommend then? I'm not really interested in rails, if that matters
Nicmavr has joined #ruby
<TheBrayn> do you already know other programming languages?
beefjoe has quit [Ping timeout: 240 seconds]
<sarna> yeah
<TheBrayn> I learned ruby by using ruby koans
<TheBrayn> and then reading the documentation and code
<sarna> I see
kaia has quit [Ping timeout: 256 seconds]
AJA4350 has joined #ruby
g- has joined #ruby
venmx has joined #ruby
jcalla has joined #ruby
bak1an has joined #ruby
jackrandom has joined #ruby
Mike11 has quit [Ping timeout: 240 seconds]
jackrandom has quit [Client Quit]
jackrandom has joined #ruby
jackrandom has quit [Client Quit]
DoubleMalt has joined #ruby
DoubleMalt has quit [Read error: Connection reset by peer]
clemens3 has joined #ruby
sagax has joined #ruby
biberu has quit []
beefjoe has joined #ruby
beefjoe has quit [Remote host closed the connection]
sleetdrop has quit [Quit: Computer has gone to sleep.]
biberu has joined #ruby
snickers has quit [Quit: Textual IRC Client: www.textualapp.com]
DTZUZO has joined #ruby
zeffy has quit [Ping timeout: 256 seconds]
crankharder has joined #ruby
bmurt has joined #ruby
p4p0l0 has joined #ruby
sysvalve has quit [Ping timeout: 256 seconds]
sysvalve has joined #ruby
xuyuheng has quit [Ping timeout: 240 seconds]
sleetdrop has joined #ruby
conta1 has joined #ruby
sameerynho has joined #ruby
sameerynho is now known as Guest56528
lxsameer has quit [Ping timeout: 264 seconds]
za1b1tsu has quit [Ping timeout: 256 seconds]
biberu has quit []
Cthulu201 is now known as _Cthulu201
Mike11 has joined #ruby
tty has quit [Quit: tty]
beefjoe has joined #ruby
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
jcalla has quit [Ping timeout: 256 seconds]
Puffball has joined #ruby
p4p0l0 has quit [Remote host closed the connection]
jcalla has joined #ruby
akaiiro has joined #ruby
gnufied has joined #ruby
nertzy has quit [Read error: Connection reset by peer]
apeiros_ has quit []
krawchyk has joined #ruby
jackrandom has joined #ruby
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
krawchyk has quit [Quit: krawchyk]
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
<cjohnson> In ruby, I have a string "foo", and I'm declaring a hash like this: {foo: 'bar'}
<cjohnson> How can I make the key of that hash be dynamic based on the value of a variable
<bougyman> I don't understand the question.
<bougyman> you have a string "foo" as a variable?
chouhoulis has joined #ruby
<bougyman> If so, you could do { foovar.to_sym => 'bar' }
<cjohnson> Yes that, thanks
<cjohnson> Is foovar.to_sym: 'bar' the same?
<cjohnson> I can never quite remember the difference
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
sleetdrop has quit [Quit: Computer has gone to sleep.]
rippa has joined #ruby
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
krawchyk has joined #ruby
<havenwood> cjohnson: Nope, you can only use the colon-on-the-right syntax with Symbol keys.
<havenwood> cjohnson: For all other keys, the Hash rocket `=>` is the only way.
<havenwood> cjohnson: Symbol literal keys*
<cjohnson> "hash rocket" haha
apeiros_ has joined #ruby
cagomez has joined #ruby
cagomez has quit [Read error: Connection reset by peer]
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
<sagax> hi
troys has joined #ruby
<sagax> i am looking for examples about rdoc syntax to definition method/class/etc
biberu has joined #ruby
conta1 has quit [Quit: conta1]
Dbugger has quit [Remote host closed the connection]
biberu has quit [Client Quit]
biberu has joined #ruby
sameerynho has joined #ruby
sameerynho has quit [Client Quit]
lxsameer has joined #ruby
lxsameer has quit [Client Quit]
dr3w_ has joined #ruby
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
lxsameer has joined #ruby
lxsameer has quit [Client Quit]
lxsameer has joined #ruby
xuyuheng has joined #ruby
TomyWork has quit [Remote host closed the connection]
Tempesta has joined #ruby
xuyuheng has quit [Ping timeout: 256 seconds]
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
jcarl43 has joined #ruby
krawchyk has quit [Quit: krawchyk]
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
ivanskie has joined #ruby
alfiemax has joined #ruby
alfiemax has quit [Remote host closed the connection]
beowuff has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
xuyuheng has joined #ruby
Beams has quit [Quit: .]
bak1an has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alem0lars has joined #ruby
lunarkitty7 has quit [Ping timeout: 265 seconds]
deathwishdave has quit [Ping timeout: 260 seconds]
sysvalve has quit [Quit: Leaving]
xuyuheng has quit [Ping timeout: 268 seconds]
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
GodFather has quit [Ping timeout: 265 seconds]
<sagax> it's normal way to convert "string" key name to "symbol" ?
<sagax> m={}; {"a": "b", "c": "d", "e": "f"}.each {|k, v| m.update({k.to_sym => v}) }; m
mikecmpbll has quit [Quit: inabit. zz.]
goez has quit [Ping timeout: 245 seconds]
redlegion has quit [Max SendQ exceeded]
yohji has quit [Remote host closed the connection]
redlegion has joined #ruby
jackrandom is now known as niv
niv is now known as n1v
Eiam has joined #ruby
lxsameer has quit [Quit: WeeChat 2.1]
lxsameer has joined #ruby
n1v is now known as dacoder
dacoder is now known as niv
niv is now known as n1v
goez has joined #ruby
lxsameer has quit [Quit: WeeChat 2.1]
lxsameer has joined #ruby
<havenwood> sagax: What version of Ruby? We've recently gotten a handy #transform_keys method.
<sagax> 2.5.1
<havenwood> sagax: m.transform_keys(&:to_sym)
<sagax> great,
<havenwood> sagax: there's also a #transform_keys!
<havenwood> (mutating the receiver with the bang)
jottr has quit [Ping timeout: 244 seconds]
<apeiros_> sagax: those are not string keys
<apeiros_> {key: value} syntax is symbol keys
<havenwood> >> :"a".class
<ruby[bot]> havenwood: # => Symbol (https://eval.in/1042185)
<sagax> :k => "some" it's to
<apeiros_> and just like you can double quote symbols like `:"symbol"`, you can use the same syntax for hash keys: {"symbol": value}
<havenwood> sagax: "a": <- this is a Symbol, not a String
<apeiros_> you can't use : syntax in hashes for string keys. not possible.
<apeiros_> always hash-rockets (=>) for non-symbol keys.
Xiti has quit [Quit: Xiti]
<havenwood> sagax: {"a": nil}.keys.first.class #=> Symbol
<havenwood> sagax: {"a" => nil}.keys.first.class #=> String
Xiti has joined #ruby
<havenwood> >> :"a".equal? :a
<ruby[bot]> havenwood: # => true (https://eval.in/1042186)
<havenwood> The same object id and everything.
chouhoulis has quit [Remote host closed the connection]
<sagax> hm
<sagax> thanks
beefjoe has quit [Remote host closed the connection]
xuyuheng has joined #ruby
Guest56528 has quit [Ping timeout: 265 seconds]
sarna has quit [Quit: Connection closed for inactivity]
xuyuheng has quit [Ping timeout: 256 seconds]
venmx has quit [Ping timeout: 256 seconds]
s2013 has joined #ruby
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
ams__ has joined #ruby
yokel has quit [Remote host closed the connection]
xuyuheng has joined #ruby
yokel has joined #ruby
SeepingN has joined #ruby
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
xuyuheng has quit [Ping timeout: 248 seconds]
beefjoe has joined #ruby
Guest56528 has joined #ruby
Guest56528 has quit [Ping timeout: 264 seconds]
snickers has joined #ruby
codymj has joined #ruby
Guest56528 has joined #ruby
_aeris_ has quit [Remote host closed the connection]
_aeris_ has joined #ruby
redlegion has quit [Max SendQ exceeded]
alem0lars has quit [Ping timeout: 265 seconds]
redlegion has joined #ruby
mikecmpbll has joined #ruby
Guest56528 has quit [Ping timeout: 240 seconds]
scrptktty has joined #ruby
Guest56528 has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
redlegion has quit [Max SendQ exceeded]
s2013 has joined #ruby
s2013 has quit [Client Quit]
redlegion has joined #ruby
r29v has joined #ruby
Guest56528 has quit [Ping timeout: 264 seconds]
Mike11 has quit [Quit: Leaving.]
codymj has quit [Remote host closed the connection]
hays has quit [Quit: No Ping reply in 180 seconds.]
hays has joined #ruby
alem0lars has joined #ruby
xuyuheng has joined #ruby
Guest56528 has joined #ruby
bak1an has joined #ruby
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
hays has quit [Quit: No Ping reply in 180 seconds.]
xuyuheng has quit [Ping timeout: 248 seconds]
Guest56528 has quit [Ping timeout: 240 seconds]
hays has joined #ruby
lxsameer has quit [Quit: WeeChat 2.1]
lxsameer has joined #ruby
Guest56528 has joined #ruby
bak1an has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
snuz has joined #ruby
hays has quit [Ping timeout: 240 seconds]
cliluw has joined #ruby
Guest56528 has quit [Ping timeout: 256 seconds]
beowuff has joined #ruby
xuyuheng has joined #ruby
Guest56528 has joined #ruby
lxsameer has quit [Quit: WeeChat 2.1]
lxsameer has joined #ruby
agent_white has joined #ruby
nertzy has joined #ruby
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
xuyuheng has quit [Ping timeout: 268 seconds]
Guest56528 has quit [Ping timeout: 260 seconds]
dr3w_ has joined #ruby
shortdudey123 has quit [Ping timeout: 264 seconds]
mitescugd has quit [Ping timeout: 244 seconds]
shortdudey123 has joined #ruby
beefjoe has quit [Ping timeout: 260 seconds]
ivanskie has quit [Quit: Textual IRC Client: www.textualapp.com]
Guest56528 has joined #ruby
<JJonah> I want to decorate an existing class to add a new class method. I can do this, but I don't like having to create the intermediate class `BetterClass__`: https://eval.in/1042206. Is there a better way to do this? In general, is there a better way to upgrade existing classes via decorators to add new methods. It's not necessarily relevant, but in this particular case, I want to add a declarative, hash-based constructor to
<JJonah> `OpenSSL::X509::Certificate`.
deathwishdave has joined #ruby
deathwishdave has quit [Client Quit]
sauvin has quit [Remote host closed the connection]
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
Guest56528 has quit [Ping timeout: 256 seconds]
hays has joined #ruby
tfitts has joined #ruby
Guest56528 has joined #ruby
Guest56528 has quit [Ping timeout: 256 seconds]
Zaab1t has joined #ruby
cthulchu_ has joined #ruby
snuz has quit [Quit: WeeChat 2.2]
xuyuheng has joined #ruby
Guest56528 has joined #ruby
cthulchu has quit [Ping timeout: 240 seconds]
jottr has joined #ruby
xuyuheng has quit [Ping timeout: 240 seconds]
Guest56528 has quit [Ping timeout: 264 seconds]
jottr has quit [Ping timeout: 240 seconds]
Guest56528 has joined #ruby
\void has joined #ruby
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
Guest56528 has quit [Ping timeout: 260 seconds]
jasmith has quit [Ping timeout: 260 seconds]
chouhoulis has joined #ruby
Guest56528 has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Guest56528 has quit [Client Quit]
regedit has joined #ruby
bmurt has joined #ruby
<regedit> anyone use carrierwave + aws/s3? why is calling uploader.remove! not actually deleting the file from s3?
alem0lars has quit [Ping timeout: 240 seconds]
bak1an has joined #ruby
<sagax> how to get hierarchy of Exceptions ?
lytol_ has quit [Remote host closed the connection]
<sagax> i know about "StandardError", "SignalException", "ScriptError"
<apeiros_> sagax: Class#ancestors will give you all ancestors
<sagax> but how to get all heirarchy?
<sagax> thanks
<apeiros_> ObjectSpace.each_object(Exception.singleton_class) gives you all exception classes.
apeiros_ is now known as apeiros
akaiiro has quit [Ping timeout: 244 seconds]
<sagax> very great
<sagax> thanks
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
beefjoe has joined #ruby
beefjoe has quit [Remote host closed the connection]
troulouliou_div2 has joined #ruby
beefjoe has joined #ruby
beefjoe has quit [Remote host closed the connection]
sharkman has joined #ruby
DTZUZO has quit [Ping timeout: 268 seconds]
manakanapa has quit [Quit: The Lounge - https://thelounge.chat]
<sharkman> in Gemfile.lock there is a gem from Git, and it has a revision number attached to it. what does the revision number mean?
manakanapa has joined #ruby
bak1an has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ams__ has quit [Quit: Connection closed for inactivity]
<sharkman> is the revision number related to something on my end, like when i last updated this gem? or is it related to something on the gem/server side about what version i'm downloading?
xuyuheng has joined #ruby
ptx0 has quit [Read error: Connection reset by peer]
<havenwood> sharkman: it's the git revision checksum
<sharkman> sorry i dont understand what that means
<havenwood> sharkman: you can specify it in your Gemfile with the `ref:` keyword argument.
<havenwood> sharkman: In git repos, there are checksums for each commit.
ptx0 has joined #ruby
<sharkman> ahhhh okay
<sharkman> so what does it mean if the Gemfile is the same, but the revision number in the Gemfile.lock changed?
<sharkman> would that imply that the owner of that git repo changed their code at the repo i was accesing it?
<havenwood> sharkman: If you don't specify a ref, deleting the Gemfile.lock or running `bundle update` will go to a new revision if there is one on git.
redlegion has quit [Max SendQ exceeded]
<havenwood> sharkman: This is what the git checksum is actually checksumming: https://gist.github.com/havenwood/38a9b504d815536a88a03ce794334102
nertzy has quit [Read error: Connection reset by peer]
<havenwood> I've been meaning to write an article on it.
redlegion has joined #ruby
<sharkman> Oh interesting.
<havenwood> sharkman: When pinning to a git repo, I usually include the ref in the Gemfile.
xuyuheng has quit [Ping timeout: 240 seconds]
<sharkman> gem 'rsruby', github: 'custora/rsruby'
<havenwood> sharkman: add: , ref: 'OMGWTFBBQREFHERE'
<sharkman> that's what i have now. i guess the "ref" is another piece of data that isn't in there now? cause somehow i updated my gems, and this broke
<sharkman> what would ref be? would that be the previous revision number that i was using when it worked?
<havenwood> Here's roughly what git-cat-file does: https://gist.github.com/havenwood/f5f2dbb69c2dd9008bba1f03cef03ca0
<havenwood> sharkman: yes
<havenwood> sharkman: exactly that
<havenwood> git-cat-file commit HEAD**
<sharkman> sorry that is a bit above my head. a friend helped me code up a lot of this. now i'm trying to maintain it but i accidentally broke the gems. i'm going to try your idea now and see if that works
<sharkman> thanks for yoru help
<havenwood> sharkman: just showing you the rabbit hole where git checksums come from - not important
<havenwood> sharkman: you're welcome
<sharkman> wow
<sharkman> huge help. thanks very much havenwood !!!
<sharkman> it works again
evdubs has quit [Remote host closed the connection]
raul782 has joined #ruby
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
xuyuheng has joined #ruby
FastJack has quit [Remote host closed the connection]
FastJack has joined #ruby
nicesignal has quit [Remote host closed the connection]
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
nicesignal has joined #ruby
xuyuheng has quit [Ping timeout: 244 seconds]
Mikasi has joined #ruby
dennisvennink has joined #ruby
biberu has quit []
dennisvennink has left #ruby [#ruby]
Mikasi has quit [Ping timeout: 256 seconds]
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
dviola has joined #ruby
xuyuheng has joined #ruby
cyberRodent has quit [Ping timeout: 240 seconds]
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
chouhoulis has quit [Remote host closed the connection]
xuyuheng has quit [Ping timeout: 244 seconds]
chouhoulis has joined #ruby
cyberRodent has joined #ruby
sanscoeur has joined #ruby
eckhardt has joined #ruby
r29v has quit [Quit: r29v]
siery has joined #ruby
Tempesta has quit [Quit: See ya!]
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
siery has quit [Client Quit]
crankharder has quit [Ping timeout: 256 seconds]
xuyuheng has joined #ruby
tty has joined #ruby
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
xuyuheng has quit [Ping timeout: 264 seconds]
crankharder has joined #ruby
desperek has joined #ruby
tdy has quit [Ping timeout: 248 seconds]
<sagax> how to class by class name? example i have class Book, how to do Book.new with string class name "book" ?
<sagax> how to call*
<sagax> how to call class*
<sagax> sorry
Zaab1t has quit [Quit: Zaab1t]
k0mpa has quit [Remote host closed the connection]
<baweaver> There's a way, but chances are you're doing something a bit screwy if you want that
<Caerus> maybe include Singleton, I´m not even sure I understood the question correctly ^^
<sagax> i want get class by classname, example Book.new -- like as --> "book".new
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
<sagax> i write method who get classname in argument
<sagax> and this method must be get class by classname
qolq has quit [Remote host closed the connection]
<konsolebox> >> Class Book; end; Object.const_get "Book"
<ruby[bot]> konsolebox: # => /tmp/execpad-4c3735633c25/source-4c3735633c25:3: syntax error, unexpected keyword_rescue, expecting ...check link for more (https://eval.in/1042225)
r29v has joined #ruby
crankharder has quit [Ping timeout: 256 seconds]
za1b1tsu has joined #ruby
<sagax> thanks!
xuyuheng has joined #ruby
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
xuyuheng has quit [Ping timeout: 248 seconds]
sanscoeur has quit [Read error: Connection reset by peer]
sanscoeur has joined #ruby
crankharder has joined #ruby
<apeiros> sagax: be aware that you technically get a constant by name, not a class. the constant just happens to reference that class.
<apeiros> this has two implications: a) you can get other types of values than classes by name if they're in constants
<apeiros> b) classes don't have to be associated with constants
<apeiros> >> wee = Array; wee.new
<ruby[bot]> apeiros: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
<apeiros> eval.in still broken, huh?
<apeiros> >> wee = Array; wee.new
<ruby[bot]> apeiros: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
<sagax> >> Wee = Array; Wee.new
<ruby[bot]> sagax: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
<apeiros> well, Wee is a constant again :)
<apeiros> anyway, try it in pry or irb and see.
<sagax> hm, in ruby all work
<sagax> yes, i use pry
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
<apeiros> all of this is really just an expansion of: classes are objects. variables (Constants, locals, @ivars, @@cvars, $globals) reference objects.
darkhanb has joined #ruby
xuyuheng has joined #ruby
regedit has quit [Quit: Connection closed for inactivity]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
r29v has quit [Quit: r29v]
xuyuheng has quit [Ping timeout: 240 seconds]
za1b1tsu has quit [Ping timeout: 240 seconds]
sanscoeur has quit []
redlegion has quit [Max SendQ exceeded]
redlegion has joined #ruby
psychicist__ has quit [Ping timeout: 268 seconds]
Guest21194 has quit []
xuyuheng has joined #ruby
nuck has joined #ruby
crankharder has quit [Ping timeout: 240 seconds]
paraxial has quit [Quit: The Lounge - https://thelounge.github.io]
Nicmavr has quit [Read error: Connection reset by peer]
paraxial has joined #ruby
xuyuheng has quit [Ping timeout: 240 seconds]
Nicmavr has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
edwardly has quit [Ping timeout: 240 seconds]
DTZUZO has joined #ruby
sharkman has quit [Ping timeout: 260 seconds]
mikecmpbll has quit [Quit: inabit. zz.]
xuyuheng has joined #ruby
raul782 has quit [Ping timeout: 240 seconds]
troulouliou_div2 has quit [Remote host closed the connection]
redlegion has quit [Max SendQ exceeded]
eblip has quit [Quit: WeeChat 2.0.1]
tdy has joined #ruby
redlegion has joined #ruby
xuyuheng has quit [Ping timeout: 240 seconds]
Freshnuts has joined #ruby
sanscoeur has joined #ruby
sanscoeur has quit []
xuyuheng has joined #ruby
xuyuheng has quit [Ping timeout: 240 seconds]
dunpeal has joined #ruby
<dunpeal> Is Ruby getting any faster for mainstream uses?
BTRE has quit [Read error: Connection reset by peer]
<dunpeal> The main implementation that everyone is using is still MRI, right? Is that getting any faster?
<dunpeal> I guess it's "YARV" now, but same question applies.
<baweaver> define "faster"
<baweaver> and then define the requirement you have that you need speed for.
BTRE has joined #ruby
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mitescugd has joined #ruby
kapil___ has quit [Quit: Connection closed for inactivity]
<dunpeal> baweaver: more time efficient? I'm not sure how else to define it.
<baweaver> It's continually getting faster.
<dunpeal> I'm just curious, because I used to write both Ruby and Python, and if I need better performance out of Python nowadays, I know how to get it.
<baweaver> So it's a bit of an odd question
<dunpeal> But back then at least, Ruby didn't have similar options.
<baweaver> Well how would you get it out of Python?
<baweaver> Cython? Iron Python? FFI?
<baweaver> Ruby does a lot of the same things
mistergibson has quit [Read error: Connection reset by peer]
<dunpeal> Lots of answers to this question. For starters, CPython has huge ecosystems of libraries that are very fast C implementations of things like N-dimensional arrays.
<baweaver> Every version since 1.8+ has performance improvements.
<dunpeal> Often if you need performance, you'll use one of these ecosystems and get very good performance.
<baweaver> Ruby has C extensions and the rest of it as well
<dunpeal> YARV, you mean? Is it that they're continuously improving the JIT?
<Zarthus> Can you elaborate on what kind of performance you need?
<baweaver> Which is why I asked you to define your requirements
<baweaver> because ruby as a language versus ruby with ffi / extensions are completely different concerns
<Zarthus> Because if you want something as fast as light, an interpreted language in general isn't the best choice. *shrug*
<lupine> I've done a few things in jruby, which is pretty speedy
<dunpeal> Zarthus: sure, but MRI used to be much slower even than most interpreted languages, e.g. JS on V8
<lupine> but 1.8 (MRI) -> 1.9 (YARV) was huge, and lots of work keeps happening along the way
<baweaver> TruffleRuby is the new kid on the block for that.
<dunpeal> How often do people use FFI in Ruby? Is Rust becoming a popular choice for that?
<baweaver> but in general it's within the same order of magnitude
<baweaver> Helix was a recent popular one for it iirc.
<lupine> FFI is pretty common, at least in my experience
<baweaver> granted I only know surface level ffi concerns
<dunpeal> lupine: what specifically improves performance in YARV? Continuously improving JIT?
venmx has joined #ruby
beowuff has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
<lupine> for jarv it was mostly gc
<lupine> the threading changes helped too
<baweaver> JIT is mostly 2.6+ coming out at Christmas
<dunpeal> That would be interesting.
<lupine> we saw literal 10x speedups in several systems
<dunpeal> One big failure with CPython has been that the core VM never successfully integrated any JIT.
<baweaver> This is a simpler article
<dunpeal> Thanks, looks interesting.
<baweaver> Kokubun is the author of most of it
<baweaver> havenwood: we summon thee
<baweaver> (he wrote the second article)
<dunpeal> "Ruby 2.6 will have an optional --jit flag that will increase startup time and take more memory in exchange for blazing speed once warmed up."
<baweaver> havenwood: bonus points if you remember any fun Truffle benchmarks
<dunpeal> That's likely a hyperbole :) If Ruby JIT release 1.0 is "blazing fast", it will be far better than any JIT project I've ever seen.
<baweaver> or eregon if he's about
<baweaver> Most things are hyperbole I find.
<havenwood> dunpeal: There's lot of work going on for Ruby performance.
<dunpeal> havenwood: RE Truffle, I understand virtually nobody is using it in production right now.
<havenwood> dunpeal: CRuby, JRuby and TruffleRuby are all doing interesting things. Traditional expectations about MRI speed don't apply anymore.
<havenwood> dunpeal: TruffleRuby isn't production ready but it's moving only nicely,.
<dunpeal> And it's not clear that will change any time soon, especially with some non-technical concerns regarding the IP
<baweaver> Mostly we want to see if Oracle pulls an Oracle or not
<havenwood> dunpeal: You can use Graal JIT with JRuby as well.
<dunpeal> havenwood: but CRuby is the main relevant one, right? So on that front, the important thing is the 2.6 release with the new JIT, right?
<dunpeal> I'm reading your fine article.
<havenwood> dunpeal: :-D
<lupine> aye. ultimately, the performance question can only be answered by benchmarking your thing
<dunpeal> havenwood: I mean, if I want to start a new Ruby project at work, likely it will use CRuby. JRuby is still an unorthodox choice.
<havenwood> dunpeal: There's been lots of speed work on the CRuby front other than the JIT. The JIT is promising, but it'll be a while before it shows fruit.
<dunpeal> Even personally, I don't want to wed myself and my codebase and team to the Java ecosystem.
<lupine> my beefs with ruby aren't really performance-based these days
<dunpeal> havenwood: yeah, I mentioned your opening line in the article is rather a hyperbole :)
<dunpeal> I guess ultimately Ruby's aiming for V8-like performance in the best case success scenario.
<havenwood> dunpeal: I briefly mention it in that article, but there are low hanging fruit for compiling to IR in Ruby that don't involve a JIT.
<havenwood> dunpeal: FWIW, here are a few pure Ruby checksum benchmarks I did the other week:
<dunpeal> I hope the whole CRuby JIT project succeeds. JITs are notoriously tricky and I've seen too many JIT projects fail in similar languages like Python.
<havenwood> dunpeal: JITs are tough. The path CRuby has chosen is quite conservative, and only relies on the survival of a C compiler.
<dunpeal> havenwood: interesting. how is it "conservative", and what would be a non-conservative path?
<havenwood> dunpeal: Here's a great article on Graal if you want to look at that angle: https://www.infoq.com/articles/Graal-Java-JIT-Compiler
<havenwood> dunpeal: Non-conservative would be writing your own JIT, like Rubinius did. (They've deprecated it and have yet to replace it.)
<havenwood> dunpeal: Or using an existing JIT library that's a moving target, like IBM's OMR or LLVM's JIT lib.
<havenwood> If those projects die, you fold. If they do breaking changes, you're left behind.
<dunpeal> havenwood: "fold" means you'll have to fork and maintain yourself, no?
<dunpeal> also, from your response I gather CRuby is, effectively, trying to roll out its own JIT library.
<baweaver> Huh, they got 2.6 and Python 3.7 on there - https://benchmarksgame-team.pages.debian.net/benchmarksgame/faster/ruby.html
<havenwood> dunpeal: Relying on C compilers is a very safe choice. It's arguably janky to use /tmp for compiling to C then statically linking, but on linux /tmp is in memory so it tend to work.
<havenwood> havenwood: Yes, but Ruby core doesn't have the bandwidth to maintain LLVM JIT for example, so it'd be a huge problem.
<havenwood> Wait, I'm me!
<dunpeal> FWIW Python3 without any JIT or FFI or tricks is slow as crap
<havenwood> dunpeal: The CRuby VM has some proposed future options as well, involving moving from YARV IR to a RTL intermediary representation.
<havenwood> dunpeal: There's lots of interesting dynamic lang performance research going on.
SCHAPiE has quit [Ping timeout: 260 seconds]
<dunpeal> havenwood: Rubinius is another one I should mention in "failed naive starry eyed JIT projects" probably ;)
<baweaver> Rubinius went on their own crazy streak and burned the entire thing to the ground
<havenwood> dunpeal: The author of the YARV MJIT had previous implemented a few JITs, including an LLVM JIT for Ruby.
<dunpeal> havenwood: I can understand not going with LLVM JIT because LLVM JIT was designed for static languages. I don't know of a dynamic language like Ruby successfully JITing with LLVM JIT.
<havenwood> dunpeal: Chris Seaton on the TruffleRuby team has some great papers on Truffle and Graal. Great stuff: https://scholar.google.co.uk/citations?user=ykthVegAAAAJ
<dunpeal> CPython had a failed JIT project that tried LLVM JIT and failed for that reason.
<havenwood> dunpeal: GraalVM's sulong actually uses LLVM to intermingle C, C++, Fortran, etc code with dynamic language nodes.
<dunpeal> havenwood: thanks, this is very interesting. I'm glad the Ruby core team is taking performance seriously.
<dunpeal> What's the difference between GraalVM and Truffle?
<havenwood> dunpeal: Truffle is a framework for implementing languages. Graal JIT is a JIT written in Java.
<havenwood> dunpeal: Code written in Truffle can use the SubstrateVM to compile to a binary via closed world analysis.
<dunpeal> So Truffle presumably has some sort of universal JIT solution?
<dunpeal> OK, sounds a bit like PyPy.
<havenwood> dunpeal: Truffle is more a language writing framework.
<havenwood> dunpeal: PyPy is written in RPython, just like Topaz is.
<dunpeal> Yeah, that's like PyPy's RPython
<havenwood> dunpeal: There's actually a Python implemented in Truffle.
<dunpeal> Oh, I bet.
SCHAPiE has joined #ruby
<havenwood> dunpeal: You can call the Python functions from Ruby, and vice versa, without a border performance penalty.
<havenwood> dunpeal: The nodes literally intermingle at the ir leve.
<dunpeal> That's in Truffle?
desperek has quit [Quit: xoxo]
<dunpeal> "
<dunpeal> "GraalVM provides an early-stage experimental implementation of Python. A primary goal is to support SciPy and its constituent libraries."
<dunpeal> Good like with supporting SciPy, I can't see that working well.
<dunpeal> That's what's holding back PyPy, by the way: no truly efficient solution to support all the old CPython C-API extensions.
<havenwood> dunpeal: The JavaScript implementation is the farthest along. It passes as many specs as V8 afaik. TruffleRuby is really getting there.
<dunpeal> Which are huge in Python-land (think numpy, the whole scipy stack etc.)
<havenwood> dunpeal: Yeah, TruffleRuby actually works with C extensions!
<havenwood> dunpeal: It also has a very fast startup.
<dunpeal> Ironically, if PyPy was done for Ruby, it would basically get Ruby where it wants to be.
<havenwood> CRuby like startup speeds are a fantastic benefit.
<havenwood> JRuby might be able to take advantage of SVM, but I'm unsure.
<dunpeal> Since at least back when I was using it, Ruby generally didn't rely much on C extensions.
<havenwood> dunpeal: A team implemented Ruby in PyPy as a proof of concept (Topaz).
<havenwood> TruffleRuby is much further along than Topaz ever got.
<dunpeal> havenwood: what about the IP / license concerns surrounding the Oracle code?
<havenwood> dunpeal: They've open sourced SVM, etc. There's currently a community and enterprise edition of TruffleRuby. I can't speak for the future.
<Caerus> A lot of claims of ruby being slow come from the shortcomings of rails regarding scalability. Eileen Uchitelle did a talk about this on rubyconf. 2.6 will have a standar way of doing multi-database
<dunpeal> Both Graal and Truffle are Oracle IP, no?
raul782 has joined #ruby
<dunpeal> Caerus: *nod*, but even without the extra burden of Rails, there's a lot of interest in speeding up dynamic languages like Ruby.
<dunpeal> havenwood: how do Graal and Truffle fit together? Is Truffle the JIT framework for Graal?
<havenwood> dunpeal: Graal seems somewhat encumbered. I haven't looked into it deeply. Someone on the TruffleRuby team might be able to speak to that.
<havenwood> dunpeal: Graal ships with the JVM these days, but it's not enabled by default.
<havenwood> dunpeal: The Graal JIT is one of the parts of the Graal VM.
<havenwood> it's a bit confusing with the naming
<havenwood> dunpeal: Twitter, for example, widely already uses Graal in prod for Scala.
<dunpeal> Yeah, I'm having trouble understand what Graal and Truffle actually are and how they relate to each other :)
<havenwood> dunpeal: Here's an example "simple lang" implemented in Truffle: https://github.com/graalvm/simplelanguage
<dunpeal> understanding*
<havenwood> dunpeal: This writeup gives a great background: https://www.infoq.com/articles/Graal-Java-JIT-Compiler
<dunpeal> Thanks. This has been a very interesting conversation!
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jmcgnh has quit [Read error: Connection reset by peer]
<Caerus> sorry, meant to say rails 6.0. Also, last time I was doing some searches on this I stumbled upon this https://pragtob.wordpress.com/2017/01/24/benchmarking-a-go-ai-in-ruby-cruby-vs-rubinius-vs-jruby-vs-truffle-a-year-later/
jmcgnh has joined #ruby
<Caerus> wonder what numbers we would see nowadays
DTZUZO has quit [Ping timeout: 240 seconds]