lite-archive 1.1.3 → 1.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: bf3cdb58b65c9f3680ff20c9f72a495c7d06a4996b967a4597ebcdd5af121517
4
- data.tar.gz: 9c26d266df7ff290be17677473d622cf16dffb83e6540baad3afa777afc2cb32
3
+ metadata.gz: ce473b0e1ae99d9aa1538d656d8fe2cbff4a4e87a061133eccdeed2071da3c77
4
+ data.tar.gz: cbab98bf4a3d868e7f3df0f95eb85b5306f4b5ab2acbb1d4a1524640340fdd8d
5
5
  SHA512:
6
- metadata.gz: 94ac1d89830d5de82ee38c1fc31f555f66ed5c6a9ac79ab6d2201ba52a503634ae3f6a5c0f909b02afa429a7d1110054ed2b81d4c310bfed881e565edd3459c8
7
- data.tar.gz: 64d6d6106e0fab93ef7c1a290008a765cf0d688cf4d5a014d3952d2a1eb7a5bb90691accbb0bfd67e8ff5d84d49f3a1647bd12778a72967460b8feb8dfa36892
6
+ metadata.gz: 9367ccb1e70e77c172d7742f846d63ee2a36bbc9be9966249faeaa0fa20504c55efd28e1bddda53a4d922af22a9575d9278b0bcb048b38cf20efb6b4a8ac49b4
7
+ data.tar.gz: 2a16b5bcea3da1f7c859c6b79ad69595fba681979168d2a09a3016267f380f67c6840a80ad8a8c1c08c4c8ed31a37736d0905ef6e4efb58b57ed462783394560
data/.rubocop.yml CHANGED
@@ -3,7 +3,6 @@ require:
3
3
  - rubocop-rake
4
4
  - rubocop-rspec
5
5
  AllCops:
6
- TargetRubyVersion: 3.0
7
6
  NewCops: enable
8
7
  DisplayCopNames: true
9
8
  DisplayStyleGuide: true
@@ -19,7 +18,7 @@ Layout/EmptyLinesAroundClassBody:
19
18
  Layout/EmptyLinesAroundModuleBody:
20
19
  EnforcedStyle: empty_lines_except_namespace
21
20
  Layout/LineLength:
22
- Max: 100
21
+ Enabled: false
23
22
  Layout/SpaceAroundMethodCallOperator:
24
23
  Enabled: true
25
24
  Lint/RaiseException:
@@ -38,3 +37,5 @@ Style/Documentation:
38
37
  Enabled: false
39
38
  Style/ExpandPathArguments:
40
39
  Enabled: false
40
+ Style/StringLiterals:
41
+ EnforcedStyle: double_quotes
data/CHANGELOG.md CHANGED
@@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [1.2.0] - 2022-11-19
10
+ ### Changed
11
+ - Improved docs
12
+ - Improve internal setup
13
+ - Improved rubocop setup
14
+
9
15
  ## [1.1.3] - 2021-07-22
10
16
  ### Changed
11
17
  - Move locales to lib
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- source 'https://rubygems.org'
3
+ source "https://rubygems.org"
4
4
 
5
5
  # Specify your gem's dependencies in lite-archive.gemspec
6
6
  gemspec
data/Gemfile.lock CHANGED
@@ -1,41 +1,40 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lite-archive (1.1.3)
4
+ lite-archive (1.2.0)
5
5
  activerecord
6
6
  activesupport
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- actionpack (6.1.4)
12
- actionview (= 6.1.4)
13
- activesupport (= 6.1.4)
14
- rack (~> 2.0, >= 2.0.9)
11
+ actionpack (7.0.4)
12
+ actionview (= 7.0.4)
13
+ activesupport (= 7.0.4)
14
+ rack (~> 2.0, >= 2.2.0)
15
15
  rack-test (>= 0.6.3)
16
16
  rails-dom-testing (~> 2.0)
