thunder 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,12 +11,12 @@ module Thunder::OptParseAdapter
11
11
  command_spec[:options].each do |name, option_spec|
12
12
  opt = []
13
13
  opt << "-#{option_spec[:short]}"
14
- opt << if option_spec[:type] == Boolean
14
+ opt << if option_spec[:type] == Thunder::Boolean
15
15
  "--[no-]#{name}"
16
16
  else
17
17
  "--#{name} [#{name.to_s.upcase}]"
18
18
  end
19
- opt << option_spec[:type] unless option_spec[:type] == Boolean
19
+ opt << option_spec[:type] unless option_spec[:type] == Thunder::Boolean
20
20
  opt << option_spec[:desc]
21
21
  parser.on(*opt) do |value|
22
22
  options[name] = value
@@ -28,7 +28,7 @@ module Thunder::OptParseAdapter
28
28
  # set default values
29
29
  command_spec[:options].each do |name, option_spec|
30
30
  next if options.has_key? name
31
- next unless option_spec[:default]
31
+ next unless option_spec.has_key? :default
32
32
  options[name] = option_spec[:default]
33
33
  end
34
34
 
@@ -13,8 +13,7 @@ class Thunder::TrollopAdapter
13
13
  type = option_spec[:type]
14
14
  type = :flag if type == Thunder::Boolean
15
15
  opt_options[:type] = type
16
- default_value = option_spec[:default]
17
- opt_options[:default] = default_value if default_value
16
+ opt_options[:default] = option_spec[:default] if options_spec.has_key? :default
18
17
  opt_options[:short] = "-" + option_spec[:short]
19
18
 
20
19
  opt name, description, opt_options
@@ -1,4 +1,4 @@
1
1
  module Thunder
2
2
  # Version string for gemspec
3
- VERSION = "0.6.2"
3
+ VERSION = "0.6.3"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thunder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: