ethos 0.2.0.beta1 → 0.2.0.beta2

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: ab618cfe1935d258913fb2986ea607baabc690bd
4
- data.tar.gz: bc01d20bfb599df12c7b5e6884406add79926258
3
+ metadata.gz: 48025a24e4808b486dda4d900c8dba809eaa3ad2
4
+ data.tar.gz: 64e974f41db04e23ac4c78de7daf80396c7112b4
5
5
  SHA512:
6
- metadata.gz: 27018e1f0949a2ba50e479769d5ccf10be153a2f5c4df3969b77db92f1737b3eb3c91e0953167b6e911d301d67702cc4621f206944f5e0a57a2a175672a0d288
7
- data.tar.gz: 959d25e2aa998cc671b3801b7661e8ce2efba9cc2ed34583db75dbb84b1fca85491a9e42b6f8fa00532f0536dcd4b81861ed8a2122c2d9ccf4b297d8b8eb35d9
6
+ metadata.gz: 888d41438ddd11d02ea08abdd268a76c0e2c7e90eca336eb2a22974fb52f2a5146d5966977ee947c7787eb17696780a78ee635efcc4ebfe5f2cc5d3ad83029ef
7
+ data.tar.gz: 6a48897c89b488b756c8733db838b339169557cedd0c412c70416f479f323419c4846ee9f2421aa21f0dd56feb79d0c393192850eff8cb80af40a8a18d707077
@@ -0,0 +1,10 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1.5
4
+ - 2.2.0
5
+ env:
6
+ - CODECLIMATE_REPO_COVERAGE=true
7
+ addons:
8
+ code_climate:
9
+ repo_token:
10
+ secure: "gu+A69oYmhfRWj3jDkqZBRw/iwbJ8sDqusuZ7uaotXtPOsn9tgAIFa/3LzTEFf3KZnnE4BkSAbphUmb7XhQrelDSXy2XEtlbBjuAdcKpRbHF7eGbOAsUFy7YjzYLNjuxYrtzBnOeEnldWzGMaueRrdlmF7Hg4MZgMYb6rLPNZzM="
data/Rakefile CHANGED
@@ -2,6 +2,12 @@ require "bundler/gem_tasks"
2
2
 
3
3
  desc 'Run gem specs'
4
4
  task :spec do
5
+ if ENV['CODECLIMATE_REPO_COVERAGE']
6
+ require "codeclimate-test-reporter"
7
+
8
+ CodeClimate::TestReporter.start
9
+ end
10
+
5
11
  require 'microspec'
6
12
 
7
13
  runner = Microspec::Runner.new
@@ -21,4 +21,5 @@ Gem::Specification.new do |spec|
21
21
  spec.add_development_dependency 'bundler', '~> 1.7'
22
22
  spec.add_development_dependency 'rake'
23
23
  spec.add_development_dependency 'microspec'
24
+ spec.add_development_dependency 'codeclimate-test-reporter'
24
25
  end
@@ -14,7 +14,7 @@ module Ethos
14
14
  @_current ||= {}
15
15
  end
16
16
 
17
- def initialize(schema:, values: {})
17
+ def initialize(schema, values: {})
18
18
  @_schema = schema
19
19
 
20
20
  values.each do |key, value|
@@ -8,8 +8,8 @@ module Ethos
8
8
  @_schema ||= Ethos::Schema.new
9
9
  end
10
10
 
11
- def attribute(key, type:, default: nil)
12
- schema.define key, type: type, default: default
11
+ def attribute(key, type, default: nil)
12
+ schema.define key, type, default: default
13
13
 
14
14
  reader = :"#{key}"
15
15
  writer = :"#{key}="
@@ -32,7 +32,7 @@ module Ethos
32
32
  schema = self.class.schema
33
33
  values = values.merge schema.defaults
34
34
 
35
- @_attributes = Ethos::Attributes.new schema: schema, values: values
35
+ @_attributes = Ethos::Attributes.new schema, values: values
36
36
 
37
37
  super()
38
38
  end
@@ -8,7 +8,7 @@ module Ethos
8
8
  @_defaults ||= {}
9
9
  end
10
10
 
