thunder 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ v0.4.1
2
+ - fixed fatal options processing bug
3
+
1
4
  v0.4.0
2
5
  + add help formatter
3
6
 
data/lib/thunder.rb CHANGED
@@ -23,15 +23,16 @@ module Thunder
23
23
  return get_help(args, options)
24
24
  end
25
25
 
26
- options.merge!(process_options(args, command_spec))
26
+ parsed_options = process_options(args, command_spec)
27
+ options.merge!(parsed_options) if parsed_options
27
28
  if command_spec[:subcommand]
28
29
  return command_spec[:subcommand].start(args, options)
29
- elsif options
30
+ elsif parsed_options
30
31
  #TODO: do arity check
31
- return send command_spec, *args, options
32
+ return send command_spec[:name], *args, options
32
33
  else
33
34
  #TODO: do arity check
34
- return send command_spec, *args
35
+ return send command_spec[:name], *args
35
36
  end
36
37
  end
37
38
 
@@ -5,7 +5,7 @@ module Thunder
5
5
  class OptParseAdapter
6
6
  # @see Thunder#process_options
7
7
  def self.process_options(args, command_spec)
8
- return nil unless command_spec[:options]
8
+ return {} unless command_spec[:options]
9
9
 
10
10
  options = {}
11
11
  command_spec[:options_processor] ||= OptionParser.new do |parser|
@@ -1,4 +1,4 @@
1
1
  module Thunder
2
2
  # Version string for gemspec
3
- VERSION = "0.4.0"
3
+ VERSION = "0.4.1"
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.4.0
4
+ version: 0.4.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: