| Module | Capistrano::CLI::Options |
| In: |
lib/capistrano/cli/options.rb
lib/capistrano/cli/options.rb |
| options | [R] | The hash of (parsed) command-line options |
| options | [R] | The hash of (parsed) command-line options |
# File lib/capistrano/cli/options.rb, line 6 6: def self.included(base) 7: base.extend(ClassMethods) 8: end
# File lib/capistrano/cli/options.rb, line 6 6: def self.included(base) 7: base.extend(ClassMethods) 8: end
# File lib/capistrano/cli/options.rb, line 225
225: def coerce_variable(value)
226: case value
227: when /^"(.*)"$/ then $1
228: when /^'(.*)'$/ then $1
229: when /^\d+$/ then value.to_i
230: when /^\d+\.\d*$/ then value.to_f
231: when "true" then true
232: when "false" then false
233: when "nil" then nil
234: else value
235: end
236: end
# File lib/capistrano/cli/options.rb, line 225
225: def coerce_variable(value)
226: case value
227: when /^"(.*)"$/ then $1
228: when /^'(.*)'$/ then $1
229: when /^\d+$/ then value.to_i
230: when /^\d+\.\d*$/ then value.to_f
231: when "true" then true
232: when "false" then false
233: when "nil" then nil
234: else value
235: end
236: end
# File lib/capistrano/cli/options.rb, line 217
217: def coerce_variable_types!
218: [:pre_vars, :vars].each do |collection|
219: options[collection].keys.each do |key|
220: options[collection][key] = coerce_variable(options[collection][key])
221: end
222: end
223: end