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
<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]
<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 ?
<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]
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
<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.
<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.
<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.
<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
<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