Sha256: 4e0ec231877757158464933bfd8ffcec80bce4f160ea4d0b6c1cc4669a1a9c66
Contents?: true
Size: 963 Bytes
Versions: 14
Compression:
Stored size: 963 Bytes
Contents
#!/usr/bin/env ruby $: << File.dirname(__FILE__)+'/../lib' require 'configliere' Settings.use :env_var, :commandline Settings.define :underpants, :env_var => 'UNDERPANTS', :default => "boxers" Settings.resolve! puts %Q{ Configliere can take parameter values from its defaults, from the commandline, or from the environment. Compare: ./env_var_script.rb # value from default ./env_var_script.rb --underpants=briefs # value from commandline UNDERPANTS="commando" ./env_var_script.rb # value from environment variable UNDERPANTS="commando" ./env_var_script.rb --underpants=briefs # commandline wins } puts %Q{Using * the default setting of: #{Settings.definition_of(:underpants, :default).inspect} * the environment variable: #{ENV['UNDERPANTS'].inspect} * the commandline setting: #{ARGV.grep(/^--underpants/).inspect} your configliere advises that #{Settings.inspect} }
Version data entries
14 entries across 14 versions & 1 rubygems