helium-console 0.1.4 → 0.1.5
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/Gemfile.lock +1 -1
- data/lib/helium/console/registry/module.rb +16 -0
- data/lib/helium/console/registry/object.rb +15 -7
- data/lib/helium/console/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6cc078f13cb540c2c2c9d14814cfe31da3b50ebdb59051918db1ac3d3fc63b51
|
4
|
+
data.tar.gz: c9fd23846bad166de9fd715c4166e60a162df08a6f820277c0815f539dac6306
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9259047186f54a53e8378d8fc0c94c35a895334acfb97950ba22511453aa4a0b855866c94d22b323c2249847cf112bcec126ef63ec0c71764fc3dce6c8038213
|
7
|
+
data.tar.gz: 475285e8aae66982bfc86cf3250fbb6e97f88eddf7e7c14228b7158fd8694981c227cc8185e9794869d1c0be27ae6a7f97b789e15269c61a575c850a64ad1263
|
data/Gemfile.lock
CHANGED
@@ -0,0 +1,16 @@
|
|
1
|
+
module Helium
|
2
|
+
class Console
|
3
|
+
define_formatter_for Module do
|
4
|
+
def call
|
5
|
+
light_yellow(object.name || anonymus_text)
|
6
|
+
end
|
7
|
+
|
8
|
+
private
|
9
|
+
|
10
|
+
def anonymus_text
|
11
|
+
closest = object.ancestors.find(&:name).name
|
12
|
+
"(ananymus #{closest})"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -16,9 +16,9 @@ module Helium
|
|
16
16
|
end
|
17
17
|
|
18
18
|
[
|
19
|
-
|
20
|
-
format(table
|
21
|
-
].join($/)
|
19
|
+
table_header,
|
20
|
+
format(table),
|
21
|
+
].reject(&:empty?).join($/)
|
22
22
|
end
|
23
23
|
|
24
24
|
def format_inline_with_truncation
|
@@ -27,13 +27,12 @@ module Helium
|
|
27
27
|
|
28
28
|
def format_inline_with_no_truncation
|
29
29
|
joined = nil
|
30
|
-
one_complex = false
|
31
30
|
|
32
31
|
object.each do |key, value|
|
33
32
|
return unless simple?(value)
|
34
33
|
|
35
|
-
formatted_key = format(key,
|
36
|
-
formatted_value = format(value,
|
34
|
+
formatted_key = format(key, level: 3, max_with: 15)
|
35
|
+
formatted_value = format(value, level: 3, max_width: 15)
|
37
36
|
formatted = "#{formatted_key} => #{formatted_value}"
|
38
37
|
|
39
38
|
joined = [joined, formatted].compact.join(", ")
|
@@ -44,8 +43,17 @@ module Helium
|
|
44
43
|
["{", joined, "}"].compact.join
|
45
44
|
end
|
46
45
|
|
46
|
+
def table_header
|
47
|
+
type = case object
|
48
|
+
when Class then :class
|
49
|
+
when Module then :module
|
50
|
+
else :instance
|
51
|
+
end
|
52
|
+
"#{light_black('#')} #{light_yellow(type == :instance ? object.class.name : object.name)} #{type}"
|
53
|
+
end
|
54
|
+
|
47
55
|
def force_inline?
|
48
|
-
|
56
|
+
level > 2
|
49
57
|
end
|
50
58
|
|
51
59
|
def all_symbol?
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: helium-console
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stanislaw Klajn
|
@@ -67,6 +67,7 @@ files:
|
|
67
67
|
- lib/helium/console/registry/array.rb
|
68
68
|
- lib/helium/console/registry/booleans.rb
|
69
69
|
- lib/helium/console/registry/hash.rb
|
70
|
+
- lib/helium/console/registry/module.rb
|
70
71
|
- lib/helium/console/registry/nil.rb
|
71
72
|
- lib/helium/console/registry/numeric.rb
|
72
73
|
- lib/helium/console/registry/object.rb
|