17
17
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
18
- actionview (6.1.4)
19
- activesupport (= 6.1.4)
18
+ actionview (7.0.4)
19
+ activesupport (= 7.0.4)
20
20
  builder (~> 3.1)
21
21
  erubi (~> 1.4)
22
22
  rails-dom-testing (~> 2.0)
23
23
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
24
- activemodel (6.1.4)
25
- activesupport (= 6.1.4)
26
- activerecord (6.1.4)
27
- activemodel (= 6.1.4)
28
- activesupport (= 6.1.4)
29
- activesupport (6.1.4)
24
+ activemodel (7.0.4)
25
+ activesupport (= 7.0.4)
26
+ activerecord (7.0.4)
27
+ activemodel (= 7.0.4)
28
+ activesupport (= 7.0.4)
29
+ activesupport (7.0.4)
30
30
  concurrent-ruby (~> 1.0, >= 1.0.2)
31
31
  i18n (>= 1.6, < 2)
32
32
  minitest (>= 5.1)
33
33
  tzinfo (~> 2.0)
34
- zeitwerk (~> 2.3)
35
34
  ast (2.4.2)
36
35
  builder (3.2.4)
37
36
  colorize (0.8.1)
38
- concurrent-ruby (1.1.9)
37
+ concurrent-ruby (1.1.10)
39
38
  crass (1.0.6)
40
39
  database_cleaner (2.0.1)
41
40
  database_cleaner-active_record (~> 2.0.0)
@@ -43,97 +42,100 @@ GEM
43
42
  activerecord (>= 5.a)
44
43
  database_cleaner-core (~> 2.0.0)
45
44
  database_cleaner-core (2.0.1)
46
- diff-lcs (1.4.4)
47
- erubi (1.10.0)
48
- fasterer (0.9.0)
45
+ diff-lcs (1.5.0)
46
+ erubi (1.11.0)
47
+ fasterer (0.10.0)
49
48
  colorize (~> 0.7)
50
- ruby_parser (>= 3.14.1)
49
+ ruby_parser (>= 3.19.1)
51
50
  generator_spec (0.9.4)
52
51
  activesupport (>= 3.0.0)
53
52
  railties (>= 3.0.0)
54
- i18n (1.8.10)
53
+ i18n (1.12.0)
55
54
  concurrent-ruby (~> 1.0)
56
- loofah (2.10.0)
55
+ json (2.6.2)
56
+ loofah (2.19.0)
57
57
  crass (~> 1.0.2)
58
58
  nokogiri (>= 1.5.9)
59
59
  method_source (1.0.0)
60
- mini_portile2 (2.5.3)
61
- minitest (5.14.4)
62
- nokogiri (1.11.7)
63
- mini_portile2 (~> 2.5.0)
60
+ mini_portile2 (2.8.0)
61
+ minitest (5.16.3)
62
+ nokogiri (1.13.9)
63
+ mini_portile2 (~> 2.8.0)
64
64
  racc (~> 1.4)
65
- parallel (1.20.1)
66
- parser (3.0.2.0)
65
+ parallel (1.22.1)
66
+ parser (3.1.2.1)
67
67
  ast (~> 2.4.1)
68
- racc (1.5.2)
69
- rack (2.2.3)
70
- rack-test (1.1.0)
71
- rack (>= 1.0, < 3)
68
+ racc (1.6.0)
69
+ rack (2.2.4)
70
+ rack-test (2.0.2)
71
+ rack (>= 1.3)
72
72
  rails-dom-testing (2.0.3)
73
73
  activesupport (>= 4.2.0)
74
74
  nokogiri (>= 1.6)
75
- rails-html-sanitizer (1.3.0)
75
+ rails-html-sanitizer (1.4.3)
76
76
  loofah (~> 2.3)
77
- railties (6.1.4)
78
- actionpack (= 6.1.4)
79
- activesupport (= 6.1.4)
77
+ railties (7.0.4)
78
+ actionpack (= 7.0.4)
79
+ activesupport (= 7.0.4)
80
80
  method_source
