acts_as_removable 3.0.0 → 3.2.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
  SHA256:
3
- metadata.gz: 2104af4e96da53bc63227ea60da8acd3916de925b60a21b4b07612d06a38afd5
4
- data.tar.gz: 4207a15fff8f2d84931726ac8a46dae342f505ec5249a353e029bbdd9ace6038
3
+ metadata.gz: e90331337f2511a5fd68294c5c57097bc4327dc0e6a8e76d05ca6583ddcec9f2
4
+ data.tar.gz: 9308d8ca6f08d3e841fe9b8012b5997248901087f8ab9463593f132b7ade549c
5
5
  SHA512:
6
- metadata.gz: fe7c2c196cedcee69c6e675b2eb728f91250d0e15f697a56e67b126e2eeaf31f20997944d6c12c5a770e6c4731fe42f0b15d670a1b8410465c1199f457b04ffc
7
- data.tar.gz: 4f4f97cf7baa15f67589383eef923753ac01e18c1b25d34dc3f11e1320f79042a2f9291cd86416cbf671126d9d625109961d0b5074ec6589ddfd611f6c9c0908
6
+ metadata.gz: 69892a74121499b980b647603f7719b9278cb76861cc5a95b725f5b05dce6cdf9fcb41b1f5702fdda402b8fa7f8f165c4173e88ed8bc8fbebadf263f4c1d7600
7
+ data.tar.gz: 9676d149163d49dab74d9ba843817130b74b58554ff37cb5f6e89f12ce080f158fe66fff03dcd696eaad0210248c6d9db68780521809a23ebd08a7650ccfbc8b
@@ -0,0 +1,29 @@
1
+ name: atcs_as_removable specs
2
+ on: [push]
3
+ jobs:
4
+ rspec:
5
+ runs-on: ubuntu-latest
6
+ env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
7
+ BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}
8
+ strategy:
9
+ matrix:
10
+ ruby: [2.6, 2.7, 3.0]
11
+ gemfile:
12
+ - rails52
13
+ - rails60
14
+ - rails61
15
+ - rails70
16
+ exclude:
17
+ - ruby: 2.6
18
+ gemfile: rails70
19
+ - ruby: 3.0
20
+ gemfile: rails52
21
+
22
+ steps:
23
+ - uses: actions/checkout@v2
24
+ - uses: ruby/setup-ruby@v1
25
+ with:
26
+ ruby-version: ${{ matrix.ruby }}
27
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
28
+ - name: Run tests
29
+ run: bundle exec rake spec
data/.rubocop.yml ADDED
@@ -0,0 +1,24 @@
1
+ require:
2
+ - rubocop-performance
3
+
4
+ AllCops:
5
+ TargetRubyVersion: 2.6
6
+
7
+ Layout/HashAlignment:
8
+ EnforcedHashRocketStyle: table
9
+ EnforcedColonStyle: table
10
+
11
+ Layout/LineLength:
12
+ Max: 120
13
+
14
+ Metrics/AbcSize:
15
+ Enabled: false
16
+
17
+ Metrics/MethodLength:
18
+ Enabled: false
19
+
20
+ Metrics/BlockLength:
21
+ Enabled: false
22
+
23
+ Style/Documentation:
24
+ Enabled: false
data/Changelog.md CHANGED
@@ -3,6 +3,25 @@ Changelog
3
3
 
4
4
  #### Unreleased
5
5
 
6
+ #### 3.2.0 (2021-12-16)
7
+ * Support for Rails 7.0
8
+ * (Update travis config) -> see below
9
+ * Replace Travis CI with github actions
10
+ * Require Ruby >= 2.6.0
11
+ * Fix renamed rubocop cops
12
+ * Update copyright year
13
+
14
+ #### 3.1.1 (2021-01-08)
15
+ * Add workaround for new argument handling in ruby 3
16
+
17
+ #### 3.1.0 (2020-12-10)
18
+ * Support for Rails 6.1.0
19
+ * Update travis config
20
+ * Reduce travis build matrix to save time and speed up CI
21
+
22
+ #### 3.0.1 (2019-11-06)
23
+ * Fix support for Rails 6.0.X patch level releases
24
+
6
25
  #### 3.0.0 (2019-08-26)
