In this PR, I fix a bug that's present in the action currently:
In Ruby, an empty string is truthy. As a result, passed a value of "" or "nil", these branches of the code will run. As a result, we need to change the default values of the input to "" and check if the passed value is an empty string. No parsing is done to the values passed in as args so these are just strings. "nil" doesn't become nil and is truthy.
In irb, you can check the following:
irb(main):024:1* if ""
irb(main):025:1* puts "that string was truthy"
irb(main):026:0> end
(irb):26: warning: string literal in condition
that string was truthy
=> nil
irb(main):027:1* if "nil"
irb(main):028:1* puts "that string was truthy"
irb(main):029:0> end
(irb):29: warning: string literal in condition
that string was truthy
=> nil
irb(main):030:1* if false
irb(main):031:1* puts "that string was truthy"
irb(main):032:0> end
=> nil
In addition, I do some other clean up - make the option descriptions more consistent and restore an optimization that was recently removed.
In this PR, I fix a bug that's present in the action currently:
In Ruby, an empty string is truthy. As a result, passed a value of
""
or"nil"
, these branches of the code will run. As a result, we need to change the default values of the input to""
and check if the passed value is an empty string. No parsing is done to the values passed in as args so these are just strings."nil"
doesn't becomenil
and is truthy.In
irb
, you can check the following:In addition, I do some other clean up - make the option descriptions more consistent and restore an optimization that was recently removed.