ethos 0.2.0.beta11 → 0.2.0.beta12

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: 99cd1b8a90c428cda94c068cd4d4a5d870e7a99e
4
- data.tar.gz: cb33a0ce5ba5e44949ee83be7a474447e2de73fc
3
+ metadata.gz: 9b44c823d7d00eff4d50e010996d19f46457eae3
4
+ data.tar.gz: 3e9bd146f6e5546871207e83a2222bf9abefca5d
5
5
  SHA512:
6
- metadata.gz: 3d118062efe920c99f05d5dcc89d0fc66d5e1ef68594d1af2a642314b851a545674b8bbb23d032aa852f9d4cd845593a612cafe916fbe5b360e56dc1dd0e5ba0
7
- data.tar.gz: 014147ee67124c927f940cfd594f00e608699576c55b8172071af0cadadb966e6a2ccb49346c958a0abdb6fde7148c2c54142c34d17886f29a84311b40ce8885
6
+ metadata.gz: 94e17b1c198ae737124d0c79435a02771978925836c8baa37ac8c03e356f3ab59b911cf2e10830ba2070cb31e0d9810e444d5a36f1fa1b21111a54b6c14b019f
7
+ data.tar.gz: 4fd8341549a9ecdbb66e110ad5fa958180da49b3814510c381e5f7a6994b1b15e95882dab63eb7d79b2969099e9b31189c534fa9b2211de6209cf920068ac486
@@ -6,10 +6,6 @@ module Ethos
6
6
  @_schema
7
7
  end
8
8
 
9
- def initial
10
- @_initial ||= {}
11
- end
12
-
13
9
  def current
14
10
  @_current ||= {}
15
11
  end
@@ -18,14 +14,14 @@ module Ethos
18
14
  @_schema = schema
19
15
 
20
16
  schema.defaults.each do |key, value|
21
- initial[key] = current[key] = value
17
+ current[key] = value
22
18
  end
23
19
 
24
20
  schema.attributes.keys.each do |key|
25
21
  if values.key? key
26
- initial[key] = current[key] = values[key]
22
+ current[key] = values[key]
27
23
  elsif values.key? String key
28
- initial[key] = current[key] = values[String key]
24
+ current[key] = values[String key]
29
25
  end
30
26
  end
31
27
  end
@@ -25,12 +25,16 @@ module Ethos
25
25
  end
26
26
 
27
27
  def collection(key, type)
28
- attribute key, Ethos::Collection, nothing: []
29
-
30
- schema.attributes[key][:extensions].push Proc.new { self.type = type }
28
+ attribute key, Ethos::Collection, nothing: [] do
29
+ self.type = type
30
+ end
31
31
  end
32
32
  end
33
33
 
34
+ def self.included(base)
35
+ base.extend ClassMethods
36
+ end
37
+
34
38
  def self.prepended(base)
35
39
  base.extend ClassMethods
36
40
  end
@@ -4,6 +4,10 @@ module Ethos
4
4
  @_attributes ||= {}
5
5
  end
6
6
 
7
+ def keys
8
+ attributes.keys
9
+ end
10
+
7
11
  def defaults
8
12
  @_defaults ||= {}
9
13
  end
@@ -1,3 +1,3 @@
1
1
  module Ethos
2
- VERSION = '0.2.0.beta11'
2
+ VERSION = '0.2.0.beta12'
3
3
  end
@@ -29,3 +29,15 @@ scope do
29
29
  asserts(schema.defaults).key? :value
30
30
  end
31
31
  end
32
+
33
+ scope do
34
+ setup do
35
+ schema.define :a, Integer
36
+ schema.define :b, Integer
37
+ schema.define :c, Integer
38
+ end
39
+
40
+ spec do
41
+ asserts(schema.keys) == %i[a b c]
42
+ end
43
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ethos
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0.beta11
4
+ version: 0.2.0.beta12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erol Fornoles
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-27 00:00:00.000000000 Z
11
+ date: 2015-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler