angostura 0.3 → 0.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: 2db0419494e53b119917ae6326fdade054c57644
4
- data.tar.gz: 734086733d0bc237213dc70f2352f7ded488d7a4
3
+ metadata.gz: 343206419c4cba3064a57fc66b2d599e90570104
4
+ data.tar.gz: a1202151edae394424074bd0d241bea27957d844
5
5
  SHA512:
6
- metadata.gz: f7e48ab25dae50d966775d4c5d2fffef310d86dfcb44573bf9df0eb99d32d83ae864409121938f2a27ecf0c2b9fd5314b8a2beb81ec3ab23d0f9a2cba8b59a81
7
- data.tar.gz: 82ec23fd844ff1e9458cbbd7603e8b64aff678ea432ed63a281d44852c53a8196eabdf48f113e3a55321fa66fa4b96af9a9714d2b7c4e0db4f3da45a8562d2b2
6
+ metadata.gz: e572ec36f38f583089cf00f284ce0c34e1ae97694d7d3e88d9a430d805a6e342843b59a4f90f4792b2ee42b0e055d31131d5c72dba6e39e495ea14c9a1126ac9
7
+ data.tar.gz: 7f838bd16ca8a9a75af7b7a6542dca124533479209361144879a05db05678054c5b0d88c39c7462a979e66a8f256ce47a8d2c708c9a8384d3ad2d307dae8dac2
@@ -1,9 +1,17 @@
1
1
  module Angostura
2
2
  module Dependencies
3
- extend ActiveSupport::Concern
3
+ def self.included(base)
4
+ base.extend ClassMethods
5
+ end
4
6
 
5
- class_methods do
6
- mattr_accessor :dependencies
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
- define_singleton_method "#{dependency}_class" do
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
@@ -1,3 +1,3 @@
1
1
  module Angostura
2
- VERSION = '0.3'
2
+ VERSION = '0.4'
3
3
  end
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.3'
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