render_me_pretty 0.6.0 → 0.7.0
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/render_me_pretty/erb/base_handler.rb +6 -1
- data/lib/render_me_pretty/erb/main_error_handler.rb +0 -5
- data/lib/render_me_pretty/erb/syntax_error_handler.rb +0 -5
- data/lib/render_me_pretty/erb.rb +5 -1
- data/lib/render_me_pretty/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a5117eedab1ddd21a238ea2c8ad2d91d13d15858c9ad1edf4a2357c189d3720
|
4
|
+
data.tar.gz: d6383e807149c95e2e41e3ff4407bf8b14b21ad11e9241caac39a98f3578d85e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9bbec4ac5edfea32c599ce69683ce959dbe8921ad726735d41358b1fbc6099f17ff43542e359f274ae0d0a3b1dbc917fcef044f75a661f290359f4f7f9c5c7a5
|
7
|
+
data.tar.gz: 6f06d72786fd72e622e512ad4186543c6856e01057cba702e1abccd36421cf079e5845a19214a922c59794526972826d270195bdd6796efdde91ec6e1fb6a832
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,10 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
This project *tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
|
5
5
|
|
6
|
+
## [0.7.0]
|
7
|
+
- allow normal exit
|
8
|
+
- show full error message for syntax error
|
9
|
+
|
6
10
|
## [0.6.0]
|
7
11
|
- Handle SyntaxError errors correctly
|
8
12
|
- refactor into MainErrorHandler and SyntaxError classes
|
@@ -5,6 +5,11 @@ class RenderMePretty::Erb
|
|
5
5
|
@exception = exception
|
6
6
|
end
|
7
7
|
|
8
|
+
def handle
|
9
|
+
line_number = find_line_number
|
10
|
+
pretty_trace(line_number, full_message=true) # returns StringIO
|
11
|
+
end
|
12
|
+
|
8
13
|
def pretty_trace(error_line_number, full_message=true)
|
9
14
|
io = StringIO.new
|
10
15
|
|
@@ -12,7 +17,7 @@ class RenderMePretty::Erb
|
|
12
17
|
io.puts "#{@exception.class}#{message}".colorize(:red)
|
13
18
|
|
14
19
|
pretty_path = @path.sub(/^\.\//, '')
|
15
|
-
io.puts "Error evaluating ERB template
|
20
|
+
io.puts "Error evaluating ERB template around line #{error_line_number.to_s.colorize(:red)} of: #{pretty_path}:"
|
16
21
|
|
17
22
|
context = 5 # lines of context
|
18
23
|
top, bottom = [error_line_number-context-1, 0].max, error_line_number+context-1
|
@@ -1,10 +1,5 @@
|
|
1
1
|
class RenderMePretty::Erb
|
2
2
|
class MainErrorHandler < BaseHandler
|
3
|
-
def handle
|
4
|
-
line_number = find_line_number
|
5
|
-
pretty_trace(line_number, full_message=true) # returns StringIO
|
6
|
-
end
|
7
|
-
|
8
3
|
# For general Tilt errors first line of the backtrace that contains the path
|
9
4
|
# of the file we're rendeirng and has the line number. Example:
|
10
5
|
#
|
@@ -1,10 +1,5 @@
|
|
1
1
|
class RenderMePretty::Erb
|
2
2
|
class SyntaxErrorHandler < BaseHandler
|
3
|
-
def handle
|
4
|
-
line_number = find_line_number
|
5
|
-
pretty_trace(line_number, full_message=false) # returns StringIO
|
6
|
-
end
|
7
|
-
|
8
3
|
# spec/fixtures/invalid/syntax.erb:2: syntax error, unexpected ';', expecting ']'
|
9
4
|
# ); if ENV['TEST' ; _erbout.<<(-" missing ending...
|
10
5
|
# ^
|
data/lib/render_me_pretty/erb.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: render_me_pretty
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tung Nguyen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-02-
|
11
|
+
date: 2018-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|