Skip to content

Commit

Permalink
Merge pull request #2 from kamsharipova/with-lock
Browse files Browse the repository at this point in the history
with_lock method added
  • Loading branch information
kamsharipova authored Feb 17, 2017
2 parents 78a5e90 + 60bfbf3 commit 97f6f14
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ rvm:
before_install: gem install bundler -v 1.11.2

script:
- CODECLIMATE_REPO_TOKEN=763e2fed349469f0d07de8278c7df59cc64b9b8aa8f2f178fb1e7c5efae1bc49 bundle exec rspec
- bundle exec rake
- CODECLIMATE_REPO_TOKEN=763e2fed349469f0d07de8278c7df59cc64b9b8aa8f2f178fb1e7c5efae1bc49 bundle exec codeclimate-test-reporter
3 changes: 2 additions & 1 deletion dao-gateway.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'rake', '~> 10.0'
spec.add_development_dependency 'rspec', '~> 3.4'
spec.add_development_dependency 'rspec-its'
spec.add_development_dependency 'codeclimate-test-reporter'
spec.add_development_dependency 'simplecov'
spec.add_development_dependency 'codeclimate-test-reporter', '~> 1.0.0'
end
4 changes: 4 additions & 0 deletions lib/dao/gateway/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ def with_transaction(&_block)
raise TransactionNotSupported
end

def with_lock(_id, &_block)
raise LockNotSupported
end

def serializable_relations(relations)
convert_array(relations)
end
Expand Down
5 changes: 5 additions & 0 deletions lib/dao/gateway/lock_not_supported.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module Dao
module Gateway
class LockNotSupported < StandardError; end
end
end
6 changes: 2 additions & 4 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
if ENV['CODECLIMATE_REPO_TOKEN']
require 'codeclimate-test-reporter'
CodeClimate::TestReporter.start
end
require 'simplecov'
SimpleCov.start

$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'dao/gateway'
Expand Down

0 comments on commit 97f6f14

Please sign in to comment.