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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ae96e7920b059541c64822c1cf976b96882e6890839772f99fe5c1b09d5ae9e8
4
- data.tar.gz: c26bcb2e78ac5d7e6b010b7a90ea977ec2dd3b4f37932402f2b817a8aa29951e
3
+ metadata.gz: 37afb0227c2842468c859b1a702b109e017eb0b8514bb64d39b93cd843d62775
4
+ data.tar.gz: 68bec95258f7211f9449f27c619879d235d13b612fb99b8522ef5f72b0ff3ae4
5
5
  SHA512:
6
- metadata.gz: 82a211cd8552c651180096500f7c441a50c3a094c64c7c31afeee5bb781553c62b4e748e79a8a32804c3cbdb004edec7a73742fcce2dae8d53d571fcbedd57e6
7
- data.tar.gz: a714f49d8b5221816cb75629a4dec47b3463a413a47ab1085514a16f94271544275efdfa946a2059a3799cfba6875b0eb499bd60857752f878650419f11b3670
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.0)
4
+ render_me_pretty (0.8.2)
5
5
  activesupport
6
- colorize
6
+ rainbow
7
7
  tilt
8
8
 
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- activesupport (5.1.5)
12
+ activesupport (5.2.2)
13
13
  concurrent-ruby (~> 1.0, >= 1.0.2)
14
- i18n (~> 0.7)
14
+ i18n (>= 0.7, < 2)
15
15
  minitest (~> 5.1)
16
16
  tzinfo (~> 1.1)
17
- colorize (0.8.1)
18
- concurrent-ruby (1.0.5)
17
+ concurrent-ruby (1.1.4)
19
18
  diff-lcs (1.3)
20
- i18n (0.9.5)
19
+ i18n (1.5.3)
21
20
  concurrent-ruby (~> 1.0)
22
21
  minitest (5.11.3)
23
- rake (12.3.1)
24
- rspec (3.7.0)
25
- rspec-core (~> 3.7.0)
26
- rspec-expectations (~> 3.7.0)
27
- rspec-mocks (~> 3.7.0)
28
- rspec-core (3.7.1)
29
- rspec-support (~> 3.7.0)
30
- rspec-expectations (3.7.0)
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.7.0)
33
- rspec-mocks (3.7.0)
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.7.0)
36
- rspec-support (3.7.1)
35
+ rspec-support (~> 3.8.0)
36
+ rspec-support (3.8.0)
37
37
  thread_safe (0.3.6)
38
- tilt (2.0.8)
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.16.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}".colorize(:red)
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.colorize(:red)} of: #{pretty_path}:"
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".colorize(:red), current_line_number, line_content)
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].colorize(:red)
76
+ lines[0] = lines[0].color(:red)
77
77
 
78
78
  # header
79
79
  lines.unshift "\nOriginal backtrace#{full ? '' : ' (last 8 lines)'}:"
@@ -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.colorize(:cyan)
113
- # puts e.message.colorize(:cyan)
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].colorize(:red)
163
+ lines[0] = lines[0].color(:red)
164
164
 
165
165
  # header
166
166
  lines.unshift "\nOriginal backtrace#{full ? '' : ' (last 8 lines)'}:"
@@ -1,3 +1,3 @@
1
1
  module RenderMePretty
2
- VERSION = "0.8.1"
2
+ VERSION = "0.8.2"
3
3
  end
@@ -1,6 +1,6 @@
1
1
  require "render_me_pretty/version"
2
2
  require "active_support/core_ext/string"
3
- require "colorize"
3
+ require 'rainbow/ext/string'
4
4
 
5
5
  module RenderMePretty
6
6
  autoload :Erb, 'render_me_pretty/erb'
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_dependency "activesupport"
22
- spec.add_dependency "colorize"
22
+ spec.add_dependency "rainbow"
23
23
  spec.add_dependency "tilt"
24
24
 
25
25
  spec.add_development_dependency "bundler"
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.1
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: 2018-03-25 00:00:00.000000000 Z
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: colorize
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.3
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