shellopts 2.0.0.pre.9 → 2.0.0.pre.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/shellopts/args.rb +2 -1
- 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: bf9123d8aaeb0abd253cbbb879763200762cbed326eff55afa1bddc5bc6825d8
|
4
|
+
data.tar.gz: 78de60189d46a9d9c36d36ac79f754b9cedc820495b69e77171e8839033fda1a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6012864adf0539064c11b700263692cec91a39d8519ec0d11030d586b7ab039f393c5595f07930f0a3e2b27a4418d18e6ee01c01deae0b7f056c9f7162106ae8
|
7
|
+
data.tar.gz: a740ce82c8134cfba058df3c0d8abed3cada1abdef0f3b640f75a8af73efee800eb650d70ca41416af9730f55bf317cf3977683d80c69b28aea2578132def4be
|
data/lib/shellopts/args.rb
CHANGED
@@ -26,12 +26,13 @@ module ShellOpts
|
|
26
26
|
n_extract = [self.size, range.max].min
|
27
27
|
n_extend = range.max > self.size ? range.max - self.size : 0
|
28
28
|
r = self.shift(n_extract) + Array.new(n_extend)
|
29
|
+
range.max <= 1 ? r.first : r
|
29
30
|
else
|
30
31
|
count = count_or_range
|
31
32
|
self.size >= count.abs or inoa(message)
|
32
33
|
start = count >= 0 ? 0 : size + count
|
33
34
|
r = slice!(start, count.abs)
|
34
|
-
r.size
|
35
|
+
r.size <= 0 ? nil : (r.size == 1 ? r.first : r)
|
35
36
|
end
|
36
37
|
end
|
37
38
|
|
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.11
|
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
|
+
date: 2020-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|