livetext 0.9.43 → 0.9.44

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2eecc4b7aec5571c91f72cdba9b7d2e3ab43c7caf3f079ba336ccc112d4a4939
4
- data.tar.gz: d3556ab21ab322f054c0aae264a8e2c833f61f1baa69bb5a965d4b418bf08c58
3
+ metadata.gz: 77c132b3f86809adfbbed149564227c061911a51bc57124fdd17ed9fb67bae55
4
+ data.tar.gz: dc92358a343e8096f7e982005585fa9633d8860f6fe569e0db61bc40a764bd73
5
5
  SHA512:
6
- metadata.gz: 665b6c06e3f9469a7f98c1e4b6b9a7a4fad55d7a554811d4c92a63757a7ec2d44f33f4468ea2d709896d4bcc4cadb8a1a7f95fdacb2533982a552c133116bbd3
7
- data.tar.gz: 7f391f554863d8411fd3523a09029419914dd8d8df66df1ac5bc2e0186060b543977c46c9e4bbe59343cb8dfa78263c81ff876f8732811b1ed2caa33fb41f05a
6
+ metadata.gz: e8ec2c7c373c5587c1a492c0cd183bb6143c16a59ed49084fcc11294ed48e05c3e076ad48f03de56a5b60f2bad828629f54c086e51b8785e4eb6b39b6366bb7f
7
+ data.tar.gz: e129c8269d51269f635b4a4995abe568cdbd0b1aa61060986ffa34528157d79ae4a455a88d309010085928d8897204fadff094f79a94bb0d89aa9a83edd4903d
@@ -15,4 +15,4 @@ end
15
15
 
16
16
  make_exception(:EndWithoutOpening, "Error: found .end with no opening command")
17
17
  make_exception(:UnknownMethod, "Error: name '%1' is unknown")
18
-
18
+ make_exception(:NoSuchFile, "Error: can't find file '%1' (method '%2')")
@@ -234,9 +234,14 @@ get_globals - 2
234
234
  pairs = Livetext::ParseGeneral.parse_vars(lines, prefix: nil)
235
235
  api.setvars(pairs)
236
236
  api.optional_blank_line
237
- rescue => e
238
- puts e
239
- puts $!
237
+ rescue => err
238
+ puts "Error in #{__method__} in #{__FILE__}
239
+ puts " #{err.inspect}"
240
+ if err.respond_to?(:backtrace)
241
+ context = err.backtrace.map {|x| " " + x}.join("\n")
242
+ puts context
243
+ end
244
+ abort "\nTerminated."
240
245
  end
241
246
 
242
247
  def heredoc(args = nil, body = nil)
@@ -2,5 +2,5 @@
2
2
  # Defining VERSION
3
3
 
4
4
  class Livetext
5
- VERSION = "0.9.43"
5
+ VERSION = "0.9.44"
6
6
  end
data/plugin/booktool.rb CHANGED
@@ -4,21 +4,22 @@ def mobi(args = nil, body = nil)
4
4
  out = api.format(api.args[0])
5
5
  src = api.args[1]
6
6
  @cover = api.args[2]
7
+ @name = api.args[3]
7
8
  if ::File.directory?(src)
8
9
  files = ::Dir["#{src}/*"].grep /\.html$/
9
10
  files = files.sort # why is this necessary now?
10
- cmd = "cat #{files.join(' ')} >TEMP.html"
11
+ cmd = "cat #{files.join(' ')} >#@name.html"
11
12
  system(cmd)
12
13
  else
13
14
  raise "Not supported yet"
14
15
  end
15
16
 
16
17
  cmd = "ebook-convert "
17
- cmd << "TEMP.html #{out}.mobi "
18
+ cmd << "#@name.html #{out}.mobi "
18
19
  cmd << "--cover #@cover " if @cover
19
20
  system(cmd)
20
21
 
21
- system("links -dump TEMP.html >/tmp/links.out")
22
+ system("links -dump #@name.html >/tmp/links.out")
22
23
  str = `wc -w /tmp/links.out`
23
24
  nw = str.split[0]
24
25
  end
@@ -27,21 +28,22 @@ def epub(args = nil, body = nil)
27
28
  out = api.format(api.args[0])
28
29
  src = api.args[1]
29
30
  @cover = api.args[2]
31
+ @name = api.args[3]
30
32
  if ::File.directory?(src)
31
33
  files = ::Dir["#{src}/*"].grep /\.html$/
32
34
  files = files.sort # why is this necessary now?
33
- cmd = "cat #{files.join(' ')} >TEMP.html"
35
+ cmd = "cat #{files.join(' ')} >#@name.html"
34
36
  system(cmd)
35
37
  else
36
38
  raise "Not supported yet"
37
39
  end
38
40
 
