havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.6.1, 2.5.3, 2.4.5: 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!
evdubs_ has quit [Remote host closed the connection]
evdubs_ has joined #ruby
blackmesa1 has quit [Ping timeout: 268 seconds]
bruul has joined #ruby
AJA4350 has quit [Ping timeout: 246 seconds]
newplasticideas has joined #ruby
lxsameer has quit [Ping timeout: 268 seconds]
blackmesa1 has joined #ruby
stryek has quit [Quit: Connection closed for inactivity]
AJA4350 has joined #ruby
crankharder has joined #ruby
d10n-work has quit [Quit: Connection closed for inactivity]
Dreamer3 has joined #ruby
asphyxia has joined #ruby
newplasticideas is now known as xick
crankharder has quit [Ping timeout: 246 seconds]
orbyt_ has quit [Ping timeout: 250 seconds]
xick has left #ruby ["Leaving"]
AJA4351 has joined #ruby
jottr has quit [Ping timeout: 250 seconds]
AJA4350 has quit [Ping timeout: 250 seconds]
AJA4351 is now known as AJA4350
Swyper has joined #ruby
crankharder has joined #ruby
doomspork has joined #ruby
Swyper has quit [Ping timeout: 246 seconds]
asphyxia has quit [Quit: Lost terminal]
doomspork has quit [Ping timeout: 245 seconds]
bruul has quit [Ping timeout: 252 seconds]
Dreamer3 has quit [Quit: Leaving...]
d^sh has quit [Ping timeout: 272 seconds]
d^sh has joined #ruby
\void has quit [Quit: So long, and thanks for all the fish.]
cnsvc has quit [Ping timeout: 256 seconds]
AJA4350 has quit [Ping timeout: 250 seconds]
orbyt_ has joined #ruby
cthulchu_ has quit [Ping timeout: 268 seconds]
cthulchu_ has joined #ruby
cthulchu_ has quit [Ping timeout: 245 seconds]
AJA4350 has joined #ruby
doomspork has joined #ruby
doomspork has quit [Ping timeout: 240 seconds]
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 268 seconds]
AJA4351 is now known as AJA4350
fluxAeon has quit [Ping timeout: 245 seconds]
crankharder has quit [Ping timeout: 245 seconds]
crankharder has joined #ruby
crankharder has quit [Ping timeout: 240 seconds]
crankharder has joined #ruby
code_zombie has joined #ruby
crankharder has quit [Ping timeout: 268 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
r3m has quit [Quit: WeeChat 2.4-dev]
r3m has joined #ruby
AJA4350 has quit [Ping timeout: 245 seconds]
r3m has quit [Client Quit]
r3m has joined #ruby
paraxial has quit [Ping timeout: 246 seconds]
paraxial has joined #ruby
KazeFX has quit [Ping timeout: 240 seconds]
cnsvc has joined #ruby
Swyper has joined #ruby
orbyt_ has joined #ruby
Swyper has quit [Ping timeout: 250 seconds]
evdubs_ is now known as evdubs
octos has quit [Read error: Connection reset by peer]
octos has joined #ruby
krawchyk has quit [Quit: krawchyk]
Swyper has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Swyper has quit [Ping timeout: 272 seconds]
AJA4350 has joined #ruby
blackmesa1 has quit [Ping timeout: 240 seconds]
Swyper has joined #ruby
orbyt_ has joined #ruby
Swyper has quit [Ping timeout: 250 seconds]
hutch has joined #ruby
agent_white has quit [Quit: leaving]
Swyper has joined #ruby
AJA4351 has joined #ruby
jottr has joined #ruby
AJA4350 has quit [Ping timeout: 250 seconds]
AJA4351 is now known as AJA4350
doomspork has joined #ruby
Swyper has quit [Ping timeout: 245 seconds]
cnsvc has quit [Ping timeout: 256 seconds]
volkov has joined #ruby
akem__ has quit [Remote host closed the connection]
elcaro has joined #ruby
akem__ has joined #ruby
doomspork has quit [Ping timeout: 245 seconds]
tdy has joined #ruby
<elcaro> Is there a name for idiomatic Ruby code, ie. Perl = Perlish, Python = Pythonic, Ruby = ???
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
DTZUZO has joined #ruby
crankharder has joined #ruby
jottr has quit [Ping timeout: 240 seconds]
gix has quit [Ping timeout: 250 seconds]
crankharder has quit [Ping timeout: 240 seconds]
AJA4350 has quit [Remote host closed the connection]
braincrash has quit [Quit: bye bye]
<baweaver> elcaro: Ruby-esque? Not sure we really have a word for it.
<elcaro> fair enough, the thought just popped into my head, so I asked.
<havenwood> elcaro: I catch myself saying "Rubyish"
guardian has quit [Ping timeout: 240 seconds]
Swyper has joined #ruby
<baweaver> Running? :P
Swyper has quit [Remote host closed the connection]
<elcaro> havenwood: it's unfortunately close to sounding like "rubbish"
<elcaro> Rubynical, lol... sounds like rabbinical
braincrash has joined #ruby
<elcaro> idioMatzic
<volkov> Ruby sleeps with the fishes.
<havenwood> elcaro: In Japan they say Ruby is 和 ("wa").
RougeR has quit [Ping timeout: 246 seconds]
<havenwood> But I guess that's about Rubyists, not Ruby code. ¯\_(ツ)_/¯
guardian has joined #ruby
asphyxia has joined #ruby
nowhere_man has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
Nicmavr has joined #ruby
arescorpio has joined #ruby
paraxial has quit [Ping timeout: 245 seconds]
fluxAeon has joined #ruby
v01d4lph4 has joined #ruby
v01d4lph4 has quit [Read error: Connection reset by peer]
asphyxia has quit [Ping timeout: 245 seconds]
asphyxia has joined #ruby
v01d4lph4 has joined #ruby
asphyxia has quit [Client Quit]
guardian has quit [Ping timeout: 250 seconds]
orbyt_ has joined #ruby
marmotini_ has joined #ruby
v01d4lph4 has quit [Ping timeout: 250 seconds]
cnsvc has joined #ruby
arescorpio has quit [Quit: Leaving.]
hutch has quit [Ping timeout: 240 seconds]
crankharder has joined #ruby
v01d4lph4 has joined #ruby
volkov has quit [Quit: volkov]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
guardian has joined #ruby
moei has joined #ruby
nowhere_man has quit [Ping timeout: 252 seconds]
doomspork has joined #ruby
doomspork has quit [Ping timeout: 272 seconds]
houhoulis has quit [Remote host closed the connection]
jottr has joined #ruby
guardian has quit [Ping timeout: 246 seconds]
dellavg__ has joined #ruby
jottr has quit [Ping timeout: 244 seconds]
guardian has joined #ruby
ua has quit [Ping timeout: 272 seconds]
conta has joined #ruby
marmotini_ has quit [Ping timeout: 250 seconds]
catbusters has joined #ruby
crankharder has quit [Ping timeout: 244 seconds]
sauvin has joined #ruby
marmotini_ has joined #ruby
<baweaver> New article is up on TracePoint, one of the more interesting parts of Ruby and debugging in it:
tpanarch1st has joined #ruby
jottr has joined #ruby
clemens3 has joined #ruby
jottr has quit [Ping timeout: 246 seconds]
tpanarch1st has quit [Ping timeout: 240 seconds]
Inline has quit [Quit: Leaving]
aufi has joined #ruby
valadares has joined #ruby
octos has quit [Remote host closed the connection]
clemens3 has quit [Ping timeout: 268 seconds]
themsay has quit [Ping timeout: 246 seconds]
paraxial has joined #ruby
paraxial has quit [Ping timeout: 246 seconds]
doomspork has joined #ruby
paraxial has joined #ruby
doomspork has quit [Ping timeout: 246 seconds]
aupadhye has joined #ruby
xrexeon has joined #ruby
clemens3 has joined #ruby
crankharder has joined #ruby
crankharder has quit [Ping timeout: 245 seconds]
jottr has joined #ruby
BH23 has joined #ruby
v01d4lph4 has quit [Remote host closed the connection]
v01d4lph4 has joined #ruby
jottr has quit [Ping timeout: 246 seconds]
BH23 has quit [Remote host closed the connection]
v01d4lph4 has quit [Remote host closed the connection]
v01d4lph4 has joined #ruby
armyriad has quit [Ping timeout: 246 seconds]
armyriad has joined #ruby
jottr has joined #ruby
code_zombie has quit [Quit: Leaving]
jottr has quit [Ping timeout: 250 seconds]
BH23 has joined #ruby
crankharder has joined #ruby
BH23 has quit [Remote host closed the connection]
crankharder has quit [Ping timeout: 246 seconds]
volkov has joined #ruby
DTZUZO has quit [Ping timeout: 250 seconds]
cd has quit [Ping timeout: 256 seconds]
cd has joined #ruby
tdy has quit [Ping timeout: 245 seconds]
RougeR has joined #ruby
blackmesa1 has joined #ruby
blackmesa1 has quit [Ping timeout: 252 seconds]
blackmesa1 has joined #ruby
BH23 has joined #ruby
jottr has joined #ruby
kapil____ has joined #ruby
doomspork has joined #ruby
BH23 has quit [Ping timeout: 245 seconds]
doomspork has quit [Ping timeout: 250 seconds]
crankharder has joined #ruby
galeido has quit [Ping timeout: 250 seconds]
crankharder has quit [Ping timeout: 246 seconds]
volkov has quit [Ping timeout: 256 seconds]
jottr has quit [Ping timeout: 250 seconds]
Guest16678 has joined #ruby
cnsvc has quit [Ping timeout: 256 seconds]
ua has joined #ruby
crankharder has joined #ruby
Guest16678 has quit [Ping timeout: 240 seconds]
crankharder has quit [Ping timeout: 244 seconds]
Guest16678 has joined #ruby
Guest16678 has quit [Ping timeout: 245 seconds]
Ove_ has joined #ruby
<Ove_> Is there a specific channel to puma?
<Ove_> I am having troubles getting any output from pumactl (when specifying the pid).
blackmesa1 has quit [Ping timeout: 264 seconds]
Guest16678 has joined #ruby
Tuor has joined #ruby
sameerynho has joined #ruby
sameerynho is now known as Guest24944
BH23 has joined #ruby
Guest16678 has quit [Ping timeout: 244 seconds]
cd has quit [Quit: cd]
Puffball has quit [Remote host closed the connection]
AJA4350 has joined #ruby
blackmesa1 has joined #ruby
BH23 has quit [Ping timeout: 272 seconds]
fritzroy15 has joined #ruby
<fritzroy15> heyo, we're looking for something cheaper ( free would be nice ) to replace NewRelic as an APM for our rails app. Suggestions?
status402 has joined #ruby
status402 has quit [Quit: status402]
status402 has joined #ruby
crankharder has joined #ruby
crankharder has quit [Ping timeout: 246 seconds]
doomspork has joined #ruby
crankharder has joined #ruby
doomspork has quit [Ping timeout: 240 seconds]
crankharder has quit [Ping timeout: 268 seconds]
blackmesa1 has quit [Ping timeout: 264 seconds]
xco has joined #ruby
<xco> I know there’s word for it but for some reason i can’t remember, what’s the word for when you’re testing some application and for each test a random result is returned, example say you have a rails app and for each refresh of the page a random error (different from the previous) shows up?
<phaul> broken testsuite? :)
<phaul> sorry
jottr has joined #ruby
<xco> phaul: lol
d^sh has quit [Ping timeout: 240 seconds]
d^sh has joined #ruby
blackmesa1 has joined #ruby
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 244 seconds]
AJA4351 is now known as AJA4350
jottr has quit [Ping timeout: 250 seconds]
DTZUZO has joined #ruby
roshanavand_ has quit [Remote host closed the connection]
roshanavand_ has joined #ruby
blackmesa1 has quit [Ping timeout: 268 seconds]
DTZUZO has quit [Ping timeout: 272 seconds]
eb0t has joined #ruby
nowhere_man has joined #ruby
status402 has quit [Quit: status402]
eb0t has quit [Ping timeout: 250 seconds]
eblip has joined #ruby
stryek has joined #ruby
blackmesa1 has joined #ruby
blackmesa1 has quit [Ping timeout: 252 seconds]
xrexeon has quit [Remote host closed the connection]
spiette has quit [Ping timeout: 250 seconds]
blackmesa1 has joined #ruby
AJA4350 has quit [Remote host closed the connection]
spiette has joined #ruby
marmotini_ has quit [Ping timeout: 250 seconds]
donofrio__ has joined #ruby
href has quit [Read error: Connection reset by peer]
Exagone313 has quit [Ping timeout: 268 seconds]
donofrio_ has quit [Ping timeout: 246 seconds]
catbusters has quit [Quit: Connection closed for inactivity]
Exagone313 has joined #ruby
rippa has joined #ruby
<phaul> &fake ChuckNorris.fact
<rubydoc> The class object inherits from Chuck Norris.
<phaul> lol. that's strangely appropriate after yesterdays discussion
za1b1tsu has joined #ruby
blackmesa1 has quit [Ping timeout: 264 seconds]
v01d4lph4 has quit [Remote host closed the connection]
kapil____ has quit [Quit: Connection closed for inactivity]
v01d4lph4 has joined #ruby
doomspork has joined #ruby
doomspork has quit [Ping timeout: 245 seconds]
conta has quit [Ping timeout: 246 seconds]
v01d4lph4 has quit [Remote host closed the connection]
href has joined #ruby
blackmesa1 has joined #ruby
blackmesa1 has quit [Ping timeout: 246 seconds]
blackmesa1 has joined #ruby
v01d4lph4 has joined #ruby
jcalla has joined #ruby
BTRE has quit [Remote host closed the connection]
v01d4lph4 has quit [Ping timeout: 250 seconds]
jottr has joined #ruby
BTRE has joined #ruby
fanta7531 has joined #ruby
awkwords has joined #ruby
polishdub has joined #ruby
blackmesa has joined #ruby
olspookishmagus has quit [Quit: All for nothing]
blackmesa1 has quit [Ping timeout: 250 seconds]
krawchyk has joined #ruby
jottr has quit [Ping timeout: 268 seconds]
hiroaki has quit [Read error: Connection reset by peer]
orbyt_ has joined #ruby
hiroaki has joined #ruby
blackmesa has quit [Read error: Connection reset by peer]
blackmesa has joined #ruby
szulak_ has joined #ruby
aupadhye has quit [Ping timeout: 272 seconds]
doomspork has joined #ruby
m0w has joined #ruby
szulak_ has quit [Remote host closed the connection]
hutch has joined #ruby
szulak_ has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
BrianWGray has joined #ruby
Nicmavr has joined #ruby
m0w has quit [Read error: Connection reset by peer]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sezuan has joined #ruby
jottr has joined #ruby
jottr has quit [Ping timeout: 250 seconds]
Tuor has quit [Quit: Konversation terminated!]
orbyt_ has joined #ruby
polishdub has quit [Quit: leaving]
conta1 has joined #ruby
conta1 has quit [Ping timeout: 246 seconds]
xco has left #ruby [#ruby]
aufi has quit [Remote host closed the connection]
jlebrech has joined #ruby
<jlebrech> hi everyone, i want to split my controllers into page controllers and api controllers. should I use engines for that or just modules?
dionysus70 has joined #ruby
guardian has quit [Quit: Coyote finally caught me]
guardian has joined #ruby
jlebrech has quit [Remote host closed the connection]
millerti has joined #ruby
clemens3 has quit [Ping timeout: 240 seconds]
old_relik has joined #ruby
maryo has joined #ruby
Inline has joined #ruby
old_relik has quit [Quit: Page closed]
fanta7531 has quit [Quit: fanta7531]
deathwishdave has joined #ruby
akem__ has quit [Remote host closed the connection]
akem__ has joined #ruby
gix has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jottr has joined #ruby
ellcs has quit [Remote host closed the connection]
cthulchu_ has joined #ruby
tdy has joined #ruby
BH23 has joined #ruby
blackmesa has quit [Ping timeout: 264 seconds]
DTZUZO has joined #ruby
kapil____ has joined #ruby
agent_white has joined #ruby
paraxial has quit [Quit: The Lounge - https://thelounge.chat]
paraxial has joined #ruby
reber has joined #ruby
[Butch] has joined #ruby
DTZUZO has quit [Ping timeout: 244 seconds]
polishdub has joined #ruby
Puffball has joined #ruby
\void has joined #ruby
blackmesa has joined #ruby
maryo has quit [Quit: Leaving]
Puffball has quit [Remote host closed the connection]
orbyt_ has joined #ruby
r29v has joined #ruby
maryo has joined #ruby
Guest24944 has quit [Ping timeout: 246 seconds]
orbyt_ has quit [Ping timeout: 272 seconds]
szulak_ has quit [Quit: Textual IRC Client: www.textualapp.com]
orbyt_ has joined #ruby
href has quit [Ping timeout: 272 seconds]
RougeR has quit [Ping timeout: 244 seconds]
DTZUZO has joined #ruby
yokel has quit [Remote host closed the connection]
yokel has joined #ruby
Dbugger has joined #ruby
dionysus70 has quit [Ping timeout: 250 seconds]
maryo has quit [Ping timeout: 245 seconds]
href has joined #ruby
BH23 has quit [Ping timeout: 244 seconds]
hahuang6- has quit [Ping timeout: 244 seconds]
hahuang6- has joined #ruby
slester has quit [Quit: Textual IRC Client: www.textualapp.com]
crankharder has joined #ruby
akem__ has quit [Remote host closed the connection]
akem__ has joined #ruby
hays has quit [Ping timeout: 272 seconds]
blackmesa has quit [Ping timeout: 252 seconds]
hutch has quit [Ping timeout: 246 seconds]
r29v has quit [Quit: r29v]
lxsameer has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hutch has joined #ruby
orbyt_ has joined #ruby
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
roshanavand_ has quit [Ping timeout: 268 seconds]
hutch has quit [Ping timeout: 268 seconds]
sauvin has quit [Remote host closed the connection]
Roelof has joined #ruby
<Roelof> someone who can help me to make this work : https://gist.github.com/RoelofWobben/e7429eefd37df9a1bf3b4ddad9065ca3
za1b1tsu has quit [Remote host closed the connection]
deathwishdave has quit [Quit: Textual IRC Client: www.textualapp.com]
istrasci has joined #ruby
<istrasci> Does ruby have official branding (esp. a color for the red colour)?
fritzroy15 has quit [Remote host closed the connection]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
jottr has quit [Ping timeout: 250 seconds]
bmurt has joined #ruby
<havenwood> istrasci: There isn't an official color, afaik. The logo is free for use, but it's a gradient of red: https://www.ruby.or.jp/en/about/
<Roelof> no one ?
<havenwood> Roelof: looking at it now
<Roelof> thanks
<havenwood> istrasci: ruby-lang.org uses #cc342d annd #9b1c16
krawchyk has quit [Quit: krawchyk]
dellavg__ has quit [Ping timeout: 244 seconds]
<havenwood> Roelof: The #seconds method takes a single argument (also called `seconds`), but your tests are calling it with no argument.
<istrasci> havenwood: Thanks! Where did youi find that?
<Roelof> @havenwood : oke, then there is another bug
xrexeon has joined #ruby
<havenwood> Roelof: You might have to show us the test for that one.
<Net> are rspec lets reevaluated if a referenced let is redefined?
<Roelof> @havenwood : added the tests.
<havenwood> Roelof: to the gist?
<Roelof> no, the dpaste.de : https://dpaste.de/dROT
<havenwood> ah, new link
orbyt_ has quit [Ping timeout: 246 seconds]
<havenwood> Roelof: #seconds is confusingly not exposing the instance variable @seconds
<havenwood> Roelof: you should rename the `def seconds` method
<Roelof> oke, to which name
<havenwood> what does it do?
<havenwood> have the name reflect that ^
<Roelof> now convert the second to a time string
<Roelof> I can do that
<Roelof> and then make a method seconds that returns zero
<Roelof> according to the test I need a method seconds
<Roelof> ` expect(@timer.seconds).to eq(0) `
<phaul> havenwood: found it!
<havenwood> Roelof: I'm assuming that #seconds is supposed to return @seconds: attr_reader :seconds
<havenwood> phaul: oh?
<phaul> coming from perl, and smalltalk
<phaul> I can't work out the third light blue arrow
<havenwood> phaul: oh, haha, nice
awkwords has quit [Quit: sleepy time]
<havenwood> yeah, it's hard to tell...
<phaul> tbh I expected an arrow from lisp as well
<havenwood> phaul: Yeah, that confused me as well...
<havenwood> phaul: Interesting downstream from Ruby though: https://github.com/agda/agda
<Roelof> @havenwood : giving up oin this one : https://dpaste.de/OJ0R
hutch has joined #ruby
<havenwood> Roelof: Nice, you're getting closer!
<Roelof> yep, but still do not see what I have to change to make it work
<phaul> dependent types.. :) the main reason I'm here and not on #haskell :D
<havenwood> Roelof: This is a slight variation on your code, to give you ideas. I tried to not change much but maybe show some options.
<phaul> oh it's crystal not agda
<havenwood> phaul: whaa? okay, that makes way more sense
<phaul> yeah I jumped arrows
<havenwood> Roelof: They want `def seconds; @seconds; end`, which you can write with the shorthand `attr_reader :seconds`.
<Roelof> oke,
<Roelof> now I see this : NoMethodError: undefined method `seconds=' `
<havenwood> Roelof: So you'd want to define `def seconds=(n); @seconds = n; end` or the shorthand `attr_writer :seconds`.
<havenwood> Roelof: You can combine an `attr_reader` and an `attr_writer` into a single `attr_accessor`.
<havenwood> Roelof: attr_accessor :seconds
<havenwood> Roelof: def seconds; @seconds; end; def seconds=(n); @seconds = n; end
<havenwood> Roelof: The first ^^ is the shorthand for the second ^
<Roelof> oke
<havenwood> Roelof: They both expose a getter and setter method for an instance variable of the same name.
<Roelof> next problem
crankharder has quit [Ping timeout: 246 seconds]
<Roelof> ```
<Roelof> ```
<Roelof> ```
<Roelof> expected: "00:01:06" got: "00:00:66"
<havenwood> Roelof: A shorthand for writing `@minutes = @minutes + 1` is: @minutes += 1
<havenwood> Roelof: And a shorthand for writing `@seconds = @seconds - 60` is: @seconds -= 60
<havenwood> Roelof: Show the code and tests for your current failure?
<havenwood> (Updating a gist might be the best way, since we can't see the dpaste changes unless you paste a link afaik.)
<havenwood> Net: What do you mean by "if a referenced let is redefined?"
<havenwood> Net: Like if it's mutated?
<havenwood> Or something else?
<Net> havenwood: if it is redefined later in the spec file
<havenwood> Roelof: I'm assuming the tests want you to be able to mutate @seconds via the #seconds=, and have #calculate re-runn.
<havenwood> Roelof: Try moving it back to `attr_reader :seconds` and define your own `def seconds=` that both sets the instance variable and calls #calculate.
<havenwood> Net: Ahhh
<havenwood> Net: Redefined in the same example?
<Net> It *seems* like dependent lets will be reevaluated, but I can find this documented anywhere
<havenwood> Roelof: Does that make sense?
<Roelof> yep, everything is finally green
<Roelof> but I think we can do without the initialize method
up|ime is now known as KindOna
<havenwood> Net: Aha. That makes sense. Yeah, good question.
uplime is now known as KindUne
<Net> specs like the above will pass for me, but I cannot find anything that references this behavior
<Roelof> @havenwood thanks, this is the code that makes all tests green : https://gist.github.com/RoelofWobben/e7429eefd37df9a1bf3b4ddad9065ca3
<Roelof> but still wierd that I have to do twice : @seconds = seconds
<havenwood> Roelof: You should probably assign `@seconds = seconds` here: https://gist.github.com/RoelofWobben/e7429eefd37df9a1bf3b4ddad9065ca3#file-timer-rb-L4
ericboehs has quit [Quit: WeeChat 2.3]
cd has joined #ruby
<havenwood> Roelof: It's just two ways of setting the same instance variable - one for new Timer instances and another for existing ones.
<Roelof> oke, I leave it this way but still I find it wierd
<Roelof> @havenwood : thanks a lot
<havenwood> Roelof: you're welcome, congrats on passing the tests!
ericboehs has joined #ruby
Fernando-Basso has joined #ruby
<Roelof> thanks now time for learning rails at the Odin project
<Roelof> and later on that course learn more and more about ruby
<Roelof> have all a good evening
<havenwood> Roelof: to you as well
hutch has quit [Ping timeout: 246 seconds]
Roelof has quit [Ping timeout: 256 seconds]
hutch has joined #ruby
pwnd_nsfw has quit [Quit: Leaving]
<Net> havenwood: neat
<Net> very neat!
kapil____ has quit [Quit: Connection closed for inactivity]
hutch has quit [Ping timeout: 240 seconds]
AJA4350 has joined #ruby
orbyt_ has joined #ruby
jottr has joined #ruby
orbyt_ has quit [Ping timeout: 250 seconds]
cnsvc has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
crankharder has joined #ruby
bmurt has joined #ruby
crankharder has quit [Ping timeout: 250 seconds]
jottr has quit [Read error: Connection reset by peer]
jottr has joined #ruby
jottr has quit [Read error: Connection reset by peer]
jottr has joined #ruby
jottr_ has joined #ruby
<TheBrayn> I have a block of code where assignments are done in if/elsif statements. Accordings to rubocop's standard they should be avoided. What is a good ways to rewrite this?
<TheBrayn> the assignments are just done from an array
<TheBrayn> should I just assign all of them beforehand and then use “elifif myvar” instead of “elif myvar = something['foo']”
cthu| has joined #ruby
jottr_ has quit [Read error: Connection reset by peer]
jottr has quit [Ping timeout: 268 seconds]
jottr_ has joined #ruby
cthulchu_ has quit [Ping timeout: 245 seconds]
cnsvc has quit [Quit: WeeChat 2.3]
<havenwood> TheBrayn: Show the code?
doomspork has quit [Ping timeout: 250 seconds]
reber has quit [Read error: Connection reset by peer]
<havenwood> TheBrayn: So they all take a Regexp, and either 1 or not, with one exception, #possible_regex?
thoraxe has joined #ruby
<havenwood> TheBrayn: It makes me wonder about extracting methods for each elsif, then iterating over Regexp/method name pairs.
<thoraxe> so this is perhaps an odd one and my google-fu is failing me. i have an array of objects and each object has 2 date fields (_one, _two) and i'm trying to sort the array of objects on the older of the dates
<thoraxe> in other words, figure out the older of the two dates on each object, and then sort the array on that older one
<TheBrayn> havenwood: what is the “possible_regex?“ method?
<TheBrayn> nvm
<thoraxe> i guess i can first make a map of the older dates and the array positions and then sort that map by date?
<thoraxe> or is there a nicer way to do it just with a single sort command
blackmesa has joined #ruby
<havenwood> &>> require 'date'; [{one: DateTime.now, two: DateTime.now}, {one: DateTime.now, two: DateTime.now}].sort_by { |h| h.keys.min }
<rubydoc> # => [{:one=>#<DateTime: 2019-02-08T22:02:14+00:00 ((2458523j,79334s,364186039n),+0s,2299161j)>,... check link for more (https://carc.in/#/r/67gp)
<havenwood> thoraxe: ^
<havenwood> thoraxe: If that ^ doesn't work, show the Array you actually have.
<thoraxe> i think i can make that work
<thoraxe> @sorted_articles = @article_models.sort_by { |h| [h.published_on,h.created_at].min }
<thoraxe> i think that's doing what i want
<TheBrayn> havenwood: thanks, I'll disable it for now until I can think of how to refactor this
<havenwood> thoraxe: Another nice thing might be to: h.values_at(:published_on, :created_at).min
postmodern has joined #ruby
<thoraxe> havenwood: i'm not a hardcore rubyist so i don't understand the difference
<havenwood> thoraxe: the latter is just a bit more efficient
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood> TheBrayn: This is along the lines of what I was thinking, fwiw: https://gist.github.com/havenwood/c1b754cf58f134ac1ce322b484d8363a
<TheBrayn> thanks
doomspork has joined #ruby
polishdub has quit [Quit: leaving]
<TheBrayn> updated it
Dbugger has quit [Ping timeout: 250 seconds]
hutch has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<phaul> TheBrayn: you can grep the array with a string instead of select ==
<phaul> &>> ['a', 'b', 'b', 'c'].grep('b')
<rubydoc> # => ["b", "b"] (https://carc.in/#/r/67gr)
<havenwood> and #grep takes a block
<TheBrayn> but is it preferred to chain two blocks over using next unless?
<havenwood> TheBrayn: arr.grep foobar do |x|
<havenwood> TheBrayn: Rubocop balks at chaining if it's not a one-liner. I think all three are reasonable.
jcalla has quit [Remote host closed the connection]
jottr_ is now known as jottr
crankharder has joined #ruby
hutch has quit [Ping timeout: 268 seconds]
crankharder has quit [Ping timeout: 246 seconds]
* baweaver wanders in
Swyper has joined #ruby
AJA4350 has quit [Ping timeout: 250 seconds]
hutch has joined #ruby
BTRE has quit [Read error: Connection reset by peer]
jcalla has joined #ruby
BTRE has joined #ruby
akem__ has quit [Read error: Connection reset by peer]
akem__ has joined #ruby
Swyper has quit [Remote host closed the connection]
SCHAPiE has quit [Ping timeout: 240 seconds]
xrexeon has quit [Remote host closed the connection]
AJA4350 has joined #ruby
valadares has quit [Read error: Connection reset by peer]
valadares has joined #ruby
SCHAPiE has joined #ruby
jottr has quit [Read error: Connection reset by peer]
jottr has joined #ruby
crankharder has joined #ruby
s2013 has joined #ruby
crankharder has quit [Ping timeout: 246 seconds]