attributes_dsl 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +5 -2
- data/CHANGELOG.md +6 -0
- data/Gemfile +1 -1
- data/README.md +1 -1
- data/attributes_dsl.gemspec +1 -1
- data/lib/attributes_dsl/transprocs.rb +4 -3
- data/lib/attributes_dsl/version.rb +1 -1
- metadata +39 -40
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d14f92013d4337b03374d318bb1cacef54de0a72
|
4
|
+
data.tar.gz: 10c7343c3daa99636e9b7cb7304c1e190cbc3b62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb2f737752bef7c008352bd5fe06536623915a6f6287f8cb35ac0ffd5599f64e4a3d2605cd3f86273fd5377e084e8de199d1381fd6fbfcdd685328d9997e1781
|
7
|
+
data.tar.gz: c5702e2dfd42146102d49eee381efd4d7efa10191b99bdf07ce4884b747dc9f24f9a2c47be1752b89bbea5880d0376023c9cf3e0a21f1357c9c3c7a067893e19
|
data/.travis.yml
CHANGED
@@ -4,11 +4,14 @@ bundler_args: --without metrics --without benchmarks
|
|
4
4
|
cache: bundler
|
5
5
|
script: bundle exec rake test:coverage:run
|
6
6
|
rvm:
|
7
|
+
- '2.0'
|
7
8
|
- '2.1'
|
8
9
|
- '2.2'
|
10
|
+
- '2.3.0'
|
9
11
|
- ruby-head
|
10
|
-
- rbx-2
|
11
|
-
- jruby-
|
12
|
+
- rbx-2
|
13
|
+
- jruby-1.7
|
14
|
+
- jruby-9000
|
12
15
|
- jruby-head
|
13
16
|
matrix:
|
14
17
|
allow_failures:
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -186,7 +186,7 @@ gem install attributes_dsl
|
|
186
186
|
Compatibility
|
187
187
|
-------------
|
188
188
|
|
189
|
-
Tested under rubies
|
189
|
+
Tested under rubies compatible to [MRI 2.0+][versions].
|
190
190
|
|
191
191
|
Uses [RSpec][rspec] 3.0+ for testing and [hexx-suit][hexx-suit] for dev/test tools collection.
|
192
192
|
|
data/attributes_dsl.gemspec
CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |gem|
|
|
15
15
|
gem.extra_rdoc_files = Dir["README.md", "LICENSE"]
|
16
16
|
gem.require_paths = ["lib"]
|
17
17
|
|
18
|
-
gem.required_ruby_version = ">= 2.
|
18
|
+
gem.required_ruby_version = ">= 2.0"
|
19
19
|
|
20
20
|
gem.add_runtime_dependency "equalizer", "~> 0.0.11"
|
21
21
|
gem.add_runtime_dependency "transproc", "~> 0.4.0"
|
@@ -21,9 +21,8 @@ module AttributesDSL
|
|
21
21
|
#
|
22
22
|
def self.filter(attributes, keys)
|
23
23
|
attributes
|
24
|
-
.
|
24
|
+
.inject({}) { |hash, (key, value)| hash.merge(key.to_sym => value) }
|
25
25
|
.select { |key, _| keys.include? key }
|
26
|
-
.to_h
|
27
26
|
end
|
28
27
|
|
29
28
|
# Ensures all given keys are present in the hash
|
@@ -38,7 +37,9 @@ module AttributesDSL
|
|
38
37
|
# @return [Hash]
|
39
38
|
#
|
40
39
|
def self.update(attributes, keys)
|
41
|
-
keys
|
40
|
+
keys
|
41
|
+
.inject({}) { |hash, key| hash.merge(key => nil) }
|
42
|
+
.merge(attributes)
|
42
43
|
end
|
43
44
|
|
44
45
|
# Checks whether the name is present in attributes' keys,
|
metadata
CHANGED
@@ -1,72 +1,72 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: attributes_dsl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kozin
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: equalizer
|
15
14
|
requirement: !ruby/object:Gem::Requirement
|
16
15
|
requirements:
|
17
|
-
- -
|
16
|
+
- - ~>
|
18
17
|
- !ruby/object:Gem::Version
|
19
18
|
version: 0.0.11
|
20
|
-
|
19
|
+
name: equalizer
|
21
20
|
prerelease: false
|
21
|
+
type: :runtime
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.0.11
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name: transproc
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
30
29
|
requirements:
|
31
|
-
- -
|
30
|
+
- - ~>
|
32
31
|
- !ruby/object:Gem::Version
|
33
32
|
version: 0.4.0
|
34
|
-
|
33
|
+
name: transproc
|
35
34
|
prerelease: false
|
35
|
+
type: :runtime
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 0.4.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name: hexx-rspec
|
43
42
|
requirement: !ruby/object:Gem::Requirement
|
44
43
|
requirements:
|
45
|
-
- -
|
44
|
+
- - ~>
|
46
45
|
- !ruby/object:Gem::Version
|
47
46
|
version: 0.5.2
|
48
|
-
|
47
|
+
name: hexx-rspec
|
49
48
|
prerelease: false
|
49
|
+
type: :development
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 0.5.2
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name: ice_nine
|
57
56
|
requirement: !ruby/object:Gem::Requirement
|
58
57
|
requirements:
|
59
|
-
- -
|
58
|
+
- - ~>
|
60
59
|
- !ruby/object:Gem::Version
|
61
60
|
version: 0.11.1
|
62
|
-
|
61
|
+
name: ice_nine
|
63
62
|
prerelease: false
|
63
|
+
type: :development
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ~>
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 0.11.1
|
69
|
-
description:
|
69
|
+
description:
|
70
70
|
email: andrew.kozin@gmail.com
|
71
71
|
executables: []
|
72
72
|
extensions: []
|
@@ -74,13 +74,13 @@ extra_rdoc_files:
|
|
74
74
|
- README.md
|
75
75
|
- LICENSE
|
76
76
|
files:
|
77
|
-
-
|
78
|
-
-
|
79
|
-
-
|
80
|
-
-
|
81
|
-
-
|
82
|
-
-
|
83
|
-
-
|
77
|
+
- .coveralls.yml
|
78
|
+
- .gitignore
|
79
|
+
- .metrics
|
80
|
+
- .rspec
|
81
|
+
- .rubocop.yml
|
82
|
+
- .travis.yml
|
83
|
+
- .yardopts
|
84
84
|
- CHANGELOG.md
|
85
85
|
- Gemfile
|
86
86
|
- Guardfile
|
@@ -118,34 +118,33 @@ homepage: https://github.com/nepalez/attributes_dsl
|
|
118
118
|
licenses:
|
119
119
|
- MIT
|
120
120
|
metadata: {}
|
121
|
-
post_install_message:
|
121
|
+
post_install_message:
|
122
122
|
rdoc_options: []
|
123
123
|
require_paths:
|
124
124
|
- lib
|
125
125
|
required_ruby_version: !ruby/object:Gem::Requirement
|
126
126
|
requirements:
|
127
|
-
- -
|
127
|
+
- - '>='
|
128
128
|
- !ruby/object:Gem::Version
|
129
|
-
version: '2.
|
129
|
+
version: '2.0'
|
130
130
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
131
131
|
requirements:
|
132
|
-
- -
|
132
|
+
- - '>='
|
133
133
|
- !ruby/object:Gem::Version
|
134
134
|
version: '0'
|
135
135
|
requirements: []
|
136
|
-
rubyforge_project:
|
137
|
-
rubygems_version: 2.4.
|
138
|
-
signing_key:
|
136
|
+
rubyforge_project:
|
137
|
+
rubygems_version: 2.4.5
|
138
|
+
signing_key:
|
139
139
|
specification_version: 4
|
140
140
|
summary: Lightweight DSL to define PORO attributes
|
141
141
|
test_files:
|
142
142
|
- spec/spec_helper.rb
|
143
|
+
- spec/integration/coerced_attribute_spec.rb
|
144
|
+
- spec/integration/blacklisted_attribute_spec.rb
|
145
|
+
- spec/integration/unreadable_attribute_spec.rb
|
143
146
|
- spec/integration/required_attribute_spec.rb
|
144
147
|
- spec/integration/unknown_attribute_spec.rb
|
145
|
-
- spec/integration/simple_attribute_spec.rb
|
146
|
-
- spec/integration/default_attribute_spec.rb
|
147
|
-
- spec/integration/unreadable_attribute_spec.rb
|
148
|
-
- spec/integration/blacklisted_attribute_spec.rb
|
149
|
-
- spec/integration/coerced_attribute_spec.rb
|
150
148
|
- spec/integration/whitelisted_attribute_spec.rb
|
151
|
-
|
149
|
+
- spec/integration/default_attribute_spec.rb
|
150
|
+
- spec/integration/simple_attribute_spec.rb
|