dissociated_introspection 0.1.3 → 0.1.4
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: c622b1363c06fc73f8ef83a3645180ba81a4ff54
|
4
|
+
data.tar.gz: 4880afc33b55e68835300cb782a6d69d09293418
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98abb12259e2c5fd7ac436269ff3f37bbd585e7e30d0fa8c42224e40ee7cf1a57e9d842e19f406ff5fef62e2c371baf7717a17c61a7ca4bd1b92d090f04fc744
|
7
|
+
data.tar.gz: 84ae96f322ec2e815ec1000f4abbb3275f31cbe0ada14266cc1f2a912ee225b131ec3bcfb2091022de11606da84c3bc751bac9c61e98607c2516c8f31790ddc7
|
@@ -45,7 +45,7 @@ module DissociatedIntrospection
|
|
45
45
|
def locally_defined_constants(type=nil)
|
46
46
|
consts = get_class.constants - get_class.__missing_constants__.keys - [:BasicObject]
|
47
47
|
return consts unless type
|
48
|
-
consts.select{ |c| get_class.const_get(c).is_a?(type)}
|
48
|
+
consts.select { |c| get_class.const_get(c).is_a?(type) }
|
49
49
|
end
|
50
50
|
|
51
51
|
# @return [DissociatedIntrospection::RubyClass]
|
@@ -61,10 +61,13 @@ module DissociatedIntrospection
|
|
61
61
|
private
|
62
62
|
|
63
63
|
def add_method_name_wo_parent(_module)
|
64
|
-
|
64
|
+
_class_name_ = parsed_source.class_name
|
65
|
+
|
66
|
+
_module.define_singleton_method(:referenced_name) do
|
65
67
|
n = name.split("::")
|
66
|
-
|
67
|
-
|
68
|
+
n = n.drop(1) if n.first =~ /#<Module:.*>/
|
69
|
+
n = n.drop(1) if n.first == _class_name_
|
70
|
+
return n.join("::")
|
68
71
|
end
|
69
72
|
_module
|
70
73
|
end
|
@@ -75,11 +78,11 @@ module DissociatedIntrospection
|
|
75
78
|
|
76
79
|
def _get_class
|
77
80
|
modified_class_source = parsed_source.modify_parent_class(parent_class_replacement)
|
78
|
-
path
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
81
|
+
path = if file.is_a? Pathname
|
82
|
+
file.to_s
|
83
|
+
else
|
84
|
+
file.path
|
85
|
+
end
|
83
86
|
load_sandbox(OpenStruct.new(read: modified_class_source.to_ruby_str, path: path))
|
84
87
|
end
|
85
88
|
|
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.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dustin Zeisler
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parser
|