havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.6.5, 2.5.7, 2.7.0-preview2: 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!
jud has joined #ruby
harai has quit [Ping timeout: 260 seconds]
greengriminal has quit [Quit: This computer has gone to sleep]
GodFather has joined #ruby
harai has joined #ruby
gix has quit [Ping timeout: 240 seconds]
paraxial has quit [Ping timeout: 240 seconds]
paraxial has joined #ruby
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4350 has joined #ruby
AJA4352 has joined #ruby
queip has quit [Ping timeout: 252 seconds]
banisterfiend has joined #ruby
AJA4351 has quit [Ping timeout: 276 seconds]
jottr has quit [Ping timeout: 252 seconds]
kyrylo has joined #ruby
AJA4352 is now known as AJA4351
AJA4350 has quit [Ping timeout: 276 seconds]
AJA4350 has joined #ruby
AJA4351 has quit [Ping timeout: 240 seconds]
queip has joined #ruby
sarink has joined #ruby
jud^ has joined #ruby
jud^ has quit [Read error: Connection reset by peer]
AJA4350 has quit [Read error: Connection reset by peer]
AJA4350 has joined #ruby
GodFather has quit [Ping timeout: 268 seconds]
budonyc has joined #ruby
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4351 is now known as AJA4350
banisterfiend has quit [Quit: Textual IRC Client: www.textualapp.com]
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4350 has joined #ruby
AJA4351 has quit [Ping timeout: 265 seconds]
GodFather has joined #ruby
ravenousmoose has joined #ruby
xGrind has quit [Remote host closed the connection]
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4350 has joined #ruby
ravenousmoose has quit [Ping timeout: 252 seconds]
dbugger has quit [Ping timeout: 245 seconds]
AJA4351 has quit [Ping timeout: 240 seconds]
davidw has quit [Ping timeout: 265 seconds]
Nicmavr has quit [Read error: Connection reset by peer]
tpanarch1st_ has quit [Ping timeout: 240 seconds]
Nicmavr has joined #ruby
skx86 has joined #ruby
GodFather has quit [Ping timeout: 276 seconds]
banisterfiend has joined #ruby
Bish has quit [Ping timeout: 265 seconds]
Bish has joined #ruby
wildtrees has quit [Quit: Leaving]
bsdband82 has quit [Ping timeout: 276 seconds]
drincruz has joined #ruby
bsdbandit-01 has joined #ruby
Bish has quit [Ping timeout: 265 seconds]
sarink has quit [Remote host closed the connection]
Bish has joined #ruby
drincruz has quit [Ping timeout: 240 seconds]
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4351 is now known as AJA4350
bsdband16 has joined #ruby
bsdbandit-01 has quit [Ping timeout: 265 seconds]
Technodrome has joined #ruby
Tempesta has quit [Read error: Connection reset by peer]
chalkmonster has joined #ruby
AJA4350 has quit [Quit: AJA4350]
greengriminal has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
sarink has joined #ruby
orbyt_ has joined #ruby
sarink has quit [Ping timeout: 240 seconds]
r3m has quit [Quit: WeeChat 2.7-dev]
r3m has joined #ruby
bitwinery has quit [Quit: Leaving]
budonyc has quit [Quit: Leaving]
drincruz has joined #ruby
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
entel has quit [Quit: Connection closed for inactivity]
DaRock has joined #ruby
banisterfiend has quit [Quit: Textual IRC Client: www.textualapp.com]
greengriminal has quit [Quit: This computer has gone to sleep]
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
cd has quit [Quit: cd]
RiPuk_ has joined #ruby
RiPuk has quit [Read error: Connection reset by peer]
lxsameer has quit [Ping timeout: 268 seconds]
ravenousmoose has joined #ruby
xco has joined #ruby
Swyper has joined #ruby
<Swyper> hey
ravenousmoose has quit [Ping timeout: 246 seconds]
<Swyper> need some help
<Swyper> hef.rb:42: syntax error, unexpected '(', expecting ')'...edients.push(@result_of_reject(ingredients))... ^
<Swyper> in chef.rb
duderonomy has joined #ruby
<havenwood> Swyper: Best to use lowercase, matching the filename: require_relative 'dish'
<havenwood> Swyper: your indentation is off
<havenwood> Swyper: I'd suggest running rubocop.
<Swyper> fair
<Swyper> the issue was that I was just supposed to push ingredients
<Swyper> xD
<Swyper> not result_of_reject(ingredients)
<havenwood> Swyper: Don't use parens when there's no method, so `def get_input` not `def get_input()`.
<havenwood> Swyper: case input
<havenwood> Swyper: when 'a'
<Swyper> that's fair I'm just used to using if
<Swyper> I updated it with your changes havenwood except doing case instead of if
<havenwood> Swyper: This makes no sense: @result_of_reject(ingredients)
<havenwood> Swyper: What's that ^ supposed to be?
<havenwood> Swyper: That's invalid code. Think about what you actually mean there.
<Swyper> what line is that o-o
<havenwood> Swyper: The line with the error.
<havenwood> Swyper: I accidentally linked a line above.
<havenwood> Swyper: Line 42.
<havenwood> Swyper: syntax error, unexpected '(', expecting ')'...edients.push(@result_of_reject(ingredients))...
<havenwood> @result_of_reject(ingredients)
<havenwood> Swyper: @result_of_reject is an Array. You can't just []().
<havenwood> &>> []()
<rubydoc> stderr: -e:4: syntax error, unexpected '(', expecting end... check link for more (https://carc.in/#/r/80a5)
<havenwood> Swyper: That's ^ the error you're running into.
greengriminal has joined #ruby
alfiemax has joined #ruby
<Swyper> havenwood I updated the repo
<havenwood> Swyper: working now?
<Swyper> nope
<Swyper> @result_of_reject = @current_dishes.reject { |dish| dish.to_s == dish_to_add_ingredients} p "enter the ingredients seperated by a comma for this dish: " + @result_of_reject[0].to_s
<Swyper> so it dosent actually grab the correct dish for some reason
Intelo_ has quit [Ping timeout: 268 seconds]
<Swyper> chef.rb:42:in `add_ingredients': undefined method `ingredients' for nil:NilClass (NoMethodError)
<Swyper> also is my use of naming the method to_s inapropriate here?
<Swyper> (byebug) @result_of_reject[]
<Swyper> so tldr its not grabbing the correct object
<Swyper> or any object.
<havenwood> Swyper: The default for @current_dishes is an empty Array. The first element of @result_of_reject will then be `nil`.
<havenwood> Swyper: It's expected that `nil.ingredients` will raise this error.
<Swyper> havenwood so I do add the fish dish to it, so at that point current_dish = ["fish"]
<Swyper> **current_dishes
<Swyper> sorry I'll post the whole thing
<Swyper> sec
<havenwood> Swyper: I don't know what your logic should result in. Up to you.
<havenwood> Swyper: @result_of_reject[0]&.ingredients&.push(ingredients_to_add) #=> nil
<havenwood> Swyper: @result_of_reject[0] #=> nil
<havenwood> Swyper: Think about why `@result_of_reject[0]` is `nil`.
<havenwood> Swyper: Should there be at least one value in that Array?
<havenwood> Swyper: What should happen if there isn't?
akemhp_ has joined #ruby
<havenwood> Swyper: Up to you what the default is and what you do.
Intelo_ has joined #ruby
<Swyper> the default should have no values, since we did not add any dishes at that point
<havenwood> Swyper: So what should the code do when there's no first argument? Do that.
<Swyper> okay, I also updated the gist
<Swyper> it now shows that fish is indeed added as an element of the array
akem__ has quit [Ping timeout: 240 seconds]
<Swyper> if @result_of_reject == [] return end ?
akem__ has joined #ruby
<Swyper> the case where there is no first arguments is handled xD
<Swyper> it just ends the function call and goes back to the loop
<Swyper> github updated
<leftylink> did different people work on this code? why is result_of_reject such a meaningless name compared to meaningful n ames like dish_to_add_ingredients and ingredients_to_add ?
<Swyper> all me xD
<Swyper> I usually write sloppy code then once its working I refactor it lol
akemhp_ has quit [Ping timeout: 252 seconds]
roadt has quit [Ping timeout: 240 seconds]
<Swyper> this branch is named add-funct, its supposed to be additional functionality for something I'm working on
<Swyper> enter the name of the dish you wish to ingredients to: fish"enter the ingredients seperated by a comma for this dish: apple"
<Swyper> tff
brool has quit [Ping timeout: 250 seconds]
<Swyper> ah logic was broken
Tempesta has joined #ruby
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
davidw has joined #ruby
<Swyper> dish.ingredients.each do |ingredient| puts "\t " + ingredient + "\n" end
<Swyper> chef.rb:74:in `+': no implicit conversion of Array into String (TypeError)
<Swyper> hmm
<Swyper> so the ingredients is an array and I'm looping through it
<Swyper> which should be an element
<Swyper> byebug) ingredient["yellow", "pink", "blue"]
<Swyper> hmm
DaRock has quit [Ping timeout: 246 seconds]
<Swyper> so it seems like push adds in my array as a subarray
<Swyper> how do i circumvent that o-o
Esa_ has quit [Ping timeout: 240 seconds]
<Swyper> anarry.push(somearray) ends up with a nested array, how do I make it so it just ends up appending the elements to the array
<Swyper> += solved it, sorry for talking to myself so much I should really buy a rubberduck..
Swyper has quit [Remote host closed the connection]
sarink has joined #ruby
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
greengriminal has quit [Quit: This computer has gone to sleep]
akemhp_ has joined #ruby
akem__ has quit [Ping timeout: 240 seconds]
sarink has quit [Remote host closed the connection]
MrCrackPot has quit [Quit: Leaving]
dellavg has joined #ruby
MrCrackPot has joined #ruby
sarink has joined #ruby
fig-le-deunch has joined #ruby
kent\n has quit [Ping timeout: 240 seconds]
sarink has quit [Remote host closed the connection]
sarink has joined #ruby
fig-le-deunch has quit [Ping timeout: 265 seconds]
donofrio_ has quit [Remote host closed the connection]
xco has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.6]
RiPuk has joined #ruby
RiPuk_ has quit [Read error: Connection reset by peer]
cthu| has joined #ruby
chalkmonster has joined #ruby
chalkmonster has quit [Client Quit]
cthulchu has quit [Ping timeout: 245 seconds]
kent\n has joined #ruby
jenrzzz has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
MrCrackPot has quit [Remote host closed the connection]
dellavg has quit [Ping timeout: 265 seconds]
stryek has quit [Quit: Connection closed for inactivity]
darris has joined #ruby
ua has quit [Ping timeout: 268 seconds]
ua has joined #ruby
Axy has joined #ruby
Mia has quit [Ping timeout: 268 seconds]
kyrylo has joined #ruby
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
conta has joined #ruby
Intelo_ has quit [Ping timeout: 268 seconds]
bsdbandit-01 has joined #ruby
davidw has quit [Ping timeout: 268 seconds]
bsdband16 has quit [Ping timeout: 268 seconds]
Intelo_ has joined #ruby
roadt has joined #ruby
Intelo_ is now known as Intelo
roadt has quit [Ping timeout: 240 seconds]
schne1der has joined #ruby
sarink has quit [Remote host closed the connection]
roadt has joined #ruby
sandstrom has joined #ruby
sandstrom has quit [Client Quit]
sauvin has joined #ruby
sandstrom has joined #ruby
schne1der has quit [Ping timeout: 276 seconds]
chalkmonster has joined #ruby
_whitelogger has joined #ruby
akem__ has joined #ruby
akemhp_ has quit [Read error: Connection reset by peer]
DaRock has joined #ruby
bsdbandit-01 has quit [Ping timeout: 250 seconds]
infinityfye has joined #ruby
andikr has joined #ruby
harai has quit [Ping timeout: 260 seconds]
bsdband81 has joined #ruby
Furai has quit [Quit: WeeChat 2.6]
Intelo has quit [Ping timeout: 276 seconds]
akemhp has joined #ruby
akem__ has quit [Ping timeout: 240 seconds]
Intelo has joined #ruby
Furai has joined #ruby
skx86 has quit [Quit: Connection closed for inactivity]
KeyJoo has joined #ruby
roadt has quit [Ping timeout: 265 seconds]
roadt has joined #ruby
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
roadt has quit [Ping timeout: 265 seconds]
Intelo has quit [Ping timeout: 245 seconds]
banisterfiend has joined #ruby
banisterfiend has quit [Client Quit]
oncall-pokemon has quit [Quit: Connection closed for inactivity]
roadt has joined #ruby
queip has quit [Ping timeout: 268 seconds]
queip has joined #ruby
Intelo has joined #ruby
mozzarella has quit [Remote host closed the connection]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mozzarella has joined #ruby
mozzarella has quit [Remote host closed the connection]
kyrylo has joined #ruby
twb has joined #ruby
<twb> I inherited a crappy RoR blob
<twb> The "+" in this File.open is stupid, right? http://ix.io/1QI2
sandstrom has quit [Quit: My computer has gone to sleep.]
<baweaver> Eh, it's not that bad.
<twb> it's just completely unnecessary, because they never read from the file
<baweaver> Then fix it
<twb> Sorry, that was a question :-)
<twb> I don't normally babysit ruby so I was a bit paranoid that there might be some weird edge-case
<baweaver> Remember not everyone writing Ruby knows it well
<baweaver> More often than not they're just looking for a solution and maybe some SO post had that
<baweaver> Could probably just outright use `File.write` instead.
mozzarella has joined #ruby
<twb> Heh, cool.
rainmanj_ has joined #ruby
<baweaver> Be careful in calling code crappy or bad
<twb> One of the few things I like in perl is that you can "use criticism;" and if your coworker does something dumb, it'll yell at them automatically
<baweaver> Instead say something to the extent of "Have you considered this alternative?" when reviewing, or "I think this code can be simplified like ..."
dbugger has joined #ruby
<baweaver> when opening a PR
<twb> baweaver: yeah fair. This particular person has already been sacked acrimoniously and I've been called in to clean up the mess
rainmanjam has quit [Ping timeout: 252 seconds]
<twb> So *this* time I don't mind if I hurt their feelings
<baweaver> but the more negative a reaction you display openly the less likely people will be to open up or seek advise
<baweaver> Always be kind when possible, even to those who can't hear you
<twb> fair
<baweaver> Remember MINASWAN :)
<baweaver> It's easy to be critical, I get that
<baweaver> I certainly was for years, just made me kinda bitter all the time
<twb> The part I'm really cranky about is they've got an ORM, and they're *still* constructing SQL queries by concatenating strings together
<baweaver> are there any injections?
<baweaver> Also make sure tests are around before moving the world
<baweaver> Sometimes an assumption is made that does bad things that a test may reveal
<baweaver> Been caught by that more times than I want to admit
<twb> Actually since I'm completely new to ruby, is there a standard linter? Equivalent of perlcritic or python3 -m flake8
<baweaver> Give it a week or so
<baweaver> Penelope Phippen was working on one they're releasing at RubyConf next week
<twb> Preferably something that will report both "this is a poor style" and "this is an actual security issue"
<twb> baweaver: OK fair enough
<baweaver> Currently Rubocop and Brakeman
<baweaver> Rubocop will also autocorrect some issues
<baweaver> I'll be speaking there again this year :D
<twb> rubocop looks pretty reasonable
gregf_ has joined #ruby
dionysus69 has joined #ruby
spacesuitdiver has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<twb> Hrm, so now THIS method is calling "MichaelsMailer.deliver_gfk_weekly_report". And I can see "MichaelsMailer", but the "deliver_gfk_weekly_report" doesn't exist *anywhere else* in the codebase
<twb> Doesn't even appear anywhere else in git history
<twb> I can't obviously see it being constructed by reflection, either.
schne1der has joined #ruby
<twb> MichaelsMailer has a "def gfk_weekly_report" which is constructing the message payload, though, so that must turn into "deliver_gfk_weekly_report"... somehow
lineus has quit [Ping timeout: 276 seconds]
jmcgnh has quit [Read error: Connection reset by peer]
sarink has joined #ruby
<baweaver> MichaelsMailer.method(:deliver_gfk_weekly_report).source
<baweaver> I think
<baweaver> though it's probably AM defining that dynamically
<twb> You mean like "just ask the runtime where the code came from" ?
Intelo_ has joined #ruby
<baweaver> Pretty much
<twb> I'm a bit scared to actually execute this code; they don't have a test environment or anything >_>
<baweaver> &>> Integer.method(:+).source_location
<rubydoc> stderr: -e:4:in `method': undefined method `+' for class `#<Class:Integer>' (NameError)... check link for more (https://carc.in/#/r/80ay)
<twb> Also the broken code I'm trying to repair is the code that buys parts on credit, so if I *do* get it working, I very definitely do not want to re-run it a bunch of times :-)
<baweaver> &>> 4.method(:+).source_location
<rubydoc> # => nil (https://carc.in/#/r/80az)
dionysus69 has quit [Ping timeout: 240 seconds]
<baweaver> Anyways that's hiding somewhere on a method object
jmcgnh has joined #ruby
Nicmavr has quit [Quit: ZNC 1.7.0 - https://znc.in]
catsed has joined #ruby
Intelo has quit [Ping timeout: 240 seconds]
cats has quit [Ping timeout: 245 seconds]
catsed is now known as cats
sarink has quit [Ping timeout: 268 seconds]
justinweiss has quit [Ping timeout: 245 seconds]
Kuukunen has quit [Ping timeout: 245 seconds]
dionysus69 has joined #ruby
Kuukunen has joined #ruby
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
jweiss has joined #ruby
Nicmavr has joined #ruby
Yes has joined #ruby
Yes is now known as Guest24022
Guest24022 has quit [Remote host closed the connection]
luminousnine has quit [Quit: Toodles]
chalkmonster has quit [Quit: WeeChat 2.6]
luminousnine has joined #ruby
luminousnine has joined #ruby
luminousnine has quit [Changing host]
<twb> thanks for your help today. It's my bedtime
mikecmpbll has joined #ruby
xtsee has quit [Quit: WeeChat 2.3]
sandstrom has joined #ruby
xtsee has joined #ruby
cthulchu_ has joined #ruby
twb has quit [Remote host closed the connection]
cthu| has quit [Ping timeout: 245 seconds]
DaRock has quit [Ping timeout: 245 seconds]
chalkmonster has joined #ruby
queip has quit [Ping timeout: 268 seconds]
DaRock has joined #ruby
queip has joined #ruby
lxsameer has joined #ruby
gregf_ has quit [Remote host closed the connection]
rapha has left #ruby ["WeeChat 2.3"]
jottr has joined #ruby
phaul_ has joined #ruby
DTZUZO has quit [Ping timeout: 276 seconds]
roadt has quit [Ping timeout: 268 seconds]
DTZUZO has joined #ruby
rapha has joined #ruby
<rapha> morning
<rapha> is it okay to call a child class's method from its parent class's constructor? or should that be considered black magic?
DTZUZO has quit [Ping timeout: 268 seconds]
andikr has quit [Ping timeout: 265 seconds]
andikr has joined #ruby
DTZUZO has joined #ruby
queip has quit [Ping timeout: 240 seconds]
queip has joined #ruby
andikr has quit [Ping timeout: 250 seconds]
lineus has joined #ruby
KeyJoo has quit [Quit: KeyJoo]
queip has quit [Ping timeout: 268 seconds]
queip has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.6]
queip has quit [Ping timeout: 268 seconds]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sandstrom has quit [Quit: My computer has gone to sleep.]
DTZUZO has quit [Ping timeout: 268 seconds]
akemhp_ has joined #ruby
queip has joined #ruby
akemhp has quit [Ping timeout: 245 seconds]
DTZUZO has joined #ruby
akem__ has joined #ruby
akemhp_ has quit [Ping timeout: 265 seconds]
DTZUZO has quit [Ping timeout: 268 seconds]
DTZUZO has joined #ruby
queip has quit [Ping timeout: 240 seconds]
NL3limin4t0r_afk is now known as NL3limin4t0r
queip has joined #ruby
DTZUZO has quit [Ping timeout: 246 seconds]
<NL3limin4t0r> rapha: Why isn't #respond implemented on Paren? It could simply be an empty method, that can be overridden by it's childs. That way you don't have to check if the method exists, and would be similar to #method_added. All classes modules have an empty method #method_added that is called when a method is added, however the default behaviour simply does nothing.
akemhp_ has joined #ruby
DTZUZO has joined #ruby
akem__ has quit [Ping timeout: 268 seconds]
roadt has joined #ruby
titanbiscuit has quit [Read error: Connection reset by peer]
titanbiscuit has joined #ruby
DTZUZO has quit [Ping timeout: 245 seconds]
DTZUZO has joined #ruby
andikr has joined #ruby
DTZUZO has quit [Ping timeout: 240 seconds]
DTZUZO has joined #ruby
akem__ has joined #ruby
akemhp_ has quit [Ping timeout: 268 seconds]
bsdbandit-01 has joined #ruby
bsdband81 has quit [Ping timeout: 268 seconds]
skx86 has joined #ruby
sandstrom has joined #ruby
sandstrom has quit [Ping timeout: 246 seconds]
sandstrom has joined #ruby
sandstrom has quit [Client Quit]
akemhp has joined #ruby
schne1der has quit [Ping timeout: 265 seconds]
DTZUZO has quit [Ping timeout: 276 seconds]
akemhp_ has joined #ruby
ElFerna has joined #ruby
DTZUZO has joined #ruby
akem__ has quit [Ping timeout: 240 seconds]
sandstrom has joined #ruby
akemhp has quit [Ping timeout: 240 seconds]
<rapha> NL3limin4t0r: because i want multiple subclasses and they should each implement their own version of #respond
<rapha> oh you mean, just implement it on the parent _in addition_
chalkmonster has joined #ruby
<rapha> yes, that sounds nice!
chalkmonster has quit [Client Quit]
Nicmavr has quit [Read error: Connection reset by peer]
Inline has quit [Quit: Leaving]
bsdband6 has joined #ruby
bsdbandit-01 has quit [Ping timeout: 246 seconds]
Nicmavr has joined #ruby
ElFerna has quit [Quit: WeeChat 1.9.1]
akem__ has joined #ruby
akemhp_ has quit [Ping timeout: 240 seconds]
DaRock has quit [Ping timeout: 265 seconds]
cthu| has joined #ruby
akemhp has joined #ruby
akem__ has quit [Ping timeout: 268 seconds]
cthulchu_ has quit [Ping timeout: 245 seconds]
akemhp_ has joined #ruby
akemhp has quit [Ping timeout: 240 seconds]
codefriar has quit [Ping timeout: 240 seconds]
akemhp_ has quit [Ping timeout: 246 seconds]
akemhp has joined #ruby
DaRock has joined #ruby
conta has quit [Remote host closed the connection]
lucasb has joined #ruby
schne1der has joined #ruby
DaRock has quit [Ping timeout: 268 seconds]
AJA4350 has joined #ruby
DaRock has joined #ruby
sarink has joined #ruby
sarink has quit [Ping timeout: 265 seconds]
jottr has quit [Ping timeout: 240 seconds]
conta has joined #ruby
jottr has joined #ruby
_dbugger has joined #ruby
dbugger has quit [Ping timeout: 250 seconds]
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 268 seconds]
AJA4351 has quit [Ping timeout: 250 seconds]
AJA4350 has joined #ruby
xco has joined #ruby
rwb has quit [Ping timeout: 265 seconds]
queip has quit [Quit: bye, freenode]
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
queip has joined #ruby
<NL3limin4t0r> rapha: Yep, simply `def respond; end` would be enough.
<NL3limin4t0r> Then you could change `respond if respond_to? :respond` to simply `respond`.
AJA4351 has joined #ruby
<NL3limin4t0r> basically a noop method
andikr has quit [Remote host closed the connection]
AJA4350 has quit [Ping timeout: 276 seconds]
tpanarch1st_ has joined #ruby
AJA4351 has quit [Ping timeout: 240 seconds]
AJA4350 has joined #ruby
griffindy has joined #ruby
codefriar has joined #ruby
griffindy has quit [Client Quit]
codefriar has quit [Client Quit]
Jonopoly has joined #ruby
AJA4351 has joined #ruby
codefriar has joined #ruby
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4350 has joined #ruby
AJA4351 has quit [Ping timeout: 246 seconds]
sandstrom has quit [Quit: My computer has gone to sleep.]
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sandstrom has joined #ruby
sarink has joined #ruby
xco has joined #ruby
AJA4350 has quit [Ping timeout: 245 seconds]
rbruchal has joined #ruby
baojg has joined #ruby
baojg has quit [Remote host closed the connection]
rbruchal has quit [Client Quit]
animo8 has joined #ruby
schne1der has quit [Ping timeout: 265 seconds]
<animo8> Hi, how do you handle a program being ran without arguments in optparse?
<animo8> It makes sense to me that printing the help message should be the default action for no arguments, as opposed to showing an error
<animo8> But whatever, I'll just implement it myself once I figure out how to handle the 0 args case
<phaul_> depends on the program you are writing I guess. some programs require cmd line arguments some have some default behaviour.
AJA4350 has joined #ruby
<phaul_> if you execute 'git' on the cmd line you get a list of sub-commands. If you do 'cat' it reads stdin
animo8 has quit [Ping timeout: 252 seconds]
guardian has quit [Ping timeout: 246 seconds]
* phaul_ wants his answer back :)
crella133 has joined #ruby
ElFerna has joined #ruby
alfiemax has quit [Remote host closed the connection]
guardian has joined #ruby
AJA4350 has quit [Ping timeout: 240 seconds]
crella133 has quit [Client Quit]
animo8 has joined #ruby
<animo8> phaul_: Yeah, but IMO the most common case (and a good default behavior) is simply printing the help. Or maybe if there are subcommands print those
<animo8> stdin reading should be something you explicitly implemented
<animo8> But even if I did want to implement it I can't figure out how to do it using optparse :p
Intelo_ has quit [Ping timeout: 276 seconds]
AJA4350 has joined #ruby
bsdband6 has quit [Read error: Connection reset by peer]
<al2o3-cr> animo8: check if argv is empty before parsing options.
<animo8> al2o3-cr: I guess that works but it feels kinda clunky. Also I'd have to copy-paste my help string and that's not DRY
<al2o3-cr> animo8: you don't, you just ARGV << '-h'/'--help' if ARGV.empty?
bsdband42 has joined #ruby
<animo8> al2o3-cr: Ohhhhh, right. That's neat
ElFerna has quit [Quit: WeeChat 1.9.1]
ElFerna has joined #ruby
AJA4350 has quit [Ping timeout: 240 seconds]
ElFerna has quit [Quit: WeeChat 1.9.1]
sarink has quit [Remote host closed the connection]
AJA4350 has joined #ruby
bsdbandit-01 has joined #ruby
bsdband42 has quit [Ping timeout: 240 seconds]
cthulchu_ has joined #ruby
jottr has quit [Ping timeout: 268 seconds]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cthu| has quit [Ping timeout: 250 seconds]
brendan- has joined #ruby
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
chalkmonster has joined #ruby
Swyper has joined #ruby
<Swyper> gem "loofah", ">= 2.3.1"how do I run this in a ruby folder but with the --conservative option?like I want to upgrade my current gemfile to use Loofah 2.3.1
DaRock has quit [Ping timeout: 268 seconds]
schne1der has joined #ruby
vondruch has quit [Ping timeout: 245 seconds]
krawchyk has joined #ruby
Swyper has quit [Remote host closed the connection]
bsdband82 has joined #ruby
bsdbandit-01 has quit [Ping timeout: 265 seconds]
Swyper has joined #ruby
Esa_ has joined #ruby
<Swyper> hi sorry I got logged out
poontangmessiah has joined #ruby
<Swyper> bundle update loofah, how do I make this do a specific version i guess?
ravenousmoose has joined #ruby
infinityfye has quit [Quit: Leaving]
harai has joined #ruby
ravenousmoose has quit [Ping timeout: 250 seconds]
jottr has joined #ruby
Swyper has quit [Remote host closed the connection]
Navred has joined #ruby
animo8 has quit [Remote host closed the connection]
greengriminal has joined #ruby
howdoi has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.6]
spacesuitdiver has joined #ruby
conta has quit [Ping timeout: 268 seconds]
Nicmavr has quit [Ping timeout: 245 seconds]
brool has joined #ruby
queip has quit [Ping timeout: 268 seconds]
davidw has joined #ruby
davidw has joined #ruby
davidw has quit [Changing host]
akemhp_ has joined #ruby
jottr has quit [Ping timeout: 265 seconds]
akemhp has quit [Ping timeout: 265 seconds]
rainmanj_ has quit []
queip has joined #ruby
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 240 seconds]
krawchyk has quit [Quit: krawchyk]
darkf has quit [Quit: Connection closed for inactivity]
queip has quit [Ping timeout: 268 seconds]
AJA4350 has joined #ruby
AJA4351 has quit [Ping timeout: 265 seconds]
Technodrome has joined #ruby
vondruch has joined #ruby
Nicmavr has joined #ruby
queip has joined #ruby
jottr has joined #ruby
Swyper has joined #ruby
bzb has joined #ruby
akem__ has joined #ruby
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 245 seconds]
AJA4351 is now known as AJA4350
jottr has quit [Quit: WeeChat 2.6]
akemhp_ has quit [Ping timeout: 240 seconds]
xco has quit [Quit: Textual IRC Client: www.textualapp.com]
drincruz has quit [Ping timeout: 268 seconds]
akemhp_ has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
akem__ has quit [Ping timeout: 240 seconds]
mikecmpbll has joined #ruby
catphish has joined #ruby
<catphish> so centos 6 ships with ruby 1.8, seems i still have to support it
* catphish sobs quietly
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4351 has joined #ruby
kyrylo has joined #ruby
_dbugger is now known as Dbugger
greengriminal has quit [Quit: Leaving]
bzb has quit [Quit: Leaving]
AJA4351 has quit [Ping timeout: 240 seconds]
akem__ has joined #ruby
entel has joined #ruby
akemhp_ has quit [Ping timeout: 240 seconds]
<adam12> catphish: Centos7 ships with Ruby 2.0 :( I guess they gave up once SCL was more popular.
codefriar has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Swyper has quit [Remote host closed the connection]
mn3m has joined #ruby
brendan- has quit [Ping timeout: 245 seconds]
brendan- has joined #ruby
<havenwood> I thought this was an interesting way to reduce a Node's ancestors: https://gist.github.com/havenwood/85734cd9a9db1cbbdfbb845467544e49
sarink has joined #ruby
Intelo has joined #ruby
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sarink has quit [Ping timeout: 240 seconds]
<havenwood> &>> loop { raise StopIteration }
<rubydoc> # => nil (https://carc.in/#/r/80di)
Intelo has quit [Ping timeout: 245 seconds]
<adam12> I wonder what it would take to offer pre-built Ruby versions (by Ruby core not RVM) similar to how all Nodejs versions have a pre-built Linux version.
roadt has quit [Ping timeout: 265 seconds]
<adam12> I'm presuming it might have something to do with the Ruby options around compilation storing run paths (--enable-load-relative et all)
roadt has joined #ruby
<havenwood> adam12: Fullstaq Ruby is an attempt to fill that gap: https://fullstaqruby.org/
<havenwood> "Furthermore, the Ruby core team does not want to be responsible for certain aspects, such as distributing binaries. But binaries are valuable. So we take up the responsibility of packaging binaries."
<havenwood> adam12: Maybe this ^ work could be made official at some point. It seems like a great start.
krawchyk has joined #ruby
Intelo has joined #ruby
dr_mdma_md has joined #ruby
al2o3-cr has quit [Remote host closed the connection]
schne1der has quit [Remote host closed the connection]
Jonopoly has quit [Quit: WeeChat 2.5]
queip has quit [Ping timeout: 240 seconds]
drincruz has joined #ruby
al2o3-cr has joined #ruby
alfiemax has joined #ruby
queip has joined #ruby
ogres has joined #ruby
queip has quit [Ping timeout: 265 seconds]
mikecmpbll has quit [Quit: inabit. zz.]
orbyt_ has joined #ruby
queip has joined #ruby
dinfuehr has quit [Ping timeout: 246 seconds]
<adam12> havenwood: I didn't realize that they existed out of package managers. Cool.
dinfuehr has joined #ruby
queip has quit [Ping timeout: 276 seconds]
krawchyk has quit [Quit: krawchyk]
catphish has quit [Quit: Leaving]
dinfuehr has quit [Ping timeout: 245 seconds]
queip has joined #ruby
dinfuehr has joined #ruby
yann-kaelig has joined #ruby
yann-kaelig has quit [Client Quit]
jbeaudoin_sher has quit [Quit: Connection closed for inactivity]
mn3m has quit [Remote host closed the connection]
mn3m has joined #ruby
dinfuehr has quit [Ping timeout: 265 seconds]
bsdband82 has quit [Ping timeout: 265 seconds]
dionysus70 has joined #ruby
dionysus69 has quit [Ping timeout: 265 seconds]
dionysus70 is now known as dionysus69
mn3m has quit [Ping timeout: 268 seconds]
<NL3limin4t0r> havenwood: Where does `Enumerator::produce` come from, I don't seem to have it available. Anyway I would use recursion there, since it's a lot shorter: https://gist.github.com/havenwood/85734cd9a9db1cbbdfbb845467544e49#gistcomment-3082394
phaul_ has quit [Ping timeout: 252 seconds]
cloaked1 has joined #ruby
cloaked1 has joined #ruby
cloaked1 has quit [Changing host]
<NL3limin4t0r> My snippet might return the ancestors in the wrong order, but that can be easily fixed.
phaul_ has joined #ruby
<havenwood> NL3limin4t0r: I'd not expect that to work. Show an example? I typically stay away from recursion in Ruby, since I don't like to have it blow up with you get enough nodes.
<havenwood> NL3limin4t0r: Enumerator::produce is new in Ruby 2.7
dinfuehr has joined #ruby
<NL3limin4t0r> havenwood: Why would you expect it not to work?
<havenwood> NL3limin4t0r: I was just thinking a very long Node chain. You're right, it passes the tests. :)
<havenwood> NL3limin4t0r: You're also right the order is backwards. We need a #>> operator. :P
sarink has joined #ruby
<havenwood> NL3limin4t0r: I like #prepend better than #unshift.
davidw has quit [Ping timeout: 265 seconds]
dinfuehr has quit [Ping timeout: 240 seconds]
<havenwood> NL3limin4t0r: It does read nicely:
<havenwood> parent.ancestors.prepend parent
dinfuehr has joined #ruby
sandstrom has quit [Ping timeout: 252 seconds]
al2o3-cr has quit [Remote host closed the connection]
al2o3-cr has joined #ruby
<NL3limin4t0r> havenwood: I was going to say, you could use `[parent] + parent.ancestors` but that creates unesesary arrays. `parent.ancestors.prepend(parent)` is better.
<NL3limin4t0r> I find that recursion generally makes code more readable, but maybe that's just me. Putting together a recursive method can be hard, but understanding them generaly isn't.
dionysus69 has quit [Ping timeout: 276 seconds]
<NL3limin4t0r> havenwood: Another option here would be using `while` loop. https://gist.github.com/havenwood/85734cd9a9db1cbbdfbb845467544e49#gistcomment-3082418
dinfuehr has quit [Ping timeout: 240 seconds]
cd has joined #ruby
<havenwood> NL3limin4t0r: Yes, that was one I considered. I just wanted to show off the new Ruby 2.7 feature. :P
dinfuehr has joined #ruby
<NL3limin4t0r> ah
rippa has joined #ruby
<NL3limin4t0r> I'll have a look though, Enumerator::produce seems interesting. There might be a solid use-case for making it in. Knowing matz you first need a real world usecase behore he even considers a feature.
<havenwood> NL3limin4t0r: Updated with a test to trigger SystemStackError with recursive.
<NL3limin4t0r> havenwood: What's the Ruby recursion limit?
<havenwood> NL3limin4t0r: Just a handy way to make infinite enumerators. StopIteration examples are the edgecase.
<havenwood> NL3limin4t0r: It depends on the stack level allowed, which is implementation specfiic.
phaul_ has quit [Ping timeout: 246 seconds]
bitwinery has joined #ruby
<havenwood> NL3limin4t0r: JRuby's is on the small end, iir.
bitwinery has quit [Remote host closed the connection]
bitwinery has joined #ruby
<havenwood> NL3limin4t0r: TCO is interesting. I'd kinda like to make it a bit more accessible to enable in Ruby.
<NL3limin4t0r> I still find it kindof strange, since a while loop is simply user managed recursion. However I also get it, since Ruby tracks things like callee, stacktrace and other stuff, which doesn't happen when you do a while loop.
<NL3limin4t0r> Or at least, it resets after each iteration.
dinfuehr has quit [Ping timeout: 276 seconds]
<al2o3-cr> you can increase the stack size with RUBY_THREAD_VM_STACK_SIZE environment variable
dinfuehr has joined #ruby
lxsameer has quit [Ping timeout: 268 seconds]
SuperLag has joined #ruby
silverbit has joined #ruby
sarink has quit []
<NL3limin4t0r> havenwood: Haven't heard of TCO, but I'm guessing you're talking about this https://nithinbekal.com/posts/ruby-tco/
silverbit has quit [Client Quit]
<adam12> havenwood: I find it interesting that Hongli is doing Fullstaq but not under the Phusion banner. Not to be a conspiracy theorist but I wonder if there's something more there.
<NL3limin4t0r> al2o3-cr: that's pretty usefull to know =)
<adam12> havenwood: Maybe it's just another brand.
<al2o3-cr> NL3limin4t0r: indeed.
jacargentina has joined #ruby
Emmanuel_Chanel has quit [Ping timeout: 240 seconds]
ellcs1 has joined #ruby
<NL3limin4t0r> It's getting late, I'm gonna let myself out. Have a nice day #ruby. =)
<al2o3-cr> o/
NL3limin4t0r is now known as NL3limin4t0r_afk
davidw has joined #ruby
drincruz_ has joined #ruby
ravenousmoose has joined #ruby
drincruz has quit [Ping timeout: 265 seconds]
droid85 has joined #ruby
droid85 has quit [Quit: droid85]
<havenwood> adam12: I noticed the same. They're both Dutch.
akemhp_ has joined #ruby
<havenwood> adam12: Maybe just Dutch collaberation?
<adam12> havenwood: Possibly. Phusion has such a strong brand it just surprised me.
<adam12> havenwood: Still didn't see a tarball download. Oh well.
akem__ has quit [Ping timeout: 268 seconds]
<adam12> havenwood: They could probably be extracted from the Heroku buildpack if one tried hard enough.
ElFerna has joined #ruby
drincruz has joined #ruby
drincruz_ has quit [Ping timeout: 240 seconds]
dionysus69 has joined #ruby
davidw has quit [Ping timeout: 240 seconds]
Dbugger has quit [Quit: Leaving]
SCHAPiE has quit [Ping timeout: 265 seconds]
SCHAPiE has joined #ruby
cloaked1 has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
tweaks has joined #ruby
<Net> trying to come up with a better name for this query param: created_on_or_after
<leftylink> created_not_before lol
<leftylink> though honestly I would probably have called it created_on_or_after as well
<Net> not_created_not_after
<ccooke> #terribleidea created_within and then use a custom date range object!
<havenwood> created_hereon_or_hereafter
<havenwood> :P
sauvin has quit [Ping timeout: 276 seconds]
Emmanuel_Chanel has joined #ruby
dinfuehr has quit [Ping timeout: 246 seconds]
sameerynho has joined #ruby
ogres has quit [Quit: Connection closed for inactivity]
dinfuehr has joined #ruby
dinfuehr has quit [Ping timeout: 240 seconds]
<adam12> Net: created_on_gte
dinfuehr has joined #ruby
<Net> elasticsearch?
wildtrees has joined #ruby
<ccooke> actually, created_since
wildtrees has quit [Remote host closed the connection]
wildtrees has joined #ruby
<Net> that's nice
<Net> I need both before and after though :/
<Net> might to gte and lte
<Net> *do
harai has quit [Ping timeout: 260 seconds]
tankf33der has joined #ruby
phaul_ has joined #ruby
shalok has quit [Ping timeout: 240 seconds]
GodFather has joined #ruby
shalok has joined #ruby
jacargentina has quit [Quit: jacargentina]
phaul_ has quit [Ping timeout: 265 seconds]
al2o3-cr has quit [Quit: WeeChat 2.6]
donofrio has joined #ruby
donofrio has quit [Remote host closed the connection]
donofrio has joined #ruby
al2o3-cr has joined #ruby
dinfuehr has quit [Ping timeout: 268 seconds]
BTRE has quit [Quit: Leaving]
dinfuehr has joined #ruby
duderonomy has joined #ruby
BTRE has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orbyt_ has quit [Quit: Textual IRC Client: www.textualapp.com]
orbyt_ has joined #ruby
Ai9zO5AP has joined #ruby
akemhp_ has quit [Ping timeout: 268 seconds]
i9zO5AP has quit [Ping timeout: 268 seconds]
lineus has quit [Ping timeout: 268 seconds]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lineus has joined #ruby
phaul_ has joined #ruby
lineus has quit [Ping timeout: 276 seconds]
lineus has joined #ruby
phaul_ has quit [Ping timeout: 276 seconds]
schne1der has joined #ruby
SCHAPiE has quit [Quit: ZNC - https://znc.in]
ElFerna has quit [Quit: WeeChat 1.9.1]
SanguineAnomaly has joined #ruby
AJA4350 has joined #ruby
davidw has joined #ruby
davidw has quit [Changing host]
davidw has joined #ruby
darkf has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
harai has joined #ruby
SCHAPiE has joined #ruby
davidw has quit [Ping timeout: 240 seconds]
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
r3m has quit [Quit: WeeChat 2.7-dev]
r3m has joined #ruby
ljarvis has joined #ruby
dionysus69 has quit [Ping timeout: 245 seconds]
VeryBewitching has joined #ruby
dinfuehr has quit [Ping timeout: 240 seconds]
dinfuehr has joined #ruby
ljarvis has quit [Quit: WeeChat 2.4]
harai has quit [Ping timeout: 260 seconds]
yoshie902a has joined #ruby
Ai9zO5AP has quit [Quit: WeeChat 2.5]
<yoshie902a> Would love advice on how to improve this payment/processing code. I am trying to design a way to roll back changes. https://stackoverflow.com/questions/58845890/rollback-method-changes-in-ruby-on-rails-with-stripe
<yoshie902a> NL3limin4t0r_afk: I implemented your policy_level code pattern. Works really well.
<phaul> how to improve? it's a 20+ line method. That should be the first red flag. I have no idea what the first "end" keyword in the code is closing
<phaul> I don't understand how the ifs are embeded in each other later with the current code indentation
<yoshie902a> phaul: fix the end issue, it was a typo
<yoshie902a> fixed the if statement issue to, it was related
<yoshie902a> the end statement was in the incorrect place
<phaul> okay :) steps in the right direction
<yoshie902a> phaul: I’m looking for a better coding pattern. and maybe logic.
<phaul> hm. this event pushing oneach step feels a bit repetative
<phaul> maybe something like event 'invoice_paid' { invoice = invoice.pay }
<phaul> btw I don't like reusing localvariables like that Ijust wanted to demonstrate the idea of a event method that takes a block
<phaul> def event(event_name, &block) ...
<yoshie902a> interesting
<phaul> you can even move it out into a module/concern, and include it with include Eventable and push on an @event instance variable
<yoshie902a> I would need to set the event after the &block runs, but it’s doable.
<phaul> yield first, then push. yes
jenrzzz has quit [Ping timeout: 268 seconds]
<phaul> well, you can try it and see how you like the looks of it. experimenting is the best way
<yoshie902a> what’s the real benefit of creating an eventable module? Or should it be a seperate instance?
<yoshie902a> class
<yoshie902a> I hate the size of it, but not sure how to reduce it, since I already moved most of the logic into the other methods
<phaul> the benefit is that it's a concept that you can talk on it's own, a single responsibility part,that then doesn't polute you business logic (it does but it'sclearer that it doesnt belong to the business logic)
<yoshie902a> makes sense
<yoshie902a> how about handing the rollback on error? I feel this is really a messy way of doing it
al2o3-cr has quit [Remote host closed the connection]
<phaul> hm maybe look into https://dry-rb.org/gems/dry-transaction/
<phaul> if you have failable steps it might be a nice way to code it
al2o3-cr has joined #ruby
<yoshie902a> When it does “Each operation shouldn’t accumulate state, instead it should receive an input and return an output without causing any side-effects.”
<yoshie902a> Does it mean my events logic is accumulating state?
<yoshie902a> I would not know how to roll back all the needed changes otherwise.
<phaul> I think dry-transaction wants you to do this is a pipeline where each step gets its input from the result of the previous step, and if something fails in the pipeline the execution is aborted altogether. If you let's say save things in the database (side-effects) then it wouldn't work. But you are encouraged not to do that. So roll back is not needed.
<phaul> once the pipeline executed sucessfully you can persist the results
<phaul> (of the last step, but you can pass through stuff from previous steps)
<yoshie902a> phaul: I am hitting an external API, and only know if things fail or succeed based on the api response, so it makes this method hard to do
<phaul> ok, forget this then
schne1der has quit [Ping timeout: 250 seconds]
<yoshie902a> for example, I update a subscription to the api, it succeeds, which then allows me to create an invoice, if that succeeds, the api lets me pay the invoice
<yoshie902a> My db and the api should be inline, so if the api succeeds, it a good time to also update the DB
<yoshie902a> however, if payments fails, I need to revert the update to the subscription, revert the db change
<yoshie902a> and cancel the invoice
<phaul> right. so the sole purpose of the events array is to know what to roll back on failure. I get it now.
duderonomy has joined #ruby
<yoshie902a> Yup
<phaul> I didn't understand that bit before
<yoshie902a> I am just so unhappy with this method.
<yoshie902a> it feels messy and just bad
<phaul> I would be too. totally agree
<yoshie902a> However, I do not know what else to do
harai has joined #ruby
<phaul> tbh now that Iunderstand what you are doing I wouldn't recommend my first recommendation any more, I thought collecting events was a higher level system requirement
<phaul> so scratch the event method with the block
<yoshie902a> ok
<yoshie902a> phaul: I’m open to all ideas :)
<phaul> I probably would have 4 methods for the 4 steps: def update_api; ...; true ; rescue StripeError => undo_update; false; end and then update_api and update_db and ...
<phaul> the event collecting feels bad. this still doesn't feel right but better (to me)
<phaul> it's kind of similar to doing it with dry-transaction where you would have a rescue in each step
ravenousmoose has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<phaul> and fail the step if exception was raised, and that also aborts the pipeline
ellcs1 has quit [Ping timeout: 245 seconds]
<phaul> so you are not passing the result of the steps just an ok status
rwb has joined #ruby
<phaul> but it's mostly emulated by a method per step where each method rescues, and returns true if there was no exception wasn't
<yoshie902a> the problem is if the last step fails, they all need to be rolled back
<yoshie902a> if I understand you, only the last step gets rolled back
<yoshie902a> Am I misunderstanding you?
<phaul> no. you are right
greengriminal has joined #ruby
greengriminal has quit [Client Quit]
akemhp has joined #ruby
jenrzzz has joined #ruby
Inline has joined #ruby
imtravis has joined #ruby
<yoshie902a> I think I am going to change the way I use the api, charge the customer first and if successful, then update the subsciption
sputnik13 has joined #ruby
ellcs1 has joined #ruby
bvdw has quit [Quit: bvdw]
bvdw has joined #ruby
jenrzzz has quit [Ping timeout: 276 seconds]
Technodrome has joined #ruby
<yoshie902a> phaul: Thank you for your feedback!
jenrzzz has joined #ruby
entel has quit [Quit: Connection closed for inactivity]
sputnik13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nisstyre has quit [Quit: WeeChat 2.5]
sputnik13 has joined #ruby
yoshie902a has quit [Quit: yoshie902a]
sputnik13 has quit [Client Quit]
nisstyre has joined #ruby
sputnik13 has joined #ruby
phaul_ has joined #ruby
sputnik13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
VeryBewitching has quit [Quit: Konversation terminated!]
phaul_ has quit [Ping timeout: 245 seconds]
bambanx has joined #ruby
spacesuitdiver has quit [Ping timeout: 240 seconds]
sputnik13 has joined #ruby
sameerynho has quit [Ping timeout: 276 seconds]
sputnik13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ellcs1 has quit [Remote host closed the connection]
harai has quit [Ping timeout: 260 seconds]
phaul_ has joined #ruby
harai has joined #ruby
yoshie902a has joined #ruby
spacesuitdiver has joined #ruby
davidw has joined #ruby
davidw has quit [Changing host]
davidw has joined #ruby
DaRock has joined #ruby