livetext 0.9.15 → 0.9.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/README.lt3 +2 -2
  3. data/lib/handler/icanhaz.rb +35 -0
  4. data/lib/handler.rb +1 -0
  5. data/lib/helpers.rb +31 -0
  6. data/lib/livetext.rb +6 -1
  7. data/lib/parser/import.rb +1 -3
  8. data/lib/parser/mixin.rb +1 -16
  9. data/lib/standard.rb +12 -1
  10. data/lib/userapi.rb +1 -0
  11. data/test/snapshots/OMIT.txt +2 -0
  12. data/test/snapshots/clusion.txt +65 -30
  13. data/test/snapshots/icanhaz/expected-output.txt +5 -0
  14. data/test/snapshots/icanhaz/match-error.txt +1 -0
  15. data/test/snapshots/icanhaz/simple_import.rb +5 -0
  16. data/test/snapshots/icanhaz/source.lt3 +10 -0
  17. data/test/snapshots/{error_invalid_name/actual-output.txt → icanhaz2/expected-error.txt} +0 -0
  18. data/test/snapshots/icanhaz2/expected-output.txt +6 -0
  19. data/test/snapshots/icanhaz2/simple_canhaz.rb +5 -0
  20. data/test/snapshots/icanhaz2/source.lt3 +6 -0
  21. data/test/snapshots.rb +32 -24
  22. metadata +11 -23
  23. data/test/snapshots/error_inc_line_num/actual-error.txt +0 -14
  24. data/test/snapshots/error_inc_line_num/actual-output.txt +0 -7
  25. data/test/snapshots/error_inc_line_num/out-sdiff.txt +0 -14
  26. data/test/snapshots/error_invalid_name/actual-error.txt +0 -10
  27. data/test/snapshots/error_invalid_name/out-sdiff.txt +0 -6
  28. data/test/snapshots/error_missing_end/actual-error.txt +0 -10
  29. data/test/snapshots/error_missing_end/actual-output.txt +0 -0
  30. data/test/snapshots/error_missing_end/out-sdiff.txt +0 -6
  31. data/test/snapshots/error_no_such_copy/actual-error.txt +0 -10
  32. data/test/snapshots/error_no_such_copy/actual-output.txt +0 -0
  33. data/test/snapshots/error_no_such_copy/out-sdiff.txt +0 -5
  34. data/test/snapshots/error_no_such_inc/actual-error.txt +0 -10
  35. data/test/snapshots/error_no_such_inc/actual-output.txt +0 -0
  36. data/test/snapshots/error_no_such_inc/out-sdiff.txt +0 -6
  37. data/test/snapshots/error_no_such_mixin/actual-error.txt +0 -37
  38. data/test/snapshots/error_no_such_mixin/actual-output.txt +0 -0
  39. data/test/snapshots/error_no_such_mixin/out-sdiff.txt +0 -6
  40. data/test/snapshots/simple_import/actual-error.txt +0 -8
  41. data/test/snapshots/simple_import/actual-output.txt +0 -3
  42. data/test/snapshots/simple_import/err-sdiff.txt +0 -9
  43. data/test/snapshots/simple_import/out-sdiff.txt +0 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a8d345a0f52ce0d7c62f40f8798793faf5136f8ce72cde8576a0284220c08082
4
- data.tar.gz: 4e037527c3abd873c9cf8ca49685d99c68fffab9630a67c1193e898e961c4d48
3
+ metadata.gz: d027612469e45b953a3e8589ebbedf1f746f87f50c4a90b502f4daac56d28605
4
+ data.tar.gz: b811285f434d3b2760e201eb403f864ba31cb12e31f21105fc8c4fe5e3b743a2
5
5
  SHA512:
6
- metadata.gz: 5b2957b2fe57d0abeff6029c63e310b7d26d653e1e7848c4026d2c16f43e6c37f6c9bf2fb63f2dfcd4e719cc82113cf549413362da43c14ac12312cafad1a744
7
- data.tar.gz: 696a9ff22bff7caae99534e1a9431e9914e9137be4212674598c2ee66a58c11bd37c56bc90c52dd0d0cae3450f8905081202fbdc08f05a6164abd2de2dc5e7ce
6
+ metadata.gz: 1e1b08d7d900ae551d7777576a7284d776422d2039813a764c3d9d9b0495ac14eec4e53225e1e0f3b97a1a548377f14b861e72d4b24d2a52055cd0f75404d2bf
7
+ data.tar.gz: 025055edd14e392750b482f4b0a9a973f213b24a5991bb9c7e9939c225a21bfe77398cc118983599a0fd1ccf1c1aa4c8bbf62874745a2cf5257410b747db72ee
data/README.lt3 CHANGED
@@ -1,5 +1,5 @@
1
- .mixin tutorial
2
- .mixin markdown
1
+ .icanhaz tutorial
2
+ .icanhaz markdown
3
3
 