39
41
  cmd = "ebook-convert "
40
- cmd << "TEMP.html #{out}.epub "
42
+ cmd << "#@name.html #{out}.epub "
41
43
  cmd << "--cover #@cover " if @cover
42
44
  system(cmd)
43
45
 
44
- system("links -dump TEMP.html >/tmp/links.out")
46
+ system("links -dump #@name.html >/tmp/links.out")
45
47
  str = `wc -w /tmp/links.out`
46
48
  nw = str.split[0]
47
49
  puts "Approx words: #{nw}"
@@ -1,5 +1,7 @@
1
1
  require 'minitest/autorun'
2
2
 
3
+ MiniTest = Minitest unless defined?(MiniTest)
4
+
3
5
  require 'livetext'
4
6
 
5
7
  # Just another testing class. Chill.
data/test/extra/double.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  require 'minitest/autorun'
2
2
 
3
+ MiniTest = Minitest unless defined?(MiniTest)
4
+
3
5
  require 'livetext'
4
6
 
5
7
  # Just another testing class. Chill.
@@ -1,5 +1,7 @@
1
1
  require 'minitest/autorun'
2
2
 
3
+ MiniTest = Minitest unless defined?(MiniTest)
4
+
3
5
  require 'livetext'
4
6
 
5
7
  # Just another testing class. Chill.
data/test/extra/single.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  require 'minitest/autorun'
2
2
 
3
+ MiniTest = Minitest unless defined?(MiniTest)
4
+
3
5
  require 'livetext'
4
6
 
5
7
  # Just another testing class. Chill.
@@ -41,6 +41,8 @@ end
41
41
  output.puts <<~RUBY
42
42
  require 'minitest/autorun'
43
43
 
44
+ MiniTest = Minitest unless defined?(MiniTest)
45
+
44
46
  require 'livetext'
45
47
 
46
48
  # Just another testing class. Chill.
@@ -1,5 +1,7 @@
1
1
  require 'minitest/autorun'
2
2
 
3
+ MiniTest = Minitest unless defined?(MiniTest)
4
+
3
5
  require 'livetext'
4
6
 
5
7
  # Just another testing class. Chill.
data/test/snapshots.rb CHANGED
@@ -9,6 +9,8 @@ end
9
9
 
10
10
  require 'minitest/autorun'
11
11
 
12
+ MiniTest = Minitest unless defined?(MiniTest)
13
+
12
14
  require_relative '../lib/livetext'
13
15
 
14
16
  =begin
data/test/unit/html.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  require 'minitest/autorun'
2
2
 
3
+ MiniTest = Minitest unless defined?(MiniTest)
4
+
3
5
  require 'livetext'
4
6
 
5
7
  class TestingLivetext < MiniTest::Test
@@ -1,6 +1,8 @@
1
1
 
2
2
  require 'minitest/autorun'
3
3
 
4
+ MiniTest = Minitest unless defined?(MiniTest)
5
+
4
6
  require_relative '../parser' # nested
5
7
 
6
8
  ParseGeneral = ::Livetext::ParseGeneral
@@ -1,6 +1,8 @@
1
1
 
2
2
  require 'minitest/autorun'
3
3
 
4
+ MiniTest = Minitest unless defined?(MiniTest)
5
+
4
6
  require_relative '../parser' # nested
5
7
 
6
8
  class TestParseSet < MiniTest::Test
@@ -1,6 +1,8 @@
1
1
 
2
2
  require 'minitest/autorun'
3
3
 
4
+ MiniTest = Minitest unless defined?(MiniTest)
5
+
4
6
  require_relative '../parser' # nested
5
7
 
6
8
  ParseSet = ::Livetext::ParseSet
@@ -1,5 +1,7 @@
1
1
  require 'minitest/autorun'
2
2
 
3
+ MiniTest = Minitest unless defined?(MiniTest)
4
+
3
5
  require_relative '../parser' # nested
4
6
 
5
7
  class TestStringParser < MiniTest::Test
@@ -1,5 +1,7 @@
1
1
  require 'minitest/autorun'
2
2
 
3
+ MiniTest = Minitest
4
+
3
5
  require_relative '../../lib/livetext'
4
6
 
5
7
  class TestingLivetext < MiniTest::Test
@@ -1,5 +1,7 @@
1
1
  require 'minitest/autorun'
2
2
 
3
+ MiniTest = Minitest unless defined?(MiniTest)
4
+
3
5
  require_relative '../../lib/stringparser'
4
6
 
5
7
  class TestStringParser < MiniTest::Test
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.43
4
+ version: 0.9.44
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-05-14 00:00:00.000000000 Z
11
+ date: 2024-05-19 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A smart text processor extensible in Ruby
14
14
  email: rubyhacker@gmail.com