constree 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d6c196c688b12a0c6b2c8c68ad8eed30f84a7bbf8f0a2fcdd80e0d4f558f1af4
4
- data.tar.gz: 7756e2e7b876586067c207a63e26f0a902c4a794469b1a1e58fb79940c389d7c
3
+ metadata.gz: 91bc646f95fa84573ef59c5c7ae36cba758a46481dcc1a33c42aecc190fd35f8
4
+ data.tar.gz: fc31388a1493bade700bba3144ab67cea1a484e89812b8cc8dfa0a63b7c5da01
5
5
  SHA512:
6
- metadata.gz: 7028fa86fe6b790f631501357712517742e6228506aed26fc255c193f8933fd8457961b2609ff9d224634c7212aa9db2d6ece2b89b15cf9286c829c720192051
7
- data.tar.gz: 9619da2f82b609b5c16cb1b7f36896b2daf5f9ac20afb49f6a30bab32d3e59648be5f41ad2be005d2264939075305b42f881160344c5bde44b73457f1cb88656
6
+ metadata.gz: 2859b1ada05e4933b59b597f60f6c05283720544fe101b7aed7d9781dd0ee6f3bc891b217333706ae384b83e67a300e883529b242ce3d6c988f6b693023e2492
7
+ data.tar.gz: 2bcae5e18331f0a84084d5e90822e32c82a7f110a83a2152050e3d77a14da0d04843c6ba052dab6cc2b976f3d964cab540ec52605019f2bd75303bc6fd5cf609
data/lib/constree/node.rb CHANGED
@@ -40,9 +40,7 @@ module Constree
40
40
  end
41
41
 
42
42
  def type
43
- return "→ #{ref.full_name}" if ref
44
- return "(#{constant.class.to_s})" unless Class === constant
45
- "< " + constant.ancestors[1..].map(&:to_s).join(" < ")
43
+ ref ? "→ #{ref.full_name}" : "(#{constant.class.to_s})"
46
44
  end
47
45
 
48
46
  def not_yet? seen
@@ -56,4 +54,12 @@ module Constree
56
54
  end
57
55
 
58
56
  end
57
+
58
+ class NodeWithAncestors < Node
59
+ def type
60
+ return "→ #{ref.full_name}" if ref
61
+ return "(#{constant.class.to_s})" unless Class === constant
62
+ "< " + constant.ancestors[1..].map(&:to_s).join(" < ")
63
+ end
64
+ end
59
65
  end
@@ -1,3 +1,3 @@
1
1
  module Constree
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: constree
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - ken