File: predicate.rb

package info (click to toggle)
ruby-nenv 0.3.0-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 184 kB
  • sloc: ruby: 517; sh: 4; makefile: 2
file content (18 lines) | stat: -rw-r--r-- 367 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
module Nenv
  class Environment
    module Loader::Predicate
      def self.call(raw_value)
        case raw_value
        when nil
          nil
        when ''
          fail ArgumentError, "Can't convert empty string into Bool"
        when '0', 'false', 'n', 'no', 'NO', 'FALSE'
          false
        else
          true
        end
      end
    end
  end
end