7
26
  * Support for Rails 6.0.0
8
27
  * Drop support for Rails < 5.0.0
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  # Specify your gem's dependencies in acts_as_removable.gemspec
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2019 SIC! Software GmbH
1
+ Copyright (c) 2021 SIC! Software GmbH
2
2
 
3
3
  MIT License
4
4
 
data/Rakefile CHANGED
@@ -1,7 +1,9 @@
1
- require "bundler/gem_tasks"
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
2
4
 
3
5
  require 'rspec/core'
4
6
  require 'rspec/core/rake_task'
5
7
  RSpec::Core::RakeTask.new(:spec)
6
8
 
7
- task :default => :spec
9
+ task default: :spec
@@ -1,28 +1,34 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path('lib', __dir__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+ require 'English'
4
6
  require 'acts_as_removable/version'
5
7
 
6
8
  Gem::Specification.new do |spec|
7
9
  spec.name = 'acts_as_removable'
8
10
  spec.version = ActsAsRemovable::VERSION
9
11
  spec.authors = ['Florian Schwab', 'Erik-B. Ernst']
10
- spec.email = ['florian.schwab@sic-software.com']
12
+ spec.email = ['florian.schwab@sic.software', 'erik.ernst@sic.software']
11
13
  spec.description = 'Simplifies handling of pseudo removed records.'
12
14
  spec.summary = 'Simplifies handling of pseudo removed records.'
13
15
  spec.homepage = 'https://github.com/SICSoftwareGmbH/acts_as_removable'
14
16
  spec.license = 'MIT'
15
17
 
16
- spec.files = `git ls-files`.split($/)
18
+ spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
17
19
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
20
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
21
  spec.require_paths = ['lib']
20
22
 
21
- spec.add_dependency 'activerecord', '>= 5.0', '<= 6.0'
22
- spec.add_dependency 'activesupport', '>= 5.0', '<= 6.0'
23
+ spec.required_ruby_version = '>= 2.6.0'
24
+
25
+ spec.add_dependency 'activerecord', '>= 5.0', '< 7.1'
26
+ spec.add_dependency 'activesupport', '>= 5.0', '< 7.1'
23
27
 
24
- spec.add_development_dependency 'bundler', '>= 1.3'
28
+ spec.add_development_dependency 'bundler', '~> 2.0'
25
29
  spec.add_development_dependency 'rake'
26
30
  spec.add_development_dependency 'rspec'
31
+ spec.add_development_dependency 'rubocop'
32
+ spec.add_development_dependency 'rubocop-performance'
27
33
  spec.add_development_dependency 'sqlite3'
28
34
  end
@@ -4,4 +4,4 @@ source 'https://rubygems.org'
4
4
  gemspec path: '..'
5
5
 
6
6
 
7
- gem 'railties', '~> 5.0'
7
+ gem 'railties', '~> 5.2'
@@ -4,4 +4,4 @@ source 'https://rubygems.org'
4
4
  gemspec path: '..'
5
5
 
6
6
 
7
- gem 'railties', '~> 4.0'
7
+ gem 'railties', '~> 6.0'
@@ -4,4 +4,4 @@ source 'https://rubygems.org'
4
4
  gemspec path: '..'
5
5
 
6
6
 
7
- gem 'railties', '~> 4.1'
7
+ gem 'railties', '~> 6.1'
@@ -4,4 +4,4 @@ source 'https://rubygems.org'
4
4
  gemspec path: '..'
5
5
 
6
6
 
7
- gem 'railties', '~> 4.2'
7
+ gem 'railties', '~> 7.0'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActsAsRemovable
2
- VERSION = '3.0.0'
4
+ VERSION = '3.2.0'
3
5
  end
@@ -1,6 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'active_support/concern'
2
4
  require 'active_record'
3
- require "acts_as_removable/version"
5
+ require 'acts_as_removable/version'
4
6
 
5
7
  module ActsAsRemovable
6
8
  extend ActiveSupport::Concern
@@ -17,11 +19,11 @@ module ActsAsRemovable
17
19
  def acts_as_removable(options = {})
18
20
  _acts_as_removable_options.merge!(options)
19
21
 
20
- scope :removed, -> {
22
+ scope :removed, lambda {
21
23
  where(all.table[_acts_as_removable_options[:column_name]].not_eq(nil).to_sql)
22
24
  }
23
25
 
24
- scope :actives, -> {
26
+ scope :actives, lambda {
25
27
  where(all.table[_acts_as_removable_options[:column_name]].eq(nil).to_sql)
26
28
  }
27
29
 
@@ -68,7 +70,13 @@ module ActsAsRemovable
68
70
  self.class.transaction do
69
71
  run_callbacks callback.to_sym do
70
72
  send("#{self.class._acts_as_removable_options[:column_name]}=", value)
71
- with_bang ? save!(options) : save(options)
73
+
74
+ # workaround for new argument handling
75
+ if RUBY_VERSION.to_i < 3
76
+ with_bang ? save!(options) : save(options)
77
+ else
78
+ with_bang ? save!(**options) : save(**options)
79
+ end
72
80
  end
73
81
  end
74
82
  end
@@ -76,9 +84,7 @@ module ActsAsRemovable
76
84
  end
77
85
 
78
86
  def _acts_as_removable_options
79
- @_acts_as_removable_options ||= {
80
- column_name: 'removed_at'
81
- }
87
+ @_acts_as_removable_options ||= { column_name: 'removed_at' }
82
88
  end
83
89
  end
84
90
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe 'acts_as_removable' do
@@ -26,10 +28,10 @@ describe 'acts_as_removable' do
26
28
  before do
27
29
  # setup database
28
30
  db_file = File.expand_path(File.join(File.dirname(__FILE__), '..', 'tmp', 'acts_as_removable.db'))
29
- Dir::mkdir(File.dirname(db_file)) unless File.exists?(File.dirname(db_file))
31
+ Dir.mkdir(File.dirname(db_file)) unless File.exist?(File.dirname(db_file))
30
32
  ActiveRecord::Base.establish_connection(
31
- :adapter => 'sqlite3',
32
- :database => "#{File.expand_path(File.join(File.dirname(__FILE__), '..'))}/tmp/acts_as_removable.db"
33
+ adapter: 'sqlite3',
34
+ database: "#{File.expand_path(File.join(File.dirname(__FILE__), '..'))}/tmp/acts_as_removable.db"
33
35
  )
34
36
  ActiveRecord::Base.connection.execute("DROP TABLE IF EXISTS 'my_models'")
35
37
  ActiveRecord::Base.connection.create_table(:my_models) do |t|
data/spec/spec_helper.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rubygems'
2
4
  require 'bundler/setup'
3
5
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_removable
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Schwab
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-08-26 00:00:00.000000000 Z
12
+ date: 2021-12-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -18,9 +18,9 @@ dependencies:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
20
  version: '5.0'
21
- - - "<="
21
+ - - "<"
22
22
  - !ruby/object:Gem::Version
23
- version: '6.0'
23
+ version: '7.1'
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
@@ -28,9 +28,9 @@ dependencies:
28
28
  - - ">="
29
29
  - !ruby/object:Gem::Version
30
30
  version: '5.0'
31
- - - "<="
31
+ - - "<"
32
32
  - !ruby/object:Gem::Version
33
- version: '6.0'
33
+ version: '7.1'
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: activesupport
36
36
  requirement: !ruby/object:Gem::Requirement
@@ -38,9 +38,9 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '5.0'
41
- - - "<="
41
+ - - "<"
42
42
  - !ruby/object:Gem::Version
43
- version: '6.0'
43
+ version: '7.1'
44
44
  type: :runtime
45
45
  prerelease: false
46
46
  version_requirements: !ruby/object:Gem::Requirement
@@ -48,23 +48,23 @@ dependencies:
48
48
  - - ">="
49
49
  - !ruby/object:Gem::Version
50
50
  version: '5.0'
51
- - - "<="
51
+ - - "<"
52
52
  - !ruby/object:Gem::Version
53
- version: '6.0'
53
+ version: '7.1'
54
54
  - !ruby/object:Gem::Dependency
55
55
  name: bundler
56
56
  requirement: !ruby/object:Gem::Requirement
57
57
  requirements:
58
- - - ">="
58
+ - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: '1.3'
60
+ version: '2.0'
61
61
  type: :development
62
62
  prerelease: false
63
63
  version_requirements: !ruby/object:Gem::Requirement
64
64
  requirements:
65
- - - ">="
65
+ - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: '1.3'
67
+ version: '2.0'
68
68
  - !ruby/object:Gem::Dependency
69
69
  name: rake
70
70
  requirement: !ruby/object:Gem::Requirement
@@ -93,6 +93,34 @@ dependencies:
93
93
  - - ">="
94
94
  - !ruby/object:Gem::Version
95
95
  version: '0'
96
+ - !ruby/object:Gem::Dependency
97
+ name: rubocop
98
+ requirement: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ type: :development
104
+ prerelease: false
105
+ version_requirements: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ - !ruby/object:Gem::Dependency
111
+ name: rubocop-performance
112
+ requirement: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
117
+ type: :development
118
+ prerelease: false
119
+ version_requirements: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - ">="
122
+ - !ruby/object:Gem::Version
123
+ version: '0'
96
124
  - !ruby/object:Gem::Dependency
97
125
  name: sqlite3
98
126
  requirement: !ruby/object:Gem::Requirement
@@ -109,23 +137,25 @@ dependencies:
109
137
  version: '0'
110
138
  description: Simplifies handling of pseudo removed records.
111
139
  email:
112
- - florian.schwab@sic-software.com
140
+ - florian.schwab@sic.software
141
+ - erik.ernst@sic.software
113
142
  executables: []
114
143
  extensions: []
115
144
  extra_rdoc_files: []
116
145
  files:
146
+ - ".github/workflows/workflow.yml"
117
147
  - ".gitignore"
118
- - ".travis.yml"
148
+ - ".rubocop.yml"
119
149
  - Changelog.md
120
150
  - Gemfile
121
151
  - LICENSE
122
152
  - README.md
123
153
  - Rakefile
124
154
  - acts_as_removable.gemspec
125
- - gemfiles/rails40
126
- - gemfiles/rails41
127
- - gemfiles/rails42
128
- - gemfiles/rails50
155
+ - gemfiles/rails52
156
+ - gemfiles/rails60
157
+ - gemfiles/rails61
158
+ - gemfiles/rails70
129
159
  - lib/acts_as_removable.rb
130
160
  - lib/acts_as_removable/version.rb
131
161
  - spec/acts_as_removable_spec.rb
@@ -142,14 +172,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
142
172
  requirements:
143
173
  - - ">="
144
174
  - !ruby/object:Gem::Version
145
- version: '0'
175
+ version: 2.6.0
146
176
  required_rubygems_version: !ruby/object:Gem::Requirement
147
177
  requirements:
148
178
  - - ">="
149
179
  - !ruby/object:Gem::Version
150
180
  version: '0'
151
181
  requirements: []
152
- rubygems_version: 3.0.3
182
+ rubygems_version: 3.2.32
153
183
  signing_key:
154
184
  specification_version: 4
155
185
  summary: Simplifies handling of pseudo removed records.
data/.travis.yml DELETED
@@ -1,18 +0,0 @@
1
- sudo: false
2
-
3
- language: ruby
4
-
5
- rvm:
6
- - 2.2.5
7
- - 2.3.1
8
-
9
- gemfile:
10
- - gemfiles/rails40
11
- - gemfiles/rails41
12
- - gemfiles/rails42
13
- - gemfiles/rails50
14
-
15
- script: bundle exec rake spec
16
-
17
- before_install:
18
- - gem install bundler -v '~> 1.12'