helium-console 0.1.8 → 0.1.9

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7552b990faace56da88a1832368189a46120a6f223312c753d5242a3f7a3f027
4
- data.tar.gz: c394e81ab462b5459067a8185ba30c2c5f0f41d42100c0c920b4fcd9ed2ae7f8
3
+ metadata.gz: 9bae4abb107ba24a4d9e30434e48cbfb8ff57b75b1bc5f636c2208a4af066b20
4
+ data.tar.gz: 910786c0c312352c2a202bc82646c38135fa8e1890318ba4f91e4fc4f9955467
5
5
  SHA512:
6
- metadata.gz: 96edfd58fb6fe13cc4c00e614093f40ae31b2caad6b5986cefa95fbca9834e9ae583d7cb830cdeceb7b579079ed5105111b9c3fbb4fd8223f7bfc60d9e9ae301
7
- data.tar.gz: c27ef0e881621f47024b487ff158a5aeaa82eec3f9db468f33abec79cacb4c597ce3c91928802d8f6c2d7275f05d7f007682ac39df400fa83f3a23014f1b7eff
6
+ metadata.gz: 7d0cf4390043396e2dcf8f550b5ac4ef827dca0445abe9c740290a97d9c09c2986c1ab8b283870e2e9bf2821590c828033d86a6bd3247611a633f26f8d333009
7
+ data.tar.gz: 26a26250b08bdf800e852887047f8c8848886bee69afa105bdd456688af6ee570a22fd17889624c5113d34b081f98bb1f5790ebb8be0733f62d841a089ff0730
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- helium-console (0.1.8)
4
+ helium-console (0.1.9)
5
5
  colorize
6
6
  pry
7
7
 
@@ -4,14 +4,20 @@ module Helium
4
4
  class Console
5
5
  define_formatter_for Module do
6
6
  def call
7
- light_yellow(object.name || anonymus_text)
7
+ light_yellow(object.name || anonymous_text)
8
8
  end
9
9
 
10
10
  private
11
11
 
12
- def anonymus_text
13
- closest = object.ancestors.find(&:name).name
14
- "(anonymous #{closest})"
12
+ def anonymous_text
13
+ closest = (object.ancestors.grep(Class) - [Object, BasicObject]).find(&:name)&.name
14
+
15
+ signature = if closest
16
+ "subclass of #{closest}"
17
+ else
18
+ object.class.name.downcase
19
+ end
20
+ "(anonymous #{signature})"
15
21
  end
16
22
  end
17
23
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Helium
4
4
  class Console
5
- VERSION = '0.1.8'
5
+ VERSION = '0.1.9'
6
6
  end
7
7
  end
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.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stanislaw Klajn