dao-repository 1.4.0 → 1.5.0

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: 16668f6ae4ffbf77f204f293e591797fb17b55c4
4
- data.tar.gz: 6a1599778d435c7ad58a930907cc56fce99ab10d
3
+ metadata.gz: ef773ffffc1ede5980a275802ae07f8aed9a3f3e
4
+ data.tar.gz: 2421203a5bbb11cdb3904ce2cbb76dd2bf6fb8f7
5
5
  SHA512:
6
- metadata.gz: b03578f51c0592ffb13237e880e654f24933b849c6c9a3788025caa54938921c9b7e8039e6c1c0a07299ef3c33c0690d23c74219f94fe7e81a56e356dc9d4d77
7
- data.tar.gz: 8d9e77eeef01e32a3278694e5f74035fc751bc93dbb39dc4a6a618405ab00f93219ee6d4c910924de812df451346d55c2a127d2e52d61ca125fb2346564e611b
6
+ metadata.gz: d17134915e61b4908cc9ff60393987181f5aeb74a459238d0a5b44ce52c9244f8746a4b9f79ff1833b976698d0b091229eeec90026fb6c8dcb71f5088c3d25fc
7
+ data.tar.gz: a8b626a075278480cffcc9fc6969b99a322bcf4fd0332f3a91efbbbcb6a925b84bb4fe66b98ab118bbdf02c9b66f73399c75f4504ed62e1a0513206a1b770d54
@@ -4,4 +4,5 @@ rvm:
4
4
  - 2.3.0
5
5
  before_install: gem install bundler -v 1.11.2
6
6
  script:
7
- - CODECLIMATE_REPO_TOKEN=9b21443096807b1b8e50308cf489cdea452b6d418e1fb48e89e55829b2fb6546 bundle exec rspec
7
+ - bundle exec rake
8
+ - CODECLIMATE_REPO_TOKEN=9b21443096807b1b8e50308cf489cdea452b6d418e1fb48e89e55829b2fb6546 bundle exec codeclimate-test-reporter
data/README.md CHANGED
@@ -38,8 +38,9 @@ Basic methods of each repository:
38
38
  9. `Repository.delete` should delete entity.
39
39
  10. `Repository.delete_by_id` should delete entity by id.
40
40
  11. `Repository.with_transaction(&block)` execute block in transaction if gateway support it.
41
- 12. `Repository.by_criteria` should return entities by given criteria.
42
- 13. `Repository.by_criteria_count` should return count of elements by given criteria.
41
+ 12. `Repository.with_lock(id, *args, &block)` in transaction: locks (with given arguments) db record with given id, execute block if gateway support it.
42
+ 13. `Repository.by_criteria` should return entities by given criteria.
43
+ 14. `Repository.by_criteria_count` should return count of elements by given criteria.
43
44
 
44
45
  ## Usage example
45
46
 
@@ -19,11 +19,12 @@ Gem::Specification.new do |spec|
19
19
 
20
20
  spec.required_ruby_version = '>= 2.2.2'
21
21
 
22
- spec.add_dependency 'dao-gateway', '>= 1.4'
22
+ spec.add_dependency 'dao-gateway', '>= 1.5'
23
23
 
24
24
  spec.add_development_dependency 'bundler', '~> 1.11'
25
25
  spec.add_development_dependency 'rake', '~> 10.0'
26
26
  spec.add_development_dependency 'rspec', '~> 3.4'
27
27
  spec.add_development_dependency 'rspec-its'
28
- spec.add_development_dependency 'codeclimate-test-reporter'
28
+ spec.add_development_dependency 'simplecov'
29
+ spec.add_development_dependency 'codeclimate-test-reporter', '~> 1.0.0'
29
30
  end
@@ -70,6 +70,10 @@ module Dao
70
70
  gateway.with_transaction(&block)
71
71
  end
72
72
 
73
+ def with_lock(id, *args, &block)
74
+ gateway.with_lock(id, *args, &block)
75
+ end
76
+
73
77
  def by_criteria(criteria)
74
78
  criteria.filter(scope)
75
79
  end
@@ -1,5 +1,5 @@
1
1
  module Dao
2
2
  module Repository
3
- VERSION = '1.4.0'
3
+ VERSION = '1.5.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dao-repository
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - llxff
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2016-12-05 00:00:00.000000000 Z
12
+ date: 2017-02-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: dao-gateway
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: '1.4'
20
+ version: '1.5'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
- version: '1.4'
27
+ version: '1.5'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: bundler
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -82,7 +82,7 @@ dependencies:
82
82
  - !ruby/object:Gem::Version
83
83
  version: '0'
84
84
  - !ruby/object:Gem::Dependency
85
- name: codeclimate-test-reporter
85
+ name: simplecov
86
86
  requirement: !ruby/object:Gem::Requirement
87
87
  requirements:
88
88
  - - ">="
@@ -95,6 +95,20 @@ dependencies:
95
95
  - - ">="
96
96
  - !ruby/object:Gem::Version
97
97
  version: '0'
98
+ - !ruby/object:Gem::Dependency
99
+ name: codeclimate-test-reporter
100
+ requirement: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - "~>"
103
+ - !ruby/object:Gem::Version
104
+ version: 1.0.0
105
+ type: :development
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - "~>"
110
+ - !ruby/object:Gem::Version
111
+ version: 1.0.0
98
112
  description: Base repository for DAO
99
113
  email:
100
114
  - ll.wg.bin@gmail.com