Module: Capistrano::CLI::Options

Module | Capistrano::CLI::Options
In: | lib/capistrano/cli/options.rb lib/capistrano/cli/options.rb

### Methods

coerce_variable coerce_variable coerce_variable_types! coerce_variable_types! included included

### Classes and Modules

Module Capistrano::CLI::Options::ClassMethods

### Attributes

options | [R] | The hash of (parsed) command-line options
options | [R] | The hash of (parsed) command-line options

### Public Class methods

included(base)

[Source]

       # File lib/capistrano/cli/options.rb, line 6
    6:       def self.included(base)
    7:         base.extend(ClassMethods)
    8:       end

included(base)

[Source]

       # File lib/capistrano/cli/options.rb, line 6
    6:       def self.included(base)
    7:         base.extend(ClassMethods)
    8:       end

### Public Instance methods

coerce_variable(value)

[Source]

         # File lib/capistrano/cli/options.rb, line 210
    210:       def coerce_variable(value)
    211:         case value
    212:         when /^"(.*)"$/ then $1
    213:         when /^'(.*)'$/ then $1
    214:         when /^\d+$/ then value.to_i
    215:         when /^\d+\.\d*$/ then value.to_f
    216:         when "true" then true
    217:         when "false" then false
    218:         when "nil" then nil
    219:         else value
    220:         end
    221:       end

coerce_variable(value)

[Source]

         # File lib/capistrano/cli/options.rb, line 210
    210:       def coerce_variable(value)
    211:         case value
    212:         when /^"(.*)"$/ then $1
    213:         when /^'(.*)'$/ then $1
    214:         when /^\d+$/ then value.to_i
    215:         when /^\d+\.\d*$/ then value.to_f
    216:         when "true" then true
    217:         when "false" then false
    218:         when "nil" then nil
    219:         else value
    220:         end
    221:       end

coerce_variable_types!()

[Source]

         # File lib/capistrano/cli/options.rb, line 202
    202:       def coerce_variable_types!
    203:         [:pre_vars, :vars].each do |collection|
    204:           options[collection].keys.each do |key|
    205:             options[collection][key] = coerce_variable(options[collection][key])
    206:           end
    207:         end
    208:       end

coerce_variable_types!()

[Source]

         # File lib/capistrano/cli/options.rb, line 202
    202:       def coerce_variable_types!
    203:         [:pre_vars, :vars].each do |collection|
    204:           options[collection].keys.each do |key|
    205:             options[collection][key] = coerce_variable(options[collection][key])
    206:           end
    207:         end
    208:       end

[Validate]