intar 2.7 → 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 +27 -7
- 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,19 +108,21 @@ 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
|
-
l.sub! %r/\s*&\s*\z/, SUB
|
115
116
|
begin
|
116
|
-
|
117
|
+
r = eval_line l
|
117
118
|
rescue SyntaxError
|
118
119
|
raise if l.end_with? $/
|
119
120
|
@previous = l
|
120
|
-
next
|
121
121
|
end
|
122
122
|
end
|
123
|
+
next if @previous
|
124
|
+
rescue Clear
|
125
|
+
@previous = nil
|
123
126
|
rescue Bye
|
124
127
|
raise if @depth.nonzero?
|
125
128
|
break
|
@@ -145,6 +148,11 @@ class Intar
|
|
145
148
|
|
146
149
|
private
|
147
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
|
+
|
148
156
|
def handle_history
|
149
157
|
unless @depth.nonzero? then
|
150
158
|
begin
|
@@ -370,7 +378,7 @@ class Intar
|
|
370
378
|
puts "Metacommand: #{names.join ' '}"
|
371
379
|
puts "Summary: #{mc.summary}"
|
372
380
|
puts "Description:"
|
373
|
-
|
381
|
+
mc.description.each_line { |l| print " " ; puts l }
|
374
382
|
else
|
375
383
|
l = cmds_list.map { |k,v| [v,k] }
|
376
384
|
puts "Metacommands:"
|
@@ -401,12 +409,24 @@ class Intar
|
|
401
409
|
|
402
410
|
metacmd %w(q x quit exit), "Quit Intar", <<~EOT
|
403
411
|
Leave Intar.
|
412
|
+
|
413
|
+
plain quit current Intar level
|
414
|
+
! quit current loop
|
415
|
+
!! quit all levels
|
404
416
|
EOT
|
405
417
|
def cmd_quit x
|
406
418
|
lx = $&.length.nonzero? if x =~ /!*/
|
407
419
|
raise lx ? (lx > 1 ? Bye : Break) : Quit
|
408
420
|
end
|
409
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
|
+
|
410
430
|
metacmd %w(cd), "Change directory", <<~EOT
|
411
431
|
Switch to a different working directory.
|
412
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
|