81
- rake (>= 0.13)
81
+ rake (>= 12.2)
82
82
  thor (~> 1.0)
83
- rainbow (3.0.0)
83
+ zeitwerk (~> 2.5)
84
+ rainbow (3.1.1)
84
85
  rake (13.0.6)
85
- regexp_parser (2.1.1)
86
+ regexp_parser (2.6.1)
86
87
  rexml (3.2.5)
87
- rspec (3.10.0)
88
- rspec-core (~> 3.10.0)
89
- rspec-expectations (~> 3.10.0)
90
- rspec-mocks (~> 3.10.0)
91
- rspec-core (3.10.1)
92
- rspec-support (~> 3.10.0)
93
- rspec-expectations (3.10.1)
88
+ rspec (3.12.0)
89
+ rspec-core (~> 3.12.0)
90
+ rspec-expectations (~> 3.12.0)
91
+ rspec-mocks (~> 3.12.0)
92
+ rspec-core (3.12.0)
93
+ rspec-support (~> 3.12.0)
94
+ rspec-expectations (3.12.0)
94
95
  diff-lcs (>= 1.2.0, < 2.0)
95
- rspec-support (~> 3.10.0)
96
- rspec-mocks (3.10.2)
96
+ rspec-support (~> 3.12.0)
97
+ rspec-mocks (3.12.0)
97
98
  diff-lcs (>= 1.2.0, < 2.0)
98
- rspec-support (~> 3.10.0)
99
- rspec-rails (5.0.1)
100
- actionpack (>= 5.2)
101
- activesupport (>= 5.2)
102
- railties (>= 5.2)
103
- rspec-core (~> 3.10)
104
- rspec-expectations (~> 3.10)
105
- rspec-mocks (~> 3.10)
106
- rspec-support (~> 3.10)
107
- rspec-support (3.10.2)
108
- rubocop (1.18.3)
99
+ rspec-support (~> 3.12.0)
100
+ rspec-rails (6.0.1)
101
+ actionpack (>= 6.1)
102
+ activesupport (>= 6.1)
103
+ railties (>= 6.1)
104
+ rspec-core (~> 3.11)
105
+ rspec-expectations (~> 3.11)
106
+ rspec-mocks (~> 3.11)
107
+ rspec-support (~> 3.11)
108
+ rspec-support (3.12.0)
109
+ rubocop (1.39.0)
110
+ json (~> 2.3)
109
111
  parallel (~> 1.10)
110
- parser (>= 3.0.0.0)
112
+ parser (>= 3.1.2.1)
111
113
  rainbow (>= 2.2.2, < 4.0)
112
114
  regexp_parser (>= 1.8, < 3.0)
113
- rexml
114
- rubocop-ast (>= 1.7.0, < 2.0)
115
+ rexml (>= 3.2.5, < 4.0)
116
+ rubocop-ast (>= 1.23.0, < 2.0)
115
117
  ruby-progressbar (~> 1.7)
116
118
  unicode-display_width (>= 1.4.0, < 3.0)
117
- rubocop-ast (1.8.0)
118
- parser (>= 3.0.1.1)
119
- rubocop-performance (1.11.4)
119
+ rubocop-ast (1.23.0)
120
+ parser (>= 3.1.1.0)
121
+ rubocop-performance (1.15.1)
120
122
  rubocop (>= 1.7.0, < 2.0)
121
123
  rubocop-ast (>= 0.4.0)
122
124
  rubocop-rake (0.6.0)
123
125
  rubocop (~> 1.0)
124
- rubocop-rspec (2.4.0)
125
- rubocop (~> 1.0)
126
- rubocop-ast (>= 1.1.0)
126
+ rubocop-rspec (2.15.0)
127
+ rubocop (~> 1.33)
127
128
  ruby-progressbar (1.11.0)
