angostura 0.5 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/angostura.rb +2 -1
- data/lib/angostura/dependencies.rb +6 -1
- data/lib/angostura/dependency_type_error.rb +7 -0
- data/lib/angostura/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88a823832cba57904de7a4ec01ce3ca75a5d4e90
|
4
|
+
data.tar.gz: 71d76d3e38436567e1899fa65994da9c4cd26fc0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: efc241c78b02ae11f1dc0e45cd254012b3b8d1f4d97395e4a64f7bd1d223f31aea9168085ab2284fbed5abc2cef0cdbcf504d02f5541a3931e83b5caa3d96b32
|
7
|
+
data.tar.gz: 3eb0a13d28ce40e96a88b433c45d0b717bef4c895a5214c9a41d10bb29118b06f5ed35a78808f94f9ecde2785a7067bc02cd259d47d9a909de83539a16f346c1
|
data/lib/angostura.rb
CHANGED
@@ -17,9 +17,14 @@ module Angostura
|
|
17
17
|
|
18
18
|
def dependency(*args, **kargs)
|
19
19
|
self.dependencies = args + kargs&.keys
|
20
|
-
singleton_class.send(:
|
20
|
+
singleton_class.send(:attr_reader, *dependencies)
|
21
21
|
|
22
22
|
dependencies.each do |dependency|
|
23
|
+
define_singleton_method "#{dependency}=" do |value|
|
24
|
+
raise Angostura::DependencyTypeError.new(value) if !value.is_a? String
|
25
|
+
self.class_eval("@#{dependency} = value")
|
26
|
+
end
|
27
|
+
|
23
28
|
define_singleton_method "#{dependency}_class" do
|
24
29
|
Object.const_get(self.send(dependency))
|
25
30
|
end
|
data/lib/angostura/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: angostura
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- justin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -76,6 +76,7 @@ files:
|
|
76
76
|
- lib/angostura.rb
|
77
77
|
- lib/angostura/dependencies.rb
|
78
78
|
- lib/angostura/dependency_error.rb
|
79
|
+
- lib/angostura/dependency_type_error.rb
|
79
80
|
- lib/angostura/version.rb
|
80
81
|
homepage: https://github.com/justindoody/angostura
|
81
82
|
licenses:
|