4
4
  . copy basic.css
5
5
 
@@ -0,0 +1,35 @@
1
+
2
+ class Livetext::Handler::ICanHaz
3
+ include Helpers
4
+
5
+ attr_reader :file
6
+
7
+ def initialize(name)
8
+ @name = name
9
+ @file = find_file(name)
10
+ end
11
+
12
+ def self.get_module(name)
13
+ handler = self.new(name)
14
+ const1 = Object.constants
15
+ @file = handler.file.sub(/.rb$/, "")
16
+ require @file # + ".rb"
17
+ const2 = Object.constants
18
+ names = (const2 - const1)
19
+ abort "Expected ONE new constant: #{names.inspect}" if names.size != 1
20
+ modname = names.first.to_s
21
+ newmod = Object.const_get("::" + modname)
22
+ newmod # return actual module
23
+ end
24
+
25
+ private
26
+
27
+ def cwd_root?
28
+ File.dirname(File.expand_path(".")) == "/"
29
+ end
30
+
31
+ def fname2module(name)
32
+ end
33
+
34
+ end
35
+
data/lib/handler.rb ADDED
@@ -0,0 +1 @@
1
+ require_relative 'handler/icanhaz'
data/lib/helpers.rb CHANGED
@@ -4,6 +4,37 @@ module Helpers
4
4
  Space = " "
5
5
  Sigil = "." # Can't change yet
6
6
 
