coactive 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/coactive/contexts/inspector.rb +14 -3
- data/lib/coactive/version.rb +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: 81adac1b8a25c283b42061c7cea9d08bc4ee06987fe2de6aba8ccee17a40e12d
|
4
|
+
data.tar.gz: ae0509c320a8e32f10dff9820d8c92adc60dee58797c6ba1d6befd206d923781
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c501671b40e84f6bf4951318db3e77e67eaa5ac7fc2120f03b6038402a9f61d4dd9ae95c4859307902f9dc5bfb0d83f193d04b1bbc8c3a9c7544b56f46c567d4
|
7
|
+
data.tar.gz: 91a4346db771c3b0ddb21c07fcf9892e8580243e80916988159b2b5a11813ea39f50b225dc21bdd74faa2430e38fbf4a1fe6ffb91a2a50d264f6744b261fb50b
|
data/CHANGELOG.md
CHANGED
@@ -7,7 +7,7 @@ module Coactive
|
|
7
7
|
class_attribute :max_num, :max_length, :basic_classes
|
8
8
|
self.max_num = 3
|
9
9
|
self.max_length = 100
|
10
|
-
self.basic_classes = [Module, Symbol, String, Numeric, TrueClass, FalseClass, Regexp]
|
10
|
+
self.basic_classes = [Module, Symbol, String, Numeric, TrueClass, FalseClass, NilClass, Regexp]
|
11
11
|
|
12
12
|
def call(data)
|
13
13
|
if data.is_a?(Array)
|
@@ -36,11 +36,22 @@ module Coactive
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def inspect_basic(data)
|
39
|
-
data.inspect
|
39
|
+
inspected = data.inspect
|
40
|
+
if inspected.length > max_length
|
41
|
+
inspected[0..max_length] + '...'
|
42
|
+
else
|
43
|
+
inspected
|
44
|
+
end
|
40
45
|
end
|
41
46
|
|
42
47
|
def inspect_object(data)
|
43
|
-
|
48
|
+
if data.respond_to?(:id)
|
49
|
+
"#<#{data.class}/#{data.id}>"
|
50
|
+
elsif data.respond_to?(:attributes) && (attributes = data.attributes).is_a?(Hash)
|
51
|
+
"#<#{data.class} #{inspect_hash(attributes)}>"
|
52
|
+
else
|
53
|
+
"#<#{data.class}:#{data.object_id}>"
|
54
|
+
end
|
44
55
|
end
|
45
56
|
end
|
46
57
|
end
|
data/lib/coactive/version.rb
CHANGED