fuelcell 0.2.3 → 0.2.4

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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- M2VlMjQzMGQwOGNjYTA1MmY4YjhlMTkzNzc2YWExMzBlMGNhNjFkNw==
4
+ OGE4NmQxNjBhMzYzOTVlYjYxNzhiOWFlNWZkYjhiOGFkNzhkOTc3Yw==
5
5
  data.tar.gz: !binary |-
6
- NmNmMGQzNTE4NDU2NmI1M2MwNTMyMThmMTczYzg0NjY0NDRmOGIwMA==
6
+ MDc3YTgxMDVjNGRkMjFmNTEyOGZlOTZkMDA4ODE5ZWZhMGFmMTQwNA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MWQzNGRjNGI5NTRiNDExZTVhMmM1Mzc0NzM2MDJkNGI4ZWZjMjA0YTc5ZjY0
10
- YTdhYmZlMjZiZjVmMjJkOTMxYmY4NjZiNDJmMGYwMDhiZDY3YjY0OWE3ZDhl
11
- ZjlmNzk1MTliZTk4NTcxZmE4NzhiODA2YWQyZmU2OTg0NjEwYTI=
9
+ MmM3YmJkNzdmZGUzNDU3NjAxMmMxNmFjNGUwMDA0MGE5ZDc3N2VmYWJkOTUw
10
+ MWE5N2QzMmY3MzRmOWU3MzMxYjM1ZTgxNmUyMjA1NmQ1YzdjMjE4YzE1NTFk
11
+ N2Q3YTIyMzJjZTI3MWIxMTQ4MThkYTc5OTE2ZTA5NzA4MTU5Y2I=
12
12
  data.tar.gz: !binary |-
13
- OGQxNzc4NDRlNDY1NDRlMTM5NmVkOTBjMjI3OTAxNGQ0N2JiMjc4NTNhYzFm
14
- MmNlNGRjNmQzNDYzYTM5ZTAxZTQ0ZWVkNGY1YWM0ZWY1YjRhOTdlMWEwNDRk
15
- NjI4ZWMyZWU0YTkxY2JjNWRmMTRmMjBkOTI0MGY3NDYxZWI2Mjc=
13
+ ZTVmY2E1OWUxYmY0OWI0M2JmYTM4YjE5OGFiOWM0NWIyMmM5NmQxNjdhZDY2
14
+ YzRmZDRkMWQ3YTA4ZjNkZDVkZmZhYThkMGZiYjA4YTE2NWJjY2VmNGE1ZGUz
15
+ MTIwNzMzMWZhNDRjMzIwNTYxYzEzNWFlYWE4M2JmNjM5MmY2Zjg=
@@ -64,7 +64,10 @@ module Fuelcell
64
64
  # @param cmd [Fuelcell::Action::Command]
65
65
  # @return [Fuelcell::Action::Command]
66
66
  def add_global_options(cmd)
67
- global_options.each { |_key, opt_definition| cmd.opt opt_definition }
67
+ return cmd if self === cmd
68
+ global_options(cmd).each do |_key, opt_definition|
69
+ cmd.opt opt_definition
70
+ end
68
71
  cmd
69
72
  end
70
73
  end
@@ -50,11 +50,6 @@ module Fuelcell
50
50
  create_tree(self, cmd_args)
51
51
  end
52
52
 
53
- def add_global_options(cmd)
54
- return cmd if cmd.is_a?(self.class)
55
- super
56
- end
57
-
58
53
  private
59
54
 
60
55
  def script_name
@@ -33,8 +33,8 @@ module Fuelcell
33
33
  # command in the Hierarchy
34
34
  #
35
35
  # @return [Hash]
36
- def global_options
37
- collect_global_options(self, {})
36
+ def global_options(target)
37
+ collect_global_options(target, self, {})
38
38
  end
39
39
 
40
40
  protected
@@ -65,14 +65,16 @@ module Fuelcell
65
65
  child
66
66
  end
67
67
 
68
- def collect_global_options(cmd, list)
68
+ def collect_global_options(target, cmd, list)
69
+ return list if target === cmd
70
+
69
71
  globals = cmd.opts.globals
70
72
  list.merge!(globals)
71
73
 
72
74
  return list if cmd.empty?
73
75
 
74
76
  cmd.each do |_, subcommand|
75
- collect_global_options(subcommand, list)
77
+ collect_global_options(target, subcommand, list)
76
78
  end
77
79
  list
78
80
  end
@@ -1,3 +1,3 @@
1
1
  module Fuelcell
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fuelcell
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Scott-Buccleuch
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-02-25 00:00:00.000000000 Z
11
+ date: 2016-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler