dissociated_introspection 0.4.0 → 0.4.1

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
  SHA1:
3
- metadata.gz: b87f194e1bad12f5d03f1607361fcf64d08bcfb7
4
- data.tar.gz: 5f59172b7b25e8fbc90a606dd6cb25a4ecf2e23b
3
+ metadata.gz: a85114518e8f37294a6b2e18da38ddf9453e0b7b
4
+ data.tar.gz: 9674c329f7c23e83f7f9fc2cddd602d3158615e6
5
5
  SHA512:
6
- metadata.gz: f1e3f2b1e0c139c30a6c11d6488f23b272bdd47e7d73ddee922e8a59bf92c70d995979a7942f906ca923afca83f7652c29475aa939d746258106e0cca1457778
7
- data.tar.gz: 2756ad073c45e86e3c61eb1a13f82f2eb7a14003fb30bd723a4047ae16e5f0aa87ecae6427b808352eb23bf08905b2c2eaa0a3c3aaf7072744191fef692476ba
6
+ metadata.gz: d363290654c25c50c1449b56386089c3b4c259ccdaadb06fba2235b13ae924eb49d2102f2a2335786927507d45a061fac549bb8ec4440e91fc3ef2b9311c010e
7
+ data.tar.gz: e43b3bff9385825a81729712aafb4e0baa0c9090b6d89f88dd37ce1838ca7452edffc9c3ae7d00f5946cc4e82227a06220d01643ea006613083cc6636183326e
data/.travis.yml CHANGED
@@ -6,3 +6,5 @@ rvm:
6
6
  addons:
7
7
  code_climate:
8
8
  repo_token: 9ee4de0c2f9b045b414b79b67a56bc98d1f365aee5e54ca9a119319b59d8ae52
9
+ sudo: false
10
+ cache: bundler
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
@@ -1,3 +1,3 @@
1
1
  module DissociatedIntrospection
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  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.0
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: