intar 2.9 → 2.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 84d165f1b9d58c19bbd9080263260ccb87c5f583bd05e9ad6045d7dab9a12c70
4
- data.tar.gz: 5efa92e7ae496464fb5344cdc1c35d94eb5ab1b4812a4b650996738bc16f5659
3
+ metadata.gz: 825ae0affe4775e50c0a96c280ce307836c6f2e4211c22643c095445f83dd9d8
4
+ data.tar.gz: d642a1ecb7f8ef0e6a1325a1d016b9efcb00288e2261ecdae4fcac0687c38ca4
5
5
  SHA512:
6
- metadata.gz: 6081809067ded417b3231e89810a4a2ae84bfd0146d9e9298f7f5b93e768639a48a9403e817ee78b0f89516fe21565a3b019d422c2466df94ff013c9d0ae7f05
7
- data.tar.gz: cfe779bd9c642e2703315f12b219f73b5101f3095797968aa03e5fd5fb9657765a1cacbcbb499bb4d1c3bcdaa3d99c58b46d05bd11677b147be66f300890099f
6
+ metadata.gz: 64c88fd2f44d9474744173a8c937611e1e1838ce82617e7d580431afd584abbb8d10ebb00c5805299822d27322b5d9f730368fa9f2c38d179439be8d287ac0fe
7
+ data.tar.gz: 5f77bc957be61437bf172bf33ad21a0581246e0aafe6467d98673c5605e5700047e000028618dce57a36db4d2ea37155a3831a76b2fec4f62f3ed472b24c8f37
data/README CHANGED
@@ -12,7 +12,8 @@ inside an application and so on.
12
12
 
13
13
  Today, Intar is a tool far less complex than Irb.
14
14
 
15
- Yet, Intar is more robust. Try this in Irb and in Intar:
15
+ Yet, Intar is more robust. Have a look at what happens
16
+ after this in Irb and in Intar:
16
17
 
17
18
  prompt> Thread.new { sleep 3 ; Thread.main.raise "stop" }
18
19
 
@@ -24,6 +25,7 @@ Yet, Intar is more robust. Try this in Irb and in Intar:
24
25
 
25
26
  obj.method & enter a sub-Intar
26
27
  obj.each & enter multiple sub-Intars
28
+ obj.method &x enter a sub-Intar with variable x
27
29
 
28
30
  \q exit from the innermost sub-Intar
29
31
  \q! exit from the innermost sub-Intar loop
data/bin/intar CHANGED
@@ -125,7 +125,7 @@ class Intar::Appl < Application
125
125
  cf = nil_if_none @configfile
126
126
  return unless cf
127
127
  c = File.expand_path cf, "~"
128
- return unless File.exists? c
128
+ return unless File.exist? c
129
129
  load c
130
130
  rescue Exception
131
131
  $@.pop 2
@@ -32,7 +32,7 @@ class Intar
32
32
  class RedirectPipe < Redirect
33
33
  class <<self
34
34
  def detect line, pager
35
- if line.slice! /\s+\|(\b[^|&;{}()\[\]]*)?\z/ then
35
+ if line.slice! /\s+\|((?:\b|\/)[^|&;{}()\[\]]*)?\z/ then
36
36
  new $1||pager
37
37
  end
38
38
  end
data/lib/intar/version.rb CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  class Intar
6
6
 
7
- VERSION = "2.9".freeze
7
+ VERSION = "2.11".freeze
8
8
 
9
9
  end
10
10
 
data/lib/intar.rb CHANGED
@@ -146,11 +146,26 @@ class Intar
146
146
  eval code, @binding, "#{self.class}/execute"
147
147
  end
148
148
 
149
+ def set_var name, val
150
+ @binding.local_variable_set name, val
151
+ end
152
+
149
153
 
150
154
  private
151
155
 
152
156
  def eval_line l
153
- ls = l.sub %r/\s*&\s*\z/, SUB
157
+ ls = l.sub %r/\s+&(\w+)?\s*\z/ do
158
+ <<~EOT
159
+ \ do |obj|
160
+ Intar.open #{"obj " unless $1}do |i|
161
+ #{"# " unless $1}i.set_var "#$1", obj
162
+ i.run
163
+ end
164
+ rescue Intar::Break
165
+ break
166
+ end
167
+ EOT
168
+ end
154
169
  @redir.redirect_output do eval ls, @binding, @file end
155
170
  end
156
171
 
@@ -181,14 +196,6 @@ class Intar
181
196
  end
182
197
 
183
198
 
184
- SUB = <<~EOT
185
- \ do |obj|
186
- Intar.run obj
187
- rescue Intar::Break
188
- break
189
- end
190
- EOT
191
-
192
199
  OLDSET = <<~EOT
193
200
  _, __, ___ = nil, nil, nil
194
201
  proc { |r,n|
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.9'
4
+ version: '2.11'
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-07-18 00:00:00.000000000 Z
11
+ date: 2023-09-09 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.4.17
77
+ rubygems_version: 3.4.19
78
78
  signing_key:
79
79
  specification_version: 4
80
80
  summary: Interactive Ruby