Sha256: fd351137b55d0a179bac6525fc9f885934b9ca03080664dcf18724237c53e5da

Contents?: true

Size: 433 Bytes

Versions: 8

Compression:

Stored size: 433 Bytes

Contents

# frozen_string_literal: true

# Convert arguments into booleans, integers, or whatever.
class Puppet::Settings::ValueTranslator
  def [](value)
    # Handle different data types correctly
    return case value
           when /^false$/i; false
           when /^true$/i; true
           when true; true
           when false; false
           else
             value.gsub(/^["']|["']$/, '').sub(/\s+$/, '')
           end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
puppet-8.5.1 lib/puppet/settings/value_translator.rb
puppet-8.5.1-x86-mingw32 lib/puppet/settings/value_translator.rb
puppet-8.5.1-x64-mingw32 lib/puppet/settings/value_translator.rb
puppet-8.5.1-universal-darwin lib/puppet/settings/value_translator.rb
puppet-8.5.0 lib/puppet/settings/value_translator.rb
puppet-8.5.0-x86-mingw32 lib/puppet/settings/value_translator.rb
puppet-8.5.0-x64-mingw32 lib/puppet/settings/value_translator.rb
puppet-8.5.0-universal-darwin lib/puppet/settings/value_translator.rb