shellopts 2.1.4 → 2.2.0
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 +4 -4
- data/lib/shellopts/args.rb +2 -0
- data/lib/shellopts/version.rb +1 -1
- data/lib/shellopts.rb +20 -20
- metadata +6 -6
- /data/lib/{ext → shellopts/ext}/array.rb +0 -0
- /data/lib/{ext → shellopts/ext}/follow.rb +0 -0
- /data/lib/{ext → shellopts/ext}/forward_to.rb +0 -0
- /data/lib/{ext → shellopts/ext}/lcs.rb +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fccea78ec2de7eab1323d529055ce1875ca9ac6b966a40dcadad83e4e68594f5
|
4
|
+
data.tar.gz: 6326b0754e0c24164bdd09f0bfbe36248aa2c7b493c1b4fa5db2c65046de7c3f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 400ac812870c7b51321cc360e547a43e0b3976c1e6d7b2358cbc2abd3fb0491837bb230bf386a899a08967d0ed5201c8e532bb49fb12ef7aa95050c9af8b8fd6
|
7
|
+
data.tar.gz: 115186fbd56935988bcdd1d7f37b00168e4432aa5fff889933b79b7ddbea0be5ab95f0a970c635e04c713aa4664e8333f67c43bc26ccc3e4916f419afb67d65c
|
data/lib/shellopts/args.rb
CHANGED
@@ -32,6 +32,7 @@ module ShellOpts
|
|
32
32
|
when Range
|
33
33
|
range = count_or_range
|
34
34
|
range.min <= self.size or inoa(message)
|
35
|
+
return self.to_a if range.end.nil?
|
35
36
|
n_extract = [self.size, range.max].min
|
36
37
|
n_extend = range.max > self.size ? range.max - self.size : 0
|
37
38
|
r = self.shift(n_extract) + Array.new(n_extend)
|
@@ -58,6 +59,7 @@ module ShellOpts
|
|
58
59
|
case count_or_range
|
59
60
|
when Range
|
60
61
|
count_or_range === self.size or inoa(message)
|
62
|
+
return self.to_a if count_or_range.end.nil?
|
61
63
|
when Integer
|
62
64
|
count_or_range >= 0 or inoa(message)
|
63
65
|
count_or_range.abs == self.size or inoa(message)
|
data/lib/shellopts/version.rb
CHANGED
data/lib/shellopts.rb
CHANGED
@@ -4,28 +4,28 @@ require 'indented_io'
|
|
4
4
|
require 'constrain'
|
5
5
|
include Constrain
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
require_relative 'shellopts/ext/array.rb'
|
8
|
+
require_relative 'shellopts/ext/follow.rb'
|
9
|
+
require_relative 'shellopts/ext/forward_to.rb' # Import into standard forward_to
|
10
|
+
require_relative 'shellopts/ext/lcs.rb'
|
11
11
|
include ForwardTo
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
13
|
+
require_relative 'shellopts/version.rb'
|
14
|
+
|
15
|
+
require_relative 'shellopts/stack.rb'
|
16
|
+
require_relative 'shellopts/token.rb'
|
17
|
+
require_relative 'shellopts/grammar.rb'
|
18
|
+
require_relative 'shellopts/program.rb'
|
19
|
+
require_relative 'shellopts/args.rb'
|
20
|
+
require_relative 'shellopts/lexer.rb'
|
21
|
+
require_relative 'shellopts/argument_type.rb'
|
22
|
+
require_relative 'shellopts/parser.rb'
|
23
|
+
require_relative 'shellopts/analyzer.rb'
|
24
|
+
require_relative 'shellopts/interpreter.rb'
|
25
|
+
require_relative 'shellopts/ansi.rb'
|
26
|
+
require_relative 'shellopts/renderer.rb'
|
27
|
+
require_relative 'shellopts/formatter.rb'
|
28
|
+
require_relative 'shellopts/dump.rb'
|
29
29
|
|
30
30
|
# TODO: Describe exception handling
|
31
31
|
#
|
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.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Claus Rasmussen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-01-
|
11
|
+
date: 2024-01-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: forward_to
|
@@ -133,16 +133,16 @@ files:
|
|
133
133
|
- doc/stylesheet.css
|
134
134
|
- doc/syntax.rb
|
135
135
|
- doc/syntax.txt
|
136
|
-
- lib/ext/array.rb
|
137
|
-
- lib/ext/follow.rb
|
138
|
-
- lib/ext/forward_to.rb
|
139
|
-
- lib/ext/lcs.rb
|
140
136
|
- lib/shellopts.rb
|
141
137
|
- lib/shellopts/analyzer.rb
|
142
138
|
- lib/shellopts/ansi.rb
|
143
139
|
- lib/shellopts/args.rb
|
144
140
|
- lib/shellopts/argument_type.rb
|
145
141
|
- lib/shellopts/dump.rb
|
142
|
+
- lib/shellopts/ext/array.rb
|
143
|
+
- lib/shellopts/ext/follow.rb
|
144
|
+
- lib/shellopts/ext/forward_to.rb
|
145
|
+
- lib/shellopts/ext/lcs.rb
|
146
146
|
- lib/shellopts/formatter.rb
|
147
147
|
- lib/shellopts/grammar.rb
|
148
148
|
- lib/shellopts/interpreter.rb
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|