dissociated_introspection 0.4.0 → 0.4.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/.travis.yml +2 -0
- data/CHANGELOG.md +11 -0
- data/lib/dissociated_introspection/ruby_class.rb +4 -3
- data/lib/dissociated_introspection/version.rb +1 -1
- metadata +1 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a85114518e8f37294a6b2e18da38ddf9453e0b7b
|
4
|
+
data.tar.gz: 9674c329f7c23e83f7f9fc2cddd602d3158615e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d363290654c25c50c1449b56386089c3b4c259ccdaadb06fba2235b13ae924eb49d2102f2a2335786927507d45a061fac549bb8ec4440e91fc3ef2b9311c010e
|
7
|
+
data.tar.gz: e43b3bff9385825a81729712aafb4e0baa0c9090b6d89f88dd37ce1838ca7452edffc9c3ae7d00f5946cc4e82227a06220d01643ea006613083cc6636183326e
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,17 @@
|
|
1
1
|
# Changelog
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
|
+
## 0.4.1 - 2015-01-18
|
5
|
+
### Fix
|
6
|
+
- `RubyClass#module_nesting` could return modules that were nested inside of a class.
|
7
|
+
|
8
|
+
## 0.4.0 - 2015-01-18
|
9
|
+
### Enhancement
|
10
|
+
- `RubyClass#module_nesting` returns an array of symbols representing the module namespacing that the class is within.
|
11
|
+
|
12
|
+
### Fix
|
13
|
+
- If a class was not found it could return all given code.
|
14
|
+
|
4
15
|
## 0.3.1 - 2015-01-17
|
5
16
|
### Enhancement
|
6
17
|
- `DissociatedIntrospection::RubyClass` now can take a `DissociatedIntrospection::RubyCode` which is build with `#build_from_ast`, `#build_from_source`.
|
@@ -85,7 +85,7 @@ module DissociatedIntrospection
|
|
85
85
|
ary = []
|
86
86
|
m = ast
|
87
87
|
while m
|
88
|
-
if (m = depth_first_search(m, :module))
|
88
|
+
if (m = depth_first_search(m, :module, :class))
|
89
89
|
name = m.to_a[0].to_a[1]
|
90
90
|
ary << name unless name.nil?
|
91
91
|
m = m.to_a[1]
|
@@ -106,12 +106,13 @@ module DissociatedIntrospection
|
|
106
106
|
depth_first_search(ast, :class)
|
107
107
|
end
|
108
108
|
|
109
|
-
def depth_first_search(node, target)
|
109
|
+
def depth_first_search(node, target, stop=nil)
|
110
110
|
return false unless node.is_a?(Parser::AST::Node)
|
111
111
|
return node if node.type == target
|
112
|
+
return false if stop && node.type == stop
|
112
113
|
if (children = node.children)
|
113
114
|
children.each do |kid|
|
114
|
-
v = depth_first_search(kid, target)
|
115
|
+
v = depth_first_search(kid, target, stop)
|
115
116
|
return v if v.is_a?(Parser::AST::Node)
|
116
117
|
end
|
117
118
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dissociated_introspection
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dustin Zeisler
|
@@ -136,4 +136,3 @@ specification_version: 4
|
|
136
136
|
summary: Introspect methods, parameters, class macros, and constants without loading
|
137
137
|
a parent class or any other dependencies.
|
138
138
|
test_files: []
|
139
|
-
has_rdoc:
|