dissociated_introspection 0.1.6 → 0.2.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d52a5954cb2475630f4bc5b5bf6f7c2da5d7f725
|
4
|
+
data.tar.gz: 40245585bd9ace7f23b553c96f74338999c475ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e5bdfb47e27e052dc08aa9318100964115918c90cbd52d1697bc45c8e2fbd1a6c57704bda52c58fdf626d17abd99951ebef9c93c2846c1a5db7657f2851ebe6
|
7
|
+
data.tar.gz: 2c56974c1bcf78f779ff30778ad92dff8c469900cb554927345550904daf0c55ead6bdba9c4135042b51117fb6d06fced33c784718c3d3b1095ffbc7dc0bbc02
|
@@ -89,8 +89,26 @@ module DissociatedIntrospection
|
|
89
89
|
self.class.new(ast: find_class.updated(find_class.type, class_begin.updated(class_begin.type, class_begin.children.reject { |n| n.try(:type) == :class })))
|
90
90
|
end
|
91
91
|
|
92
|
+
def wrap_in_modules(modules)
|
93
|
+
return self if modules.nil? || modules.empty?
|
94
|
+
ruby_string = to_ruby_str
|
95
|
+
modules.split("::").reverse.each do |module_name|
|
96
|
+
ruby_string = wrap_module(module_name, ruby_string)
|
97
|
+
end
|
98
|
+
wrapped_ast = Parser::CurrentRuby.parse(ruby_string)
|
99
|
+
self.class.new(ast: wrapped_ast)
|
100
|
+
end
|
101
|
+
|
92
102
|
private
|
93
103
|
|
104
|
+
def wrap_module(module_name, ruby)
|
105
|
+
<<-RUBY
|
106
|
+
module #{module_name}
|
107
|
+
#{ruby}
|
108
|
+
end
|
109
|
+
RUBY
|
110
|
+
end
|
111
|
+
|
94
112
|
attr_reader :source
|
95
113
|
|
96
114
|
def find_class
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dissociated_introspection
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dustin Zeisler
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parser
|