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 +4 -4
- data/lib/shellopts.rb +18 -4
- data/lib/shellopts/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ac8ce6815e283630cb66195b0069a0d1772d8234dd580833e49b38cb0717fe8
|
4
|
+
data.tar.gz: e6fc6e96d47db9078edad643ce9ee4fabdeaf3450a5ab61fd330b701bfadf244
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f77988efda7870d95b7693125e0e4b9753dbbe637cfc126d92559654bd171f17f37698ac7588ce9d3fc0521ba00156b862e763f1ae95190d77d89cc5e500bf5a
|
7
|
+
data.tar.gz: 98d96929cd577649796e5f699e3c748f7ef3c72cb8ad3dd6036d2e656bae15229a414263a3701a4a027daacb869de2ceb52b1d3095fd1715c064d6befbaedbd0
|
data/lib/shellopts.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
|
data/lib/shellopts/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2020-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|