intar 2.7 → 2.9
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/intar/version.rb +1 -1
- data/lib/intar.rb +30 -9
- 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: 84d165f1b9d58c19bbd9080263260ccb87c5f583bd05e9ad6045d7dab9a12c70
|
4
|
+
data.tar.gz: 5efa92e7ae496464fb5344cdc1c35d94eb5ab1b4812a4b650996738bc16f5659
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6081809067ded417b3231e89810a4a2ae84bfd0146d9e9298f7f5b93e768639a48a9403e817ee78b0f89516fe21565a3b019d422c2466df94ff013c9d0ae7f05
|
7
|
+
data.tar.gz: cfe779bd9c642e2703315f12b219f73b5101f3095797968aa03e5fd5fb9657765a1cacbcbb499bb4d1c3bcdaa3d99c58b46d05bd11677b147be66f300890099f
|
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,23 @@ 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
|
+
display r
|
125
|
+
rescue Clear
|
126
|
+
@previous = nil
|
127
|
+
next
|
123
128
|
rescue Bye
|
124
129
|
raise if @depth.nonzero?
|
125
130
|
break
|
@@ -127,10 +132,9 @@ class Intar
|
|
127
132
|
break
|
128
133
|
rescue Exception
|
129
134
|
break if SystemExit === $! and not @params[ :catch_exit]
|
135
|
+
r = $!
|
130
136
|
show_exception
|
131
|
-
$!
|
132
137
|
end
|
133
|
-
display r
|
134
138
|
oldset.call r, @n
|
135
139
|
@n += 1
|
136
140
|
end
|
@@ -145,6 +149,11 @@ class Intar
|
|
145
149
|
|
146
150
|
private
|
147
151
|
|
152
|
+
def eval_line l
|
153
|
+
ls = l.sub %r/\s*&\s*\z/, SUB
|
154
|
+
@redir.redirect_output do eval ls, @binding, @file end
|
155
|
+
end
|
156
|
+
|
148
157
|
def handle_history
|
149
158
|
unless @depth.nonzero? then
|
150
159
|
begin
|
@@ -370,7 +379,7 @@ class Intar
|
|
370
379
|
puts "Metacommand: #{names.join ' '}"
|
371
380
|
puts "Summary: #{mc.summary}"
|
372
381
|
puts "Description:"
|
373
|
-
|
382
|
+
mc.description.each_line { |l| print " " ; puts l }
|
374
383
|
else
|
375
384
|
l = cmds_list.map { |k,v| [v,k] }
|
376
385
|
puts "Metacommands:"
|
@@ -401,12 +410,24 @@ class Intar
|
|
401
410
|
|
402
411
|
metacmd %w(q x quit exit), "Quit Intar", <<~EOT
|
403
412
|
Leave Intar.
|
413
|
+
|
414
|
+
plain quit current Intar level
|
415
|
+
! quit current loop
|
416
|
+
!! quit all levels
|
404
417
|
EOT
|
405
418
|
def cmd_quit x
|
406
419
|
lx = $&.length.nonzero? if x =~ /!*/
|
407
420
|
raise lx ? (lx > 1 ? Bye : Break) : Quit
|
408
421
|
end
|
409
422
|
|
423
|
+
metacmd %w(c clear), "Clear command line", <<~EOT
|
424
|
+
Use this if a statement cannot be successfully ended,
|
425
|
+
i. e. when there is no other way to leave the dot prompt.
|
426
|
+
EOT
|
427
|
+
def cmd_clear x
|
428
|
+
raise Clear
|
429
|
+
end
|
430
|
+
|
410
431
|
metacmd %w(cd), "Change directory", <<~EOT
|
411
432
|
Switch to a different working directory.
|
412
433
|
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.9'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bertram Scharpf
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-07-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: appl
|
@@ -74,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
74
74
|
version: '0'
|
75
75
|
requirements:
|
76
76
|
- Ruby and some small Gems; Readline
|
77
|
-
rubygems_version: 3.
|
77
|
+
rubygems_version: 3.4.17
|
78
78
|
signing_key:
|
79
79
|
specification_version: 4
|
80
80
|
summary: Interactive Ruby
|