128
- ruby_parser (3.16.0)
129
- sexp_processor (~> 4.15, >= 4.15.1)
130
- sexp_processor (4.15.3)
131
- sqlite3 (1.4.2)
132
- thor (1.1.0)
133
- tzinfo (2.0.4)
129
+ ruby_parser (3.19.1)
130
+ sexp_processor (~> 4.16)
131
+ sexp_processor (4.16.1)
132
+ sqlite3 (1.5.4)
133
+ mini_portile2 (~> 2.8.0)
134
+ thor (1.2.1)
135
+ tzinfo (2.0.5)
134
136
  concurrent-ruby (~> 1.0)
135
- unicode-display_width (2.0.0)
136
- zeitwerk (2.4.2)
137
+ unicode-display_width (2.3.0)
138
+ zeitwerk (2.6.6)
137
139
 
138
140
  PLATFORMS
139
141
  ruby
@@ -154,4 +156,4 @@ DEPENDENCIES
154
156
  sqlite3
155
157
 
156
158
  BUNDLED WITH
157
- 2.2.24
159
+ 2.3.26
data/README.md CHANGED
@@ -5,8 +5,6 @@
5
5
 
6
6
  Lite::Archive is a library for archiving (soft-delete) database records.
7
7
 
8
- **NOTE:** If you are coming from `ActiveArchive`, please read the [port](#port) section.
9
-
10
8
  ## Installation
11
9
 
12
10
  Add this line to your application's Gemfile:
@@ -30,12 +28,11 @@ Or install it yourself as:
30
28
  * [Methods](#methods)
31
29
  * [Scopes](#scopes)
32
30
  * [Callbacks](#callbacks)
33
- * [Port](#port)
34
31
 
35
32
  ## Configurations
36
33
 
37
- `rails g lite:archive:install` will generate the following file:
38
- `../config/initalizers/lite_archive.rb`
34
+ `rails g lite:archive:install` will generate the following file in your application root:
35
+ `config/initalizers/lite_archive.rb`
39
36
 
40
37
  ```ruby
41
38
  Lite::Archive.configure do |config|
@@ -46,35 +43,46 @@ end
46
43
 
47
44
  ## Usage
48
45
 
49
- An `archived_at` column must be added to tables where you do not want records destroyed.
50
- If the table does not have this column, records will be destroy instead of archived.
46
+ An `archived_at` column must be added to tables where you that you want to archive.
47
+ If the table does not have this column, records will be destroyed instead.
51
48
 
49
+ #### Table create
52
50
  ```ruby
53
51
  class AddArchivedAtColumn < ActiveRecord::Migration
54
52
  def change
55
53
  create_table :table_name do |t|
56
- t.timestamp # Adds archived_at automatically (if all_records_archivable is set to true)
54
+ t.timestamp # Adds archived_at automatically if all_records_archivable
57
55
  t.timestamp archive: true # Adds archived_at timestamp
58
56
  t.timestamp archive: false # Does NOT add archived_at timestamp
59
57
  end
58
+ end
59
+ end
60
+ ```
60
61
 
61
- add_timestamp :table_name
62
-
62
+ #### Column migration
63
+ ```ruby
64
+ class AddArchivedAtColumn < ActiveRecord::Migration
65
+ def change
63
66
  add_column :table_name, :archived_at, :datetime # Manual column (null constraint must be false)
67
+ add_timestamp :table_name # Named column helper (equivalent to the above)
64
68
  end
65
69
  end
66
70
  ```
67
71
 
68
72
  ## Methods
69
73
 
74
+ #### Instance
70
75
  ```ruby
71
76
  user = User.first
72
- user.archive #=> Archives the User record and its dependents
73
- user.unarchive #=> Unarchives the User record and its dependents
74
- user.to_archival #=> Returns the User archival state locale string (ex: Archived)
77
+ user.archive #=> Archives the User record and its dependents
78
+ user.unarchive #=> Unarchives the User record and its dependents
79
+ user.to_archival #=> Returns the User archival state locale string (ex: Archived)
80
+ ```
75
81
 
76
- User.archive_all #=> Archives all User records and their dependents
77
- User.unarchive_all #=> Unarchives all User record and their dependents
82
+ #### Class
83
+ ```ruby
84
+ User.archive_all #=> Archives all User records and their dependents
85
+ User.unarchive_all #=> Unarchives all User record and their dependents
78
86
  ```
79
87
 
80
88
  ## Scopes
@@ -86,25 +94,21 @@ User.unarchived.all #=> Returns only unarchived records
86
94
 
87
95
  ## Callbacks
88
96
 
97
+ #### Before
89
98
  ```ruby
90
99
  class User < ActiveRecord::Base
91
- # ... omitted ...
92
-
93
100
  before_archive :do_something
94
- after_archive :do_something
95
-
96
101
  before_unarchived :do_something
97
- after_unarchive :do_something
98
-
99
- # ... omitted ...
100
102
  end
101
103
  ```
102
104
 
103
- ## Port
104
-
105
- `Lite::Archive` is a compatible port of [ActiveArchive](https://github.com/drexed/active_archive).
106
-
107
- Switching is as easy as renaming `ActiveArchive` to `Lite::Archive`.
105
+ #### After
106
+ ```ruby
107
+ class User < ActiveRecord::Base
108
+ after_archive :do_something
109
+ after_unarchive :do_something
110
+ end
111
+ ```
108
112
 
109
113
  ## Development
110
114
 
@@ -114,7 +118,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
114
118
 
115
119
  ## Contributing
116
120
 
117
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/lite-archive. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
121
+ Bug reports and pull requests are welcome on GitHub at https://github.com/drexed/lite-archive. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
118
122
 
119
123
  ## License
120
124
 
@@ -122,4 +126,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
122
126
 
123
127
  ## Code of Conduct
124
128
 
125
- Everyone interacting in the Lite::Archive project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/lite-archive/blob/master/CODE_OF_CONDUCT.md).
129
+ Everyone interacting in the Lite::Archive project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/drexed/lite-archive/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'bundler/gem_tasks'
4
- require 'rspec/core/rake_task'
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
5
 
6
6
  RSpec::Core::RakeTask.new(:spec)
7
7
 
data/bin/console CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- require 'bundler/setup'
5
- require 'lite/archive'
4
+ require "bundler/setup"
5
+ require "lite/archive"
6
6
 
7
7
  # You can add fixtures and/or initialization code here to make experimenting
8
8
  # with your gem easier. You can also use a different console, if you like.
@@ -11,5 +11,5 @@ require 'lite/archive'
11
11
  # require "pry"
12
12
  # Pry.start
13
13
 
14
- require 'irb'
14
+ require "irb"
15
15
  IRB.start(__FILE__)
@@ -4,10 +4,10 @@ module Lite
4
4
  module Archive
5
5
  class InstallGenerator < Rails::Generators::Base
6
6
 
7
- source_root File.expand_path('../templates', __FILE__)
7
+ source_root File.expand_path("../templates", __FILE__)
8
8
 
9
9
  def copy_initializer_file
10
- copy_file('install.rb', 'config/initializers/lite_archive.rb')
10
+ copy_file("install.rb", "config/initializers/lite_archive.rb")
11
11
  end
12
12
 
13
13
  end
@@ -9,7 +9,8 @@ module Lite
9
9
  base.extend Scopes
10
10
 
11
11
  base.instance_eval do
12
- %i[archive unarchive].each { |name| define_model_callbacks name, only: %i[before after] }
12
+ define_model_callbacks :archive, only: %i[before after]
13
+ define_model_callbacks :unarchive, only: %i[before after]
13
14
  end
14
15
  end
15
16
 
@@ -84,12 +85,14 @@ module Lite
84
85
 
85
86
  self.updated_at = ts if updatable?
86
87
  self.archived_at = ts
88
+
87
89
  save(validate: false)
88
90
  end
89
91
 
90
92
  def mark_as_unarchived
91
93
  self.updated_at = archival_timestamp if updatable?
92
94
  self.archived_at = nil
95
+
93
96
  save(validate: false)
94
97
  end
95
98
 
@@ -101,12 +104,13 @@ module Lite
101
104
  dependents = reflection_dependents(table_name)
102
105
  next if dependents.nil?
103
106
 
104
- action = case [reflection_marco(reflection), archivable?]
105
- when ['one', true] then :archive
106
- when ['one', false] then :destroy
107
- when ['many', true] then :archive_all
108
- when ['many', false] then :destroy_all
109
- end
107
+ action =
108
+ case [reflection_marco(reflection), archivable?]
109
+ when ["one", true] then :archive
110
+ when ["one", false] then :destroy
111
+ when ["many", true] then :archive_all
112
+ when ["many", false] then :destroy_all
113
+ end
110
114
 
111
115
  dependents.send(action)
112
116
  end
@@ -123,10 +127,11 @@ module Lite
123
127
  dependents = reflection_dependents(table_name)
124
128
  next if dependents.nil?
125
129
 
126
- action = case reflection_marco(reflection)
127
- when 'one' then :unarchive
128
- when 'many' then :unarchive_all
129
- end
130
+ action =
131
+ case reflection_marco(reflection)
132
+ when "one" then :unarchive
133
+ when "many" then :unarchive_all
134
+ end
130
135
 
131
136
  dependents.send(action)
132
137
  end
@@ -142,7 +147,7 @@ module Lite
142
147
  end
143
148
 
144
149
  def reflection_marco(reflection)
145
- reflection.macro.to_s.gsub('has_', '')
150
+ reflection.macro.to_s.gsub("has_", "")
146
151
  end
147
152
 
148
153
  def updatable?
@@ -5,7 +5,7 @@ module Lite
5
5
  module Methods
6
6
 
7
7
  def archivable?
8
- columns.detect { |col| col.name == 'archived_at' }
8
+ columns.detect { |col| col.name == "archived_at" }
9
9
  end
10
10
 
11
11
  def archive_all(conditions = nil)
@@ -4,7 +4,7 @@ module Lite
4
4
  module Archive
5
5
  class Railtie < Rails::Railtie
6
6
 
7
- initializer 'lite-archive.configure_locales' do |app|
7
+ initializer "lite-archive.configure_locales" do |app|
8
8
  Array(app.config.i18n.available_locales).each do |locale|
9
9
  path = File.expand_path("../../../locales/#{locale}.yml", __FILE__)
10
10
  next unless File.file?(path)
@@ -3,7 +3,7 @@
3
3
  module Lite
4
4
  module Archive
5
5
 
6
- VERSION = '1.1.3'
6
+ VERSION = "1.2.0"
7
7
 
8
8
  end
9
9
  end
data/lib/lite/archive.rb CHANGED
@@ -1,15 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'active_record' unless defined?(ActiveRecord)
4
- require 'active_support' unless defined?(ActiveSupport)
3
+ require "active_record" unless defined?(ActiveRecord)
4
+ require "active_support" unless defined?(ActiveSupport)
5
5
 
6
- require 'generators/lite/archive/install_generator' if defined?(Rails::Generators)
6
+ require "generators/lite/archive/install_generator" if defined?(Rails::Generators)
7
7
 
8
- require 'lite/archive/railtie' if defined?(Rails::Railtie)
9
- require 'lite/archive/version'
10
- require 'lite/archive/configuration'
11
- require 'lite/archive/schema_statement'
12
- require 'lite/archive/table_definition'
13
- require 'lite/archive/methods'
14
- require 'lite/archive/scopes'
15
- require 'lite/archive/base'
8
+ require "lite/archive/railtie" if defined?(Rails::Railtie)
9
+ require "lite/archive/version"
10
+ require "lite/archive/configuration"
11
+ require "lite/archive/schema_statement"
12
+ require "lite/archive/table_definition"
13
+ require "lite/archive/methods"
14
+ require "lite/archive/scopes"
15
+ require "lite/archive/base"
data/lite-archive.gemspec CHANGED
@@ -1,55 +1,49 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- lib = File.expand_path('../lib', __FILE__)
3
+ lib = File.expand_path("../lib", __FILE__)
4
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
- require 'lite/archive/version'
5
+ require "lite/archive/version"
6
6
 
7
7
  Gem::Specification.new do |spec|
8
- spec.name = 'lite-archive'
8
+ spec.name = "lite-archive"
9
9
  spec.version = Lite::Archive::VERSION
10
- spec.authors = ['Juan Gomez']
10
+ spec.authors = ["Juan Gomez"]
11
11
  spec.email = %w[j.gomez@drexed.com]
12
12
 
13
- spec.summary = 'Archive (soft-delete) ActiveRecord database records'
14
- spec.homepage = 'http://drexed.github.io/lite-archive'
15
- spec.license = 'MIT'
13
+ spec.summary = "Archive (soft-delete) ActiveRecord database records"
14
+ spec.homepage = "http://drexed.github.io/lite-archive"
15
+ spec.license = "MIT"
16
16
 
17
17
  # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
18
  # to allow pushing to a single host or delete this section to allow pushing to any host.
19
- if spec.respond_to?(:metadata)
20
- spec.metadata.merge(
21
- 'allowed_push_host' => 'https://rubygems.org',
22
- 'changelog_uri' => 'https://github.com/drexed/lite-archive/blob/master/CHANGELOG.md',
23
- 'homepage_uri' => spec.homepage,
24
- 'source_code_uri' => 'https://github.com/drexed/lite-archive'
25
- )
26
- else
27
- raise 'RubyGems 2.0 or newer is required to protect against ' \
28
- 'public gem pushes.'
29
- end
19
+ spec.metadata["allowed_push_host"] = "https://rubygems.org"
20
+ spec.metadata["changelog_uri"] = "https://github.com/drexed/lite-archive/blob/master/CHANGELOG.md"
21
+ spec.metadata["homepage_uri"] = spec.homepage
22
+ spec.metadata["rubygems_mfa_required"] = "true"
23
+ spec.metadata["source_code_uri"] = "https://github.com/drexed/lite-archive"
30
24
 
31
25
  # Specify which files should be added to the gem when it is released.
32
26
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
33
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
27
+ spec.files = Dir.chdir(File.expand_path("..", __FILE__)) do
34
28
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
35
29
  end
36
- spec.bindir = 'exe'
30
+ spec.bindir = "exe"
37
31
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
38
32
  spec.require_paths = %w[lib]
39
33
 
40
- spec.add_runtime_dependency 'activerecord'
41
- spec.add_runtime_dependency 'activesupport'
34
+ spec.add_runtime_dependency "activerecord"
35
+ spec.add_runtime_dependency "activesupport"
42
36
 
43
- spec.add_development_dependency 'bundler'
44
- spec.add_development_dependency 'database_cleaner'
45
- spec.add_development_dependency 'fasterer'
46
- spec.add_development_dependency 'generator_spec'
47
- spec.add_development_dependency 'rake'
48
- spec.add_development_dependency 'rspec'
49
- spec.add_development_dependency 'rspec-rails'
50
- spec.add_development_dependency 'rubocop'
51
- spec.add_development_dependency 'rubocop-performance'
52
- spec.add_development_dependency 'rubocop-rake'
53
- spec.add_development_dependency 'rubocop-rspec'
54
- spec.add_development_dependency 'sqlite3'
37
+ spec.add_development_dependency "bundler"
38
+ spec.add_development_dependency "database_cleaner"
39
+ spec.add_development_dependency "fasterer"
40
+ spec.add_development_dependency "generator_spec"
41
+ spec.add_development_dependency "rake"
42
+ spec.add_development_dependency "rspec"
43
+ spec.add_development_dependency "rspec-rails"
44
+ spec.add_development_dependency "rubocop"
45
+ spec.add_development_dependency "rubocop-performance"
46
+ spec.add_development_dependency "rubocop-rake"
47
+ spec.add_development_dependency "rubocop-rspec"
48
+ spec.add_development_dependency "sqlite3"
55
49
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lite-archive
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-07-22 00:00:00.000000000 Z
11
+ date: 2022-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -217,7 +217,6 @@ files:
217
217
  - ".gitignore"
218
218
  - ".rspec"
219
219
  - ".rubocop.yml"
220
- - ".travis.yml"
221
220
  - CHANGELOG.md
222
221
  - CODE_OF_CONDUCT.md
223
222
  - Gemfile
@@ -244,7 +243,12 @@ files:
244
243
  homepage: http://drexed.github.io/lite-archive
245
244
  licenses:
246
245
  - MIT
247
- metadata: {}
246
+ metadata:
247
+ allowed_push_host: https://rubygems.org
248
+ changelog_uri: https://github.com/drexed/lite-archive/blob/master/CHANGELOG.md
249
+ homepage_uri: http://drexed.github.io/lite-archive
250
+ rubygems_mfa_required: 'true'
251
+ source_code_uri: https://github.com/drexed/lite-archive
248
252
  post_install_message:
249
253
  rdoc_options: []
250
254
  require_paths:
@@ -260,7 +264,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
260
264
  - !ruby/object:Gem::Version
261
265
  version: '0'
262
266
  requirements: []
263
- rubygems_version: 3.2.24
267
+ rubygems_version: 3.3.26
264
268
  signing_key:
265
269
  specification_version: 4
266
270
  summary: Archive (soft-delete) ActiveRecord database records
data/.travis.yml DELETED
@@ -1,25 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- cache: bundler
4
- rvm:
5
- - 2.5
6
- - 2.6
7
- - 2.7
8
- - ruby-head
9
- matrix:
10
- fast_finish: true
11
- allow_failures:
12
- - rvm: ruby-head
13
- before_install:
14
- - gem update --system
15
- - gem install bundler
16
- install:
17
- - bundle install --jobs=3 --retry=3
18
- script:
19
- - bundle exec rspec
20
- - bundle exec rubocop
21
- - bundle exec fasterer
22
- notifications:
23
- email: false
24
- slack:
25
- secure: VdEizS3D0v5cSQBgPDMooq5mGwf2sYQALnt0MF3dr/hLK36IeLI6FR5GkiC+qWXW88QnDm2i1HbgeM5SlSUZfU9EOGrnGIzCUe690q7XTI+N35P/Op59Ma1fOV2ojEjg2wwJzUVtfS6fYMzI0mfNAN8gg9ASN1fHtCnh5VK9AECC4931b0TxdwrJECRE+hzDSRGcmjqX+Nam0jj6GzJt0blBMcHpJAd+Ari/gGcb5v3+rBdzPLY79/HECZvzPORFDOqtgWKHv7gWQ44HEyGwJXp0fzBb1G1CCAwxMldqv7Jz4lPaADulFaAJOPMaNjTYIajhhjW8nG4zAav45cFhctpW/9YujYHBe9PnhmFFSopBGTJzXYJnAmTzrDKupZOxrLvx4ZWR+DRs7F6v73rPlKYpnmaEmy+wbp4Awju7Shc64veuCohw7sVMivUH634u6Yd5ezh22nyTb541i1RPwy0T7E9nRBXTz5sFnymQGUuvUfBPpRwDJUVxsBO86xofHHzY7YgKo2haiZP07wRX0LVxrnVyD31vMY+oTMAlvHK2WzGnX757gcXbwtLEb3qD8WYEi0mGVHSVo3CvYggv3mTCpgR2U3t+Wl9oxFDbNNQulaomSheBWVBcncYeftBLdZcLFTBtx/WbT/rppS4XxYrVkfGraJ17P6kGnhJCbmo=