activerecord-transactionable 3.0.1 → 3.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,34 +0,0 @@
1
- name: Code Style Checks
2
-
3
- on:
4
- push:
5
- branches:
6
- - master
7
- - '*-maintenance'
8
- - '*-dev'
9
- tags:
10
- - '!*' # Do not execute on tags
11
- pull_request:
12
- branches:
13
- - '*'
14
-
15
- jobs:
16
- rubocop:
17
- name: Rubocop
18
- if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')"
19
- strategy:
20
- fail-fast: false
21
- matrix:
22
- ruby:
23
- - 2.6
24
- runs-on: ubuntu-latest
25
- steps:
26
- - name: Checkout
27
- uses: actions/checkout@v2
28
- - name: Setup Ruby & Bundle
29
- uses: ruby/setup-ruby@v1
30
- with:
31
- ruby-version: ${{ matrix.ruby }}
32
- bundler-cache: true
33
- - name: Run Rubocop
34
- run: bundle exec rubocop -DESP
@@ -1,58 +0,0 @@
1
- name: Supported Rubies
2
-
3
- on:
4
- push:
5
- branches:
6
- - master
7
- - '*-maintenance'
8
- - '*-dev'
9
- tags:
10
- - '!*' # Do not execute on tags
11
- pull_request:
12
- branches:
13
- - '*'
14
-
15
- jobs:
16
- test:
17
- name: Specs - Ruby ${{ matrix.ruby }} ${{ matrix.name_extra || '' }}
18
- if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')"
19
- strategy:
20
- fail-fast: false
21
- matrix:
22
- ruby:
23
- - truffleruby-head
24
- - ruby-head
25
- - 3.0
26
- - 2.7
27
- - 2.6
28
- runs-on: ubuntu-latest
29
- continue-on-error: ${{ matrix.allow_failure || endsWith(matrix.ruby, 'head') }}
30
- steps:
31
- - uses: amancevice/setup-code-climate@v0
32
- name: CodeClimate Install
33
- if: matrix.ruby == '2.6' && github.event_name != 'pull_request'
34
- with:
35
- cc_test_reporter_id: ${{ secrets.CC_TEST_REPORTER_ID }}
36
- - name: Checkout
37
- uses: actions/checkout@v2
38
- - name: Setup Ruby & Bundle
39
- uses: ruby/setup-ruby@v1
40
- with:
41
- ruby-version: ${{ matrix.ruby }}
42
- bundler-cache: true
43
- - name: CodeClimate Pre-build Notification
44
- run: cc-test-reporter before-build
45
- if: matrix.ruby == '2.6' && github.event_name != 'pull_request'
46
- continue-on-error: ${{ matrix.allow_failures != 'false' }}
47
- - name: Run tests
48
- run: bundle exec rake test
49
- - uses: codecov/codecov-action@v2
50
- if: matrix.ruby == '2.6' && github.event_name != 'pull_request' && always()
51
- with:
52
- flags: unittests
53
- name: codecov-upload
54
- fail_ci_if_error: true
55
- - name: CodeClimate Post-build Notification
56
- run: cc-test-reporter after-build
57
- if: matrix.ruby == '2.6' && github.event_name != 'pull_request' && always()
58
- continue-on-error: ${{ matrix.allow_failures != 'false' }}
@@ -1,37 +0,0 @@
1
- name: Unsupported Rubies
2
-
3
- on:
4
- push:
5
- branches:
6
- - master
7
- - '*-maintenance'
8
- - '*-dev'
9
- tags:
10
- - '!*' # Do not execute on tags
11
- pull_request:
12
- branches:
13
- - '*'
14
-
15
- jobs:
16
- test:
17
- name: Specs - Ruby ${{ matrix.ruby }} ${{ matrix.name_extra || '' }}
18
- if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')"
19
- strategy:
20
- fail-fast: false
21
- matrix:
22
- ruby:
23
- - 2.5
24
- runs-on: ubuntu-18.04
25
- continue-on-error: ${{ matrix.allow_failure || endsWith(matrix.ruby, 'head') }}
26
- steps:
27
- - name: Checkout
28
- uses: actions/checkout@v2
29
- - name: Install cURL Headers
30
- run: sudo apt-get install libcurl4-openssl-dev
31
- - name: Setup Ruby & Bundle
32
- uses: ruby/setup-ruby@v1
33
- with:
34
- ruby-version: ${{ matrix.ruby }}
35
- bundler-cache: true
36
- - name: Run tests
37
- run: bundle exec rake test
data/.gitignore DELETED
@@ -1,12 +0,0 @@
1
- .bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
10
-
11
- # rspec failure tracking
12
- .rspec_status
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
data/.rubocop.yml DELETED
@@ -1,121 +0,0 @@
1
- inherit_from: .rubocop_todo.yml
2
-
3
- require:
4
- - 'rubocop-md'
5
- - 'rubocop-minitest'
6
- - 'rubocop-packaging'
7
- - 'rubocop-performance'
8
- - 'rubocop-rake'
9
- - 'rubocop-rspec'
10
- - 'rubocop-thread_safety'
11
-
12
- AllCops:
13
- NewCops: enable
14
- DisplayCopNames: true # Display the name of the failing cops
15
- TargetRubyVersion: 2.6 # Oldest non-EOL Ruby
16
-
17
- Gemspec/DateAssignment: # new in 1.10
18
- Enabled: true
19
- Layout/DotPosition:
20
- Enabled: true
21
- EnforcedStyle: trailing
22
- Layout/LineEndStringConcatenationIndentation: # new in 1.18
23
- Enabled: true
24
- Layout/SpaceBeforeBrackets: # new in 1.7
25
- Enabled: true
26
- Lint/AmbiguousAssignment: # new in 1.7
27
- Enabled: true
28
- Lint/AmbiguousOperatorPrecedence: # new in 1.21
29
- Enabled: true
30
- Lint/AmbiguousRange: # new in 1.19
31
- Enabled: true
32
- Lint/DeprecatedConstants: # new in 1.8
33
- Enabled: true
34
- Lint/DuplicateBranch: # new in 1.3
35
- Enabled: true
36
- Lint/DuplicateRegexpCharacterClassElement: # new in 1.1
37
- Enabled: true
38
- Lint/EmptyBlock: # new in 1.1
39
- Enabled: true
40
- Lint/EmptyClass: # new in 1.3
41
- Enabled: true
42
- Lint/EmptyInPattern: # new in 1.16
43
- Enabled: true
44
- Lint/IncompatibleIoSelectWithFiberScheduler: # new in 1.21
45
- Enabled: true
46
- Lint/LambdaWithoutLiteralBlock: # new in 1.8
47
- Enabled: true
48
- Lint/NoReturnInBeginEndBlocks: # new in 1.2
49
- Enabled: true
50
- Lint/NumberedParameterAssignment: # new in 1.9
51
- Enabled: true
52
- Lint/OrAssignmentToConstant: # new in 1.9
53
- Enabled: true
54
- Lint/RedundantDirGlobSort: # new in 1.8
55
- Enabled: true
56
- Lint/RequireRelativeSelfPath: # new in 1.22
57
- Enabled: true
58
- Lint/SymbolConversion: # new in 1.9
59
- Enabled: true
60
- Lint/ToEnumArguments: # new in 1.1
61
- Enabled: true
62
- Lint/TripleQuotes: # new in 1.9
63
- Enabled: true
64
- Lint/UnexpectedBlockArity: # new in 1.5
65
- Enabled: true
66
- Lint/UnmodifiedReduceAccumulator: # new in 1.1
67
- Enabled: true
68
- Metrics/BlockLength:
69
- IgnoredMethods:
70
- - context
71
- - describe
72
- - it
73
- - shared_context
74
- - shared_examples
75
- - shared_examples_for
76
- Security/IoMethods: # new in 1.22
77
- Enabled: true
78
- Style/ArgumentsForwarding: # new in 1.1
79
- Enabled: true
80
- Style/CollectionCompact: # new in 1.2
81
- Enabled: true
82
- Style/DocumentDynamicEvalDefinition: # new in 1.1
83
- Enabled: true
84
- Style/EndlessMethod: # new in 1.8
85
- Enabled: true
86
- Style/HashConversion: # new in 1.10
87
- Enabled: true
88
- Style/HashExcept: # new in 1.7
89
- Enabled: true
90
- Style/IfWithBooleanLiteralBranches: # new in 1.9
91
- Enabled: true
92
- Style/InPatternThen: # new in 1.16
93
- Enabled: true
94
- Style/MultilineInPatternThen: # new in 1.16
95
- Enabled: true
96
- Style/NegatedIfElseCondition: # new in 1.2
97
- Enabled: true
98
- Style/NilLambda: # new in 1.3
99
- Enabled: true
100
- Style/NumberedParameters: # new in 1.22
101
- Enabled: true
102
- Style/NumberedParametersLimit: # new in 1.22
103
- Enabled: true
104
- Style/QuotedSymbols: # new in 1.16
105
- Enabled: true
106
- Style/RedundantArgument: # new in 1.4
107
- Enabled: true
108
- Style/RedundantSelfAssignmentBranch: # new in 1.19
109
- Enabled: true
110
- Style/SelectByRegexp: # new in 1.22
111
- Enabled: true
112
- Style/StringChars: # new in 1.12
113
- Enabled: true
114
- Style/StringLiterals:
115
- Enabled: true
116
- EnforcedStyle: double_quotes
117
- Style/StringLiteralsInInterpolation:
118
- Enabled: true
119
- EnforcedStyle: double_quotes
120
- Style/SwapValues: # new in 1.1
121
- Enabled: true
data/.rubocop_todo.yml DELETED
@@ -1,149 +0,0 @@
1
- # This configuration was generated by
2
- # `rubocop --auto-gen-config`
3
- # on 2021-11-10 07:27:25 UTC using RuboCop version 1.22.3.
4
- # The point is for the user to remove these configuration records
5
- # one by one as the offenses are removed from the code base.
6
- # Note that changes in the inspected code, or installation of new
7
- # versions of RuboCop, may require this file to be generated again.
8
-
9
- # Offense count: 1
10
- # Configuration parameters: Include.
11
- # Include: **/*.gemspec
12
- Gemspec/RequiredRubyVersion:
13
- Exclude:
14
- - 'activerecord-transactionable.gemspec'
15
-
16
- # Offense count: 1
17
- # Configuration parameters: Include.
18
- # Include: **/*.gemspec
19
- Gemspec/RubyVersionGlobalsUsage:
20
- Exclude:
21
- - 'activerecord-transactionable.gemspec'
22
-
23
- # Offense count: 2
24
- # Cop supports --auto-correct.
25
- # Configuration parameters: Width, IgnoredPatterns.
26
- Layout/IndentationWidth:
27
- Exclude:
28
- - 'README.md'
29
-
30
- # Offense count: 5
31
- # Configuration parameters: AllowedMethods.
32
- # AllowedMethods: enums
33
- Lint/ConstantDefinitionInBlock:
34
- Exclude:
35
- - 'spec/activerecord/transactionable_spec.rb'
36
-
37
- # Offense count: 1
38
- Lint/MissingSuper:
39
- Exclude:
40
- - 'spec/config/active_record.rb'
41
-
42
- # Offense count: 6
43
- # Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
44
- Metrics/AbcSize:
45
- Max: 32
46
-
47
- # Offense count: 1
48
- # Configuration parameters: IgnoredMethods.
49
- Metrics/CyclomaticComplexity:
50
- Max: 10
51
-
52
- # Offense count: 6
53
- # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
54
- Metrics/MethodLength:
55
- Max: 37
56
-
57
- # Offense count: 1
58
- # Configuration parameters: CountComments, CountAsOne.
59
- Metrics/ModuleLength:
60
- Max: 135
61
-
62
- # Offense count: 3
63
- # Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
64
- Metrics/ParameterLists:
65
- Max: 8
66
-
67
- # Offense count: 1
68
- # Configuration parameters: IgnoredMethods.
69
- Metrics/PerceivedComplexity:
70
- Max: 12
71
-
72
- # Offense count: 1
73
- Packaging/GemspecGit:
74
- Exclude:
75
- - 'activerecord-transactionable.gemspec'
76
-
77
- # Offense count: 38
78
- # Configuration parameters: Prefixes.
79
- # Prefixes: when, with, without
80
- RSpec/ContextWording:
81
- Exclude:
82
- - 'spec/activerecord/transactionable_spec.rb'
83
-
84
- # Offense count: 1
85
- # Configuration parameters: CountAsOne.
86
- RSpec/ExampleLength:
87
- Max: 10
88
-
89
- # Offense count: 1
90
- # Configuration parameters: AssignmentOnly.
91
- RSpec/InstanceVariable:
92
- Exclude:
93
- - 'spec/activerecord/transactionable_spec.rb'
94
-
95
- # Offense count: 5
96
- RSpec/LeakyConstantDeclaration:
97
- Exclude:
98
- - 'spec/activerecord/transactionable_spec.rb'
99
-
100
- # Offense count: 48
101
- # Configuration parameters: .
102
- # SupportedStyles: have_received, receive
103
- RSpec/MessageSpies:
104
- EnforcedStyle: receive
105
-
106
- # Offense count: 27
107
- RSpec/MultipleExpectations:
108
- Max: 2
109
-
110
- # Offense count: 44
111
- # Configuration parameters: IgnoreSharedExamples.
112
- RSpec/NamedSubject:
113
- Exclude:
114
- - 'spec/activerecord/transactionable_spec.rb'
115
-
116
- # Offense count: 54
117
- RSpec/NestedGroups:
118
- Max: 8
119
-
120
- # Offense count: 5
121
- # Configuration parameters: AllowedConstants.
122
- Style/Documentation:
123
- Exclude:
124
- - '**/*.md'
125
- - '**/*.markdown'
126
- - 'lib/activerecord/transactionable.rb'
127
- - 'lib/activerecord/transactionable/result.rb'
128
- - 'spec/activerecord/transactionable_spec.rb'
129
- - 'spec/config/active_record.rb'
130
-
131
- # Offense count: 2
132
- # Configuration parameters: MinBodyLength.
133
- Style/GuardClause:
134
- Exclude:
135
- - 'README.md'
136
- - 'spec/activerecord/transactionable_spec.rb'
137
-
138
- # Offense count: 5
139
- ThreadSafety/InstanceVariableInClassMethod:
140
- Exclude:
141
- - 'spec/activerecord/transactionable_spec.rb'
142
-
143
- # Offense count: 70
144
- # Cop supports --auto-correct.
145
- # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
146
- # URISchemes: http, https
147
- # IgnoredPatterns: (?-mix:^\#)
148
- Layout/LineLength:
149
- Max: 278
data/.simplecov DELETED
@@ -1,37 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- ruby_version = Gem::Version.new(RUBY_VERSION)
4
- actual_version = lambda do |major, minor|
5
- actual = Gem::Version.new(ruby_version)
6
- major == actual.segments[0] && minor == actual.segments[1] && RUBY_ENGINE == "ruby"
7
- end
8
- coverage = actual_version.call(2, 6)
9
-
10
- if coverage
11
- require "simplecov-cobertura"
12
- require "simplecov_json_formatter"
13
- require "codecov"
14
-
15
- SimpleCov.start do
16
- add_filter "/spec/"
17
- add_filter "/lib/activerecord/transactionable/version.rb"
18
-
19
- if ENV["CI"]
20
- # Disambiguate individual test runs
21
- command_name "#{ENV["GITHUB_WORKFLOW"]} Job #{ENV["GITHUB_RUN_ID"]}:#{ENV["GITHUB_RUN_NUMBER"]}"
22
- formatters = []
23
- formatters << SimpleCov::Formatter::HTMLFormatter
24
- formatters << SimpleCov::Formatter::CoberturaFormatter
25
- formatters << SimpleCov::Formatter::JSONFormatter # For CodeClimate
26
- formatters << SimpleCov::Formatter::Codecov # For CodeCov
27
- formatter SimpleCov::Formatter::MultiFormatter.new(formatters)
28
- else
29
- # Use default
30
- formatter SimpleCov::Formatter::HTMLFormatter
31
- end
32
-
33
- track_files "**/*.rb"
34
- end
35
- else
36
- puts "Not running coverage on #{RUBY_ENGINE} #{RUBY_VERSION}"
37
- end
data/Gemfile DELETED
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source "https://rubygems.org"
4
-
5
- git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
6
-
7
- # Specify your gem's dependencies in activerecord-transactionable.gemspec
8
- gemspec
data/Rakefile DELETED
@@ -1,25 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- %w[
4
- bundler/gem_tasks
5
- rake/testtask
6
- rspec/core/rake_task
7
- fileutils
8
- ].each { |f| require f }
9
-
10
- Bundler::GemHelper.install_tasks
11
-
12
- RSpec::Core::RakeTask.new(:spec)
13
- desc "alias spec => test"
14
- task test: :spec
15
-
16
- begin
17
- require "rubocop/rake_task"
18
- RuboCop::RakeTask.new
19
- rescue LoadError
20
- task :rubocop do
21
- warn "RuboCop is disabled on Ruby #{RUBY_VERSION}"
22
- end
23
- end
24
-
25
- task default: %i[spec rubocop]
@@ -1,62 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- lib = File.expand_path("lib", __dir__)
4
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
- require "activerecord/transactionable/version"
6
-
7
- Gem::Specification.new do |spec|
8
- spec.name = "activerecord-transactionable"
9
- spec.version = Activerecord::Transactionable::VERSION
10
- spec.authors = ["Peter Boling"]
11
- spec.email = ["peter.boling@gmail.com"]
12
- spec.licenses = ["MIT"]
13
-
14
- spec.summary = "Do ActiveRecord transactions the right way."
15
- spec.description = "Getting transactions right is hard, and this gem makes it easier."
16
- spec.homepage = "http://www.railsbling.com/tags/activerecord-transactionable"
17
-
18
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
19
- spec.bindir = "exe"
20
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
- spec.require_paths = ["lib"]
22
- spec.required_ruby_version = ">= 2.5.0"
23
-
24
- ruby_version = Gem::Version.new(RUBY_VERSION)
25
- minimum_version = ->(version) { ruby_version >= Gem::Version.new(version) && RUBY_ENGINE == "ruby" }
26
- actual_version = lambda do |major, minor|
27
- actual = Gem::Version.new(ruby_version)
28
- major == actual.segments[0] && minor == actual.segments[1] && RUBY_ENGINE == "ruby"
29
- end
30
- coverage = actual_version.call(2, 6)
31
- linting = minimum_version.call("2.6")
32
- stream = minimum_version.call("2.3")
33
-
34
- spec.add_dependency "activemodel", ">= 4.0.0"
35
- spec.add_dependency "activerecord", ">= 4.0.0"
36
-
37
- spec.add_development_dependency "byebug", "~> 11.1"
38
- spec.add_development_dependency "factory_bot", ">= 4.0"
39
- spec.add_development_dependency "rake", ">= 12.0"
40
- spec.add_development_dependency "rspec", "~> 3.10"
41
- spec.add_development_dependency "rspec-benchmark", "~> 0.6"
42
- spec.add_development_dependency "rspec-block_is_expected", "~> 1.0"
43
- spec.add_development_dependency "rspec-pending_for", "~> 0.1"
44
- spec.add_development_dependency "silent_stream", "~> 1.0" if stream
45
- if linting
46
- spec.add_development_dependency("rubocop", "~> 1.22")
47
- spec.add_development_dependency("rubocop-md", "~> 1.0")
48
- spec.add_development_dependency("rubocop-minitest", "~> 0.15")
49
- spec.add_development_dependency("rubocop-packaging", "~> 0.5")
50
- spec.add_development_dependency("rubocop-performance", "~> 1.11")
51
- spec.add_development_dependency("rubocop-rake", "~> 0.6")
52
- spec.add_development_dependency("rubocop-rspec", "~> 2.5")
53
- spec.add_development_dependency("rubocop-thread_safety", "~> 0.4")
54
- end
55
- if coverage
56
- spec.add_development_dependency("codecov", "~> 0.6")
57
- spec.add_development_dependency("simplecov", "~> 0.21")
58
- spec.add_development_dependency("simplecov-cobertura", "~> 1.4")
59
- end
60
- spec.add_development_dependency "sqlite3", "~> 1"
61
- spec.add_development_dependency "yard", ">= 0.9.20"
62
- end
data/bin/console DELETED
@@ -1,15 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require "bundler/setup"
5
- require "activerecord/transactionable"
6
-
7
- # You can add fixtures and/or initialization code here to make experimenting
8
- # with your gem easier. You can also use a different console, if you like.
9
-
10
- # (If you use this, don't forget to add pry to your Gemfile!)
11
- # require "pry"
12
- # Pry.start
13
-
14
- require "irb"
15
- IRB.start
data/bin/setup DELETED
@@ -1,8 +0,0 @@
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