livetext 0.9.19 → 0.9.23

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. data/README.lt3 +4 -2
  3. data/README.md +330 -339
  4. data/bin/livetext +0 -2
  5. data/imports/bookish.rb +8 -10
  6. data/imports/markdown.rb +6 -6
  7. data/imports/pyggish.rb +2 -34
  8. data/imports/tutorial.rb +4 -4
  9. data/lib/cmdargs.rb +30 -20
  10. data/lib/errors.rb +2 -0
  11. data/lib/formatline.rb +54 -124
  12. data/lib/funcall.rb +93 -0
  13. data/lib/functions.rb +17 -2
  14. data/lib/global_helpers.rb +39 -0
  15. data/lib/handler/import.rb +44 -0
  16. data/lib/handler.rb +3 -1
  17. data/lib/helpers.rb +46 -12
  18. data/lib/html.rb +2 -0
  19. data/lib/livetext.rb +34 -6
  20. data/lib/parser/file.rb +0 -2
  21. data/lib/parser/general.rb +1 -4
  22. data/lib/parser/mixin.rb +4 -8
  23. data/lib/parser/set.rb +3 -8
  24. data/lib/parser/string.rb +11 -10
  25. data/lib/parser.rb +2 -0
  26. data/lib/parsing.rb +31 -0
  27. data/lib/processor.rb +66 -60
  28. data/lib/standard.rb +28 -17
  29. data/lib/userapi.rb +8 -4
  30. data/plugin/bookish.rb +4 -5
  31. data/plugin/markdown.rb +6 -6
  32. data/plugin/pyggish.rb +46 -77
  33. data/plugin/tutorial.rb +3 -3
  34. data/test/snapshots/error_inc_line_num/OUT +17 -0
  35. data/test/snapshots/{icanhaz2/expected-error.txt → error_inc_line_num/actual-error.txt} +0 -0
  36. data/test/snapshots/error_inc_line_num/actual-output.txt +17 -0
  37. data/test/snapshots/error_invalid_name/actual-error.txt +10 -0
  38. data/test/snapshots/error_invalid_name/actual-output.txt +0 -0
  39. data/test/snapshots/error_invalid_name/out-sdiff.txt +6 -0
  40. data/test/snapshots/error_missing_end/actual-error.txt +10 -0
  41. data/test/snapshots/error_missing_end/actual-output.txt +0 -0
  42. data/test/snapshots/error_missing_end/out-sdiff.txt +6 -0
  43. data/test/snapshots/error_no_such_copy/actual-error.txt +10 -0
  44. data/test/snapshots/error_no_such_copy/actual-output.txt +0 -0
  45. data/test/snapshots/error_no_such_copy/match-error.txt +1 -1
  46. data/test/snapshots/error_no_such_copy/out-sdiff.txt +5 -0
  47. data/test/snapshots/error_no_such_inc/actual-error.txt +10 -0
  48. data/test/snapshots/error_no_such_inc/actual-output.txt +0 -0
  49. data/test/snapshots/error_no_such_inc/match-error.txt +1 -1
  50. data/test/snapshots/error_no_such_inc/out-sdiff.txt +6 -0
  51. data/test/snapshots/error_no_such_mixin/actual-error.txt +13 -0
  52. data/test/snapshots/error_no_such_mixin/actual-output.txt +0 -0
  53. data/test/snapshots/error_no_such_mixin/out-sdiff.txt +6 -0
  54. data/test/snapshots/{icanhaz → import}/expected-output.txt +0 -0
  55. data/test/snapshots/{icanhaz → import}/match-error.txt +0 -0
  56. data/test/snapshots/{icanhaz → import}/simple_import.rb +0 -0
  57. data/test/snapshots/{icanhaz → import}/source.lt3 +2 -2
  58. data/test/snapshots/import2/expected-error.txt +0 -0
  59. data/test/snapshots/{icanhaz2 → import2}/expected-output.txt +3 -1
  60. data/test/snapshots/{icanhaz2/simple_canhaz.rb → import2/simple_import.rb} +0 -0
  61. data/test/snapshots/import2/source.lt3 +8 -0
  62. data/test/snapshots/import_bookish/expected-error.txt +0 -0
  63. data/test/snapshots/import_bookish/expected-output.txt +10 -0
  64. data/test/snapshots/import_bookish/source.lt3 +7 -0
  65. data/test/snapshots/import_bookish/toc.tmp +0 -0
  66. data/test/snapshots/mixin_bookish/expected-error.txt +0 -0
  67. data/test/snapshots/mixin_bookish/expected-output.txt +10 -0
  68. data/test/snapshots/mixin_bookish/source.lt3 +7 -0
  69. data/test/snapshots/mixin_bookish/toc.tmp +0 -0
  70. data/test/snapshots/more_functions/expected-error.txt +0 -0
  71. data/test/snapshots/more_functions/expected-output.txt +37 -0
  72. data/test/snapshots/more_functions/source.lt3 +40 -0
  73. data/test/snapshots/simple_import/expected-output.txt +2 -0
  74. data/test/snapshots/simple_import/source.lt3 +3 -1
  75. data/test/snapshots/subset.txt +84 -0
  76. data/test/snapshots.rb +39 -43
  77. data/test/unit/formatline.rb +253 -134
  78. data/test/unit/html.rb +1 -1
  79. data/test/unit/parser/general.rb +1 -2
  80. data/test/unit/parser/mixin.rb +1 -3
  81. data/test/unit/parser/set.rb +22 -24
  82. data/test/unit/parser/string.rb +46 -7
  83. data/test/unit/parser.rb +0 -1
  84. data/test/unit/standard.rb +0 -1
  85. metadata +43 -24
  86. data/imports/markdown_importable.rb +0 -46
  87. data/lib/handler/icanhaz.rb +0 -35
  88. data/lib/livetext/importable.rb +0 -2
  89. data/lib/parser/import.rb +0 -15
  90. data/test/affirm/kbks.jpg +0 -0
  91. data/test/affirm/lm-kbks.lt +0 -19
  92. data/test/cleanup +0 -1
  93. data/test/newtest +0 -14
  94. data/test/sdtest +0 -6
  95. data/test/snapshots/OMIT.txt +0 -11
  96. data/test/snapshots/clusion.txt +0 -84
  97. data/test/snapshots/crap +0 -16
  98. data/test/snapshots/fixit +0 -6
  99. data/test/snapshots/icanhaz2/source.lt3 +0 -6
  100. data/test/unit/parser/importable.rb +0 -19
