junctions 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/junctions/engine.rb +6 -5
- data/lib/junctions/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba9b0c6bbb7f1551509b794fe40fc714591435b7bed1fde0a405f3f0cf9673f2
|
4
|
+
data.tar.gz: add9919b0f50038beb17c162921476285e1c1d8e1c6e77f8fb5634e18993208a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ba3e6693ebe7591a973e3568cf34b16cb221a8b7807c96a974de22e5fe7e8942917bd1ada860e1744fb3782f685da60c99ae64ae868b3f195eb9f484b21e297
|
7
|
+
data.tar.gz: 11603f724721fb86e4790997396048ea953b834f4c6b7183cb37ce2293c59cb62c5ca9b7c1971da1bc35e27927f6060a1c1e9bedbd3386efb180e48676b15be5
|
data/lib/junctions/engine.rb
CHANGED
@@ -9,6 +9,10 @@ module Junctions
|
|
9
9
|
@junction_list||=get_initializer_roots('junctions')
|
10
10
|
end
|
11
11
|
|
12
|
+
def junction_classes
|
13
|
+
junction_list.reverse
|
14
|
+
end
|
15
|
+
|
12
16
|
def core
|
13
17
|
@core||='core'
|
14
18
|
end
|
@@ -17,14 +21,10 @@ module Junctions
|
|
17
21
|
def get_initializer_roots(*args)
|
18
22
|
args.map do |arg|
|
19
23
|
root=ENV[arg]
|
20
|
-
root && root.split(',') or nil
|
24
|
+
root && root.split(',').map(&:squish) or nil
|
21
25
|
end.flatten.compact << core
|
22
26
|
end
|
23
27
|
|
24
|
-
def junction_classes
|
25
|
-
junction_list.reverse
|
26
|
-
end
|
27
|
-
|
28
28
|
def switch_to_junction(junction_class, base, base_name)
|
29
29
|
name=base_name.gsub("#{core.classify}::", "#{junction_class}::")
|
30
30
|
begin
|
@@ -32,6 +32,7 @@ module Junctions
|
|
32
32
|
base.instance_eval {
|
33
33
|
include name.constantize
|
34
34
|
} if name.gsub(/::[^:]*$/, '').constantize.const_defined?(name.demodulize)
|
35
|
+
rescue NameError
|
35
36
|
rescue Exception => e
|
36
37
|
puts(e.message)
|
37
38
|
puts(e.backtrace)
|
data/lib/junctions/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: junctions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul McKibbin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|