shellopts 2.0.0.pre.11 → 2.0.0.pre.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bf9123d8aaeb0abd253cbbb879763200762cbed326eff55afa1bddc5bc6825d8
4
- data.tar.gz: 78de60189d46a9d9c36d36ac79f754b9cedc820495b69e77171e8839033fda1a
3
+ metadata.gz: 8ac8ce6815e283630cb66195b0069a0d1772d8234dd580833e49b38cb0717fe8
4
+ data.tar.gz: e6fc6e96d47db9078edad643ce9ee4fabdeaf3450a5ab61fd330b701bfadf244
5
5
  SHA512:
6
- metadata.gz: 6012864adf0539064c11b700263692cec91a39d8519ec0d11030d586b7ab039f393c5595f07930f0a3e2b27a4418d18e6ee01c01deae0b7f056c9f7162106ae8
7
- data.tar.gz: a740ce82c8134cfba058df3c0d8abed3cada1abdef0f3b640f75a8af73efee800eb650d70ca41416af9730f55bf317cf3977683d80c69b28aea2578132def4be
6
+ metadata.gz: f77988efda7870d95b7693125e0e4b9753dbbe637cfc126d92559654bd171f17f37698ac7588ce9d3fc0521ba00156b862e763f1ae95190d77d89cc5e500bf5a
7
+ data.tar.gz: 98d96929cd577649796e5f699e3c748f7ef3c72cb8ad3dd6036d2e656bae15229a414263a3701a4a027daacb869de2ceb52b1d3095fd1715c064d6befbaedbd0
@@ -86,6 +86,10 @@ module ShellOpts
86
86
  @default_key_type = type
87
87
  end
88
88
 
89
+ # Result of the last as_* command
90
+ def self.opts() @opts end
91
+ def self.args() @args end
92
+
89
93
  # Base class for ShellOpts exceptions
90
94
  class Error < RuntimeError; end
91
95
 
@@ -144,7 +148,9 @@ module ShellOpts
144
148
  def self.as_program(spec, argv, name: ::ShellOpts.default_name, usage: ::ShellOpts.default_usage)
145
149
  Main.main.send(:include, ::ShellOpts) if caller.last =~ Main::CALLER_RE
146
150
  process(spec, argv, name: name, usage: usage)
147
- [shellopts.idr, shellopts.args]
151
+ @opts = shellopts.idr
152
+ @args = shellopts.args
153
+ [@opts, @args]
148
154
  end
149
155
 
150
156
  # Process command line, set current shellopts object, and return a [array,
@@ -153,7 +159,9 @@ module ShellOpts
153
159
  def self.as_array(spec, argv, name: ::ShellOpts.default_name, usage: ::ShellOpts.default_usage)
154
160
  Main.main.send(:include, ::ShellOpts) if caller.last =~ Main::CALLER_RE
155
161
  process(spec, argv, name: name, usage: usage)
156
- [shellopts.to_a, shellopts.args]
162
+ @opts = shellopts.to_a
163
+ @args = shellopts.args
164
+ [@opts, @args]
157
165
  end
158
166
 
159
167
  # Process command line, set current shellopts object, and return a [hash,
@@ -166,7 +174,9 @@ module ShellOpts
166
174
  aliases: {})
167
175
  Main.main.send(:include, ::ShellOpts) if caller.last =~ Main::CALLER_RE
168
176
  process(spec, argv, name: name, usage: usage)
169
- [shellopts.to_h(key_type: key_type, aliases: aliases), shellopts.args]
177
+ @opts = shellopts.to_h(key_type: key_type, aliases: aliases)
178
+ @args = shellopts.args
179
+ [@opts, @args]
170
180
  end
171
181
 
172
182
  # Process command line, set current shellopts object, and return a [struct,
@@ -178,7 +188,9 @@ module ShellOpts
178
188
  aliases: {})
179
189
  Main.main.send(:include, ::ShellOpts) if caller.last =~ Main::CALLER_RE
180
190
  process(spec, argv, name: name, usage: usage)
181
- [shellopts.to_struct(aliases: aliases), shellopts.args]
191
+ @opts = shellopts.to_struct(aliases: aliases)
192
+ @args = shellopts.args
193
+ [@opts, @args]
182
194
  end
183
195
 
184
196
  # Process command line, set current shellopts object, and then iterate
@@ -189,6 +201,8 @@ module ShellOpts
189
201
  def self.each(spec = nil, argv = nil, name: ::ShellOpts.default_name, usage: ::ShellOpts.default_usage, &block)
190
202
  Main.main.send(:include, ::ShellOpts) if caller.last =~ Main::CALLER_RE
191
203
  process(spec, argv, name: name, usage: usage)
204
+ @opts = shellopts.to_a
205
+ @args = shellopts.args
192
206
  shellopts.each(&block)
193
207
  end
194
208
 
@@ -1,3 +1,3 @@
1
1
  module Shellopts
2
- VERSION = "2.0.0.pre.11"
2
+ VERSION = "2.0.0.pre.13"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shellopts
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.pre.11
4
+ version: 2.0.0.pre.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claus Rasmussen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-11-08 00:00:00.000000000 Z
11
+ date: 2020-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler