intar 2.15 → 2.16.1
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/README +9 -7
- data/lib/intar/version.rb +1 -1
- data/lib/intar.rb +29 -11
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 65941b687800d76ae7bba2e690b56ba94f30ca1ccd78650db345a0fb8cc60891
|
4
|
+
data.tar.gz: 231b81799431f3a33b00139f57b3c83f42a261238d1c46342a349fafbfea3e68
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c2732ba6af248d47aeb7d29ee98de5ae78c4cec84ba20865c15740ac6b0d9b1b688d05a1f72d34c44874267d7ac0477980707a29840280721b425729d30b3c5
|
7
|
+
data.tar.gz: '0285277cabae513ff717d452f8017c7dfade0e80c3c7648633c066cbeca70b4d695bd73e1230f8f3aaaa83211bcb632a6cd64906c803a09b30a48c01097b2a5f'
|
data/README
CHANGED
@@ -23,15 +23,17 @@ after this in Irb and in Intar:
|
|
23
23
|
|
24
24
|
=== Subcommands
|
25
25
|
|
26
|
-
obj.method
|
27
|
-
obj.
|
28
|
-
obj.
|
26
|
+
obj.method do & enter a sub-Intar
|
27
|
+
obj.method { & enter a sub-Intar
|
28
|
+
obj.each { & enter multiple sub-Intars
|
29
|
+
obj.method { |x| & enter a sub-Intar with variable x
|
30
|
+
obj.method { |x,y| & enter a sub-Intar with multiple variables
|
29
31
|
|
30
|
-
\q
|
31
|
-
\q!
|
32
|
-
\q!!
|
32
|
+
\q exit from the innermost sub-Intar
|
33
|
+
\q! exit from the innermost sub-Intar loop
|
34
|
+
\q!! exit from all levels
|
33
35
|
|
34
|
-
\h
|
36
|
+
\h get a list of all subcommands
|
35
37
|
|
36
38
|
|
37
39
|
|
data/lib/intar/version.rb
CHANGED
data/lib/intar.rb
CHANGED
@@ -116,6 +116,7 @@ class Intar
|
|
116
116
|
handle_history do
|
117
117
|
set_current do
|
118
118
|
execute OLD_INIT
|
119
|
+
r = nil
|
119
120
|
loop do
|
120
121
|
l = readline
|
121
122
|
l or break
|
@@ -150,6 +151,7 @@ class Intar
|
|
150
151
|
(execute OLD_SET).call r, @n
|
151
152
|
@n += 1
|
152
153
|
end
|
154
|
+
r
|
153
155
|
ensure
|
154
156
|
execute OLD_INIT
|
155
157
|
end
|
@@ -168,19 +170,35 @@ class Intar
|
|
168
170
|
private
|
169
171
|
|
170
172
|
def eval_line l
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
173
|
+
if l =~ %r/\s*(?:\{|\bdo)\s*(?:\|([a-z0-9_,]*)\|)?\s*&\z/ then
|
174
|
+
cmd = $`
|
175
|
+
argl = $1
|
176
|
+
if argl.notempty? then
|
177
|
+
s = (argl.split ",").map { |a|
|
178
|
+
break unless a =~ /\A[a-z][a-z0-9_]*\z/
|
179
|
+
%Q((_i.set_var "#{a}", #{a}))
|
180
|
+
}
|
181
|
+
if s then
|
182
|
+
sets = s.join "; "
|
183
|
+
iobj = "self"
|
180
184
|
end
|
181
|
-
|
185
|
+
else
|
186
|
+
argl = iobj = "obj"
|
187
|
+
end
|
188
|
+
if iobj then
|
189
|
+
l = cmd + <<~EOT
|
190
|
+
\ do |#{argl}|
|
191
|
+
Intar.open #{iobj} do |_i|
|
192
|
+
#{sets}
|
193
|
+
_i.run
|
194
|
+
end
|
195
|
+
rescue Intar::Break
|
196
|
+
break
|
197
|
+
end
|
198
|
+
EOT
|
199
|
+
end
|
182
200
|
end
|
183
|
-
@redir.redirect_output do execute
|
201
|
+
@redir.redirect_output do execute l end
|
184
202
|
end
|
185
203
|
|
186
204
|
def handle_history
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: intar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.16.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bertram Scharpf
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-11-
|
11
|
+
date: 2023-11-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: appl
|
@@ -88,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
88
88
|
version: '0'
|
89
89
|
requirements:
|
90
90
|
- Ruby and some small Gems; Readline
|
91
|
-
rubygems_version: 3.4.
|
91
|
+
rubygems_version: 3.4.22
|
92
92
|
signing_key:
|
93
93
|
specification_version: 4
|
94
94
|
summary: Interactive Ruby
|