11
- def define(key, type:, default: nil)
11
+ def define(key, type, default: nil)
12
12
  attributes[key] = {
13
13
  type: type,
14
14
  default: default
@@ -1,3 +1,3 @@
1
1
  module Ethos
2
- VERSION = '0.2.0.beta1'
2
+ VERSION = '0.2.0.beta2'
3
3
  end
@@ -3,18 +3,12 @@ require 'ethos/attributes'
3
3
 
4
4
  define schema: -> do
5
5
  schema = Ethos::Schema.new
6
- schema.define :value, type: Integer
6
+ schema.define :value, Integer
7
7
  schema
8
8
  end
9
9
 
10
- spec do
11
- raises ArgumentError, 'missing keyword: schema' do
12
- Ethos::Attributes.new
13
- end
14
- end
15
-
16
10
  scope do
17
- define attributes: -> { Ethos::Attributes.new schema: schema }
11
+ define attributes: -> { Ethos::Attributes.new schema }
18
12
 
19
13
  spec do
20
14
  asserts(attributes[:value]) == nil
@@ -35,13 +29,13 @@ end
35
29
 
36
30
  scope do
37
31
  spec do
38
- attributes = Ethos::Attributes.new schema: schema, values: {value: 1}
32
+ attributes = Ethos::Attributes.new schema, values: {value: 1}
39
33
 
40
34
  asserts(attributes[:value]) == 1
41
35
  end
42
36
 
43
37
  spec do
44
- attributes = Ethos::Attributes.new schema: schema, values: {value: '1'}
38
+ attributes = Ethos::Attributes.new schema, values: {value: '1'}
45
39
 
46
40
  asserts(attributes[:value]) == 1
47
41
  end
@@ -5,7 +5,7 @@ scope do
5
5
  class Entity
6
6
  prepend Ethos::Entity
7
7
 
8
- attribute :value, type: Integer
8
+ attribute :value, Integer
9
9
  end
10
10
  end
11
11
 
@@ -33,7 +33,7 @@ scope do
33
33
  class Entity
34
34
  prepend Ethos::Entity
35
35
 
36
- attribute :value, type: Integer, default: 1
36
+ attribute :value, Integer, default: 1
37
37
  end
38
38
  end
39
39
 
@@ -49,7 +49,7 @@ scope do
49
49
  class Entity
50
50
  prepend Ethos::Entity
51
51
 
52
- attribute :value, type: Integer, default: '1'
52
+ attribute :value, Integer, default: '1'
53
53
  end
54
54
  end
55
55
 
@@ -65,8 +65,8 @@ scope do
65
65
  class Entity
66
66
  prepend Ethos::Entity
67
67
 
68
- attribute :name, type: String
69
- attribute :parent, type: Entity
68
+ attribute :name, String
69
+ attribute :parent, Entity
70
70
  end
71
71
  end
72
72
 
@@ -2,15 +2,9 @@ require 'ethos/schema'
2
2
 
3
3
  define schema: -> { Ethos::Schema.new }
4
4
 
5
- spec do
6
- raises ArgumentError, 'missing keyword: type' do
7
- schema.define :value
8
- end
9
- end
10
-
11
5
  scope do
12
6
  setup do
13
- schema.define :value, type: Integer
7
+ schema.define :value, Integer
14
8
  end
15
9
 
16
10
  spec do
@@ -24,7 +18,7 @@ end
24
18
 
25
19
  scope do
26
20
  setup do
27
- schema.define :value, type: Integer, default: 1
21
+ schema.define :value, Integer, default: 1
28
22
  end
29
23
 
30
24
  spec do
@@ -76,7 +76,7 @@ scope '.cast' do
76
76
  class Entity
77
77
  prepend Ethos::Entity
78
78
 
79
- attribute :value, type: Float
79
+ attribute :value, Float
80
80
  end
81
81
 
82
82
  values = {value: 1}
@@ -92,7 +92,7 @@ scope '.cast' do
92
92
  class Entity
93
93
  prepend Ethos::Entity
94
94
 
95
- attribute :value, type: Float
95
+ attribute :value, Float
96
96
  end
97
97
 
98
98
  expected = nil
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.beta1
4
+ version: 0.2.0.beta2
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-02-17 00:00:00.000000000 Z
11
+ date: 2015-02-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: codeclimate-test-reporter
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  description: Lightweight entity library for Ruby
56
70
  email:
57
71
  - erol.fornoles@gmail.com
@@ -60,6 +74,7 @@ extensions: []
60
74
  extra_rdoc_files: []
61
75
  files:
62
76
  - ".gitignore"
77
+ - ".travis.yml"
63
78
  - Gemfile
64
79
  - LICENSE.txt
65
80
  - README.md