super_awesome_print 0.2.0 → 0.2.1
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/README.md +1 -0
- data/lib/super_awesome_print.rb +1 -1
- data/lib/super_awesome_print/configuration.rb +2 -1
- data/lib/super_awesome_print/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f49802099873f8df102416cb70d8ee685cc60a07
|
4
|
+
data.tar.gz: 27a180a209b4c76437af52730c3265a64fd3e5cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3416033acc16e1e1c1347b34cb94f786dda5032a2fbfaf11819b269f7311934683388490b7da3cebc752a36e5047cbb080e5c0e21bf463b34684f1d32304c26
|
7
|
+
data.tar.gz: 8a91e65efee4301ce20710848977c0a7bf1e3090a3f966f99128895ed5ff8e1d86494db9d7a1d255b729febf5e7e1c218abd82772f06fdf050dea95bc29adeac
|
data/README.md
CHANGED
@@ -34,6 +34,7 @@ SuperAwesomePrint.configure do |config|
|
|
34
34
|
config.caller_lines = 3 # defaults to 1
|
35
35
|
config.blank_lines_top = 2 # defaults to 0
|
36
36
|
config.blank_lines_bottom = 2 # defaults to 0
|
37
|
+
config.root_path = Rails.root.to_s # this path will be removed from caller's files path, defaults to Rails.root.to_s
|
37
38
|
end
|
38
39
|
```
|
39
40
|
|
data/lib/super_awesome_print.rb
CHANGED
@@ -20,7 +20,7 @@ module SuperAwesomePrint
|
|
20
20
|
def self.print_caller_lines(caller_array)
|
21
21
|
number_of_lines = config.caller_lines
|
22
22
|
lines = caller_array[0...number_of_lines].map do |line|
|
23
|
-
line.gsub(
|
23
|
+
line.gsub(config.root_path + '/', '')
|
24
24
|
end
|
25
25
|
lines.each { |line| ap line, color: { string: :purpleish } }
|
26
26
|
end
|
@@ -1,9 +1,10 @@
|
|
1
1
|
class Configuration
|
2
|
-
attr_accessor :caller_lines, :blank_lines_top, :blank_lines_bottom
|
2
|
+
attr_accessor :caller_lines, :blank_lines_top, :blank_lines_bottom, :root_path
|
3
3
|
|
4
4
|
def initialize
|
5
5
|
@caller_lines = 1
|
6
6
|
@blank_lines_top = 0
|
7
7
|
@blank_lines_bottom = 0
|
8
|
+
@root_path = defined?(Rails) ? Rails.root.to_s : ''
|
8
9
|
end
|
9
10
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: super_awesome_print
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oleg Antonyan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|