isolator 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3989180bbf762b11ac3da685f48e49a8a52ed0f4
4
+ data.tar.gz: 3b57b51b75473599d693202b08ed9077a93385a2
5
+ SHA512:
6
+ metadata.gz: 4ce58f4e7519ee626b6c71fcff3d68c14a6bd390bc0399c65186fc9c8b71b5afe7e8218d9c7b9b927ac2cdfd20101c9c13726e3000b9af2fae1d7b68fb8ae0e6
7
+ data.tar.gz: ce7c60f51a29ffd3b7a7850ad484c67cd5dec19c2d3b9ecd763514c2c985474724e9d0bce0bcdfa07ac23d748c4741d51d99bd5972c2fc4a440b9817b29c861b
data/.gitignore ADDED
@@ -0,0 +1,12 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.gem
11
+ gemfiles/*.lock
12
+ Gemfile.local
data/.rubocop.yml ADDED
@@ -0,0 +1,53 @@
1
+ require:
2
+ - rubocop-md
3
+
4
+ AllCops:
5
+ Include:
6
+ - 'lib/**/*.rb'
7
+ - 'lib/**/*.rake'
8
+ - 'spec/**/*.rb'
9
+ Exclude:
10
+ - 'bin/**/*'
11
+ - 'gemfiles/**/*'
12
+ - 'spec/dummy/**/*'
13
+ - 'vendor/**/*'
14
+ - 'tmp/**/*'
15
+ - 'Rakefile'
16
+ - 'Gemfile'
17
+ - '*.gemspec'
18
+ DisplayCopNames: true
19
+ StyleGuideCopsOnly: false
20
+ TargetRubyVersion: 2.3
21
+
22
+ Rails:
23
+ Enabled: false
24
+
25
+ Style/SymbolArray:
26
+ Enabled: false
27
+
28
+ Style/Documentation:
29
+ Exclude:
30
+ - 'spec/**/*.rb'
31
+
32
+ Style/StringLiterals:
33
+ EnforcedStyle: double_quotes
34
+
35
+ Style/RegexpLiteral:
36
+ Enabled: false
37
+
38
+ Style/BlockDelimiters:
39
+ Exclude:
40
+ - 'spec/**/*.rb'
41
+
42
+ Layout/SpaceInsideStringInterpolation:
43
+ EnforcedStyle: no_space
44
+
45
+ Lint/AmbiguousRegexpLiteral:
46
+ Enabled: false
47
+
48
+ Metrics/LineLength:
49
+ Max: 100
50
+
51
+ Metrics/BlockLength:
52
+ Exclude:
53
+ - 'spec/**/*.rb'
data/.travis.yml ADDED
@@ -0,0 +1,26 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.5.0
5
+
6
+ notifications:
7
+ email: false
8
+
9
+ matrix:
10
+ fast_finish: true
11
+ include:
12
+ - rvm: ruby-head
13
+ gemfile: gemfiles/railsmaster.gemfile
14
+ - rvm: jruby-9.1.0.0
15
+ gemfile: gemfiles/jruby.gemfile
16
+ - rvm: 2.5.0
17
+ gemfile: Gemfile
18
+ - rvm: 2.4.3
19
+ gemfile: Gemfile
20
+ - rvm: 2.3.1
21
+ gemfile: gemfiles/activerecord42.gemfile
22
+ allow_failures:
23
+ - rvm: ruby-head
24
+ gemfile: gemfiles/railsmaster.gemfile
25
+ - rvm: jruby-9.1.0.0
26
+ gemfile: gemfiles/jruby.gemfile
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ # Change log
2
+
3
+ ## master
4
+
5
+ [@palkan]: https://github.com/palkan
data/Gemfile ADDED
@@ -0,0 +1,16 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in isolator.gemspec
6
+ gemspec
7
+
8
+ gem 'pry-byebug'
9
+ gem 'sqlite3'
10
+ gem 'activerecord', '>= 5.0'
11
+
12
+ local_gemfile = 'Gemfile.local'
13
+
14
+ if File.exist?(local_gemfile)
15
+ eval(File.read(local_gemfile)) # rubocop:disable Security/Eval
16
+ end
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 Vladimir Dementyev
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,50 @@
1
+ [![Gem Version](https://badge.fury.io/rb/isolator.svg)](https://badge.fury.io/rb/isolator)
2
+ [![Build Status](https://travis-ci.org/palkan/isolator.svg?branch=master)](https://travis-ci.org/palkan/isolator)
3
+
4
+ # Isolator
5
+
6
+ Detect non-atomic interactions within DB transactions.
7
+
8
+ Examples:
9
+
10
+ ```ruby
11
+ # HTTP calls within transaction
12
+ User.transaction do
13
+ user = User.new(user_params)
14
+ user.save!
15
+ # HTTP API call
16
+ PaymentsService.charge!(user)
17
+ end
18
+
19
+ #=> raises Isolator::HTTPError
20
+
21
+ # background job
22
+ User.transaction do
23
+ user.update!(confirmed_at: Time.now)
24
+ UserMailer.successful_confirmation(user).deliver_later
25
+ end
26
+
27
+ #=> raises Isolator::BackgroundJobError
28
+ ```
29
+
30
+ ## Installation
31
+
32
+ Add this line to your application's Gemfile:
33
+
34
+ ```ruby
35
+ group :development, :test do
36
+ gem "isolator"
37
+ end
38
+ ```
39
+
40
+ ## Usage
41
+
42
+ TBD
43
+
44
+ ## Contributing
45
+
46
+ Bug reports and pull requests are welcome on GitHub at https://github.com/palkan/isolator.
47
+
48
+ ## License
49
+
50
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+ require "rubocop/rake_task"
4
+
5
+ RSpec::Core::RakeTask.new(:spec)
6
+ RuboCop::RakeTask.new
7
+
8
+ task default: [:rubocop, :spec]
data/bin/console ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "isolator"
5
+
6
+ require "pry"
7
+ Pry.start
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'activerecord', '~> 4.2'
4
+ gem 'sqlite3'
5
+
6
+ gemspec path: '..'
@@ -0,0 +1,7 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'activerecord-jdbcsqlite3-adapter', '~> 50.0'
4
+ gem 'jdbc-sqlite3'
5
+ gem 'activerecord', '~> 5.0.0'
6
+
7
+ gemspec path: '..'
@@ -0,0 +1,7 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'arel', github: 'rails/arel'
4
+ gem 'rails', github: 'rails/rails'
5
+ gem 'sqlite3'
6
+
7
+ gemspec path: '..'
data/isolator.gemspec ADDED
@@ -0,0 +1,28 @@
1
+ lib = File.expand_path("../lib", __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require "isolator/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "isolator"
7
+ spec.version = Isolator::VERSION
8
+ spec.authors = ["Vladimir Dementyev"]
9
+ spec.email = ["dementiev.vm@gmail.com"]
10
+
11
+ spec.summary = "Detect non-atomic interactions within DB transactions"
12
+ spec.description = "Detect non-atomic interactions within DB transactions"
13
+ spec.homepage = "https://github.com/palkan/isolator"
14
+ spec.license = "MIT"
15
+
16
+ spec.required_ruby_version = ">= 2.3.0"
17
+
18
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
19
+ f.match(%r{^(test|spec|features)/})
20
+ end
21
+ spec.require_paths = ["lib"]
22
+
23
+ spec.add_development_dependency "bundler", "~> 1.14"
24
+ spec.add_development_dependency "rake", "~> 10.0"
25
+ spec.add_development_dependency "rspec", "~> 3.0"
26
+ spec.add_development_dependency "rubocop", "~> 0.51"
27
+ spec.add_development_dependency "rubocop-md", "~> 0.2"
28
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Isolator
4
+ VERSION = "0.0.1"
5
+ end
data/lib/isolator.rb ADDED
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "isolator/version"
4
+
5
+ module Isolator # :nodoc:
6
+ end
metadata ADDED
@@ -0,0 +1,130 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: isolator
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Vladimir Dementyev
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-01-28 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.14'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.14'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubocop
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.51'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0.51'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rubocop-md
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '0.2'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '0.2'
83
+ description: Detect non-atomic interactions within DB transactions
84
+ email:
85
+ - dementiev.vm@gmail.com
86
+ executables: []
87
+ extensions: []
88
+ extra_rdoc_files: []
89
+ files:
90
+ - ".gitignore"
91
+ - ".rubocop.yml"
92
+ - ".travis.yml"
93
+ - CHANGELOG.md
94
+ - Gemfile
95
+ - LICENSE.txt
96
+ - README.md
97
+ - Rakefile
98
+ - bin/console
99
+ - bin/setup
100
+ - gemfiles/activerecord42.gemfile
101
+ - gemfiles/jruby.gemfile
102
+ - gemfiles/railsmaster.gemfile
103
+ - isolator.gemspec
104
+ - lib/isolator.rb
105
+ - lib/isolator/version.rb
106
+ homepage: https://github.com/palkan/isolator
107
+ licenses:
108
+ - MIT
109
+ metadata: {}
110
+ post_install_message:
111
+ rdoc_options: []
112
+ require_paths:
113
+ - lib
114
+ required_ruby_version: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ version: 2.3.0
119
+ required_rubygems_version: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - ">="
122
+ - !ruby/object:Gem::Version
123
+ version: '0'
124
+ requirements: []
125
+ rubyforge_project:
126
+ rubygems_version: 2.6.13
127
+ signing_key:
128
+ specification_version: 4
129
+ summary: Detect non-atomic interactions within DB transactions
130
+ test_files: []