render_me_pretty 0.8.1 → 0.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +21 -21
- data/lib/render_me_pretty/erb/base_handler.rb +4 -4
- data/lib/render_me_pretty/erb.rb +3 -3
- data/lib/render_me_pretty/version.rb +1 -1
- data/lib/render_me_pretty.rb +1 -1
- data/render_me_pretty.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37afb0227c2842468c859b1a702b109e017eb0b8514bb64d39b93cd843d62775
|
4
|
+
data.tar.gz: 68bec95258f7211f9449f27c619879d235d13b612fb99b8522ef5f72b0ff3ae4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26384f2792d24e9b5a8b4267c9afd064b772154ab60e3d1f49a194755e16ee55da3e2ae03c82d2149897fac674e392173240d9b5d01b9529aaa86f1234578daa
|
7
|
+
data.tar.gz: af714d14c2f4ee3927e579599f05289c906ecd7d8c586a989194cb238142eb4fb4be2d30e5169943acad63fe074e941c49a607cc76490415bedbd91f57af8030
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,9 @@
|
|
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.8.2]
|
7
|
+
- use rainbow gem for terminal color
|
8
|
+
|
6
9
|
## [0.8.1]
|
7
10
|
- tilt default_encoding utf-8
|
8
11
|
- update readme with layout support
|
data/Gemfile.lock
CHANGED
@@ -1,41 +1,41 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
render_me_pretty (0.8.
|
4
|
+
render_me_pretty (0.8.2)
|
5
5
|
activesupport
|
6
|
-
|
6
|
+
rainbow
|
7
7
|
tilt
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
activesupport (5.
|
12
|
+
activesupport (5.2.2)
|
13
13
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
14
|
-
i18n (
|
14
|
+
i18n (>= 0.7, < 2)
|
15
15
|
minitest (~> 5.1)
|
16
16
|
tzinfo (~> 1.1)
|
17
|
-
|
18
|
-
concurrent-ruby (1.0.5)
|
17
|
+
concurrent-ruby (1.1.4)
|
19
18
|
diff-lcs (1.3)
|
20
|
-
i18n (
|
19
|
+
i18n (1.5.3)
|
21
20
|
concurrent-ruby (~> 1.0)
|
22
21
|
minitest (5.11.3)
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
rspec-
|
27
|
-
rspec-
|
28
|
-
|
29
|
-
|
30
|
-
|
22
|
+
rainbow (3.0.0)
|
23
|
+
rake (12.3.2)
|
24
|
+
rspec (3.8.0)
|
25
|
+
rspec-core (~> 3.8.0)
|
26
|
+
rspec-expectations (~> 3.8.0)
|
27
|
+
rspec-mocks (~> 3.8.0)
|
28
|
+
rspec-core (3.8.0)
|
29
|
+
rspec-support (~> 3.8.0)
|
30
|
+
rspec-expectations (3.8.2)
|
31
31
|
diff-lcs (>= 1.2.0, < 2.0)
|
32
|
-
rspec-support (~> 3.
|
33
|
-
rspec-mocks (3.
|
32
|
+
rspec-support (~> 3.8.0)
|
33
|
+
rspec-mocks (3.8.0)
|
34
34
|
diff-lcs (>= 1.2.0, < 2.0)
|
35
|
-
rspec-support (~> 3.
|
36
|
-
rspec-support (3.
|
35
|
+
rspec-support (~> 3.8.0)
|
36
|
+
rspec-support (3.8.0)
|
37
37
|
thread_safe (0.3.6)
|
38
|
-
tilt (2.0.
|
38
|
+
tilt (2.0.9)
|
39
39
|
tzinfo (1.2.5)
|
40
40
|
thread_safe (~> 0.1)
|
41
41
|
|
@@ -49,4 +49,4 @@ DEPENDENCIES
|
|
49
49
|
rspec
|
50
50
|
|
51
51
|
BUNDLED WITH
|
52
|
-
1.
|
52
|
+
1.17.2
|
@@ -15,10 +15,10 @@ class RenderMePretty::Erb
|
|
15
15
|
io = StringIO.new
|
16
16
|
|
17
17
|
message = full_message ? ": #{@exception.message}" : ""
|
18
|
-
io.puts "#{@exception.class}#{message}".
|
18
|
+
io.puts "#{@exception.class}#{message}".color(:red)
|
19
19
|
|
20
20
|
pretty_path = template_path_with_error.sub(/^\.\//, '')
|
21
|
-
io.puts "Error evaluating ERB template around line #{error_line_number.to_s.
|
21
|
+
io.puts "Error evaluating ERB template around line #{error_line_number.to_s.color(:red)} of: #{pretty_path}:"
|
22
22
|
|
23
23
|
context = 5 # lines of context
|
24
24
|
top, bottom = [error_line_number-context-1, 0].max, error_line_number+context-1
|
@@ -28,7 +28,7 @@ class RenderMePretty::Erb
|
|
28
28
|
lines[top..bottom].each_with_index do |line_content, index|
|
29
29
|
current_line_number = top+index+1
|
30
30
|
if current_line_number == error_line_number
|
31
|
-
io.printf("%#{spacing}d %s\n".
|
31
|
+
io.printf("%#{spacing}d %s\n".color(:red), current_line_number, line_content)
|
32
32
|
else
|
33
33
|
io.printf("%#{spacing}d %s\n", current_line_number, line_content)
|
34
34
|
end
|
@@ -73,7 +73,7 @@ class RenderMePretty::Erb
|
|
73
73
|
# render_me_pretty lines
|
74
74
|
lines = lines[0..7] # keep 8 lines
|
75
75
|
end
|
76
|
-
lines[0] = lines[0].
|
76
|
+
lines[0] = lines[0].color(:red)
|
77
77
|
|
78
78
|
# header
|
79
79
|
lines.unshift "\nOriginal backtrace#{full ? '' : ' (last 8 lines)'}:"
|
data/lib/render_me_pretty/erb.rb
CHANGED
@@ -109,8 +109,8 @@ module RenderMePretty
|
|
109
109
|
# Refer to specs and uncomment puts out to see the different types of errors.
|
110
110
|
def handle_exception(e)
|
111
111
|
# puts "*" * 30
|
112
|
-
# puts e.class.to_s.
|
113
|
-
# puts e.message.
|
112
|
+
# puts e.class.to_s.color(:cyan)
|
113
|
+
# puts e.message.color(:cyan)
|
114
114
|
# puts e.backtrace
|
115
115
|
# puts "*" * 30
|
116
116
|
handler = e.is_a?(SyntaxError) ?
|
@@ -160,7 +160,7 @@ module RenderMePretty
|
|
160
160
|
# render_me_pretty lines
|
161
161
|
lines = lines[0..7] # keep 8 lines
|
162
162
|
end
|
163
|
-
lines[0] = lines[0].
|
163
|
+
lines[0] = lines[0].color(:red)
|
164
164
|
|
165
165
|
# header
|
166
166
|
lines.unshift "\nOriginal backtrace#{full ? '' : ' (last 8 lines)'}:"
|
data/lib/render_me_pretty.rb
CHANGED
data/render_me_pretty.gemspec
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.8.
|
4
|
+
version: 0.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tung Nguyen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -25,7 +25,7 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: rainbow
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
@@ -137,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
137
137
|
version: '0'
|
138
138
|
requirements: []
|
139
139
|
rubyforge_project:
|
140
|
-
rubygems_version: 2.7.
|
140
|
+
rubygems_version: 2.7.6
|
141
141
|
signing_key:
|
142
142
|
specification_version: 4
|
143
143
|
summary: Render ERB template and provide more useful message pointing out the line
|