angostura 0.3 → 0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/angostura/dependencies.rb +26 -9
- data/lib/angostura/version.rb +1 -1
- metadata +1 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 343206419c4cba3064a57fc66b2d599e90570104
|
4
|
+
data.tar.gz: a1202151edae394424074bd0d241bea27957d844
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e572ec36f38f583089cf00f284ce0c34e1ae97694d7d3e88d9a430d805a6e342843b59a4f90f4792b2ee42b0e055d31131d5c72dba6e39e495ea14c9a1126ac9
|
7
|
+
data.tar.gz: 7f838bd16ca8a9a75af7b7a6542dca124533479209361144879a05db05678054c5b0d88c39c7462a979e66a8f256ce47a8d2c708c9a8384d3ad2d307dae8dac2
|
@@ -1,9 +1,17 @@
|
|
1
1
|
module Angostura
|
2
2
|
module Dependencies
|
3
|
-
|
3
|
+
def self.included(base)
|
4
|
+
base.extend ClassMethods
|
5
|
+
end
|
4
6
|
|
5
|
-
|
6
|
-
|
7
|
+
module ClassMethods
|
8
|
+
def dependencies
|
9
|
+
@@dependencies
|
10
|
+
end
|
11
|
+
|
12
|
+
def dependencies=(value)
|
13
|
+
@@dependencies = value
|
14
|
+
end
|
7
15
|
|
8
16
|
def setup
|
9
17
|
yield self
|
@@ -15,17 +23,26 @@ module Angostura
|
|
15
23
|
|
16
24
|
def dependency(*args, **kargs)
|
17
25
|
self.dependencies = args + kargs&.keys
|
18
|
-
self.mattr_accessor(*dependencies)
|
19
|
-
|
20
|
-
kargs.each do |key, default_value|
|
21
|
-
self.send("#{key}=", default_value)
|
22
|
-
end
|
23
26
|
|
24
27
|
dependencies.each do |dependency|
|
25
|
-
|
28
|
+
class_eval("@@#{dependency} = nil")
|
29
|
+
|
30
|
+
self.define_singleton_method "#{dependency}" do
|
31
|
+
class_eval("@@#{dependency}")
|
32
|
+
end
|
33
|
+
|
34
|
+
self.define_singleton_method "#{dependency}=" do |value|
|
35
|
+
class_eval("@@#{dependency} = '#{value}'")
|
36
|
+
end
|
37
|
+
|
38
|
+
self.define_singleton_method "#{dependency}_class" do
|
26
39
|
Object.const_get(self.send(dependency))
|
27
40
|
end
|
28
41
|
end
|
42
|
+
|
43
|
+
kargs.each do |key, default_value|
|
44
|
+
self.send("#{key}=", default_value)
|
45
|
+
end
|
29
46
|
end
|
30
47
|
end
|
31
48
|
end
|
data/lib/angostura/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: angostura
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.4'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- justin
|
@@ -10,20 +10,6 @@ bindir: bin
|
|
10
10
|
cert_chain: []
|
11
11
|
date: 2017-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: activesupport
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '4.0'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '4.0'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: bundler
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|