intar 2.6 → 2.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/intar/version.rb +1 -1
- data/lib/intar.rb +32 -10
- 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: 353105e4252052ef911b05ead40920c09770699711c077f6a0f5ea7cb3c2347e
|
4
|
+
data.tar.gz: 3e4c7bbacccbc4fac8b3502ce32e86975cd613c7683de3e119aee3b89dcbeeb9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1efee80e12e3507ac442bf34cd8ced94e55513d4ae801ed6465e5f0cf32ba4e4a46de4aa76695672da9416fe5ab1c232874582f4107a07b8c7f88f1efd0868a
|
7
|
+
data.tar.gz: be88c5df6eb80b18fbebfc0946e53eaed1f9f20172b5404d1ebc8be3fc3e59418266415b314875faddfd41f831b669044f0b223ee2e4d64953566334e6d6e4b0
|
data/lib/intar/version.rb
CHANGED
data/lib/intar.rb
CHANGED
@@ -94,6 +94,7 @@ class Intar
|
|
94
94
|
end
|
95
95
|
|
96
96
|
|
97
|
+
class Clear < Exception ; end
|
97
98
|
class Quit < Exception ; end
|
98
99
|
class Bye < Quit ; end
|
99
100
|
class Break < Bye ; end
|
@@ -107,22 +108,26 @@ class Intar
|
|
107
108
|
l = readline
|
108
109
|
l or break
|
109
110
|
@redir = find_redirect l
|
110
|
-
|
111
|
-
if l
|
112
|
-
send (get_metacommand $1).method, (eval_param $2)
|
111
|
+
begin
|
112
|
+
if l.slice! /^\\(\w+|.)\s*(.*?)\s*$\n?/ then
|
113
|
+
r = send (get_metacommand $1).method, (eval_param $2)
|
114
|
+
l.empty? or @previous = l
|
113
115
|
else
|
114
|
-
|
115
|
-
|
116
|
+
begin
|
117
|
+
r = eval_line l
|
118
|
+
rescue SyntaxError
|
119
|
+
raise if l.end_with? $/
|
120
|
+
@previous = l
|
121
|
+
end
|
116
122
|
end
|
123
|
+
next if @previous
|
124
|
+
rescue Clear
|
125
|
+
@previous = nil
|
117
126
|
rescue Bye
|
118
127
|
raise if @depth.nonzero?
|
119
128
|
break
|
120
129
|
rescue Quit
|
121
130
|
break
|
122
|
-
rescue SyntaxError
|
123
|
-
raise if l.end_with? $/
|
124
|
-
@previous = l
|
125
|
-
next
|
126
131
|
rescue Exception
|
127
132
|
break if SystemExit === $! and not @params[ :catch_exit]
|
128
133
|
show_exception
|
@@ -143,6 +148,11 @@ class Intar
|
|
143
148
|
|
144
149
|
private
|
145
150
|
|
151
|
+
def eval_line l
|
152
|
+
ls = l.sub %r/\s*&\s*\z/, SUB
|
153
|
+
@redir.redirect_output do eval ls, @binding, @file end
|
154
|
+
end
|
155
|
+
|
146
156
|
def handle_history
|
147
157
|
unless @depth.nonzero? then
|
148
158
|
begin
|
@@ -368,7 +378,7 @@ class Intar
|
|
368
378
|
puts "Metacommand: #{names.join ' '}"
|
369
379
|
puts "Summary: #{mc.summary}"
|
370
380
|
puts "Description:"
|
371
|
-
|
381
|
+
mc.description.each_line { |l| print " " ; puts l }
|
372
382
|
else
|
373
383
|
l = cmds_list.map { |k,v| [v,k] }
|
374
384
|
puts "Metacommands:"
|
@@ -399,12 +409,24 @@ class Intar
|
|
399
409
|
|
400
410
|
metacmd %w(q x quit exit), "Quit Intar", <<~EOT
|
401
411
|
Leave Intar.
|
412
|
+
|
413
|
+
plain quit current Intar level
|
414
|
+
! quit current loop
|
415
|
+
!! quit all levels
|
402
416
|
EOT
|
403
417
|
def cmd_quit x
|
404
418
|
lx = $&.length.nonzero? if x =~ /!*/
|
405
419
|
raise lx ? (lx > 1 ? Bye : Break) : Quit
|
406
420
|
end
|
407
421
|
|
422
|
+
metacmd %w(c clear), "Clear command line", <<~EOT
|
423
|
+
Use this if a statement cannot be successfully ended,
|
424
|
+
i. e. when there is no other way to leave the dot prompt.
|
425
|
+
EOT
|
426
|
+
def cmd_clear x
|
427
|
+
raise Clear
|
428
|
+
end
|
429
|
+
|
408
430
|
metacmd %w(cd), "Change directory", <<~EOT
|
409
431
|
Switch to a different working directory.
|
410
432
|
Former directories will be pushed to a stack.
|
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.8'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bertram Scharpf
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-12-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: appl
|