livetext 0.9.41 → 0.9.42

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: 8f65ba04aa3e01ed5a56dd2163dd7ff35e2e4292f41f971e61713789867e6def
4
- data.tar.gz: 127e52d056f1da7417881d24663789ef6b8fb606832fa28c7f9228bbbd77af02
3
+ metadata.gz: 3cef25ba4a47577159b300d63d723939aef6e5bef6c083685d8f6539e988601e
4
+ data.tar.gz: a20a3a5e09c47639180428833a62c855a0a13d26ec317b49a3e400b9f0b4a64c
5
5
  SHA512:
6
- metadata.gz: 6bd983272c4169d31eeb01ccf18fb04bf960a3cde7c6769a8533d5a6dbc55add87cda2788c73fa3d9b8b679efc8f40afd1ec0e74997cfd36926175c8dde569a2
7
- data.tar.gz: 57f5909d4b25efb53c8e7aaad64bcd1bc1f5387f1934a67193c2c10e37868135585cff57476fe3fec6e2cd9fcccc8ede3f734fcb891b27157841aee18d054d13
6
+ metadata.gz: b4ddc892156911f77e9bd4b3878e77ddfba0d739b03c5df0fbeefb1b22562c03f173ffdc36fceff940273557a27c12cec0a4aea3a35a5470efdfd5ec360f0261
7
+ data.tar.gz: f222133e7b2e784e15b43241e711e29bad362c10f41857e1e72883aac95d523580127a50a146a5b539e266eea98067e094b6dc3b1490e6b8a2d1b88c1a813b08
data/bin/livetext CHANGED
@@ -5,6 +5,25 @@ require 'rubygems'
5
5
  require_relative '../lib/livetext'
6
6
 
7
7
  def usage
8
+ STDERR.puts <<~EOF
9
+ Usage:
10
+ livetext [options] [filename]
11
+
12
+ Options:
13
+ -v, --version Print version information
14
+ -t, --test Run all tests
15
+ -p, --path Print the path of the installed gem
16
+ -b, --backtrace Enable backtrace information
17
+ -m name, --mixin name Load the specified mixin before processing
18
+ -s, --stdin Read from standard input
19
+ -h, --help Print this help information
20
+ -i name, --install name Install the specified plugin
21
+
22
+ EOF
23
+ exit
24
+ end
25
+
26
+ def old_usage
8
27
  STDERR.puts <<~EOF
9
28
  Usage:
10
29
  livetext filename
@@ -22,6 +41,10 @@ def usage
22
41
  livetext -p
23
42
  livetext --path
24
43
 
44
+ Load a mixin:
45
+ livetext -m name
46
+ livetext --mixin name
47
+
25
48
  Run tests:
26
49
  livetext -t
27
50
  livetext --test
data/lib/livetext/more.rb CHANGED
@@ -101,12 +101,10 @@ class Livetext
101
101
  obj = self.new
102
102
  mix = Array(mix)
103
103
  call = Array(call)
104
- # STDERR.puts "#{__method__}: obj meth = #{obj.methods.sort.inspect}"
105
104
  mix.each do |lib|
106
105
  obj.invoke_dotcmd(:mixin, lib.dup)
107
106
  end
108
107
  call.each {|cmd| obj.main.send(cmd[1..-1]) } # ignores leading dot, no param
109
- # vars.each_pair {|var, val| obj.setvar(var, val.to_s) }
110
108
  obj.api.setvars(vars)
111
109
  obj
112
110
  end
@@ -182,7 +182,12 @@ module Livetext::Standard
182
182
  def variables(args = nil, body = nil)
183
183
  prefix = api.args[0]
184
184
  file = api.args[1]
185
+ puts ">> variables: pre=#{prefix.inspect} file=#{file.inspect} pwd=#{Dir.pwd}"
185
186
  prefix = nil if prefix == "-" # FIXME dumb hack
187
+ here = File.dirname(file)
188
+ dok, fok = Dir.exist?(here), File.exist?(file)
189
+ raise "No such dir #{here.inspect} (file #{file})" unless dok
190
+ raise "No such file #{file.inspect} (file #{file})" unless fok
186
191
  if file
187
192
  here = ::Livetext::Vars[:FileDir] + "/"
188
193
  lines = File.readlines(here + file)
@@ -192,6 +197,9 @@ module Livetext::Standard
192
197
  pairs = Livetext::ParseGeneral.parse_vars(lines, prefix: nil)
193
198
  api.setvars(pairs)
194
199
  api.optional_blank_line
200
+ rescue => e
201
+ puts e
202
+ puts $!
195
203
  end
196
204
 
197
205
  def heredoc(args = nil, body = nil)
@@ -2,5 +2,5 @@
2
2
  # Defining VERSION
3
3
 
4
4
  class Livetext
5
- VERSION = "0.9.41"
5
+ VERSION = "0.9.42"
6
6
  end
@@ -1,7 +1,9 @@
1
1
  Testing heredocs (used in a table)
2
2
  <p>
3
3
 
4
- <br><center><table width=90% cellpadding=5>
4
+ <br>
5
+
6
+ <center><table width=90% cellpadding=5>
5
7
  <tr>
6
8
  <td valign=top>This is <br>only <br>a test.<br></td>
7
9
  <td valign=top>This is <br>just <br>some <br>random text.<br></td>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: livetext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.41
4
+ version: 0.9.42
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hal Fulton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-06 00:00:00.000000000 Z
11
+ date: 2024-02-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A smart text processor extensible in Ruby
14
14
  email: rubyhacker@gmail.com