intar 2.14 → 2.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README +9 -7
- data/bin/intar +1 -0
- 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: 1e871a9a15a8e544e9e88d5cb06bf2b0ec3b38f75ae6a5396aabd02ed72d9d9e
|
4
|
+
data.tar.gz: e3955b86060800a5699d7098579ee1474181374012a94bee25109707c7aa126f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85fdba632254cdc85eb3cd6ba2789abc842e4301ac491bcede18e1a658d9d8c797e7def229477fd452156a224964959b8e004fd576a50ced30042c1fe5723846
|
7
|
+
data.tar.gz: b5a6dfd709c9567ef7f94d317ff7e0ac3babddc9b654e1e85435881299e31296a8b10b46de1e18f992da65fa65c02d91be1da1ee26261fdbbaa891f958ebe6c2
|
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/bin/intar
CHANGED
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: '2.
|
4
|
+
version: '2.16'
|
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-27 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
|