Sha256: c4430bfa370bb3bffa31721835d36587e8452eca8dd97420118ff06ee30fdd9a
Contents?: true
Size: 533 Bytes
Versions: 26
Compression:
Stored size: 533 Bytes
Contents
class ImageOptim # Denote ternary value (`true`/`false`/`nil`) for worker option class TrueFalseNil # Add handling of ternary value in OptionParser instance, maps `nil` and # `'nil'` to `nil` def self.add_to_option_parser(option_parser) completing = OptionParser.top.atype[TrueClass][0].merge('nil' => nil) option_parser.accept(self, completing){ |_arg, val| val } end # Convert everything truthy to `true`, leave `false` and `nil` as is def self.convert(v) v && true end end end
Version data entries
26 entries across 26 versions & 3 rubygems