active_mocker 2.6.0 → 2.6.1.beta
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: bef80549ecc7fff2879bd261103cbde42ed7939f
|
4
|
+
data.tar.gz: 5965d36b46ae431e93b70507911dfcdf56f52f12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c05810f552eed2f24c4dee009aa393ab0c006af900c87474925b113d47f2246c81bca29290c566b3eb21803dda45f46f4bcc7408750e63424492f6e94037917b
|
7
|
+
data.tar.gz: 6802f02bbc7b88bbcb7d89963a1d361ee46ddd9a7e4161383653a87aef4f598a35b1a69a45226d1b6bbda520e6a0194de576787d0509653a6aa01eb5111991da
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
# Changelog
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
|
+
## Current
|
5
|
+
### Enhancement
|
6
|
+
- Locally defined modules are imported and included.
|
7
|
+
|
4
8
|
## 2.6.0 - 2017-12-01
|
5
9
|
### Feature
|
6
10
|
- Relation#order now accepts all non-SQL arguments
|
@@ -23,14 +23,18 @@ module ActiveMocker
|
|
23
23
|
class_introspector.get_class.constants.each_with_object({}) do |v, const|
|
24
24
|
c = class_introspector.get_class.const_get(v)
|
25
25
|
next if [Module, Class].include?(c.class)
|
26
|
-
if /\A#</ =~ c.inspect
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
26
|
+
const[v] = if /\A#</ =~ c.inspect
|
27
|
+
Inspectable.new("ActiveMocker::UNREPRESENTABLE_CONST_VALUE")
|
28
|
+
else
|
29
|
+
c
|
30
|
+
end
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
+
def defined_nested_modules
|
35
|
+
class_introspector.parsed_source.defined_nested_modules.map(&:source)
|
36
|
+
end
|
37
|
+
|
34
38
|
private
|
35
39
|
def reject_local_const(source)
|
36
40
|
source.reject do |n|
|
@@ -47,7 +51,7 @@ module ActiveMocker
|
|
47
51
|
end
|
48
52
|
|
49
53
|
def get_module_by_reference(type)
|
50
|
-
isolated_module_names =
|
54
|
+
isolated_module_names = class_introspector.public_send(type).map(&:referenced_name)
|
51
55
|
real_module_names = get_real_module(type).map(&:name).compact
|
52
56
|
isolated_module_names.map do |isolated_name|
|
53
57
|
real_name = real_module_names.detect do |rmn|
|
@@ -56,7 +60,7 @@ module ActiveMocker
|
|
56
60
|
[
|
57
61
|
real_parts.include?(active_record_model.name),
|
58
62
|
real_parts.include?(isolated_name),
|
59
|
-
(total_parts_count == real_parts.count)
|
63
|
+
(total_parts_count == real_parts.count),
|
60
64
|
].all?
|
61
65
|
end
|
62
66
|
real_name ? real_name : isolated_name
|
@@ -2,9 +2,12 @@
|
|
2
2
|
<% constants.each do |constant| -%>
|
3
3
|
<%= constant.first %> = <%= constant.last.inspect %>
|
4
4
|
<% end -%>
|
5
|
+
<% defined_nested_modules.each do |m| -%>
|
6
|
+
<%= m %>
|
7
|
+
<% end -%>
|
5
8
|
<% modules[:included].each do |constant| -%>
|
6
9
|
prepend <%= constant %>
|
7
10
|
<% end -%>
|
8
11
|
<% modules[:extended].each do |constant| -%>
|
9
12
|
extend <%= constant %>
|
10
|
-
<% end -%>
|
13
|
+
<% end -%>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_mocker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.6.
|
4
|
+
version: 2.6.1.beta
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dustin Zeisler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -132,20 +132,14 @@ dependencies:
|
|
132
132
|
requirements:
|
133
133
|
- - "~>"
|
134
134
|
- !ruby/object:Gem::Version
|
135
|
-
version: '0.
|
136
|
-
- - ">="
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: 0.8.4
|
135
|
+
version: '0.9'
|
139
136
|
type: :runtime
|
140
137
|
prerelease: false
|
141
138
|
version_requirements: !ruby/object:Gem::Requirement
|
142
139
|
requirements:
|
143
140
|
- - "~>"
|
144
141
|
- !ruby/object:Gem::Version
|
145
|
-
version: '0.
|
146
|
-
- - ">="
|
147
|
-
- !ruby/object:Gem::Version
|
148
|
-
version: 0.8.4
|
142
|
+
version: '0.9'
|
149
143
|
- !ruby/object:Gem::Dependency
|
150
144
|
name: bundler
|
151
145
|
requirement: !ruby/object:Gem::Requirement
|
@@ -292,9 +286,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
292
286
|
version: '2.1'
|
293
287
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
294
288
|
requirements:
|
295
|
-
- - "
|
289
|
+
- - ">"
|
296
290
|
- !ruby/object:Gem::Version
|
297
|
-
version:
|
291
|
+
version: 1.3.1
|
298
292
|
requirements: []
|
299
293
|
rubyforge_project:
|
300
294
|
rubygems_version: 2.5.1
|