data/lib/standard.rb CHANGED
@@ -1,7 +1,10 @@
1
+ # p __FILE__
2
+
1
3
  require 'pathname' # For _seek - remove later??
2
4
 
3
5
  require_relative 'parser' # nested requires
4
6
  require_relative 'html'
7
+ require_relative 'global_helpers'
5
8
  require_relative 'helpers'
6
9
 
7
10
  make_exception(:ExpectedOnOff, "Error: expected 'on' or 'off'")
@@ -14,7 +17,7 @@ make_exception(:FileNotFound, "Error: file '%1' not found")
14
17
  module Livetext::Standard
15
18
 
16
19
  include HTMLHelper
17
- include Helpers
20
+ include Livetext::Helpers
18
21
 
19
22
  SimpleFormats = # Move this?
20
23
  { b: %w[<b> </b>],
@@ -101,7 +104,7 @@ module Livetext::Standard
101
104
  end
102
105
 
103
106
  def errout(args = nil, body = nil)
104
- STDERR.puts @_data.chomp
107
+ ::STDERR.puts @_data.chomp
105
108
  _optional_blank_line
106
109
  end
107
110
 
@@ -187,7 +190,7 @@ module Livetext::Standard
187
190
  text = _body.join("\n")
188
191
  rhs = ""
189
192
  text.each_line do |line|
190
- str = FormatLine.var_func_parse(line.chomp)
193
+ str = Livetext.interpolate(line.chomp)
191
194
  rhs << str + "<br>"
192
195
  end
193
196
  indent = @parent.indentation.last
@@ -209,6 +212,14 @@ module Livetext::Standard
209
212
  check_file_exists(file)
210
213
  @parent.process_file(file)
211
214
  _optional_blank_line
215
+ rescue StandardError => err
216
+ p err
217
+ puts "-----"
218
+ err.backtrace.to_a.each {|x| puts x }
219
+ puts "-----"
220
+ exit
221
+ TTY.puts ">>> #{__method__}: rescue in process_file!!"
222
+ # _out @body
212
223
  end
213
224
 
214
225
  def inherit(args = nil, body = nil)
@@ -225,32 +236,25 @@ module Livetext::Standard
225
236
 
226
237
  def mixin(args = nil, body = nil)
227
238
  name = @_args.first # Expect a module name
239
+ # TTY.puts "#{__method__}: name = #{name}"
228
240
  return if @_mixins.include?(name)
229
241
  @_mixins << name
230
- mod = Livetext::ParseMixin.get_module(name) # FIXME??
242
+ mod = Livetext::ParseMixin.get_module(name)
243
+ # TTY.puts "#{__method__}: mod = #{mod.inspect}"
231
244
  self.extend(mod)
232
245
  init = "init_#{name}"
233
- self.send(init) if self.respond_to? init
246
+ self.send(init) rescue nil # if self.respond_to? init
234
247
  _optional_blank_line
235
248
  end
236
249
 
237
- def icanhaz(args = nil, body = nil)
250
+ def import(args = nil, body = nil)
238
251
  name = @_args.first # Expect a module name
239
252
  return if @_mixins.include?(name)
240
253
  @_mixins << name
241
- mod = Livetext::Handler::ICanHaz.get_module(name) # FIXME??
254
+ mod = Livetext::Handler::Import.get_module(name)
242
255
  self.extend(mod)
243
256
  init = "init_#{name}"
244
- self.send(init) if self.respond_to? init
245
- _optional_blank_line
246
- end
247
-
248
- def import(args = nil, body = nil)
249
- name = @_args.first # Expect a module name
250
- return if @_mixins.include?(name)
251
- @_mixins << name
252
- mod = Livetext::ParseImport.get_module(name)
253
- parse.use_import(name)
257
+ self.send(init) rescue nil # if self.respond_to? init
254
258
  _optional_blank_line
255
259
  end
256
260
 
@@ -367,4 +371,11 @@ module Livetext::Standard
367
371
  _out out
368
372
  end
369
373
 
374
+ def reflection # strictly experimental!
375
+ list = self.methods
376
+ obj = Object.instance_methods
377
+ diff = (list - obj).sort
378
+ _out "#{diff.size} methods:"
379
+ _out diff.inspect
380
+ end
370
381
  end
data/lib/userapi.rb CHANGED
@@ -1,4 +1,4 @@
1
- # User API
1
+ # p __FILE__
2
2
 
3
3
  require_relative 'formatline'
4
4
 
@@ -6,6 +6,10 @@ require_relative 'formatline'
6
6
 
7
7
  module Livetext::UserAPI
8
8
 
9
+ # FIXME I am tired of all my leading underscores...
10
+ # FIXME Q: Could this be converted into a class?? What about its
11
+ # interaction thru instance vars?
12
+
9
13
  def setvar(var, val)
10
14
  str, sym = var.to_s, var.to_sym
11
15
  Livetext::Vars[str] = val
@@ -114,9 +118,9 @@ module Livetext::UserAPI
114
118
  end
115
119
 
116
120
  def _format(line)
117
- return "" if line == "\n"
118
- line2 = FormatLine.parse!(line)
119
- line.replace(line2) unless line.nil?
121
+ return "" if line == "\n" || line.nil?
122
+ line2 = Livetext::FormatLine.parse!(line)
123
+ line.replace(line2)
120
124
  line
121
125
  end
122
126
 
data/plugin/bookish.rb CHANGED
@@ -18,7 +18,7 @@ def h2; _out "<h2>#{@_data}</h2>"; end
18
18
  def h3; _out "<h3>#{@_data}</h3>"; end
19
19
 
20
20
  def alpha_columns(args = nil, body = nil)
21
- n = @_args.first.to_i # FIXME: what if missing?
21
+ n = @_args.first.to_i # FIXME: what if it's missing?
22
22
  words = []
23
23
  _body do |line|
24
24
  words << line.chomp
@@ -50,8 +50,8 @@ def _slug(str)
50
50
  s2
51
51
  end
52
52
 
53
-
54
53
  # FIXME duplicated?
54
+
55
55
  def image(args = nil, body = nil)
56
56
  name = @_args[0]
57
57
  _out "<img src='#{name}'></img>"
@@ -67,7 +67,6 @@ def figure(args = nil, body = nil)
67
67
  end
68
68
 
69
69
  def chapter(args = nil, body = nil)
70
- # _errout("chapter")
71
70
  @chapter = @_args.first.to_i
72
71
  @sec = @sec2 = 0
73
72
  title = @_data.split(" ",2)[1]
@@ -108,7 +107,7 @@ def sec(args = nil, body = nil)
108
107
  next_output
109
108
  _out "<h3>#@section #{title}</h3>\n"
110
109
  rescue => err
111
- STDERR.puts "#{err}\n#{err.backtrace}"
110
+ ::STDERR.puts "#{err}\n#{err.backtrace}"
112
111
  exit
113
112
  end
114
113
 
@@ -275,7 +274,7 @@ def quote(args = nil, body = nil)
275
274
  _body {|line| _out line }
276
275
  _out "</blockquote>"
277
276
  rescue => err
278
- STDERR.puts "#{err}\n#{err.backtrace}"
277
+ ::STDERR.puts "#{err}\n#{err.backtrace}"
279
278
  exit
280
279
  end
281
280
 
data/plugin/markdown.rb CHANGED
@@ -8,12 +8,12 @@ SimpleFormats[:t] = %w[` `]
8
8
  SimpleFormats[:s] = %w[<strike> </strike>]
9
9
 
10
10
 
11
- def h1(args = nil, body = nil); _out "# #{FormatLine.var_func_parse(@_data)}"; _optional_blank_line end # atx style for now
12
- def h2(args = nil, body = nil); _out "## #{FormatLine.var_func_parse(@_data)}"; _optional_blank_line end
13
- def h3(args = nil, body = nil); _out "### #{FormatLine.var_func_parse(@_data)}"; _optional_blank_line end
14
- def h4(args = nil, body = nil); _out "#### #{FormatLine.var_func_parse(@_data)}"; _optional_blank_line end
15
- def h5(args = nil, body = nil); _out "##### #{FormatLine.var_func_parse(@_data)}"; _optional_blank_line end
16
- def h6(args = nil, body = nil); _out "###### #{FormatLine.var_func_parse(@_data)}"; _optional_blank_line end
11
+ def h1(args = nil, body = nil); _out "# #{Livetext.interpolate(@_data)}"; _optional_blank_line end # atx style for now
12
+ def h2(args = nil, body = nil); _out "## #{Livetext.interpolate(@_data)}"; _optional_blank_line end
13
+ def h3(args = nil, body = nil); _out "### #{Livetext.interpolate(@_data)}"; _optional_blank_line end
14
+ def h4(args = nil, body = nil); _out "#### #{Livetext.interpolate(@_data)}"; _optional_blank_line end
15
+ def h5(args = nil, body = nil); _out "##### #{Livetext.interpolate(@_data)}"; _optional_blank_line end
16
+ def h6(args = nil, body = nil); _out "###### #{Livetext.interpolate(@_data)}"; _optional_blank_line end
17
17
 
18
18
  def title(args = nil, body = nil)
19
19
  h1
data/plugin/pyggish.rb CHANGED
@@ -1,59 +1,56 @@
1
1
  require 'rouge'
2
2
 
3
- def self.pyg_change(code, klass, style)
4
- color = style[0..6]
5
- modifier = style[8]
6
- mod_open = modifier ? "<#{modifier}>" : ""
7
- mod_close = modifier ? "</#{modifier}>" : ""
8
- rx = /<span class="#{klass}">(?<cname>[^<]+?)<\/span>/
9
- loop do
10
- md = rx.match(code)
11
- break if md.nil?
12
- str = md[:cname]
13
- result = code.sub!(rx, "<font color=#{color}>#{mod_open}#{str}#{mod_close}</font>")
14
- break if result.nil?
15
- end
16
- end
17
-
18
- def self._codebar_color(lexer)
19
- color = case lexer
20
- when :elixir
21
- "#fc88fc"
22
- when :ruby
23
- "#fc8888"
24
- else
25
- raise "Unknown lexer"
26
- end
3
+ # FIXME This whole file has a weird vibe. It has dead code and
4
+ # also exposes methods that are not dot commands...
5
+
6
+ def self.pyg_change(code, klass, style)
7
+ color = style[0..6]
8
+ modifier = style[8]
9
+ mod_open = modifier ? "<#{modifier}>" : ""
10
+ mod_close = modifier ? "</#{modifier}>" : ""
11
+ rx = /<span class="#{klass}">(?<cname>[^<]+?)<\/span>/
12
+ loop do
13
+ md = rx.match(code)
14
+ break if md.nil?
15
+ str = md[:cname]
16
+ result = code.sub!(rx, "<font color=#{color}>#{mod_open}#{str}#{mod_close}</font>")
17
+ break if result.nil?
27
18
  end
19
+ end
28
20
 
29
- def self.pyg_finalize(code, lexer=:elixir)
30
- Styles.each_pair {|klass, style| pyg_change(code, klass, style) }
31
- File.open("debug-pf1", "w") {|f| f.puts code }
32
- code.sub!(/<pre>/, "<pre>\n")
33
- code.gsub!(/<span class="[np]">/, "")
34
- code.gsub!(/<\/span>/, "")
35
- color = _codebar_color(lexer)
36
- code.sub!(/<td class="linenos"/, "<td width=2%></td><td width=5% bgcolor=#{color}")
37
- code.gsub!(/<td/, "<td valign=top ")
38
- code.gsub!(/ class="[^"]*?"/, "") # Get rid of remaining Pygments CSS
39
- File.open("debug-pf2", "w") {|f| f.puts code }
40
- lines = code.split("\n")
41
- # lines.each {|line| line << "\n" }
42
- n1 = lines.index {|x| x =~ /<pre>/ }
43
- n2 = lines.index {|x| x =~ /<\/pre>/ }
44
- # FIXME ?
45
- n1 ||= 0
46
- n2 ||= -1
47
- lines[n1].sub!(/ 1$/, " 1 ")
48
- (n1+1).upto(n2) {|n| lines[n].replace(" " + lines[n] + " ") }
49
- code = lines.join("\n")
50
- File.open("debug-pf3", "w") {|f| f.puts code }
51
- code
21
+ def self._codebar_color(lexer)
22
+ color = case lexer
23
+ when :elixir
24
+ "#fc88fc"
25
+ when :ruby
26
+ "#fc8888"
27
+ else
28
+ raise "Unknown lexer"
52
29
  end
30
+ end
53
31
 
32
+ def self.pyg_finalize(code, lexer=:elixir)
33
+ Styles.each_pair {|klass, style| pyg_change(code, klass, style) }
34
+ code.sub!(/<pre>/, "<pre>\n")
35
+ code.gsub!(/<span class="[np]">/, "")
36
+ code.gsub!(/<\/span>/, "")
37
+ color = _codebar_color(lexer)
38
+ code.sub!(/<td class="linenos"/, "<td width=2%></td><td width=5% bgcolor=#{color}")
39
+ code.gsub!(/<td/, "<td valign=top ")
40
+ code.gsub!(/ class="[^"]*?"/, "") # Get rid of remaining Pygments CSS
41
+ lines = code.split("\n")
42
+ n1 = lines.index {|x| x =~ /<pre>/ }
43
+ n2 = lines.index {|x| x =~ /<\/pre>/ }
44
+ # FIXME ?
45
+ n1 ||= 0
46
+ n2 ||= -1
47
+ lines[n1].sub!(/ 1$/, " 1 ")
48
+ (n1+1).upto(n2) {|n| lines[n].replace(" " + lines[n] + " ") }
49
+ code = lines.join("\n")
50
+ code
51
+ end
54
52
 
55
53
  def _process_code(text)
56
- File.open("debug-pc1", "w") {|f| f.puts text }
57
54
  lines = text.split("\n")
58
55
  lines = lines.select {|x| x !~ /##~ omit/ }
59
56
  @refs = {}
@@ -66,7 +63,6 @@ File.open("debug-pc1", "w") {|f| f.puts text }
66
63
  end
67
64
  lines.map! {|line| " " + line }
68
65
  text2 = lines.join("\n")
69
- File.open("debug-pc2", "w") {|f| f.puts text2 }
70
66
  text.replace(text2)
71
67
  end
72
68
 
@@ -86,37 +82,10 @@ def _colorize!(code, lexer=:elixir)
86
82
  result
87
83
  end
88
84
 
89
- def OLD_ruby
90
- file = @_args.first
91
- if file.nil?
92
- code = "# Ruby code\n"
93
- _body {|line| code << line + "\n" }
94
- else
95
- code = "# Ruby code\n\n" + ::File.read(file)
96
- end
97
-
98
- _process_code(code)
99
- html = _colorize(code, :ruby)
100
- _out "\n#{html}\n "
101
- end
102
-
103
- def OLD_elixir
104
- file = @_args.first
105
- if file.nil?
106
- code = ""
107
- _body {|line| code << line + "\n" }
108
- else
109
- code = ::File.read(file)
110
- end
111
-
112
- _process_code(code)
113
- html = _colorize(code, :elixir)
114
- _out "\n#{html}\n "
115
- end
116
-
117
85
  def fragment
118
86
  lang = @_args.empty? ? :elixir : @_args.first.to_sym # ruby or elixir
119
87
  @_args = []
88
+ # TTY.puts "\n#{self.inspect}"
120
89
  send(lang)
121
90
  _out "\n"
122
91
  end
data/plugin/tutorial.rb CHANGED
@@ -52,8 +52,8 @@ def inout(args = nil, body = nil)
52
52
  end
53
53
 
54
54
  def put_table(src, exp)
55
- t1 = ::File.readlines(src) rescue (abort "t1 = #{src}")
56
- t2 = ::File.readlines(exp) rescue (abort "t2 = #{out}")
55
+ t1 = ::File.readlines(src) rescue (abort "Fail - src = #{src} t1 = #{src}")
56
+ t2 = ::File.readlines(exp) rescue (abort "Fail - src = #{exp} t2 = #{out}")
57
57
  t1 = t1.map {|x| " " + x.sub(/ +$/,"").gsub(/_/, "\\_") }.join
58
58
  t2 = t2.map {|x| " " + x.sub(/ +$/,"").gsub(/_/, "\\_") }.join
59
59
 
@@ -80,7 +80,7 @@ end
80
80
  def testcase(args = nil, body = nil)
81
81
  name = _args.first
82
82
  _out "\n<font size=+1><b>Test: </font><font size=+2><tt>#{name}</tt></font></b></h3><br>"
83
- src, exp = "test/data/#{name}/source.lt3", "test/data/#{name}/expected-output.txt"
83
+ src, exp = "test/snapshots/#{name}/source.lt3", "test/snapshots/#{name}/expected-output.txt"
84
84
  @_args = [src, exp] # Better way to do this??
85
85
  put_table(src, exp)
86
86
  _out "<br>"
@@ -0,0 +1,17 @@
1
+ This is my
2
+ source file
3
+ which includes file2 here:
4
+ This is file2
5
+ which has an error
6
+ about an unknown command
7
+ in line 5
8
+ This is my
9
+ source file
10
+ which includes file2 here:
11
+ This is file2
12
+ which has an error
13
+ about an unknown command
14
+ in line 5
15
+ <p>
16
+
17
+ And this is file2 line 7.
@@ -0,0 +1,17 @@
1
+ This is my
2
+ source file
3
+ which includes file2 here:
4
+ This is file2
5
+ which has an error
6
+ about an unknown command
7
+ in line 5
8
+ This is my
9
+ source file
10
+ which includes file2 here:
11
+ This is file2
12
+ which has an error
13
+ about an unknown command
14
+ in line 5
15
+ <p>
16
+
17
+ And this is file2 line 7.
@@ -0,0 +1,10 @@
1
+ /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:146:in `check_disallowed': Error: name 'to_s' is invalid (DisallowedName)
2
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/standard.rb:142:in `dot_def'
3
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:101:in `handle_dotcmd'
4
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:79:in `process_line'
5
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:63:in `block in process_file'
6
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:60:in `loop'
7
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:60:in `process_file'
8
+ from ../../../bin/livetext:86:in `block in <main>'
9
+ from ../../../bin/livetext:57:in `loop'
10
+ from ../../../bin/livetext:57:in `<main>'
@@ -0,0 +1,6 @@
1
+ ACTUAL | EXPECTED
2
+ > This file has
3
+ > a defined method
4
+ > that is invalid:
5
+ > <p>
6
+ >
@@ -0,0 +1,10 @@
1
+ /Users/Hal/Dropbox/topx/git/livetext/lib/userapi.rb:92:in `_body': Expected .end, found end of file (RuntimeError)
2
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/standard.rb:48:in `comment'
3
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:101:in `handle_dotcmd'
4
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:79:in `process_line'
5
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:63:in `block in process_file'
6
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:60:in `loop'
7
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:60:in `process_file'
8
+ from ../../../bin/livetext:86:in `block in <main>'
9
+ from ../../../bin/livetext:57:in `loop'
10
+ from ../../../bin/livetext:57:in `<main>'
@@ -0,0 +1,6 @@
1
+ ACTUAL | EXPECTED
2
+ > Blah
3
+ > blah
4
+ > <p>
5
+ >
6
+ >
@@ -0,0 +1,10 @@
1
+ /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:150:in `check_file_exists': Error: file 'nosuchfile.txt' not found (FileNotFound)
2
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/standard.rb:255:in `copy'
3
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:101:in `handle_dotcmd'
4
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:79:in `process_line'
5
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:63:in `block in process_file'
6
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:60:in `loop'
7
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:60:in `process_file'
8
+ from ../../../bin/livetext:86:in `block in <main>'
9
+ from ../../../bin/livetext:57:in `loop'
10
+ from ../../../bin/livetext:57:in `<main>'
@@ -1 +1 @@
1
- 1 /file nosuchfile.txt not found/
1
+ 1 /file 'nosuchfile.txt' not found/
@@ -0,0 +1,5 @@
1
+ ACTUAL | EXPECTED
2
+ > Make sure a
3
+ > nonexistent file with .copy
4
+ > gives an error.
5
+ > <p>
@@ -0,0 +1,10 @@
1
+ /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:150:in `check_file_exists': Error: file 'nosuchinc.lt3' not found (FileNotFound)
2
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/standard.rb:209:in `dot_include'
3
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:101:in `handle_dotcmd'
4
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:79:in `process_line'
5
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:63:in `block in process_file'
6
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:60:in `loop'
7
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:60:in `process_file'
8
+ from ../../../bin/livetext:86:in `block in <main>'
9
+ from ../../../bin/livetext:57:in `loop'
10
+ from ../../../bin/livetext:57:in `<main>'
@@ -1 +1 @@
1
- 1 /file nosuchinc.lt3 not found/
1
+ 1 /file 'nosuchinc.lt3' not found/
@@ -0,0 +1,6 @@
1
+ ACTUAL | EXPECTED
2
+ > Make sure
3
+ > a nonexistent include
4
+ > will give an error.
5
+ > <p>
6
+ >
@@ -0,0 +1,13 @@
1
+ /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:36:in `find_file': No such mixin 'nosuchthing' (RuntimeError)
2
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/parser/mixin.rb:12:in `initialize'
3
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/parser/mixin.rb:16:in `new'
4
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/parser/mixin.rb:16:in `get_module'
5
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/standard.rb:234:in `mixin'
6
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:101:in `handle_dotcmd'
7
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:79:in `process_line'
8
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:63:in `block in process_file'
9
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:60:in `loop'
10
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:60:in `process_file'
11
+ from ../../../bin/livetext:86:in `block in <main>'
12
+ from ../../../bin/livetext:57:in `loop'
13
+ from ../../../bin/livetext:57:in `<main>'
@@ -0,0 +1,6 @@
1
+ ACTUAL | EXPECTED
2
+ > Test that
3
+ > we give an error
4
+ > when a mixin does not
5
+ > exist:
6
+ > <p>
File without changes
File without changes
@@ -1,9 +1,9 @@
1
- Test fake command .icanhaz:
1
+ Test .import:
2
2
  we give an error
3
3
  when a .rb does not
4
4
  exist:
5
5
 
6
- .icanhaz nonexistent
6
+ .import nonexistent
7
7
 
8
8
  We shouldn't
9
9
  reach this point
File without changes
@@ -1,6 +1,8 @@
1
- Testing fake command .icanhaz:
1
+ Testing .import:
2
2
  <p>
3
3
 
4
4
  Now call a method:
5
5
  Hello, world.
6
+ <p>
7
+
6
8
  That's all.
@@ -0,0 +1,8 @@
1
+ Testing .import:
2
+
3
+ .import simple_import
4
+
5
+ Now call a method:
6
+ .hello_world
7
+
8
+ That's all.
File without changes
@@ -0,0 +1,10 @@
1
+ <table cellpadding=2>
2
+ <tr>
3
+ <td width=[0, 0]% valign=top>this</td>
4
+ <td width=[0, 0]% valign=top>that</td>
5
+ </tr>
6
+ <tr>
7
+ <td width=[0, 0]% valign=top>foo</td>
8
+ <td width=[0, 0]% valign=top>bar</td>
9
+ </tr>
10
+ </table>
@@ -0,0 +1,7 @@
1
+ .import bookish
2
+
3
+ .simple_table
4
+ this :: that
5
+ foo :: bar
6
+ .end
7
+
File without changes
File without changes
@@ -0,0 +1,10 @@
1
+ <table cellpadding=2>
2
+ <tr>
3
+ <td width=[0, 0]% valign=top>this</td>
4
+ <td width=[0, 0]% valign=top>that</td>
5
+ </tr>
6
+ <tr>
7
+ <td width=[0, 0]% valign=top>foo</td>
8
+ <td width=[0, 0]% valign=top>bar</td>
9
+ </tr>
10
+ </table>
@@ -0,0 +1,7 @@
1
+ .mixin bookish
2
+
3
+ .simple_table
4
+ this :: that
5
+ foo :: bar
6
+ .end
7
+
File without changes
File without changes