kamaze-project 1.0.0 → 1.0.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/lib/kamaze/project/debug.rb +14 -6
- data/lib/kamaze/project/version.yml +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57feaf5267144909889e24c879dc4766670f90a18929897ed0e2e91d7edc00bd
|
4
|
+
data.tar.gz: dc08edac7257e908f078d635bfc13daeae6d9cbdd4e50d50a7dbac41df0803e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ee3f5109d24d58de5e2d70ceb19553ccd7b4cf502ae95239e044f3fdd5652d35636d0d00d3aabe0d92e66d6245496c22bb8108f5a61e9940cb3403354feafda
|
7
|
+
data.tar.gz: d46474c38cc272c3d05296e58c59d24cb85055e7f8d506f70c84a6ec580fbc6d2796e981a10973e523d1319df6889f995b37a13c02ea265e03e2647011f3f7c1
|
data/lib/kamaze/project/debug.rb
CHANGED
@@ -7,8 +7,6 @@
|
|
7
7
|
# There is NO WARRANTY, to the extent permitted by law.
|
8
8
|
|
9
9
|
require_relative '../project'
|
10
|
-
require 'tty/screen'
|
11
|
-
require 'active_support/inflector'
|
12
10
|
|
13
11
|
# Provides colored pretty-printer automagically
|
14
12
|
#
|
@@ -16,7 +14,6 @@ require 'active_support/inflector'
|
|
16
14
|
# @see https://github.com/pry/pry
|
17
15
|
class Kamaze::Project::Debug
|
18
16
|
def initialize
|
19
|
-
@inflector ||= ActiveSupport::Inflector
|
20
17
|
@printers = available_printers
|
21
18
|
end
|
22
19
|
|
@@ -50,7 +47,7 @@ class Kamaze::Project::Debug
|
|
50
47
|
# @param [Fixnum] width
|
51
48
|
# @see http://ruby-doc.org/stdlib-2.2.0/libdoc/pp/rdoc/PP.html
|
52
49
|
def dump(obj, out = $stdout, width = nil)
|
53
|
-
width ||=
|
50
|
+
width ||= screen_width || 79
|
54
51
|
|
55
52
|
printer_for(out).pp(obj, out, width)
|
56
53
|
end
|
@@ -90,8 +87,19 @@ class Kamaze::Project::Debug
|
|
90
87
|
# @return [Boolean|nil]
|
91
88
|
attr_reader :warned
|
92
89
|
|
93
|
-
# @return [
|
94
|
-
|
90
|
+
# @return [Dry::Inflector]
|
91
|
+
def inflector
|
92
|
+
require 'dry/inflector'
|
93
|
+
|
94
|
+
Dry::Inflector.new
|
95
|
+
end
|
96
|
+
|
97
|
+
# @return [Integer]
|
98
|
+
def screen_width
|
99
|
+
require 'tty/screen'
|
100
|
+
|
101
|
+
TTY::Screen.width
|
102
|
+
end
|
95
103
|
|
96
104
|
# Load printers requirements (on demand)
|
97
105
|
#
|