7
+ def escape_html(string)
8
+ enc = string.encoding
9
+ unless enc.ascii_compatible?
10
+ if enc.dummy?
11
+ origenc = enc
12
+ enc = Encoding::Converter.asciicompat_encoding(enc)
13
+ string = enc ? string.encode(enc) : string.b
14
+ end
15
+ table = Hash[TABLE_FOR_ESCAPE_HTML__.map {|pair|pair.map {|s|s.encode(enc)}}]
16
+ string = string.gsub(/#{"['&\"<>]".encode(enc)}/, table)
17
+ string.encode!(origenc) if origenc
18
+ return string
19
+ end
20
+ string.gsub(/['&\"<>]/, TABLE_FOR_ESCAPE_HTML__)
21
+ end
22
+
23
+ def find_file(name, ext=".rb")
24
+ paths = [Livetext::Path.sub(/lib/, "imports/"), "./"]
25
+ base = "#{name}#{ext}"
26
+ paths.each do |path|
27
+ file = path + base
28
+ return file if File.exist?(file)
29
+ end
30
+
31
+ raise "No such mixin '#{name}'"
32
+
33
+ # # Really want to search upward??
34
+ # raise "No such mixin '#{name}'" if cwd_root?
35
+ # Dir.chdir("..") { find_file(name) }
36
+ end
37
+
7
38
  def self.rx(str, space=nil)
8
39
  Regexp.compile("^" + Regexp.escape(str) + "#{space}")
9
40
  end
data/lib/livetext.rb CHANGED
@@ -1,8 +1,11 @@
1
1
  # Class Livetext skeleton (top level).
2
2
 
3
3
  class Livetext
4
- VERSION = "0.9.15"
4
+ VERSION = "0.9.17"
5
5
  Path = File.expand_path(File.join(File.dirname(__FILE__)))
6
+
7
+ module Handler
8
+ end
6
9
  end
7
10
 
8
11
  # $LOAD_PATH << Livetext::Path
@@ -16,8 +19,10 @@ require_relative 'standard'
16
19
  require_relative 'formatline'
17
20
  require_relative 'processor'
18
21
  require_relative 'helpers'
22
+ require_relative 'handler'
19
23
 
20
24
  Plugins = File.expand_path(File.join(File.dirname(__FILE__), "../plugin"))
25
+ Imports = File.expand_path(File.join(File.dirname(__FILE__), "../imports"))
21
26
 
22
27
  TTY = ::File.open("/dev/tty", "w")
23
28
 
data/lib/parser/import.rb CHANGED
@@ -4,9 +4,7 @@ require '../livetext/importable'
4
4
  make_exception(:BadVariableName, "Error: invalid variable name")
5
5
  make_exception(:NoEqualSign, "Error: no equal sign found")
6
6
 
7
- # FIXME probably belongs elsewhere?
8
-
9
- class Livetext::ParseImport
7
+ class Livetext::Handler::Import
10
8
  def use_import(name)
11
9
  require name
12
10
  include name
data/lib/parser/mixin.rb CHANGED
@@ -2,13 +2,9 @@ require_relative '../livetext'
2
2
  require_relative '../helpers'
3
3
  require_relative 'string'
4
4
 
5
- make_exception(:BadVariableName, "Error: invalid variable name")
6
5
  make_exception(:NoEqualSign, "Error: no equal sign found")
7
6
 
8
- # FIXME probably belongs elsewhere?
9
-
10
- class Livetext::ParseMixin # < StringParser
11
-
7
+ class Livetext::ParseMixin
12
8
  include Helpers
13
9
 
14
10
  def initialize(name)
@@ -37,17 +33,6 @@ class Livetext::ParseMixin # < StringParser
37
33
  File.dirname(File.expand_path(".")) == "/"
38
34
  end
39
35
 
40
- def find_file(name, ext=".rb")
41
- base = "./#{name}#{ext}"
42
- file = "#{Plugins}/#{base}"
43
- return file if File.exist?(file)
44
-
45
- file = base
46
- return file if File.exist?(file)
47
-
48
- raise "No such mixin '#{name}'" if cwd_root?
49
- Dir.chdir("..") { find_file(name) }
50
- end
51
36
 
52
37
  end
53
38
 
data/lib/standard.rb CHANGED
@@ -118,7 +118,7 @@ module Livetext::Standard
118
118
 
119
119
  def banner(args = nil, body = nil)
120
120
  str = _format(@_data.chomp)
121
- num = str.length - 1
121
+ num = str.length
122
122
  decor = "-"*num + "\n"
123
123
  puts decor + str + "\n" + decor
124
124
  end
@@ -234,6 +234,17 @@ module Livetext::Standard
234
234
  _optional_blank_line
235
235
  end
236
236
 
237
+ def icanhaz(args = nil, body = nil)
238
+ name = @_args.first # Expect a module name
239
+ return if @_mixins.include?(name)
240
+ @_mixins << name
241
+ mod = Livetext::Handler::ICanHaz.get_module(name) # FIXME??
242
+ self.extend(mod)
243
+ init = "init_#{name}"
244
+ self.send(init) if self.respond_to? init
245
+ _optional_blank_line
246
+ end
247
+
237
248
  def import(args = nil, body = nil)
238
249
  name = @_args.first # Expect a module name
239
250
  return if @_mixins.include?(name)
data/lib/userapi.rb CHANGED
@@ -3,6 +3,7 @@
3
3
  require_relative 'formatline'
4
4
 
5
5
  # UserAPI deals mostly with user-level methods.
6
+
6
7
  module Livetext::UserAPI
7
8
 
8
9
  def setvar(var, val)
@@ -7,3 +7,5 @@
7
7
  error_invalid_name ^ Same behavior as error_no_such_inc
8
8
  error_missing_end Output is duplicated somehow. Look for: puts @body or puts @main.body
9
9
  error_inc_line_num Forgot what's wrong here
10
+ simple_import Not coded yet
11
+ icanhaz Dummy command similar to import/mixin
@@ -1,35 +1,70 @@
1
+ # This file specifies which snapshots will/won't be run.
2
+
1
3
  # Blank lines and comments are ignored.
2
4
  # Other lines: name_of_snapshot and any comments here are ignored (no # needed)
3
5
 
4
6
  # i to include, x to exclude
5
7
 
6
- error_no_such_inc Output BEFORE error doesn't get passed through
7
- error_no_such_copy ^ Same behavior as error_no_such_inc
8
- error_no_such_mixin ^ Same behavior as error_missing_end
9
- error_invalid_name ^ Same behavior as error_no_such_inc
10
- error_missing_end Output is duplicated somehow. Look for: puts @body or puts @main.body
11
- error_inc_line_num Forgot what's wrong here
12
-
13
- basic_formatting
14
- block_comment
15
- comments_ignored_1
16
- copy_is_raw
17
- def_method
18
- error_line_num
19
- error_mismatched_end
20
- error_name_not_permitted
21
- example_alpha
22
- example_alpha2
23
- functions
24
- hello_world
25
- more_complex_vars
26
- predef_vars
27
- raw_lines
28
- raw_text_block
29
- simple_copy
30
- simple_import
31
- simple_include
32
- simple_mixin
33
- simple_vars
34
- single_raw_line
35
- table_with_heredocs
8
+ x error_no_such_inc # Output BEFORE error doesn't get passed through ("leading" output)
9
+ x error_no_such_copy # ^ Same behavior as error_no_such_inc
10
+ x error_no_such_mixin # ^ Same behavior as error_missing_end
11
+ x error_invalid_name # ^ Same behavior as error_no_such_inc
12
+ x error_missing_end # Output is duplicated somehow. Look for: puts @body or puts @main.body
13
+ x error_inc_line_num # Forgot what's wrong here
14
+
15
+ # Dummy command .icanhaz works like .mixin or .import
16
+
17
+ x icanhaz # "Leading" output doesn't get generated (same as error_no_such_inc)
18
+ icanhaz2
19
+
20
+ # Others (usually passing):
21
+
22
+ # import/include/mixin, others...
23
+
24
+ simple_copy #
25
+ simple_import #
26
+ simple_include #
27
+ simple_mixin #
28
+
29
+ # raw input
30
+
31
+ single_raw_line #
32
+ raw_lines #
33
+ raw_text_block #
34
+ copy_is_raw #
35
+
36
+ # comments
37
+
38
+ block_comment #
39
+ comments_ignored_1 #
40
+
41
+ # variables and heredocs
42
+
43
+ predef_vars #
44
+ simple_vars #
45
+ more_complex_vars #
46
+ table_with_heredocs #
47
+
48
+ # testing def
49
+
50
+ def_method #
51
+
52
+ # intraline formatting
53
+
54
+ basic_formatting #
55
+
56
+ # Errors
57
+
58
+ error_line_num #
59
+ error_mismatched_end #
60
+ error_name_not_permitted #
61
+
62
+ # functions
63
+
64
+ functions #
65
+
66
+ # More/misc...
67
+
68
+ example_alpha #
69
+ example_alpha2 #
70
+ hello_world #
@@ -0,0 +1,5 @@
1
+ Test fake command .icanhaz:
2
+ we give an error
3
+ when a .rb does not
4
+ exist:
5
+ <p>
@@ -0,0 +1 @@
1
+ 1 /No such mixin 'nonexistent'/
@@ -0,0 +1,5 @@
1
+ module SimpleImport
2
+ def hello_world
3
+ _out "Hello, world."
4
+ end
5
+ end
@@ -0,0 +1,10 @@
1
+ Test fake command .icanhaz:
2
+ we give an error
3
+ when a .rb does not
4
+ exist:
5
+
6
+ .icanhaz nonexistent
7
+
8
+ We shouldn't
9
+ reach this point
10
+ in the file.
@@ -0,0 +1,6 @@
1
+ Testing fake command .icanhaz:
2
+ <p>
3
+
4
+ Now call a method:
5
+ Hello, world.
6
+ That's all.
@@ -0,0 +1,5 @@
1
+ module SimpleImport
2
+ def hello_world
3
+ _out "Hello, world."
4
+ end
5
+ end
@@ -0,0 +1,6 @@
1
+ Testing fake command .icanhaz:
2
+
3
+ .icanhaz simple_canhaz
4
+ Now call a method:
5
+ .hello_world
6
+ That's all.
data/test/snapshots.rb CHANGED
@@ -124,40 +124,48 @@ class TestingLivetext < MiniTest::Test
124
124
  end
125
125
  end
126
126
 
127
+ def self.get_dir # FIXME - uh what?
128
+ cmdline = ARGV.first == "cmdline" # FIXME remove??
129
+ if cmdline
130
+ dir = "../"
131
+ Dir.chdir `livetext --path`.chomp.chomp
132
+ else
133
+ dir = ""
134
+ end
135
+ end
136
+
127
137
  TTY = File.open("/dev/tty","w")
128
138
 
129
- cmdline = ARGV.first == "cmdline" # FIXME remove??
130
- if cmdline
131
- dir = "../"
132
- Dir.chdir `livetext --path`.chomp.chomp
133
- else
134
- dir = ""
135
- end
139
+ args = ARGV - ["cmdline"]
140
+
141
+ dir = self.get_dir
136
142
 
137
143
  Data = "#{dir}test/snapshots"
138
144
  Dir.chdir(Data)
139
145
 
140
146
  TestDirs = Dir.entries(".").reject {|fname| ! File.directory?(fname) } - %w[. ..]
141
147
 
142
- selected = File.readlines("subset.txt").map(&:chomp)
143
-
144
- omitfile = "OMIT.txt"
145
- omitted = File.readlines(omitfile).map(&:chomp)
146
- omitted.reject! {|line| line.start_with?("#") }
147
- omit_names = omitted.map {|line| line.split.first }
148
- STDERR.puts
149
- STDERR.puts " >>> Warning: Omitting #{omitted.size} snapshot tests:\n "
150
- indented = " "*7
151
- omitted.each do |line|
152
- STDERR.print indented
153
- name, info = line.split(" ", 2)
154
- STDERR.printf "%-20s %s\n", name, info
148
+ if args.empty?
149
+ selected = File.readlines("subset.txt").map(&:chomp)
150
+ omitfile = "OMIT.txt"
151
+ omitted = File.readlines(omitfile).map(&:chomp)
152
+ omitted.reject! {|line| line.start_with?("#") }
153
+ omit_names = omitted.map {|line| line.split.first }
154
+ STDERR.puts
155
+ STDERR.puts " >>> Warning: Omitting #{omitted.size} snapshot tests:\n "
156
+ indented = " "*7
157
+ omitted.each do |line|
158
+ STDERR.print indented
159
+ name, info = line.split(" ", 2)
160
+ STDERR.printf "%-20s %s\n", name, info
161
+ end
162
+ STDERR.puts
163
+ wanted = selected.empty? ? TestDirs : selected
164
+ Subset = wanted - omit_names
165
+ else
166
+ Subset = args
155
167
  end
156
- STDERR.puts
157
-
158
- wanted = selected.empty? ? TestDirs : selected
159
168
 
160
- Subset = wanted - omit_names
161
169
 
162
170
  Subset.each do |tdir|
163
171
  define_method("test_#{tdir}") do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: livetext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.15
4
+ version: 0.9.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hal Fulton
@@ -24,6 +24,8 @@ files:
24
24
  - lib/errors.rb
25
25
  - lib/formatline.rb
26
26
  - lib/functions.rb
27
+ - lib/handler.rb
28
+ - lib/handler/icanhaz.rb
27
29
  - lib/helpers.rb
28
30
  - lib/html.rb
29
31
  - lib/livetext.rb
@@ -71,18 +73,12 @@ files:
71
73
  - test/snapshots/def_method/expected-error.txt
72
74
  - test/snapshots/def_method/expected-output.txt
73
75
  - test/snapshots/def_method/source.lt3
74
- - test/snapshots/error_inc_line_num/actual-error.txt
75
- - test/snapshots/error_inc_line_num/actual-output.txt
76
76
  - test/snapshots/error_inc_line_num/expected-output.txt
77
77
  - test/snapshots/error_inc_line_num/file2.lt3
78
78
  - test/snapshots/error_inc_line_num/match-error.txt
79
- - test/snapshots/error_inc_line_num/out-sdiff.txt
80
79
  - test/snapshots/error_inc_line_num/source.lt3
81
- - test/snapshots/error_invalid_name/actual-error.txt
82
- - test/snapshots/error_invalid_name/actual-output.txt
83
80
  - test/snapshots/error_invalid_name/expected-output.txt
84
81
  - test/snapshots/error_invalid_name/match-error.txt
85
- - test/snapshots/error_invalid_name/out-sdiff.txt
86
82
  - test/snapshots/error_invalid_name/source.lt3
87
83
  - test/snapshots/error_line_num/expected-output.txt
88
84
  - test/snapshots/error_line_num/match-error.txt
@@ -90,32 +86,20 @@ files:
90
86
  - test/snapshots/error_mismatched_end/expected-output.txt
91
87
  - test/snapshots/error_mismatched_end/match-error.txt
92
88
  - test/snapshots/error_mismatched_end/source.lt3
93
- - test/snapshots/error_missing_end/actual-error.txt
94
- - test/snapshots/error_missing_end/actual-output.txt
95
89
  - test/snapshots/error_missing_end/expected-output.txt
96
90
  - test/snapshots/error_missing_end/match-error.txt
97
- - test/snapshots/error_missing_end/out-sdiff.txt
98
91
  - test/snapshots/error_missing_end/source.lt3
99
92
  - test/snapshots/error_name_not_permitted/expected-output.txt
100
93
  - test/snapshots/error_name_not_permitted/match-error.txt
101
94
  - test/snapshots/error_name_not_permitted/source.lt3
102
- - test/snapshots/error_no_such_copy/actual-error.txt
103
- - test/snapshots/error_no_such_copy/actual-output.txt
104
95
  - test/snapshots/error_no_such_copy/expected-output.txt
105
96
  - test/snapshots/error_no_such_copy/match-error.txt
106
- - test/snapshots/error_no_such_copy/out-sdiff.txt
107
97
  - test/snapshots/error_no_such_copy/source.lt3
108
- - test/snapshots/error_no_such_inc/actual-error.txt
109
- - test/snapshots/error_no_such_inc/actual-output.txt
110
98
  - test/snapshots/error_no_such_inc/expected-output.txt
111
99
  - test/snapshots/error_no_such_inc/match-error.txt
112
- - test/snapshots/error_no_such_inc/out-sdiff.txt
113
100
  - test/snapshots/error_no_such_inc/source.lt3
114
- - test/snapshots/error_no_such_mixin/actual-error.txt
115
- - test/snapshots/error_no_such_mixin/actual-output.txt
116
101
  - test/snapshots/error_no_such_mixin/expected-output.txt
117
102
  - test/snapshots/error_no_such_mixin/match-error.txt
118
- - test/snapshots/error_no_such_mixin/out-sdiff.txt
119
103
  - test/snapshots/error_no_such_mixin/source.lt3
120
104
  - test/snapshots/example_alpha/expected-error.txt
121
105
  - test/snapshots/example_alpha/expected-output.txt
@@ -130,6 +114,14 @@ files:
130
114
  - test/snapshots/hello_world/expected-error.txt
131
115
  - test/snapshots/hello_world/expected-output.txt
132
116
  - test/snapshots/hello_world/source.lt3
117
+ - test/snapshots/icanhaz/expected-output.txt
118
+ - test/snapshots/icanhaz/match-error.txt
119
+ - test/snapshots/icanhaz/simple_import.rb
120
+ - test/snapshots/icanhaz/source.lt3
121
+ - test/snapshots/icanhaz2/expected-error.txt
122
+ - test/snapshots/icanhaz2/expected-output.txt
123
+ - test/snapshots/icanhaz2/simple_canhaz.rb
124
+ - test/snapshots/icanhaz2/source.lt3
133
125
  - test/snapshots/more_complex_vars/expected-error.txt
134
126
  - test/snapshots/more_complex_vars/expected-output.txt
135
127
  - test/snapshots/more_complex_vars/source.lt3
@@ -147,12 +139,8 @@ files:
147
139
  - test/snapshots/simple_copy/expected-output.txt
148
140
  - test/snapshots/simple_copy/simplefile.inc
149
141
  - test/snapshots/simple_copy/source.lt3
150
- - test/snapshots/simple_import/actual-error.txt
151
- - test/snapshots/simple_import/actual-output.txt
152
- - test/snapshots/simple_import/err-sdiff.txt
153
142
  - test/snapshots/simple_import/expected-error.txt
154
143
  - test/snapshots/simple_import/expected-output.txt
155
- - test/snapshots/simple_import/out-sdiff.txt
156
144
  - test/snapshots/simple_import/simple_import.rb
157
145
  - test/snapshots/simple_import/source.lt3
158
146
  - test/snapshots/simple_include/expected-error.txt
@@ -1,14 +0,0 @@
1
- /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:64:in `handle_dotcmd': Name 'foobar' is unknown (RuntimeError)
2
- from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:39:in `process_line'
3
- from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:27:in `block in process_file'
4
- from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:24:in `loop'
5
- from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:24:in `process_file'
6
- from /Users/Hal/Dropbox/topx/git/livetext/lib/standard.rb:210:in `dot_include'
7
- from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:61:in `handle_dotcmd'
8
- from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:39:in `process_line'
9
- from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:27:in `block in process_file'
10
- from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:24:in `loop'
11
- from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:24:in `process_file'
12
- from ../../../bin/livetext:88:in `block in <main>'
13
- from ../../../bin/livetext:57:in `loop'
14
- from ../../../bin/livetext:57:in `<main>'
@@ -1,7 +0,0 @@
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
@@ -1,14 +0,0 @@
1
- ACTUAL | EXPECTED
2
- This is my This is my
3
- source file source file
4
- which includes file2 here: which includes file2 here:
5
- This is file2 This is file2
6
- which has an error which has an error
7
- about an unknown command about an unknown command
8
- in line 5 in line 5
9
- > <p>
10
- >
11
- > And this is file2 line 7.
12
- > And here we are
13
- > back in the
14
- > original file.
@@ -1,10 +0,0 @@
1
- /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:83: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:61:in `handle_dotcmd'
4
- from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:39:in `process_line'
5
- from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:27:in `block in process_file'
6
- from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:24:in `loop'
7
- from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:24:in `process_file'
8
- from ../../../bin/livetext:88:in `block in <main>'
9
- from ../../../bin/livetext:57:in `loop'
10
- from ../../../bin/livetext:57:in `<main>'
@@ -1,6 +0,0 @@
1
- ACTUAL | EXPECTED
2
- > This file has
3
- > a defined method
4
- > that is invalid:
5
- > <p>
6
- >
@@ -1,10 +0,0 @@
1
- /Users/Hal/Dropbox/topx/git/livetext/lib/userapi.rb:89: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:61:in `handle_dotcmd'
4
- from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:39:in `process_line'
5
- from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:27:in `block in process_file'
6
- from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:24:in `loop'
7
- from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:24:in `process_file'
8
- from ../../../bin/livetext:88:in `block in <main>'
9
- from ../../../bin/livetext:57:in `loop'
10
- from ../../../bin/livetext:57:in `<main>'
File without changes
@@ -1,6 +0,0 @@
1
- ACTUAL | EXPECTED
2
- > Blah
3
- > blah
4
- > <p>
5
- >
6
- >
@@ -1,10 +0,0 @@
1
- /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:87:in `check_file_exists': Error: file 'nosuchfile.txt' not found (FileNotFound)
2
- from /Users/Hal/Dropbox/topx/git/livetext/lib/standard.rb:248:in `copy'
3
- from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:61:in `handle_dotcmd'
4
- from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:39:in `process_line'
5
- from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:27:in `block in process_file'
6
- from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:24:in `loop'
7
- from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:24:in `process_file'
8
- from ../../../bin/livetext:88:in `block in <main>'
9
- from ../../../bin/livetext:57:in `loop'
10
- from ../../../bin/livetext:57:in `<main>'
File without changes
@@ -1,5 +0,0 @@
1
- ACTUAL | EXPECTED
2
- > Make sure a
3
- > nonexistent file with .copy
4
- > gives an error.
5
- > <p>
@@ -1,10 +0,0 @@
1
- /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:87: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:61:in `handle_dotcmd'
4
- from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:39:in `process_line'
5
- from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:27:in `block in process_file'
6
- from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:24:in `loop'
7
- from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:24:in `process_file'
8
- from ../../../bin/livetext:88:in `block in <main>'
9
- from ../../../bin/livetext:57:in `loop'
10
- from ../../../bin/livetext:57:in `<main>'
File without changes
@@ -1,6 +0,0 @@
1
- ACTUAL | EXPECTED
2
- > Make sure
3
- > a nonexistent include
4
- > will give an error.
5
- > <p>
6
- >
@@ -1,37 +0,0 @@
1
- /Users/Hal/Dropbox/topx/git/livetext/lib/parser/mixin.rb:48:in `find_file': No such mixin 'nosuchthing' (RuntimeError)
2
- from /Users/Hal/Dropbox/topx/git/livetext/lib/parser/mixin.rb:49:in `block in find_file'
3
- from /Users/Hal/Dropbox/topx/git/livetext/lib/parser/mixin.rb:49:in `chdir'
4
- from /Users/Hal/Dropbox/topx/git/livetext/lib/parser/mixin.rb:49:in `find_file'
5
- from /Users/Hal/Dropbox/topx/git/livetext/lib/parser/mixin.rb:49:in `block in find_file'
6
- from /Users/Hal/Dropbox/topx/git/livetext/lib/parser/mixin.rb:49:in `chdir'
7
- from /Users/Hal/Dropbox/topx/git/livetext/lib/parser/mixin.rb:49:in `find_file'
8
- from /Users/Hal/Dropbox/topx/git/livetext/lib/parser/mixin.rb:49:in `block in find_file'
9
- from /Users/Hal/Dropbox/topx/git/livetext/lib/parser/mixin.rb:49:in `chdir'
10
- from /Users/Hal/Dropbox/topx/git/livetext/lib/parser/mixin.rb:49:in `find_file'
11
- from /Users/Hal/Dropbox/topx/git/livetext/lib/parser/mixin.rb:49:in `block in find_file'
12
- from /Users/Hal/Dropbox/topx/git/livetext/lib/parser/mixin.rb:49:in `chdir'
13
- from /Users/Hal/Dropbox/topx/git/livetext/lib/parser/mixin.rb:49:in `find_file'
14
- from /Users/Hal/Dropbox/topx/git/livetext/lib/parser/mixin.rb:49:in `block in find_file'
15
- from /Users/Hal/Dropbox/topx/git/livetext/lib/parser/mixin.rb:49:in `chdir'
16
- from /Users/Hal/Dropbox/topx/git/livetext/lib/parser/mixin.rb:49:in `find_file'
17
- from /Users/Hal/Dropbox/topx/git/livetext/lib/parser/mixin.rb:49:in `block in find_file'
18
- from /Users/Hal/Dropbox/topx/git/livetext/lib/parser/mixin.rb:49:in `chdir'
19
- from /Users/Hal/Dropbox/topx/git/livetext/lib/parser/mixin.rb:49:in `find_file'
20
- from /Users/Hal/Dropbox/topx/git/livetext/lib/parser/mixin.rb:49:in `block in find_file'
21
- from /Users/Hal/Dropbox/topx/git/livetext/lib/parser/mixin.rb:49:in `chdir'
22
- from /Users/Hal/Dropbox/topx/git/livetext/lib/parser/mixin.rb:49:in `find_file'
23
- from /Users/Hal/Dropbox/topx/git/livetext/lib/parser/mixin.rb:49:in `block in find_file'
24
- from /Users/Hal/Dropbox/topx/git/livetext/lib/parser/mixin.rb:49:in `chdir'
25
- from /Users/Hal/Dropbox/topx/git/livetext/lib/parser/mixin.rb:49:in `find_file'
26
- from /Users/Hal/Dropbox/topx/git/livetext/lib/parser/mixin.rb:16:in `initialize'
27
- from /Users/Hal/Dropbox/topx/git/livetext/lib/parser/mixin.rb:20:in `new'
28
- from /Users/Hal/Dropbox/topx/git/livetext/lib/parser/mixin.rb:20:in `get_module'
29
- from /Users/Hal/Dropbox/topx/git/livetext/lib/standard.rb:230:in `mixin'
30
- from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:61:in `handle_dotcmd'
31
- from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:39:in `process_line'
32
- from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:27:in `block in process_file'
33
- from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:24:in `loop'
34
- from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:24:in `process_file'
35
- from ../../../bin/livetext:88:in `block in <main>'
36
- from ../../../bin/livetext:57:in `loop'
37
- from ../../../bin/livetext:57:in `<main>'
File without changes
@@ -1,6 +0,0 @@
1
- ACTUAL | EXPECTED
2
- > Test that
3
- > we give an error
4
- > when a mixin does not
5
- > exist:
6
- > <p>
@@ -1,8 +0,0 @@
1
- /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:64:in `handle_dotcmd': Name 'hello_world' is unknown (RuntimeError)
2
- from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:39:in `process_line'
3
- from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:27:in `block in process_file'
4
- from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:24:in `loop'
5
- from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:24:in `process_file'
6
- from ../../../bin/livetext:88:in `block in <main>'
7
- from ../../../bin/livetext:57:in `loop'
8
- from ../../../bin/livetext:57:in `<main>'
@@ -1,3 +0,0 @@
1
- Here I am
2
- testing a simple import
3
- Now call a method:
@@ -1,9 +0,0 @@
1
- ACTUAL | EXPECTED
2
- /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:64:in ` <
3
- from /Users/Hal/Dropbox/topx/git/livetext/lib/helpe <
4
- from /Users/Hal/Dropbox/topx/git/livetext/lib/helpe <
5
- from /Users/Hal/Dropbox/topx/git/livetext/lib/helpe <
6
- from /Users/Hal/Dropbox/topx/git/livetext/lib/helpe <
7
- from ../../../bin/livetext:88:in `block in <main>' <
8
- from ../../../bin/livetext:57:in `loop' <
9
- from ../../../bin/livetext:57:in `<main>' <
@@ -1,9 +0,0 @@
1
- ACTUAL | EXPECTED
2
- [:ARGF, :ARGV, :ArgumentError, :Array, :BadQuotedString, :B <
3
- Here I am Here I am
4
- testing a simple import testing a simple import
5
- <p> <p>
6
-
7
- Now call a method: Now call a method:
8
- > Hello, world.
9
- That's all. That's all.