havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.6.5, 2.5.7, 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!
gorsuch has quit [Remote host closed the connection]
gix has joined #ruby
xarthna_ has joined #ruby
agent_white has joined #ruby
blackmesa1 has quit [Ping timeout: 276 seconds]
Fernando-Basso has quit [Quit: Leaving]
drincruz has quit [Ping timeout: 240 seconds]
bambanx has quit [Remote host closed the connection]
bambanx has joined #ruby
agent_white has quit [Quit: brb]
agent_white has joined #ruby
cloaked1 has joined #ruby
cloaked1 has joined #ruby
cloaked1 has quit [Changing host]
xarthna_ has quit [Ping timeout: 240 seconds]
gorsuch has joined #ruby
cloaked1 has quit [Client Quit]
cyclonis_ has joined #ruby
tdy has joined #ruby
al2o3-cr has quit [Quit: WeeChat 2.6]
cyclonis has quit [Ping timeout: 250 seconds]
al2o3-cr has joined #ruby
eljimmy has joined #ruby
darkwingchuck has joined #ruby
n88 has quit [Ping timeout: 265 seconds]
al2o3-cr has quit [Quit: WeeChat 2.6]
al2o3-cr has joined #ruby
ogres has quit [Quit: Connection closed for inactivity]
RougeR has quit [Ping timeout: 240 seconds]
lucasb has quit [Quit: Connection closed for inactivity]
Mia has quit [Ping timeout: 240 seconds]
wildtrees has quit [Quit: Leaving]
xarthna__ has joined #ruby
gix has quit [Ping timeout: 240 seconds]
kyrylo has joined #ruby
<adam12> Frankenstein: Sequel
<adam12> Frankenstein: Ships with a tool called `sequel` that can run migrations from a folder. sequel -m migrations/ postgres://localhost/databasename
<Frankenstein> ah, that looks perfect. thanks!
<Frankenstein> Assuming that's this? https://github.com/jeremyevans/sequel
<adam12> Frankenstein: Sequel is awesome. One of the best parts of the Ruby ecosystem, IMHO.
<adam12> Frankenstein: That's the one!
<Frankenstein> great, thanks!
bambanx has quit [Ping timeout: 268 seconds]
witlesswonder__ has quit [Quit: Leaving]
arahael has quit [Ping timeout: 264 seconds]
witlesswonder has joined #ruby
arahael has joined #ruby
DaRock has joined #ruby
akemhp_ has joined #ruby
akem__ has quit [Ping timeout: 268 seconds]
mynameisdebian has quit [Ping timeout: 250 seconds]
sytherax has joined #ruby
xarthna_1 has joined #ruby
dbz_ has joined #ruby
xarthna__ has quit [Ping timeout: 265 seconds]
darkwingchuck has quit [Ping timeout: 240 seconds]
dbz_ has quit []
mynameisdebian has joined #ruby
eljimmy has quit [Quit: This computer has gone to sleep]
fphilipe has joined #ruby
Mia has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
SzeregowyPosel has quit [Quit: Bye Bye]
fphilipe has quit [Ping timeout: 276 seconds]
tsujp_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sytherax has quit [Remote host closed the connection]
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Mia has quit [Read error: Connection reset by peer]
jeremycw has joined #ruby
Mia has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
mynameisdebian has quit [Ping timeout: 240 seconds]
reyfi9e has quit [Quit: Konversation term]
sytherax has joined #ruby
tdy has quit [Ping timeout: 268 seconds]
jeremycw has quit [Ping timeout: 276 seconds]
sytherax has quit [Remote host closed the connection]
baojg has quit [Remote host closed the connection]
ExoUNX has joined #ruby
sytherax has joined #ruby
sytherax has quit [Remote host closed the connection]
tdy has joined #ruby
sgen has quit [Ping timeout: 245 seconds]
sytherax has joined #ruby
howdoi has joined #ruby
dasher00 has quit [Ping timeout: 240 seconds]
bambanx has joined #ruby
inkvar has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bradleyprice has joined #ruby
bambanx has quit [Ping timeout: 250 seconds]
cyclonis_ has quit [Quit: -a- IRC for Android 2.1.55]
cyclonis has joined #ruby
bradleyprice has quit [Ping timeout: 250 seconds]
akem__ has joined #ruby
brool has quit [Ping timeout: 250 seconds]
akemhp_ has quit [Ping timeout: 240 seconds]
bradleyprice has joined #ruby
jeremycw has joined #ruby
jeremycw has quit [Ping timeout: 240 seconds]
tsujp has joined #ruby
tdy has quit [Ping timeout: 250 seconds]
cyclonis_ has joined #ruby
cycloni62 has joined #ruby
cyclonis has quit [Read error: Connection reset by peer]
fphilipe has joined #ruby
cyclonis_ has quit [Ping timeout: 250 seconds]
fphilipe has quit [Ping timeout: 245 seconds]
bradleyprice has quit [Remote host closed the connection]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
agent_white has quit [Quit: bbl]
arahael has quit [Ping timeout: 276 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
arahael has joined #ruby
dionysus69 has quit [Remote host closed the connection]
dionysus69 has joined #ruby
xarthna_1 has quit [Ping timeout: 250 seconds]
chalkmonster has joined #ruby
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
xarthna__ has joined #ruby
sytherax has quit [Remote host closed the connection]
tdy has joined #ruby
sytherax has joined #ruby
sytherax has quit [Ping timeout: 265 seconds]
baojg has joined #ruby
xarthna__ has quit [Ping timeout: 240 seconds]
akem__ has quit [Ping timeout: 240 seconds]
akem__ has joined #ruby
akemhp has joined #ruby
akem__ has quit [Ping timeout: 276 seconds]
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
sytherax has joined #ruby
akemhp has quit [Ping timeout: 276 seconds]
akemhp has joined #ruby
Swyper has quit [Remote host closed the connection]
mynameisdebian has joined #ruby
mynameisdebian has quit [Client Quit]
akemhp has quit [Ping timeout: 250 seconds]
mossplix has joined #ruby
tuxaanand has joined #ruby
<Frankenstein> is it possible to chain a method to a heredoc?
<Frankenstein> e.g. foo <<-EOF ... EOF.to_h
tuxaanand has quit [Quit: -a- IRC for Android 2.1.55]
<Frankenstein> oh, its attached to the <<-EOF
<Frankenstein> nmd
<leftylink> great
witlesswonder has quit [Remote host closed the connection]
cthulchu_ has quit [Read error: Connection reset by peer]
sandstrom has joined #ruby
sandstrom has quit [Client Quit]
howdoi has quit [Quit: Connection closed for inactivity]
sauvin has joined #ruby
sytherax has quit [Ping timeout: 240 seconds]
sandstrom has joined #ruby
Inline has quit [Quit: Leaving]
blackmesa1 has joined #ruby
tdy has quit [Ping timeout: 265 seconds]
akemhp has joined #ruby
fphilipe has joined #ruby
m3ssia has quit [Quit: ZNC 1.6.3+deb1ubuntu0.2 - http://znc.in]
blackmesa1 has quit [Ping timeout: 250 seconds]
jmcgnh has quit [Ping timeout: 265 seconds]
stooj has quit [Quit: ZNC 1.7.3 - https://znc.in]
stooj has joined #ruby
m3ssia has joined #ruby
blackmesa1 has joined #ruby
kyrylo has joined #ruby
akemhp_ has joined #ruby
akemhp has quit [Ping timeout: 276 seconds]
cycloni62 has quit [Remote host closed the connection]
blackmesa1 has quit [Ping timeout: 250 seconds]
jmcgnh has joined #ruby
andikr has joined #ruby
mossplix has quit [Remote host closed the connection]
mossplix has joined #ruby
mossplix has quit [Remote host closed the connection]
mossplix has joined #ruby
cd has quit [Quit: cd]
jdeen has quit [Remote host closed the connection]
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<markand> hello
<markand> it is said that since ruby 2.1.0 there is semantic versioning in Ruby
<markand> however, someone pointed me out the fact that gitlab as issues migrating to newer versions of ruby, how is that possible then?
fphilipe has quit [Ping timeout: 276 seconds]
<havenwood> markand: It's semantic in that major version means an incompatible special event, minor means API incompatible, and teeny is an API compatible bug or security fix.
<markand> also it is said that API incompatibilities may be found in minor version which is the opposite of semantic versioning
<markand> API means in the C API or also in Ruby modules?
<havenwood> markand: Both.
<markand> so ruby 2.8 can be incompatible with 2.7 then?
<havenwood> markand: Yes, it will be. It's not "Semantic Versioning 2.0.0" but similarly semantic versioning.
<havenwood> markand: It will be incompatible.
tpanarch1st has quit [Ping timeout: 240 seconds]
dionysus69 has quit [Quit: dionysus69]
<markand> :/
<havenwood> markand: Ruby 2.7 will be released on Christmas. ¯\_(ツ)_/¯ Ruby 2.8 will be released on Christmas.
<havenwood> markand: Think of the Ruby MAJOR as ornamentation, the MINOR as a Semantic Versioning MAJOR, and PATCH as a combination of MINOR and PATCH.
TomyWork has joined #ruby
<markand> okay
<markand> so I think I should either provide several versions of ruby at once in my distribution or to wait that all packages are compatible with
<havenwood> markand: Matz is slowing the breaking changes in Ruby. The biggest breaking change was Ruby 1.8 to 1.9. Since then it's been trending towards compatibility rather than breakage.
<markand> yay, my book I'm currently reading always compare 1.8 <-> 1.9
<havenwood> markand: Since 1.8 is long gone, I'd solely focus on 1.9+.
jeremycw has joined #ruby
<leftylink> hmm, now I want to find out when I started ruby
<havenwood> markand: Most Rubyists use latest stable or a MINOR behind it.
sandstrom has quit [Quit: My computer has gone to sleep.]
<havenwood> markand: But yeah, it's not abnormal to depend on more than one version with a variety of libs.
<leftylink> .... 2010?!?!?!
<leftylink> I didn't even know that about myself
<leftylink> what version was that then
schne1der has joined #ruby
<leftylink> 1.9 was out, I probably used that and didn't do 1.8
<leftylink> probably
priodev has quit [Ping timeout: 240 seconds]
jeremycw has quit [Ping timeout: 250 seconds]
<havenwood> leftylink: 1.9 was released in 2010. That's when I started Ruby!
ltp has quit [Remote host closed the connection]
ltp has joined #ruby
priodev has joined #ruby
sytherax has joined #ruby
mossplix has quit [Remote host closed the connection]
absolutejam has joined #ruby
fphilipe has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
sandstrom has joined #ruby
Fridtjof has quit [Ping timeout: 240 seconds]
Nicmavr has joined #ruby
ur5us has quit [Remote host closed the connection]
wouter71 has joined #ruby
wouter71 has left #ruby [#ruby]
mossplix has joined #ruby
<Frankenstein> can't wait for ruby 3 to become a totally different language, so we can have our own major split
KeyJoo has joined #ruby
ur5us has joined #ruby
wouter71 has joined #ruby
wouter71 has quit [Client Quit]
Fridtjof has joined #ruby
Intelo has joined #ruby
fphilipe has quit [Ping timeout: 240 seconds]
jmcgnh has quit [Ping timeout: 240 seconds]
ellcs has joined #ruby
dionysus69 has joined #ruby
jmcgnh has joined #ruby
sytherax has quit [Ping timeout: 250 seconds]
<havenwood> Frankenstein: Luckily that one language already did that so we already know it's no fun and can avoid.
<Frankenstein> haha
fphilipe has joined #ruby
n88 has joined #ruby
bradleyprice has joined #ruby
leitz has joined #ruby
bradleyprice has quit [Ping timeout: 250 seconds]
NL3limin4t0r_afk is now known as NL3limin4t0r
ellcs has quit [Ping timeout: 245 seconds]
<ytti> we sort of had that moment from 1.8 to 1.9
bitwinery has quit [Quit: Leaving]
<ytti> i think lesson learned is, don't introduce many large changes rapidly
<ytti> trickle them in
<ytti> so that people convert them code becausae 'oh i just need to change this one thing'
inkvar has joined #ruby
<ytti> in reality converting python2 to python3 is easy and fast, but people are super lazy
<ytti> so you need to manipulate people's behaviour
fphilipe has quit [Read error: Connection reset by peer]
<ytti> if you trickle breaking changes, people will move with the changes
<ytti> if you overload them, you'll cause split
<Frankenstein> makes sense. i was a lot more willing to read the 2.6 changes than learn about py3
blackmesa1 has joined #ruby
dionysus69 has quit [Quit: dionysus69]
absolutejam has quit [Ping timeout: 240 seconds]
absolutejam has joined #ruby
n88 has quit [Ping timeout: 250 seconds]
sandstro_ has joined #ruby
sandstrom has quit [Ping timeout: 276 seconds]
Ai9zO5AP has joined #ruby
Intelo has quit [Remote host closed the connection]
Intelo has joined #ruby
fphilipe has joined #ruby
tsujp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ellcs has joined #ruby
krandi has joined #ruby
andikr has quit [Ping timeout: 268 seconds]
Intelo has quit [Ping timeout: 250 seconds]
Intelo has joined #ruby
krandi has quit [Ping timeout: 265 seconds]
ur5us has quit [Remote host closed the connection]
andikr has joined #ruby
sylario has joined #ruby
andikr has quit [Ping timeout: 265 seconds]
deathwishdave has joined #ruby
dostoyevsky has quit [Quit: leaving]
dostoyevsky has joined #ruby
dionysus69 has joined #ruby
sytherax has joined #ruby
AJA4350 has joined #ruby
dionysus70 has joined #ruby
dionysus69 has quit [Ping timeout: 240 seconds]
dionysus70 is now known as dionysus69
Intelo has quit [Ping timeout: 265 seconds]
inkvar has quit [Quit: Textual IRC Client: www.textualapp.com]
SzeregowyPosel has joined #ruby
Swyper has joined #ruby
yann-kaelig has joined #ruby
tsujp has joined #ruby
n88 has joined #ruby
andikr has joined #ruby
sytherax has quit [Ping timeout: 276 seconds]
mossplix has quit [Remote host closed the connection]
Jonopoly has joined #ruby
mossplix has joined #ruby
KeyJoo has quit [Quit: KeyJoo]
mossplix has quit [Remote host closed the connection]
darkwingchuck has joined #ruby
dionysus69 has quit [Remote host closed the connection]
dionysus69 has joined #ruby
mossplix has joined #ruby
mossplix has quit [Remote host closed the connection]
mossplix has joined #ruby
Intelo has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Technodrome has joined #ruby
Technodrome has quit [Client Quit]
Technodrome has joined #ruby
Technodrome has quit [Client Quit]
Technodrome has joined #ruby
Technodrome has quit [Client Quit]
dasher00 has joined #ruby
wildermind has joined #ruby
<ytti> hmps
<ytti> using Monkey
<ytti> class CLI
<ytti> def run
<ytti> p {}.public_methods.grep(/keys/)
<ytti> using Monkey doesnt complain anything, so it finds it
<ytti> yet, i don't have the methods there
<ytti> http://p.ip.fi/Rb_w - contents
<ytti> if i change it to straight up monkey patch, the methods are visible
tsujp_ has joined #ruby
tsujp has quit [Ping timeout: 268 seconds]
<c-c> ytti: gist
mossplix has quit [Read error: Connection reset by peer]
<jhass> that's according to spec initially (any kind of reflection/introspection ignores refinements) but looks like they're moving towards allowing it https://bugs.ruby-lang.org/issues/11476
<jhass> so you probably could get through a ticket that fixes that
<c-c> ytti: are you saying that the methods you added to the module with "refine", are not available with "using"?
mossplix has joined #ruby
<NL3limin4t0r> c-c: I believe he's saying that they don't show up in the #public_methods array.
absolutejam has quit [Ping timeout: 264 seconds]
sytherax has joined #ruby
absolutejam has joined #ruby
darkwingchuck has quit [Ping timeout: 268 seconds]
mossplix has quit [Read error: Connection reset by peer]
mossplix has joined #ruby
mossplix has quit [Ping timeout: 240 seconds]
Swyper has quit [Remote host closed the connection]
bradleyprice has joined #ruby
mossplix has joined #ruby
bradleyprice has quit [Ping timeout: 246 seconds]
al2o3-cr has quit [Quit: WeeChat 2.6]
al2o3-cr has joined #ruby
darkwingchuck has joined #ruby
millerti has joined #ruby
cyclonis has joined #ruby
tdy has joined #ruby
mossplix has quit [Remote host closed the connection]
mossplix has joined #ruby
<ytti> date
zodd has joined #ruby
zodd is now known as Guest26043
Guest26043 is now known as zodd_
z4phod_ is now known as z4phod
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4351 is now known as AJA4350
blackmesa1 has quit [Ping timeout: 268 seconds]
brendan- has quit [Ping timeout: 240 seconds]
sytherax has quit [Ping timeout: 265 seconds]
brendan- has joined #ruby
SzeregowyPosel has quit [Quit: Bye Bye]
schne1der has quit [Ping timeout: 245 seconds]
mossplix has quit [Remote host closed the connection]
stryek has joined #ruby
mossplix has joined #ruby
mossplix has quit [Ping timeout: 268 seconds]
sytherax has joined #ruby
blackmesa1 has joined #ruby
suukim has joined #ruby
cyclonis_ has joined #ruby
cyclonis has quit [Ping timeout: 250 seconds]
mossplix has joined #ruby
schne1der has joined #ruby
absolutejam has quit [Ping timeout: 268 seconds]
<rapha> trying to sort a hash with keys such as :A, :B, :C, ... :AA, :AB, ... but failing. what's my mistake in `sort_by {|key| key.to_s.rjust(2, '0')}`?
mcspud has quit [Ping timeout: 276 seconds]
lucasb has joined #ruby
drincruz has joined #ruby
mcspud has joined #ruby
akem__ has joined #ruby
<c-c> rapha: perhaps the 1 char symbol string get padded with leading zero
AJA4350 has quit [Ping timeout: 245 seconds]
<c-c> rapha use gist to share irb session or source
<rapha> c-c: no, i checked: "A" becomes "0A" and "AA" remains "AA".
AJA4350 has joined #ruby
<rapha> but yes, i should ... second
<c-c> so what do you expect sort_by to do, rapha ?
akemhp_ has quit [Ping timeout: 240 seconds]
<c-c> rapha what if your sort_by block is simply 'key'
<c-c> I mean: { |k| k }
<c-c> >>{a:1,b:2,c:3,aa:4,ab:5,ac:6}.sort_by {|k| k}
<ruby[bot]> c-c: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
<rapha> c-c: same result. to ruby, "aa" comes immediatel after "a" and certainly not after "b".
<rapha> weird that the bot can't interpret that
<havenwood> &>>{a:1,b:2,c:3,aa:4,ab:5,ac:6}.sort_by {|k| k}
<rubydoc> # => [[:a, 1], [:aa, 4], [:ab, 5], [:ac, 6], [:b, 2], [:c, 3]] (https://carc.in/#/r/7tf8)
<rapha> havenwood: what did the & do?
<havenwood> rapha: It ask's phaul's bot to eval.
<havenwood> rapha: (Different bot.0
<rapha> hah! got it!
<al2o3-cr> &>> {a:1,b:2,c:3,aa:4,ab:5,ac:6}.sort_by { |k, _| k.size }
<rubydoc> # => [[:a, 1], [:b, 2], [:c, 3], [:aa, 4], [:ab, 5], [:ac, 6]] (https://carc.in/#/r/7tf9)
<rapha> &>> {a:1,b:2,c:3,aa:4,ab:5,ac:6}.sort_by {|k| k.to_s.rjust(2,'0') <=> k.to_s.rjust(2,'0') }
<rubydoc> # => [[:a, 1], [:b, 2], [:c, 3], [:aa, 4], [:ab, 5], [:ac, 6]] (https://carc.in/#/r/7tfa)
<sh7d> tip:
<rapha> okay, al2o3-cr's is much more elegant
SzeregowyPosel has joined #ruby
<sh7d> &>> {a:1,b:2,c:3,aa:4,ab:5,ac:6}.sort_by {|k| k}.then(&Hash.method(:[]))
<rubydoc> # => {:a=>1, :aa=>4, :ab=>5, :ac=>6, :b=>2, :c=>3} (https://carc.in/#/r/7tfb)
<rapha> sh7d: or simply .to_h at the end
<sh7d> thers is ?
<al2o3-cr> &>> {a:1,b:2,c:3,aa:4,ab:5,ac:6}.sort_by &:size
<rubydoc> # => [[:a, 1], [:b, 2], [:c, 3], [:aa, 4], [:ab, 5], [:ac, 6]] (https://carc.in/#/r/7tfc)
<rapha> okay, even more elegant
<rapha> damn
<rapha> thank you al2o3-cr
<al2o3-cr> ok rapha ;)
darkwingchuck has quit [Ping timeout: 268 seconds]
<al2o3-cr> rapha: with the keys being symbols you can actually sort by object_id too
<al2o3-cr> &>> {a:1,b:2,c:3,aa:4,ab:5,ac:6}.sort_by &:object_id
<rubydoc> # => [[:c, 3], [:b, 2], [:a, 1], [:ac, 6], [:ab, 5], [:aa, 4]] (https://carc.in/#/r/7tfd)
<al2o3-cr> ah, nvm
wildermind has quit [Quit: Connection closed for inactivity]
<rapha> funky
<al2o3-cr> with being little endian
<rapha> when i hear "endian" i remember there are people who actually study compsci and i run away
<rapha> one thing that's awesome btw:
<rapha> &>> 'Z'.next!
<rubydoc> # => "AA" (https://carc.in/#/r/7tff)
<rapha> :-D
<sh7d> lel
<al2o3-cr> what am i going on about
<rapha> al2o3-cr: seems to not work universally: https://gist.github.com/sixtyfive/c7ffe2dc797aba42569d7d937e0b32d1
<al2o3-cr> &>> {a:1,b:2,c:3,aa:4,ab:5,ac:6}.to_a
<rubydoc> # => [[:a, 1], [:b, 2], [:c, 3], [:aa, 4], [:ab, 5], [:ac, 6]] (https://carc.in/#/r/7tfl)
Rapture has joined #ruby
<rapha> o_O
<rapha> hahahah it still goes D, F, A, B...
<al2o3-cr> but really that hash is more complex that what you showed
<al2o3-cr> so it won't work
<rapha> true but i don't understand how that complexity changes anything, al2o3-cr?
<rapha> i mean all of that is in the values, not the keys
<al2o3-cr> how big is @tree hash is it pastable?
<rapha> it can grow very big but that was a complete example of a shorter one
<rapha> also it has infinite depth but i'm only interested in sorting at the top
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
ellcs has quit [Ping timeout: 268 seconds]
<al2o3-cr> do you need it back to a hash?
bradleyprice has joined #ruby
jeremycw has joined #ruby
voices has joined #ruby
blackmesa1 has quit [Ping timeout: 276 seconds]
<rapha> yes ... is that what's unsorting it again?
<rapha> HAH! got it! somehow...
<rapha> @tree = @tree.sort_by {|k, _| k.rjust(2,'0')}.to_h after @tree.deep_stringify_keys works!
darkwingchuck has joined #ruby
<al2o3-cr> there's another way, i just can't think of it off the top of my head.
blackmesa1 has joined #ruby
<rapha> that's fine, i want to deep_stringify anyways before converting it to yaml
* rapha sighs in relief
<al2o3-cr> cool
jmcgnh has quit [Ping timeout: 252 seconds]
<voices> hi im not a ruby programmer. if a ruby script has something like
<voices> depends_on "thing1"
<voices> depends_on "thing2"
<voices> is there a way to not have to type depends_on twice? that's just basic iteration i guess, but is there a shorthand syntax or something for that? with bash for instance you might just wrap the two strings in braces like depends_on {"thing1","thing2"}
<adam12> voices: Either depends_on accpets an Array, or you use an Array here and call depends_on in the loop (iteration).
bvdw has quit [Read error: Connection reset by peer]
cow[moo] has joined #ruby
mjsmith2 has joined #ruby
<adam12> voices: If you just want to simplify your example. ["thing1", "thing2"].each {|thing| depends_on(thing) }
<NL3limin4t0r> rapha: Keep in mind that only sorting by size wont yield the correct result in all situations.
donofrio_ has quit [Remote host closed the connection]
<NL3limin4t0r> &>> {b: 1, a: 2, c: 3, bb: 4, bc: 5, ba: 6, ac: 7}.sort_by { |key,| key.size }
<rubydoc> # => [[:b, 1], [:a, 2], [:c, 3], [:bb, 4], [:bc, 5], [:ba, 6], [:ac, 7]] (https://carc.in/#/r/7tfx)
donofrio has joined #ruby
mossplix has quit [Remote host closed the connection]
tdy has quit [Ping timeout: 246 seconds]
mossplix has joined #ruby
cow[moo] has quit [Ping timeout: 268 seconds]
<mjsmith2> Hello, I have ruby cli tool I am writing tests for using rspec. I am following the 4 phase pattern of setup, exercise, verify, teardown. Some of the behavior comes from a shared module so I have a few shared examples to assert behavior coming from this module. What I'm stuck on is asserting that the cli throws an error within this shared example. The test will exit in the execution phase before I can catch the error in the test. Has anyone tack
<mjsmith2> led a problem like this before and have recommendations for how to approach it? - Thanks
Intelo has quit [Ping timeout: 268 seconds]
<NL3limin4t0r> &>> {b: 1, a: 2, c: 3, bb: 4, bc: 5, ba: 6, ac: 7}.sort { |(key_a,), (key_b,)| size_comp = key_a <=> key_b; next size_comp unless size_comp.zero?; key_a <=> key_b }
<rubydoc> stderr: -e:4: syntax error, unexpected ')'... check link for more (https://carc.in/#/r/7tg4)
mossplix has quit [Ping timeout: 264 seconds]
<NL3limin4t0r> &>> {b: 1, a: 2, c: 3, bb: 4, bc: 5, ba: 6, ac: 7}.sort { |(key_a,_), (key_b,_)| size_comp = key_a <=> key_b; next size_comp unless size_comp.zero?; key_a <=> key_b }
<rubydoc> # => [[:a, 2], [:ac, 7], [:b, 1], [:ba, 6], [:bb, 4], [:bc, 5], [:c, 3]] (https://carc.in/#/r/7tga)
<NL3limin4t0r> hmm
<NL3limin4t0r> &>> {b: 1, a: 2, c: 3, bb: 4, bc: 5, ba: 6, ac: 7}.sort { |(key_a,_), (key_b,_)| size_comp = key_a.size <=> key_b.size; next size_comp unless size_comp.zero?; key_a <=> key_b }
<rubydoc> # => [[:a, 2], [:b, 1], [:c, 3], [:ac, 7], [:ba, 6], [:bb, 4], [:bc, 5]] (https://carc.in/#/r/7tgd)
<NL3limin4t0r> Forgot the .size in the first comparison
<voices> adam12: oo that seems awkward. doesn't it? i thought ruby might have some cute terse syntax for that. i guess not
<adam12> voices: What's awkward about it? If depends_on supports an array, just call it with one. depends_on "thing1", "thing2"
andikr has quit [Remote host closed the connection]
<NL3limin4t0r> mjsmith2: I'm not sure if I can help, but a code sample of the failing test could help me or others understand what the issue is.
impermanence has joined #ruby
<mjsmith2> @ NL3limin4t0r I'll put together a small example
ellcs has joined #ruby
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4351 is now known as AJA4350
brendan- has quit [Ping timeout: 245 seconds]
darkwingchuck has quit [Quit: Lost terminal]
xarthna_ has joined #ruby
<voices> i expected
<voices> ["thing1", "thing2"].each { |thing| depends_on(thing) } to just more be like
<voices> depends_on ["thing1", "thing2"]
brendan- has joined #ruby
<al2o3-cr> NL3limin4t0r: that's nice! but i was sure there were a different way of going about this. maybe not.
cow[moo] has joined #ruby
Inline has joined #ruby
absolutejam has joined #ruby
eljimmy has joined #ruby
DaRock has quit [Remote host closed the connection]
conta2 has joined #ruby
xarthna_ has quit [Ping timeout: 240 seconds]
tsujp_ has quit [Ping timeout: 264 seconds]
ajunior has joined #ruby
SzeregowyPosel has quit [Quit: Bye Bye]
poontangmessiah has joined #ruby
jmcgnh has joined #ruby
<NL3limin4t0r> I'm dump, just realized that the following is way easier
ajunior has quit [Excess Flood]
<NL3limin4t0r> &>> {b: 1, a: 2, c: 3, bb: 4, bc: 5, ba: 6, ac: 7}.sort_by { |key,| [key.size, key] }
<rubydoc> # => [[:a, 2], [:b, 1], [:c, 3], [:ac, 7], [:ba, 6], [:bb, 4], [:bc, 5]] (https://carc.in/#/r/7tgs)
<NL3limin4t0r> dumb*
tsujp has joined #ruby
ajunior has joined #ruby
<NL3limin4t0r> forgot that array naturally walks down the elements until it finds one that isn't even
<al2o3-cr> NL3limin4t0r: that's way better. nice catch
ajunior has quit [Client Quit]
<rapha> NL3limin4t0r: it's cool now, i'm just doing the other thing (with the rjust) and that's working fine!
<NL3limin4t0r> 👍
ua has quit [Excess Flood]
ua has joined #ruby
bvdw has joined #ruby
SeepingN has joined #ruby
bradleyprice_ has joined #ruby
dionysus69 has quit [Ping timeout: 250 seconds]
bradleyprice_ has quit [Remote host closed the connection]
bradleyprice_ has joined #ruby
poontangmessiah has quit [Read error: Connection reset by peer]
bradleyprice has quit [Ping timeout: 250 seconds]
poontangmessiah has joined #ruby
blackmesa1 has quit [Ping timeout: 268 seconds]
Jonopoly has quit [Quit: WeeChat 2.5]
poontangmessiah has quit [Remote host closed the connection]
poontangmessiah has joined #ruby
TomyWork has quit [Ping timeout: 246 seconds]
jmcgnh has quit [Ping timeout: 265 seconds]
sytherax has quit [Remote host closed the connection]
dionysus69 has joined #ruby
sytherax has joined #ruby
cthulchu_ has joined #ruby
voices has left #ruby [#ruby]
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 264 seconds]
AJA4351 is now known as AJA4350
akemhp_ has joined #ruby
sytherax has quit [Ping timeout: 268 seconds]
akem__ has quit [Ping timeout: 240 seconds]
conta2 has quit [Quit: conta2]
jmcgnh has joined #ruby
absolutejam has quit [Ping timeout: 265 seconds]
bambanx has joined #ruby
conta2 has joined #ruby
bradleyprice_ has quit [Remote host closed the connection]
poontangmessiah has quit [Read error: Connection reset by peer]
poontangmessiah has joined #ruby
haxx0r has joined #ruby
zodd_ has quit [Ping timeout: 265 seconds]
wildtrees has joined #ruby
wildtrees has quit [Max SendQ exceeded]
dretnx has joined #ruby
bradleyprice has joined #ruby
wildtrees has joined #ruby
brool has joined #ruby
Ai9zO5AP has quit [Ping timeout: 265 seconds]
nowhere_man has joined #ruby
hiroaki_ has joined #ruby
sytherax has joined #ruby
suukim has quit [Quit: Konversation terminated!]
haxx0r has quit [Remote host closed the connection]
Ai9zO5AP has joined #ruby
conta2 has quit [Ping timeout: 265 seconds]
Ai9zO5AP has quit [Excess Flood]
queip has quit [Ping timeout: 240 seconds]
Azure has quit [Read error: Connection reset by peer]
orbyt_ has joined #ruby
queip has joined #ruby
baojg has quit [Remote host closed the connection]
Azure has joined #ruby
conta has joined #ruby
pb122 has joined #ruby
pb122_2 has joined #ruby
pb122_2 has quit [Read error: Connection reset by peer]
Ai9zO5AP has joined #ruby
jmcgnh has quit [Read error: Connection reset by peer]
tdy has joined #ruby
ewanchic has joined #ruby
Intelo has joined #ruby
<ewanchic> Hey all! I have a questions about gem creation and add_dependency in the .gemspec file. is this the right place to ask?
<adam12> ewanchic: Ask.
xarthna_ has joined #ruby
AJA4351 has joined #ruby
absolutejam has joined #ruby
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4351 is now known as AJA4350
<ewanchic> addam12: Thanks! In my gem, I'm I have a { spec.add_dependency "rails", "6.0.0" }. I'm now realizing I need to go back to rails 5.2.3 for now. So, I want to keep my code for rails 6, and be able to specify which rails that I want to install/use. Typically when I use RVM, I'll have my rails versions spereated by gemsets. One idea I have is to split/fork my gem for different rails versions, but I'm hoping there is another better way than wha
<ewanchic> t I'm thinking of.
sandstro_ has quit [Ping timeout: 276 seconds]
gix has joined #ruby
sytherax has quit [Ping timeout: 245 seconds]
<ewanchic> adam12: I'm going to face this issue again when there is a rails 6.1, 6.2, 7.0, etc.
<adam12> ewanchic: You're dependency is way too narrow. You likely want to break them up with a few greater than / less thans.
Intelo has quit [Ping timeout: 264 seconds]
yann-kaelig has quit [Quit: yann-kaelig]
<wildtrees> is there a .flatten method/function that will only flatten a nested array one level? not flatten all the arrays together?
<adam12> ewanchic: In this case, Roda 5.0 isn't out yet, but I've tested each time for 2, 3, and 4.x. Once Roda 5 comes out, I test, then bump up the limitation again to < 6.0.
<adam12> wildtrees: Array.flatten accepts a level to flatten. Does Array.flatten(1) work for you?
conta has quit [Ping timeout: 265 seconds]
<ewanchic> adam12: You're correct, it is to narrow. At first I'm thinking it "has to be", but now that I'm thinking about it, if I install the rails gem of my choice, first. Then install my gem, then my gem would see the variance and think it just fine. Therefore it won't not install a higher version of Rails. Am I think this correctly?
<ewanchic> adam12: Boy, I'm such a bad typer sometimes.
<adam12> ewanchic: If you're using bundler I doubt it will resolve your dependencies for you. That's the bigger issue imho.
<ewanchic> adam12: Well, I'm not using bundler initially. My gem should be installed via gem install first. But, I see what you are saying.
<adam12> ewanchic: If you want to support Rails 5 and 6, use something like spec.add_dependency "rails", ">= 5.0", "< 7.0". If you find you need to narrow it, move one or the other up or down. No point in restricting it like you would in a Gemfile as it will just cause other people (any probably you) agony.
<adam12> ewanchic: If you're using Rails, I think you might have no choice but use bundler. No? It's a dependency, and if bundler manipulates load path using something like the --vendor argument, system gems might not be visible.
<adam12> ewanchic: But I'm talking hypothetically. I haven't tested it.
<ewanchic> adam12: I'm going to give this a try. In addition, is there anyway for my gem to detect the current version of rails that is installed. Similar to your roda, can you detect which version of roda is installed?
<adam12> ewanchic: Convention is something like Rails::VERSION, tho I'm not sure they adhere to that. You should look (I don't know).
<adam12> ewanchic: There's probably a way to get it from the gem dependency tree too but that's likely overkill.
<ewanchic> adam12: Thanks so much! That helps out a lot!
<adam12> ewanchic: cheers!
absolutejam has quit [Ping timeout: 276 seconds]
blackmesa1 has joined #ruby
<NL3limin4t0r> ewanchic: You could also use the ~> syntax `spec.add_dependency "rails", "~> 6.0"` is the same as `spec.add_dependency "rails", ">= 6.0", "< 6.0"`
<NL3limin4t0r> That last argument should be `"< 6.0"`.
<NL3limin4t0r> That last argument should be `"< 7.0"`.
<NL3limin4t0r> can't type today ... -_-
jmcgnh has joined #ruby
sameerynho has joined #ruby
<ewanchic> NL3limin4t0r: Thanks!
<wildtrees> adam12, thanks that seems to be working just fine now :)
<NL3limin4t0r> wildtrees: If you're doing any mapping in combination with flattening don't forget about flat_map.
rippa has joined #ruby
<NL3limin4t0r> &ri Enumerable#flat_map
<wildtrees> that is what I was going for, is flat_map builtin for a bunch of classes in ruby these days?
<wildtrees> NL3limin4t0r, does flat_map flatten more than one level?
<NL3limin4t0r> No, it concatinates all resulting block return values, resulting in a flattening of 1 level.
<wildtrees> oh ok
<NL3limin4t0r> Inernally it might look something like this `result.concat(yield(current_element))` assume that `result` is an empty array to start with that is returned at the end of the iteration.
<wildtrees> concat map ?
NL3limin4t0r is now known as NL3limin4t0r_afk
<NL3limin4t0r_afk> Could be a better name, but since concatination of the resulting values results in an flattened array they chose to describe the result rather than the action.
<NL3limin4t0r_afk> For the same reason #yield_self is renamed to #then since, yield_self describes what it does rather then describing the result.
dionysus69 has quit [Ping timeout: 240 seconds]
<NL3limin4t0r_afk> &>> incr = ->n { n + 1 }; halve = ->n { n / 2 }; 1.then(&incr >> halve >> incr >> incr)
<rubydoc> # => 3 (https://carc.in/#/r/7thh)
<NL3limin4t0r_afk> gotta go though
dretnx has quit [Quit: Going offline, see ya! (www.adiirc.com)]
poontangmessiah has quit [Remote host closed the connection]
zodd_ has joined #ruby
dionysus69 has joined #ruby
zodd_ is now known as Guest23107
howdoi has joined #ruby
Xiti has quit [Read error: Connection reset by peer]
SeepingN has quit [Read error: Connection reset by peer]
SeepingN has joined #ruby
leitz has quit [Remote host closed the connection]
Xiti has joined #ruby
leitz has joined #ruby
Xiti has quit [Read error: Connection reset by peer]
blackmesa1 has quit [Ping timeout: 250 seconds]
Xiti has joined #ruby
blackmesa1 has joined #ruby
leitz has quit [Client Quit]
SuperLag has quit [Ping timeout: 240 seconds]
Omnilord has joined #ruby
SuperLag has joined #ruby
bradleyprice has quit [Remote host closed the connection]
cd has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
bradleyprice has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orbyt_ has joined #ruby
Nicmavr has joined #ruby
orbyt_ has quit [Client Quit]
impermanence has quit [Remote host closed the connection]
tdy has quit [Ping timeout: 268 seconds]
Intelo has joined #ruby
AJA4351 has joined #ruby
sauvin has quit [Read error: Connection reset by peer]
AJA4350 has quit [Ping timeout: 268 seconds]
AJA4351 is now known as AJA4350
CableNinja has joined #ruby
CableNinja_ has joined #ruby
CableNinja has quit [Ping timeout: 268 seconds]
drincruz_ has joined #ruby
bradleyprice_ has joined #ruby
drincruz has quit [Ping timeout: 265 seconds]
bradleyprice has quit [Ping timeout: 240 seconds]
absolutejam has joined #ruby
Omnilord has quit [Quit: This computer has gone to sleep]
chalkmonster has quit [Quit: WeeChat 2.6]
SzeregowyPosel has joined #ruby
nowhere_man has quit [Ping timeout: 264 seconds]
duckpuppy has quit [Quit: ZNC 1.7.5-rc1 - https://znc.in]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
bradleyprice_ has quit [Remote host closed the connection]
bradleyprice has joined #ruby
bradleyprice has quit [Remote host closed the connection]
bradleyprice has joined #ruby
dostoyevsky has quit [Quit: leaving]
dostoyevsky has joined #ruby
Guest23107 has quit [Ping timeout: 240 seconds]
duckpuppy has joined #ruby
xarthna_ has quit [Ping timeout: 265 seconds]
queip has quit [Ping timeout: 268 seconds]
queip_ has joined #ruby
queip_ is now known as queip
sytherax has joined #ruby
greengriminal has joined #ruby
blackmesa1 has quit [Ping timeout: 250 seconds]
Omnilord has joined #ruby
Inline__ has joined #ruby
dostoyevsky has quit [Quit: leaving]
Inline has quit [Ping timeout: 264 seconds]
<cjohnson> How would you convert an array of strings to {"n1", "n2", "n3"} ?
<cjohnson> '{"n1", "n2", "n3"}'
<phaul> you want to go from ['n1', 'n2', 'n3'] to '{"n1", "n2", "n3"}' ?
<cjohnson> right
dostoyevsky has joined #ruby
blackmesa1 has joined #ruby
<phaul> &>> '{' + ['n1', 'n2', 'n3'].map {|s| "\"#{s}\""}.join(', ') + '}'
<rubydoc> # => "{\"n1\", \"n2\", \"n3\"}" (https://carc.in/#/r/7thp)
<cjohnson> ho ho, thanks phaul :)
<phaul> yw
<leftylink> inspeeeeeeeect! jk, quotes are maybe clearer anyway!
<leftylink> those who want to use quotes have mys upport
<al2o3-cr> cjohnson: is this json?
schne1der has quit [Ping timeout: 264 seconds]
<al2o3-cr> why would anyone need that
<al2o3-cr> {} that associative array (hash) syntax
<phaul> yeah, the why would anyone want to do this was my first thought as well
<al2o3-cr> they want to_json or dump
xarthna has joined #ruby
<al2o3-cr> &>> require 'json'; ['n1', 'n2', 'n3'].to_json
<rubydoc> # => "[\"n1\",\"n2\",\"n3\"]" (https://carc.in/#/r/7thq)
<al2o3-cr> &>> ['n1', 'n2', 'n3'].map &:dump
<rubydoc> # => ["\"n1\"", "\"n2\"", "\"n3\""] (https://carc.in/#/r/7thr)
<al2o3-cr> &>> ['n1', 'n2', 'n3'].inspect
<leftylink> well, even if this were JSON being discussed, {"a", "b"} is not valid in JSON anyway, right? so it must not be JSON
<rubydoc> # => "[\"n1\", \"n2\", \"n3\"]" (https://carc.in/#/r/7ths)
<leftylink> it must be something else
<phaul> al2o3-cr: btw back in the UK :) living in Reading, new job in London
<al2o3-cr> leftylink: but they say array with {} so?
<al2o3-cr> maybe they're confused
sgen has joined #ruby
<al2o3-cr> phaul: ah cool, what job?
<phaul> ruby dev
<phaul> backend stuff
<al2o3-cr> ah sweet, what company? not many ruby dev jobs in the UK.
<phaul> smartpension
<al2o3-cr> oh wow, started yet?
<phaul> just starting.. first week
<al2o3-cr> how's it gone so far?
<phaul> we can take it over to -offtopic or pm if you are interested
<al2o3-cr> yeah, i'm in offtopic
ur5us has joined #ruby
orbyt_ has joined #ruby
mossplix has joined #ruby
sytherax has quit [Ping timeout: 240 seconds]
drincruz_ is now known as drincruz
jacksoow has quit [Ping timeout: 250 seconds]
jacksoow has joined #ruby
deathwishdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
Fire-Dragon-DoL has quit [Quit: Quit]
xarthna_2 has joined #ruby
Fire-Dragon-DoL has joined #ruby
xarthna has quit [Ping timeout: 268 seconds]
tdy has joined #ruby
bitwinery has joined #ruby
bitwinery has quit [Remote host closed the connection]
bitwinery has joined #ruby
queip has quit [Ping timeout: 240 seconds]
queip_ has joined #ruby
queip_ is now known as queip
<baweaver> ohai cjohnson
Seich has quit [Remote host closed the connection]
CableNinja_ has left #ruby ["Leaving"]
xarthna_ has joined #ruby
hiroaki_ has quit [Ping timeout: 240 seconds]
mjsmith2 has quit [Remote host closed the connection]
dionysus69 has quit [Ping timeout: 268 seconds]
jacksoow has quit [Read error: Connection reset by peer]
jacksoow has joined #ruby
xarthna_2 has quit [Ping timeout: 268 seconds]
<al2o3-cr> ohai baweaver
<al2o3-cr> still doing your cartoons?
xarthna_ has quit [Ping timeout: 268 seconds]
mossplix has quit [Remote host closed the connection]
mossplix has joined #ruby
<baweaver> Off and on. More off than on recently, will be back soon enough.
<baweaver> About time for the semi-annual fun
hiroaki_ has joined #ruby
Seich has joined #ruby
mossplix has quit [Ping timeout: 265 seconds]
<cjohnson> Yeah {} is postgres array syntax
<cjohnson> Not JSON
<al2o3-cr> cjohnson: where'd you go for a pint? LOL
Omnilord has quit [Quit: This computer has gone to sleep]
Cyrus has quit [Ping timeout: 265 seconds]
Cyrus has joined #ruby
xco has joined #ruby
<xco> hi all! is there a way to convert something like "04721" to_i as 04721?
<xco> when i do
<xco> "04721".to_i
<xco> i get
<xco> 4721
<xco> but i need the leading zero
<Frankenstein> you can keep it stored as an integer then when printing it use String#rjust
<Frankenstein> e.g. 4721.to_s.rjust(5, '0')
<al2o3-cr> xco: that's a representation
<al2o3-cr> &>> 04721
<rubydoc> # => 2513 (https://carc.in/#/r/7ti7)
<xco> Frankenstein: i’m converting to an int not string :D
<al2o3-cr> xco: leading 0 is octal
<al2o3-cr> &>> 08
<rubydoc> stderr: -e:4: Invalid octal digit... check link for more (https://carc.in/#/r/7ti8)
<xco> al2o3-cr: ok but how do i get 04721 out of "04721”?
<al2o3-cr> xco: you can't
<al2o3-cr> it's an implementation
<al2o3-cr> &>> 04721
<rubydoc> # => 2513 (https://carc.in/#/r/7ti9)
<al2o3-cr> same with hex
<al2o3-cr> &>> 0xff
<rubydoc> # => 255 (https://carc.in/#/r/7tia)
<al2o3-cr> &>> "04721”.to_s 10
<rubydoc> stderr: -e:6: unterminated string meets end of file... check link for more (https://carc.in/#/r/7tib)
<al2o3-cr> &>> "04721”.to_i 10
<rubydoc> stderr: -e:6: unterminated string meets end of file... check link for more (https://carc.in/#/r/7tic)
dinfuehr has quit [Ping timeout: 265 seconds]
ellcs has quit [Remote host closed the connection]
<Frankenstein> xco: it doesn't matter what it looks like as an integer. you just need the leading 0 for printing. like al2o3-cr said its the representation
<Frankenstein> s/printing/viewing/
dinfuehr has joined #ruby
<xco> ooooh. ok got it! :) thank you
<al2o3-cr> i'm going bed
<al2o3-cr> &>> [255, 0xff, 0377]
<rubydoc> # => [255, 255, 255] (https://carc.in/#/r/7tid)
<al2o3-cr> we should have used base 12
tpanarch1st has joined #ruby
xarthna_ has joined #ruby
Technodrome has joined #ruby
istrasci has quit [Remote host closed the connection]
Intelo has quit [Ping timeout: 245 seconds]
sgen has quit [Ping timeout: 250 seconds]
ellcs has joined #ruby
xarthna_ has quit [Ping timeout: 240 seconds]
howdoi has quit [Quit: Connection closed for inactivity]
cyclonis_ has quit [Ping timeout: 245 seconds]
tpanarch1st has quit [Ping timeout: 240 seconds]
cyclonis has joined #ruby
falconfox has joined #ruby
SzeregowyPosel has quit [Quit: Bye Bye]
tdy has quit [Ping timeout: 276 seconds]
yann-kaelig has joined #ruby
xarthna has joined #ruby
blackmesa1 has quit [Ping timeout: 276 seconds]
SzeregowyPosel has joined #ruby
Intelo has joined #ruby
sgen has joined #ruby
falconfox has quit []
xarthna has quit [Ping timeout: 268 seconds]
sytherax has joined #ruby
bradleyprice_ has joined #ruby
bradleyprice has quit [Ping timeout: 276 seconds]
bradleyprice_ has quit [Ping timeout: 265 seconds]
bradleyprice has joined #ruby
dinfuehr has quit [Ping timeout: 265 seconds]
dinfuehr has joined #ruby
<xco> i have an Enumetor object. How do i perform a #select on it get items that satisfy some condition?
<xco> i know for an Array which is enumberable i can do [1,2,3,4,5,6].select { |n| n.even? }
<phaul> eeehm isn't Enumerator an Enumerable ?
<xco> i’d like something similar for an Enumerator
bradleyprice has quit [Ping timeout: 265 seconds]
<phaul> &>> Enumerator.ancestors
<rubydoc> # => [Enumerator, Enumerable, Object, Kernel, BasicObject] (https://carc.in/#/r/7tjc)
<phaul> it is n Enumerable
SzeregowyPosel has quit [Quit: Bye Bye]
<xco> phaul: oh i see :D
bradleyprice has joined #ruby
bradleyprice has quit [Ping timeout: 268 seconds]
<baweaver> xco: try it out in Pry
<xco> baweaver: yeap. done that already. satisfied and got what i want :) thanks!
<phaul> happy days :D
greengriminal has quit [Quit: This computer has gone to sleep]
jeremycw has quit [Ping timeout: 240 seconds]
ellcs has quit [Ping timeout: 240 seconds]
Fernando-Basso has joined #ruby
<Frankenstein> adam12: yeah, you were right. sequel is great. i'm replacing all of my code that called the sqlite3 gem directly, and it looks so much cleaner/maintainable
<adam12> Frankenstein: I love it.
<Frankenstein> i can see why
xco has quit [Ping timeout: 240 seconds]
<adam12> Ah yeah.
<adam12> That's the beauty of Sequel tho; writing raw SQL isn't an antipattern, but mostly encouraged.
<adam12> But still room to cleanup if you wanted.
greengriminal has joined #ruby
xco has joined #ruby
tdy has joined #ruby
greengriminal has quit [Quit: Leaving]
<Frankenstein> is there a way with DB.create_table to specify a foreign key? I can only find how to do it in a Model
sytherax has quit [Ping timeout: 265 seconds]
crichoux has joined #ruby
phaul has quit [Ping timeout: 276 seconds]
sgen has quit [Ping timeout: 245 seconds]
wildtrees has quit [Quit: Leaving]
bradleyprice has joined #ruby
SzeregowyPosel has joined #ruby
yann-kaelig has quit [Quit: yann-kaelig]
sytherax has joined #ruby
bradleyprice has quit [Ping timeout: 245 seconds]
Exuma has joined #ruby
absolutejam has quit [Ping timeout: 240 seconds]
stryek has quit [Quit: Connection closed for inactivity]
drincruz has quit [Ping timeout: 240 seconds]
Swyper has joined #ruby
xGrind has joined #ruby
sylario has quit [Quit: Connection closed for inactivity]
xarthna has joined #ruby
xarthna has quit [Quit: leaving]
sameerynho has quit [Ping timeout: 240 seconds]
tdy has quit [Ping timeout: 265 seconds]
Skaterhaym has joined #ruby
bitwinery has quit [Ping timeout: 240 seconds]
postmodern has joined #ruby
xGrind has quit [Quit: Saindo]
Fernando-Basso has quit [Quit: Leaving]
agent_white has joined #ruby
Swyper has quit [Remote host closed the connection]