havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.6.3, 2.5.5, 2.7.0-preview1: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select Ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
DaRock has joined #ruby
nowhereman has quit [Ping timeout: 245 seconds]
DTZUZO has joined #ruby
queip has quit [Ping timeout: 244 seconds]
cd has joined #ruby
queip has joined #ruby
nowhereman has joined #ruby
gix has quit [Ping timeout: 246 seconds]
tjbp has quit [Remote host closed the connection]
DTZUZO has quit [Ping timeout: 248 seconds]
Exuma has quit [Quit: Textual IRC Client: www.textualapp.com]
dbugger has quit [Quit: Leaving]
bjpenn has quit [Ping timeout: 245 seconds]
lepepe has joined #ruby
GodFather has quit [Ping timeout: 248 seconds]
Snowy has joined #ruby
nowhereman has quit [Ping timeout: 245 seconds]
skryking has joined #ruby
involans has joined #ruby
fphilipe has joined #ruby
cagomez has joined #ruby
fphilipe has quit [Ping timeout: 248 seconds]
haxx0r has joined #ruby
ElFerna has joined #ruby
codefriar has joined #ruby
Snowy has quit [Ping timeout: 244 seconds]
Guest42592 has quit [Read error: Connection reset by peer]
Guest42592 has joined #ruby
chalkmonster has joined #ruby
megamos has quit [Ping timeout: 272 seconds]
jenrzzz_ has joined #ruby
Esa_ has quit [Read error: Connection reset by peer]
jenrzzz has quit [Ping timeout: 248 seconds]
thebananaking has joined #ruby
<thebananaking> afternoon
<baweaver> ohai
<thebananaking> I've got a stupid syntax error and I haven't had coffee yet. Someone sanity check?
<thebananaking> lines=IO.readlines(dbfile).select {|line| aliases.any? {|alias| line.match /alias/}}
<baweaver> What'
<baweaver> s the error say?
<baweaver> alias is a reserved word
<baweaver> Also that regex will be literally alias
<baweaver> You can also make that a lot faster
<thebananaking> argh fuck thanks for that, will fix
<baweaver> aliases = Regexp.union([array, of, regexes])
<baweaver> ines=IO.readlines(dbfile).grep(aliases)
<thebananaking> alias being reserved would do it :P
<thebananaking> woah, you can grep(array)?
<thebananaking> Noice.
<baweaver> grep works with === so it can use regex
<baweaver> If you did a union on it
<baweaver> Regexp.union(array)
<baweaver> &>> Regexp.union([/a/, /b/, /c/])
<rubydoc> # => /(?-mix:a)|(?-mix:b)|(?-mix:c)/ (https://carc.in/#/r/77ba)
<baweaver> &>> Regexp.union([/a/, /b/, /c/]).match 'a'
<rubydoc> # => #<MatchData "a"> (https://carc.in/#/r/77bb)
<thebananaking> love it, many thanks
<thebananaking> heh, Regexp.union(%w{a b c}) # => /a|b|c/
<thebananaking> that's NEAT
sauvin_ is now known as Sauvin
akem-lnvo has quit [Read error: Connection reset by peer]
ElFerna has quit [Quit: Konversation terminated!]
jenrzzz_ has quit [Ping timeout: 248 seconds]
cagomez has quit [Remote host closed the connection]
jenrzzz has joined #ruby
AJA4350 has quit [Quit: AJA4350]
sarink has joined #ruby
lepepe has quit [Remote host closed the connection]
lepepe has joined #ruby
jenrzzz has quit [Ping timeout: 272 seconds]
sarink has quit [Ping timeout: 245 seconds]
jaequery has joined #ruby
lepepe has quit [Ping timeout: 248 seconds]
involans has quit [Ping timeout: 246 seconds]
involans has joined #ruby
bjpenn has joined #ruby
zacts has joined #ruby
_whitelogger has joined #ruby
bjpenn has quit [Ping timeout: 248 seconds]
braincrash has quit [Quit: bye bye]
tdy3 has quit [Ping timeout: 272 seconds]
cyclonis has joined #ruby
cyclonis has quit [Max SendQ exceeded]
fphilipe has joined #ruby
braincrash has joined #ruby
redlegion has quit [Quit: The Lounge - https://thelounge.chat]
fphilipe has quit [Ping timeout: 272 seconds]
zacts has quit [Quit: WeeChat 2.4]
braincrash has quit [Ping timeout: 245 seconds]
redlegion has joined #ruby
involans has quit [Read error: Connection reset by peer]
involans has joined #ruby
Snowy has joined #ruby
sarink has joined #ruby
involans has quit [Ping timeout: 272 seconds]
dviola has quit [Quit: WeeChat 2.5]
_whitelogger has joined #ruby
bjpenn has joined #ruby
cd has quit [Quit: cd]
bjpenn has quit [Read error: Connection reset by peer]
bjpenn has joined #ruby
pygmypuppy has quit [Ping timeout: 248 seconds]
cyclonis has joined #ruby
cyclonis has quit [Remote host closed the connection]
code_zombie has quit [Quit: Leaving]
cyclonis has joined #ruby
cyclonis has quit [Excess Flood]
cyclonis has joined #ruby
tdy4 has joined #ruby
Snowy has quit [Ping timeout: 258 seconds]
fphilipe has joined #ruby
fphilipe has quit [Ping timeout: 248 seconds]
Swyper has joined #ruby
polysics has joined #ruby
<polysics> sup
Swyper has quit [Remote host closed the connection]
DTZUZO has joined #ruby
<polysics> I have an amnesia moment. Is there a way to define an array of constants on a class?
zacts has joined #ruby
jenrzzz has joined #ruby
<baweaver> polysics: how so?
Swyper has joined #ruby
<polysics> I am dealing with an API that has lengthy event names, and they are separated on a few groups
<polysics> so I'd like to do something like CALL_STATE::RINGING to reference them
<polysics> I guess I can just name them TYPE_SUBTYPE, but it was more of a generic question I came up with
<baweaver> Hashes, possibly
<polysics> because the actual name is something like 'event.calling.call.call_state.ringing' because I assume it is mapped from some undelying relationship
<polysics> how would that look, please?
<baweaver> So you need an arbitrarily deep structure of events?
<polysics> no, I can make do with two levels
<polysics> let's say "call_state.ringing" is what matters
<baweaver> Just make a module that wraps a set of constants
<polysics> there sill be "call_connect.started", "call_play.finished" etc
<polysics> and how would the constants be arranged?
<baweaver> class Something; module GroupA; CONSTS
<polysics> oh, so there is no way to do a hash of constants, gotcha
<baweaver> Hash keys could be anything
<polysics> I was almost sure I had seen it somewhere but I was probably seein things, I guess
Swyper has quit [Remote host closed the connection]
<polysics> baweaver: you mean something like this?
<polysics> module CallState
<polysics> RINGING = 'long_event_name'
<polysics> end
<polysics> module CallPlay
<polysics> STARTED = 'some more long name'
<polysics> end
<baweaver> Use a gist
<polysics> oops wtf, sorry
<polysics> yes, my bad
<baweaver> but yeah
<polysics> wrong focused window.
<polysics> yes, thinking about it, I can't think of a syntax that would allow for an actual hash of constants to be defined
<polysics> is a module name in all caps bad-looking?
<polysics> so that it is clear it is only a constant holder
<polysics> you can ofc have an hash as a constant but that has a confusing syntax to use
<polysics> MyModel::SOME_ATTR_OPTIONS[:first_option]
<haxx0r> how to validate that the PGP key a user provided to encrypt emails is valid
<polysics> you should probably be shelling out to pgp/pgp2
<haxx0r> no ruby gem to check it? thats bad
<polysics> though it looks like IOStreams has some PGP stuff in it
<polysics> apparently you are right
<haxx0r> i wanna run like `validates :pgp_key, pgp: true`
<polysics> you can always write it
<polysics> oh, look
<haxx0r> that gem is just a wrapper class for the shell, isn't?
sarink has quit [Remote host closed the connection]
<haxx0r> mmh. i'll cook food and will recheck in 20 minutes
<polysics> don't know, go check out the source code - I looked for 10 seconds and it looks like it's an actual implementation
<polysics> (referring to gpgme)
<polysics> gpgme has a "verify" method too
lepepe has joined #ruby
sarink has joined #ruby
polysics has quit []
zacts has quit [Quit: WeeChat 2.4]
sarink has quit [Remote host closed the connection]
sarink has joined #ruby
matheusmoreira has quit [Ping timeout: 246 seconds]
lepepe has quit [Ping timeout: 246 seconds]
matheusmoreira has joined #ruby
<haxx0r> lets see, i'll check that gem now
brool has quit [Ping timeout: 252 seconds]
sandstrom has joined #ruby
planigan has quit [Ping timeout: 245 seconds]
sarink has quit [Remote host closed the connection]
queip has quit [Ping timeout: 244 seconds]
zenspider has quit [Quit: bye]
absolutejam1 has joined #ruby
sarink has joined #ruby
zenspider has joined #ruby
sarink_ has joined #ruby
queip has joined #ruby
conta has joined #ruby
planigan has joined #ruby
sarink has quit [Ping timeout: 245 seconds]
absolutejam1 has quit [Ping timeout: 244 seconds]
conta has quit [Ping timeout: 246 seconds]
conta has joined #ruby
dellavg_ has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.5]
sarink_ has quit [Remote host closed the connection]
cd has joined #ruby
DTZUZO has quit [Ping timeout: 268 seconds]
ur5us has quit [Remote host closed the connection]
havenwood has quit [Quit: ZNC 1.7.3 - https://znc.in]
Nilium has quit [Quit: <kristin> Cower is like... I dunno. sometimes he seems senile and other times he seems like a middle schooler.]
sarink has joined #ruby
Nilium has joined #ruby
fphilipe has joined #ruby
havenwood has joined #ruby
havenwood has quit [Changing host]
havenwood has joined #ruby
zacts has joined #ruby
Snowy has joined #ruby
sarink has quit [Remote host closed the connection]
bjpenn has quit [Ping timeout: 248 seconds]
sarink has joined #ruby
schne1der has joined #ruby
xco has joined #ruby
m27frogy has quit [Read error: Connection reset by peer]
jenrzzz has quit [Ping timeout: 245 seconds]
m27frogy has joined #ruby
jenrzzz has joined #ruby
sarink_ has joined #ruby
sarink has quit [Read error: Connection reset by peer]
absolutejam1 has joined #ruby
conta has quit [Ping timeout: 258 seconds]
Snowy has quit [Ping timeout: 245 seconds]
haxx0r has quit [Remote host closed the connection]
suukim has joined #ruby
sarink_ has quit [Remote host closed the connection]
sarink has joined #ruby
fphilipe has quit [Ping timeout: 252 seconds]
conta has joined #ruby
schne1der has quit [Ping timeout: 246 seconds]
lxsameer has joined #ruby
jenrzzz has quit [Ping timeout: 248 seconds]
chalkmonster has joined #ruby
lepepe has joined #ruby
salvor has quit [Remote host closed the connection]
salvor has joined #ruby
S007 has joined #ruby
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
andikr has joined #ruby
jidar has quit [Quit: WeeChat 2.5]
lepepe has quit [Ping timeout: 245 seconds]
TomyWork has joined #ruby
fphilipe has joined #ruby
sarink has quit [Remote host closed the connection]
sarink has joined #ruby
m27frogy has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
m27frogy has joined #ruby
schne1der has joined #ruby
jud^ has quit [Quit: Leaving]
lepepe has joined #ruby
lepepe has quit [Ping timeout: 248 seconds]
jidar has joined #ruby
ssriram has joined #ruby
lepepe has joined #ruby
themsay has quit [Ping timeout: 246 seconds]
schne1der has quit [Quit: schne1der]
reber has joined #ruby
schne1der has joined #ruby
ssriram has quit [Quit: Leaving]
absolutejam1 has quit [Ping timeout: 268 seconds]
Snowy has joined #ruby
Snowy has quit [Client Quit]
lepepe has quit [Ping timeout: 258 seconds]
deepreds1 has joined #ruby
Tuor has joined #ruby
johnny56 has quit [Ping timeout: 272 seconds]
deepredsky has quit [Ping timeout: 244 seconds]
jmcgnh has quit [Ping timeout: 248 seconds]
megamos has joined #ruby
mayurvpatil has joined #ruby
jmcgnh has joined #ruby
absolutejam1 has joined #ruby
mayurvpatil has quit [Ping timeout: 245 seconds]
sarink has quit [Remote host closed the connection]
lepepe has joined #ruby
queip has quit [Ping timeout: 246 seconds]
dbugger has joined #ruby
envex has quit []
chalkmonster has quit [Quit: WeeChat 2.5]
bjpenn has joined #ruby
lepepe has quit [Ping timeout: 248 seconds]
conta has quit [Ping timeout: 248 seconds]
chalkmonster has joined #ruby
sarink has joined #ruby
queip has joined #ruby
sandstrom has quit [Quit: My computer has gone to sleep.]
conta has joined #ruby
johnny56 has joined #ruby
BH23 has joined #ruby
Fraeon has quit [Ping timeout: 248 seconds]
jenrzzz has quit [Ping timeout: 246 seconds]
alem0lars has joined #ruby
queip has quit [Ping timeout: 248 seconds]
BH23 has quit [Ping timeout: 244 seconds]
absolutejam2 has joined #ruby
absolutejam1 has quit [Ping timeout: 268 seconds]
sarink has quit [Remote host closed the connection]
Guest34898 has quit [Quit: All for nothing]
queip has joined #ruby
akem-hp has joined #ruby
olspookishmagus has joined #ruby
sarink has joined #ruby
alem0lars has quit [Remote host closed the connection]
alem0lars has joined #ruby
bjpenn has quit [Ping timeout: 244 seconds]
sandstrom has joined #ruby
queip has quit [Ping timeout: 245 seconds]
aupadhye has joined #ruby
bjpenn has joined #ruby
akem-lnvo has joined #ruby
jefffrails35 has joined #ruby
queip has joined #ruby
jefffrails35 has quit [Client Quit]
DTZUZU has quit [Ping timeout: 258 seconds]
andikr has quit [Ping timeout: 245 seconds]
andikr has joined #ruby
absolutejam2 has quit [Ping timeout: 245 seconds]
DTZUZU has joined #ruby
sandstrom has quit [Quit: OS X IRC Client (www.textualapp.com)]
sarink has quit [Remote host closed the connection]
sandstrom has joined #ruby
sarink has joined #ruby
sarink has quit [Remote host closed the connection]
codefriar has quit [Ping timeout: 272 seconds]
sarink has joined #ruby
absolutejam2 has joined #ruby
sarink has quit [Remote host closed the connection]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
sarink has joined #ruby
sarink has quit [Remote host closed the connection]
Nicmavr has quit [Read error: Connection reset by peer]
Nicmavr has joined #ruby
cd has quit [Quit: cd]
lepepe has joined #ruby
conta has quit [Ping timeout: 244 seconds]
conta has joined #ruby
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
andikr has quit [Ping timeout: 245 seconds]
lepepe has quit [Ping timeout: 245 seconds]
Nilium has quit [Ping timeout: 244 seconds]
Nilium has joined #ruby
queip has quit [Ping timeout: 245 seconds]
sarink has joined #ruby
sarink has quit [Remote host closed the connection]
sarink has joined #ruby
havenwood has quit [Ping timeout: 248 seconds]
sarink has quit [Remote host closed the connection]
sarink has joined #ruby
conta has quit [Ping timeout: 248 seconds]
queip has joined #ruby
Nilium has quit [Ping timeout: 245 seconds]
Nilium has joined #ruby
xtsee has quit [Ping timeout: 276 seconds]
havenwood has joined #ruby
havenwood has joined #ruby
conta has joined #ruby
Nilium has quit [Ping timeout: 245 seconds]
tdy4 has quit [Ping timeout: 246 seconds]
Nilium has joined #ruby
xtsee has joined #ruby
havenwood has quit [Ping timeout: 268 seconds]
havenwood has joined #ruby
havenwood has joined #ruby
Nilium_ has joined #ruby
xtsee has quit [Ping timeout: 264 seconds]
vondruch has quit [Read error: Connection reset by peer]
vondruch has joined #ruby
Nilium has quit [Ping timeout: 268 seconds]
Nilium_ is now known as Nilium
NL3limin4t0r_afk is now known as NL3limin4t0r
xtsee has joined #ruby
evdubs has quit [Remote host closed the connection]
evdubs has joined #ruby
andikr has joined #ruby
lepepe has joined #ruby
mcgeeio has joined #ruby
lepepe has quit [Ping timeout: 244 seconds]
mcgeeio has left #ruby [#ruby]
leitz has joined #ruby
queip has quit [Ping timeout: 272 seconds]
mcgee_io has joined #ruby
mcgee_io has quit [Client Quit]
absolutejam2 has quit [Ping timeout: 245 seconds]
mcgeeio has joined #ruby
mcgeeio has quit [Client Quit]
mcgee_io has joined #ruby
queip has joined #ruby
mcgee_io has quit [Client Quit]
mcgee_io has joined #ruby
mcgee_io has left #ruby [#ruby]
GodFather has joined #ruby
troulouliou_div2 has joined #ruby
akem-lnvo has quit [Ping timeout: 245 seconds]
ElFerna has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
bjpenn has quit [Ping timeout: 248 seconds]
reber has quit [Ping timeout: 246 seconds]
Dr_MDMA_MD has quit [Quit: Connection closed for inactivity]
lepepe has joined #ruby
kyrylo has joined #ruby
ElFerna has quit [Quit: Konversation terminated!]
Rudd0^ has quit [Ping timeout: 246 seconds]
Rudd0 has quit [Ping timeout: 245 seconds]
sarink has quit [Read error: Connection reset by peer]
sarink has joined #ruby
DTZUZO has joined #ruby
lepepe has quit [Ping timeout: 268 seconds]
cyclonis_ has joined #ruby
Cthulu201 has quit [Quit: Nowhere special. I always wanted to go there.]
Swyper has joined #ruby
cyclonis has quit [Ping timeout: 246 seconds]
cyclonis_ has quit [Read error: Connection reset by peer]
TimApple has quit [Quit: Gone.]
cyclonis_ has joined #ruby
Cthulu201 has joined #ruby
yalue has joined #ruby
GodFather has quit [Ping timeout: 245 seconds]
involans has joined #ruby
AJA4350 has joined #ruby
sphenxes has joined #ruby
jefffrails35 has joined #ruby
sandstrom has quit [Quit: My computer has gone to sleep.]
jefffrails35 has quit [Quit: Leaving]
GodFather has joined #ruby
conta has quit [Ping timeout: 246 seconds]
kurko_ has joined #ruby
fphilipe has quit [Ping timeout: 245 seconds]
fphilipe has joined #ruby
cyclonis has joined #ruby
cyclonis has quit [Max SendQ exceeded]
cyclonis_ has quit [Ping timeout: 258 seconds]
Swyper has quit [Remote host closed the connection]
conta1 has joined #ruby
Swyper has joined #ruby
fphilipe has quit [Read error: Connection reset by peer]
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
fphilipe has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
cyclonis has joined #ruby
cyclonis has quit [Excess Flood]
dviola has joined #ruby
Swyper has quit [Ping timeout: 245 seconds]
jenrzzz has joined #ruby
cyclonis has joined #ruby
cyclonis has quit [Excess Flood]
jenrzzz has quit [Ping timeout: 244 seconds]
skryking has quit [Remote host closed the connection]
sandstrom has joined #ruby
queip has quit [Ping timeout: 258 seconds]
skryking has joined #ruby
cyclonis has joined #ruby
cyclonis has quit [Excess Flood]
involans has quit [Quit: involans]
tf2ftw has joined #ruby
Swyper has joined #ruby
conta1 has quit [Ping timeout: 268 seconds]
queip has joined #ruby
za1b1tsu has joined #ruby
involans has joined #ruby
lepepe has joined #ruby
alan_w has joined #ruby
fphilipe has quit [Read error: Connection reset by peer]
lepepe has quit [Ping timeout: 245 seconds]
andikr has quit [Ping timeout: 258 seconds]
Guest22 has joined #ruby
andikr has joined #ruby
lepepe has joined #ruby
Guest22 is now known as fretta
Inline has joined #ruby
fphilipe has joined #ruby
vondruch has quit [Ping timeout: 272 seconds]
andikr has quit [Ping timeout: 245 seconds]
codefriar has joined #ruby
troulouliou_div2 has quit [Remote host closed the connection]
DTZUZO has quit [Ping timeout: 272 seconds]
involans has quit [Quit: involans]
envex has joined #ruby
involans has joined #ruby
<Norrin> I have a couple of questions about the syntax in this method definition -- https://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-add_reference
<Norrin> 1) when it says **options, is that like variable arguments? casting everything remaining into an "options" hash?
<Norrin> 2) the keys to the hash are symbols? `add_reference(:products, :user, type: :string)` passing "type" as a symbol?
THE_GFR|WORK has joined #ruby
<THE_GFR|WORK> hey everyone have a ruby/ruby-on-rails system and I was wondering if anyone here knew of a gem that might give google sheets like saving ability where text typed into specific areas is automatically saved?
involans has quit [Ping timeout: 258 seconds]
brendan- has joined #ruby
cagomez has joined #ruby
<NL3limin4t0r> Norrin: Have a look at the Methods - Keyword Arguments documentation. http://ruby-doc.org/core-2.6.3/doc/syntax/methods_rdoc.html#label-Keyword+Arguments
sarink has quit [Remote host closed the connection]
sarink has joined #ruby
<NL3limin4t0r> If you have still questions after reading it don't be shy to ask.
akem-lnvo has joined #ruby
lucasb has joined #ruby
<Norrin> thanks! NL3limin4t0r
sarink has quit [Ping timeout: 245 seconds]
fphilipe has quit [Read error: Connection reset by peer]
queip has quit [Ping timeout: 246 seconds]
<NL3limin4t0r> Norrin: In short, the answer to both questions is yes.
<NL3limin4t0r> This syntax also doesn't allow for other keys.
fphilipe has joined #ruby
Esa_ has joined #ruby
GodFather has quit [Read error: Connection reset by peer]
<NL3limin4t0r> &>> def hello(**options); p options; end; hello(a: 1)
<rubydoc> # => {:a=>1} (https://carc.in/#/r/77co)
<NL3limin4t0r> &>> def hello(**options); p options; end; hello('a' => 1)
<rubydoc> stderr: -e:2:in `hello': wrong number of arguments (given 1, expected 0) (ArgumentError) (https://carc.in/#/r/77cp)
Dr_MDMA_MD has joined #ruby
<NL3limin4t0r> With "other keys" I mean keys other than symbols. See the example above ^ where a string is used as key.
akem-lnvo has quit [Ping timeout: 244 seconds]
queip has joined #ruby
schne1der has quit [Ping timeout: 245 seconds]
meinside has quit [Quit: Connection closed for inactivity]
<NL3limin4t0r> THE_GFR|WORK: I know what you mean, but I don't know of any editors of the top of my head. A quick search found me this https://www.quora.com/Which-HTML5-WYSIWYG-editors-have-a-built-in-autosave
megamos has quit [Ping timeout: 272 seconds]
megamos has joined #ruby
akem-lnvo has joined #ruby
brendan- has quit [Quit: Textual IRC Client: www.textualapp.com]
codefriar has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rippa has joined #ruby
sarink has joined #ruby
cagomez has quit []
andikr has joined #ruby
niceperl has joined #ruby
jenrzzz has joined #ruby
Esa_ has quit []
Esa_ has joined #ruby
jenrzzz has quit [Ping timeout: 272 seconds]
involans has joined #ruby
sandstrom has quit [Read error: Connection reset by peer]
<leitz> More storms...drat...
leitz has quit [Quit: Leaving]
sandstrom has joined #ruby
zacts_pi has joined #ruby
GodFather has joined #ruby
fretta has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
codefriar has joined #ruby
m27frogy has quit [Ping timeout: 248 seconds]
codefriar has quit [Client Quit]
pygmypuppy has joined #ruby
m27frogy has joined #ruby
niceperl has quit [Remote host closed the connection]
lepepe_ has joined #ruby
DaRock has quit [Ping timeout: 258 seconds]
codefriar has joined #ruby
kurko__ has joined #ruby
kurko_ has quit [Ping timeout: 268 seconds]
lepepe has quit [Ping timeout: 258 seconds]
zacts_pi has quit [Quit: WeeChat 2.4]
absolutejam has quit [Quit: WeeChat 2.5]
pygmypuppy has quit [Quit: Textual IRC Client: www.textualapp.com]
pygmypuppy has joined #ruby
jenrzzz has joined #ruby
dviola has quit [Quit: WeeChat 2.5]
alem0lars has quit [Remote host closed the connection]
vondruch has joined #ruby
jenrzzz has quit [Ping timeout: 248 seconds]
schne1der has joined #ruby
<Norrin> NL3limin4t0r, interesting. why do the keys have to be symbols?
andikr has quit [Remote host closed the connection]
<NL3limin4t0r> Norrin: I don't know exactly why, maybe someone else can tell you. What I do know is that keyword arguments should always be symbols. If you do want to allow string and other types as key simply create an optional positional argument.
<NL3limin4t0r> &>> def hello(options = {}); p options; end; hello('a' => 1)
<rubydoc> # => {"a"=>1} (https://carc.in/#/r/77dc)
involans has quit [Quit: involans]
involans has joined #ruby
<Norrin> 😫 how array captured hashes and keyword arguments look the same at the call site
<Norrin> &>> def test(*options, a: something); p something; end; a=22; test(1,2,3, a: "a string")
<rubydoc> stderr: -e:2:in `test': undefined local variable or method `something' for main:Object (NameError) (https://carc.in/#/r/77ds)
<Norrin> &>> def test(*options, a: nil); p a; end; a=22; test(1,2,3, a: "a string")
<rubydoc> # => "a string" (https://carc.in/#/r/77du)
<Norrin> &>> def test(*options); p options; end; a=22; test(1,2,3, a: "a string")
<rubydoc> # => [1, 2, 3, {:a=>"a string"}] (https://carc.in/#/r/77dx)
<Norrin> &>> def test(*options); p options; end; a=22; test(1,2,3, 22: "a string")
<rubydoc> stderr: -e:2: syntax error, unexpected ':', expecting ')' (https://carc.in/#/r/77dy)
<leftylink> indeed they take on the same form at the call site. as a logical consequence of this, it also means that at the call site, even `:sym => v` is substitutable for `sym: v`
<Norrin> &>> def test(*options); p options; end; a="test"; test(1,2,3, a: "a string")
<rubydoc> # => [1, 2, 3, {:a=>"a string"}] (https://carc.in/#/r/77dz)
<leftylink> &>> def f(a: :adef, b: :bdef) p [a, b] end; f(:a => :world, :b => :world)
<rubydoc> # => [:world, :world] (https://carc.in/#/r/77e0)
<Norrin> keys to hashes have to be symbols?
<Norrin> &>> def test(*options); p options; end; a="test"; test(1,2,3, "string_key": "a string")
<rubydoc> # => [1, 2, 3, {:string_key=>"a string"}] (https://carc.in/#/r/77e1)
<leftylink> keys to hashes can be whatever you want. {5 => 1, ?a => 2} is a hash with a number and a string as keys
<NL3limin4t0r> Norrin: `"string_key":` is still a symbol.
<NL3limin4t0r> &>> :"foo"
<rubydoc> # => :foo (https://carc.in/#/r/77e2)
<Norrin> ok. so seems the a: b format dictates that it's a symbol
<Norrin> => will allow a different type
<NL3limin4t0r> Only symbols have the `:` shortcut, other keys must alwasy use the arrow (`=>`).
<NL3limin4t0r> &>> { "a": 1, b: 2, "c" => 4, 5 => :d }
Guest22 has joined #ruby
<rubydoc> # => {:a=>1, :b=>2, "c"=>4, 5=>:d} (https://carc.in/#/r/77e3)
ellcs has quit [Ping timeout: 258 seconds]
<NL3limin4t0r> The reason that you can put quotes it to easily allow otherwise invalid symbols. With for example spaces in them.
<NL3limin4t0r> &>> :"still a symbol"
<rubydoc> # => :"still a symbol" (https://carc.in/#/r/77e4)
Guest22 has quit [Client Quit]
<Norrin> &>> def test(*options, a: nil); p a; end; a=22; test(1,2,3, a => "a string")
mgraf has joined #ruby
SeepingN has joined #ruby
mgraf has left #ruby [#ruby]
<Norrin> &>> def test(*options, a: nil); p a; end; a=22; test(1,2,3, a => "a string")
<Norrin> maybe rubydoc is as confused by this as I am
mgraf has joined #ruby
<Norrin> &>> def test(*options, a: nil); p a; end; a=22; test(1,2,3, a => "a string", a: "different string")
<Norrin> &>> def test(*options, a: nil); p a; end; a=22; test(1,2,3, a: "different string")
jaequery has joined #ruby
<Norrin> &>> p "you're not blocked"
<rubydoc> # => "you're not blocked" (https://carc.in/#/r/77e9)
Tuor has quit [Quit: Konversation terminated!]
tdy4 has joined #ruby
m27frogy has quit [Quit: ZNC - https://znc.in]
Guest42592 has quit [Remote host closed the connection]
m27frogy has joined #ruby
Guest42592 has joined #ruby
mgraf has left #ruby [#ruby]
orbyt_ has joined #ruby
absolutejam2 has joined #ruby
<NL3limin4t0r> Norrin: You've inded some of those lines with a single space.
cow[moo] has quit [Quit: Textual IRC Client: www.textualapp.com]
sandstrom has quit [Ping timeout: 252 seconds]
<leftylink> 16:24:16 < Norrin> I&>> def test
<leftylink> as is reasonable, it would only respond if &>> is the firs tthing. it would not work if there is an I before the &
cow[moo] has joined #ruby
<Norrin> hmm, had some strange characters there. it's invisible on my screen, except for whitespace
<Norrin> &>> def test(*options, a: nil); p a; end; a=22; test(1,2,3, a => "a string")
<rubydoc> # => nil (https://carc.in/#/r/77eb)
<leftylink> of course that is no different than if it had been 22 => "a string"
<Norrin> &>> def test(*options, a: nil); p options,a; end; a=22; test(1,2,3, a => "a string")
<rubydoc> # => [1, 2, 3, {22=>"a string"}] (https://carc.in/#/r/77ec)
<Norrin> hmm so array capture will capture a hash even when the method accepts keyword arguments, as long as it's in the a => b form instead of the a: b form
<leftylink> the "as long as" does not apply
<leftylink> actually, I guess kind of
za1b1tsu has quit [Remote host closed the connection]
<NL3limin4t0r> symbols can also be in that form `:a => 1`
<leftylink> it really does not matter what syntax was used at the call site, as can be seen in the `def f(a: :adef, b: :bdef) p [a, b] end; f(:a => :hello, :b => :world)` example.
<NL3limin4t0r> &>> def test(*options, a: nil); p options,a; end; a=22; test(1,2,3, a => "a string", a: 1)
<rubydoc> stderr: -e:2:in `<main>': non-symbol key in keyword arguments: 22 (ArgumentError) (https://carc.in/#/r/77ed)
cow[moo] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood> Norrin: See this issue for some discussion of the design direction for keyword arguments in Ruby 3: https://bugs.ruby-lang.org/issues/14183
<NL3limin4t0r> ^ You can't provide an mix of keywords and regular arguments, Ruby doesn't understand it.
<NL3limin4t0r> This does work however:
<NL3limin4t0r> &>> def test(*options, a: nil); p options,a; end; a=22; test(1,2,3, {a => "a string"}, a: 1)
<rubydoc> # => [1, 2, 3, {22=>"a string"}] (https://carc.in/#/r/77ee)
<havenwood> &>> RUBY_VERSION
<rubydoc> # => "2.6.0" (https://carc.in/#/r/77ef)
<havenwood> NL3limin4t0r: In 2.6.3: def test(*options, a: nil); p options,a; end; a=22; test(1,2,3, a => "a string", a: 1)
<havenwood> #=> [[1, 2, 3, {22=>"a string"}], 1]
matheusmoreira has quit [Ping timeout: 246 seconds]
matheusmoreira has joined #ruby
<Norrin> NL3limin4t0r interesting. seems like it glued the two together into one hash
<NL3limin4t0r> havenwood: Didn't know that, but it's good to know. I generally only read the x.x.0 patch notes, since those mostly include the new features.
cow[moo] has joined #ruby
<Norrin> havenwood interesting
absolutejam3 has joined #ruby
absolutejam2 has quit [Ping timeout: 246 seconds]
orbyt_ has quit [Quit: Textual IRC Client: www.textualapp.com]
<havenwood> NL3limin4t0r: Yeah, this is a fairly rare case where a 2.6.0 feature had to be backed out due to unforeseen incompatibility.
m27frogy has quit [Quit: ZNC - https://znc.in]
m27frogy has joined #ruby
lord4163 has quit [Excess Flood]
absolutejam3 has quit [Ping timeout: 244 seconds]
<NL3limin4t0r> Which Ruby version was it added? I can't seem to find it in the 2.6.1, 2.6.2 or 2.6.3 change log. I'm not in the mood to walk through the commit log at this time.
orbyt_ has joined #ruby
lord4163 has joined #ruby
<THE_GFR|WORK> NL3limin4t0r: thanks!
<THE_GFR|WORK> NL3limin4t0r: I'm looking for a gem that I can put into my ruby project...
cyclonis has joined #ruby
cyclonis has quit [Max SendQ exceeded]
cyclonis has joined #ruby
cyclonis has quit [Excess Flood]
cyclonis has joined #ruby
cyclonis has quit [Excess Flood]
cyclonis has joined #ruby
GodFather has quit [Ping timeout: 246 seconds]
Swyper has quit []
absolutejam3 has joined #ruby
dbugger has quit [Quit: Leaving]
absolutejam3 has quit [Client Quit]
TomyWork has quit [Ping timeout: 246 seconds]
johnny56 has quit [Ping timeout: 272 seconds]
gix has joined #ruby
conta has joined #ruby
absolutejam has joined #ruby
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
aupadhye has quit [Quit: Leaving]
<Norrin> havenwood what feature was removed?
<Norrin> all i can see if an enhancement, distinguishing the hash from the keyword arg
cyclonis_ has joined #ruby
<havenwood> Norrin: In 2.6.0, a prohibition was added to prevent passing both Symbol and non-Symbol keys at once.
<havenwood> Norrin: After 2.6.1 release, core team decided it needed to be backed out.
cyclonis has quit [Ping timeout: 258 seconds]
<Norrin> gotcha
cyclonis_ has quit [Read error: Connection reset by peer]
cyclonis has joined #ruby
cyclonis has quit [Excess Flood]
cyclonis has joined #ruby
cyclonis has quit [Max SendQ exceeded]
conta has quit [Quit: conta]
<NL3limin4t0r> For some reason I thought that behaviour was present in older versions too. But testing it in 2.4.1 and 2.5.5 it seems to work fine. I have no clue where I got the idea from then. 😅
bjpenn has joined #ruby
cyclonis has joined #ruby
cyclonis has quit [Excess Flood]
cyclonis has joined #ruby
cyclonis has quit [Excess Flood]
cyclonis has joined #ruby
cyclonis has quit [Excess Flood]
queip has quit [Ping timeout: 248 seconds]
cyclonis has joined #ruby
cyclonis has quit [Excess Flood]
conta has joined #ruby
cyclonis has joined #ruby
cyclonis has quit [Excess Flood]
cyclonis has joined #ruby
cyclonis has quit [Excess Flood]
cyclonis has joined #ruby
cyclonis has quit [Excess Flood]
cyclonis has joined #ruby
cyclonis has quit [Excess Flood]
cyclonis has joined #ruby
cyclonis has quit [Excess Flood]
akem-lnvo has quit [Ping timeout: 272 seconds]
Esa_ has quit []
lxsameer has quit [Ping timeout: 248 seconds]
queip has joined #ruby
cyclonis has joined #ruby
cyclonis has quit [Excess Flood]
Rudd0 has joined #ruby
cyclonis has joined #ruby
cyclonis has quit [Excess Flood]
cyclonis has joined #ruby
cyclonis has quit [Excess Flood]
kyrylo has joined #ruby
cyclonis has joined #ruby
cyclonis has quit [Excess Flood]
cyclonis has joined #ruby
cyclonis has quit [Excess Flood]
cyclonis has joined #ruby
cyclonis has quit [Excess Flood]
cyclonis has joined #ruby
cyclonis has quit [Max SendQ exceeded]
kyrylo has quit [Read error: Connection timed out]
kyrylo has joined #ruby
brendan- has joined #ruby
absolutejam has quit [Ping timeout: 245 seconds]
rafadc has quit [Remote host closed the connection]
NL3limin4t0r is now known as NL3limin4t0r_afk
queip has quit [Ping timeout: 244 seconds]
conta has quit [Quit: conta]
megamos has quit [Ping timeout: 268 seconds]
rafadc has joined #ruby
queip has joined #ruby
Guest42592 has quit [Ping timeout: 272 seconds]
cliluw has quit [Ping timeout: 244 seconds]
cliluw has joined #ruby
lucasb has quit [Quit: Connection closed for inactivity]
Guest42592 has joined #ruby
jenrzzz has joined #ruby
fr3tz0r has joined #ruby
akem-lnvo has joined #ruby
alem0lars has joined #ruby
akem-hp has quit [Remote host closed the connection]
absolutejam has joined #ruby
snickers has joined #ruby
megamos has joined #ruby
suukim has quit [Quit: Konversation terminated!]
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
johnny56 has joined #ruby
Fusl has quit [Max SendQ exceeded]
cd has joined #ruby
Fusl has joined #ruby
Fusl has quit [Max SendQ exceeded]
Fusl has joined #ruby
johnny56 has quit [Ping timeout: 272 seconds]
SeepingN has joined #ruby
colechristensen has joined #ruby
jaequery has joined #ruby
jenrzzz has quit [Ping timeout: 272 seconds]
m27frogy has quit [Quit: ZNC - https://znc.in]
m27frogy has joined #ruby
englishm has quit [Excess Flood]
englishm has joined #ruby
leitz has joined #ruby
megamos has quit [Ping timeout: 248 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Inline has quit [Quit: Leaving]
orbyt_ has joined #ruby
cyclonis has joined #ruby
cyclonis has quit [Excess Flood]
colechristensen has quit [Read error: Connection reset by peer]
colechristensen has joined #ruby
reber has joined #ruby
johnny56 has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
Nicmavr has joined #ruby
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
johnny56 has quit [Ping timeout: 272 seconds]
code_zombie has joined #ruby
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ascarter has joined #ruby
yalue has quit [Quit: Leaving]
kyrylo has joined #ruby
ElFerna has joined #ruby
colechristensen has quit [Read error: Connection reset by peer]
colechr60 has joined #ruby
<fr3tz0r> I'm trying to use self.text_input in gosu in a seperate class (Input) than my window class (which inherits Gosu::Window). I passed a reference to an instance of the window to the Input class and call window.text_input but get undefined method text_input, Why?
kyrylo has quit [Ping timeout: 245 seconds]
ljarvis has joined #ruby
jonarrien has joined #ruby
<ljarvis> :)
psilly0 has joined #ruby
sphenxes has quit [Remote host closed the connection]
psilly0 has quit [Quit: psilly0]
tf2ftw has quit [Ping timeout: 246 seconds]
psilly0 has joined #ruby
tf2ftw has joined #ruby
LtHummus has quit [Quit: ZNC 1.7.3 - https://znc.in]
ur5us has joined #ruby
Aaron has joined #ruby
Aaron is now known as Guest29808
Guest29808 has quit [Remote host closed the connection]
jaequery has joined #ruby
LtHummus has joined #ruby
queip has quit [Ping timeout: 268 seconds]
Xeago_ has joined #ruby
Xeago has quit [Ping timeout: 272 seconds]
Xeago_ is now known as Xeago
ElFerna has quit [Quit: Konversation terminated!]
xco has quit [Quit: xco]
ElFerna has joined #ruby
yo-wan has quit [Ping timeout: 268 seconds]
reber has quit [Read error: Connection reset by peer]
queip has joined #ruby
mozzarella has quit [Ping timeout: 244 seconds]
xco has joined #ruby
CCDelivery has joined #ruby
mozzarella has joined #ruby
lxsameer has joined #ruby
schne1der has quit [Ping timeout: 248 seconds]
dellavg_ has quit [Ping timeout: 268 seconds]
colechr60 has quit [Read error: Connection reset by peer]
colechristensen has joined #ruby
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xco has quit [Quit: xco]
alem0lars has quit [Read error: Connection reset by peer]
lepepe_ has quit [Remote host closed the connection]
lepepe has joined #ruby
alan_w has quit [Ping timeout: 244 seconds]
kurko__ has quit [Read error: Connection reset by peer]
ascarter has joined #ruby
kurko_ has joined #ruby
lepepe has quit [Ping timeout: 258 seconds]
cliluw has quit [Read error: Connection reset by peer]
cliluw has joined #ruby
lxsameer has quit [Ping timeout: 258 seconds]
cliluw has quit [Read error: Connection reset by peer]
cliluw has joined #ruby
cliluw has quit [Read error: Connection reset by peer]
ascarter_ has joined #ruby
ascarter has quit [Read error: Connection reset by peer]
cliluw has joined #ruby
_falsebay_ has quit [Read error: Connection reset by peer]
psilly0 has quit [Quit: psilly0]
snickers has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cammellos has quit [Ping timeout: 258 seconds]
psilly0 has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
queip has quit [Ping timeout: 246 seconds]
involans has quit [Quit: involans]
sarink has quit [Remote host closed the connection]
queip has joined #ruby
jenrzzz has joined #ruby
TomyLobo has joined #ruby
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lepepe has joined #ruby
lepepe has quit [Ping timeout: 245 seconds]
ellcs has joined #ruby
ellcs has quit [Max SendQ exceeded]
ellcs has joined #ruby
sarink has joined #ruby
akem_lnvo has joined #ruby
bjpenn has quit [Quit: leaving]
akem-lnvo has quit [Ping timeout: 248 seconds]
jonarrien has quit [Quit: Textual IRC Client: www.textualapp.com]
BTRE has quit [Remote host closed the connection]
BTRE has joined #ruby
CCDelivery_ has joined #ruby
CCDelivery has quit [Read error: Connection reset by peer]
lepepe has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.5]
ElFerna has quit [Ping timeout: 268 seconds]
sarink has quit [Remote host closed the connection]
TomyLobo has quit [Read error: Connection reset by peer]
ellcs has quit [Ping timeout: 252 seconds]
lepepe has quit [Ping timeout: 272 seconds]
colechristensen has quit [Read error: Connection reset by peer]
colechristensen has joined #ruby
codefriar has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
absolutejam has quit [Ping timeout: 248 seconds]
unreal has quit [Ping timeout: 245 seconds]
tf2ftw has quit [Quit: This computer has gone to sleep]
<fr3tz0r> any ideas?
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
colechr94 has joined #ruby
unreal has joined #ruby
colechristensen has quit [Read error: Connection reset by peer]
kurko_ has quit [Ping timeout: 248 seconds]
orbyt_ has joined #ruby
kurko_ has joined #ruby
<adam12> fr3tz0r: Can you share some code?
lepepe has joined #ruby