audited 5.5.0 → 5.5.1.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/audited.gemspec +38 -0
  3. data/lib/audited/version.rb +1 -1
  4. data/lib/audited.rb +6 -2
  5. metadata +18 -53
  6. data/.github/workflows/buildlight.yml +0 -15
  7. data/.github/workflows/ci.yml +0 -145
  8. data/.github/workflows/publish_gem.yml +0 -28
  9. data/.gitignore +0 -17
  10. data/.standard.yml +0 -5
  11. data/.yardopts +0 -3
  12. data/gemfiles/rails50.gemfile +0 -12
  13. data/gemfiles/rails51.gemfile +0 -12
  14. data/gemfiles/rails52.gemfile +0 -12
  15. data/gemfiles/rails60.gemfile +0 -10
  16. data/gemfiles/rails61.gemfile +0 -10
  17. data/gemfiles/rails70.gemfile +0 -10
  18. data/gemfiles/rails71.gemfile +0 -10
  19. data/spec/audited/audit_spec.rb +0 -357
  20. data/spec/audited/auditor_spec.rb +0 -1272
  21. data/spec/audited/rspec_matchers_spec.rb +0 -69
  22. data/spec/audited/sweeper_spec.rb +0 -133
  23. data/spec/audited_spec.rb +0 -14
  24. data/spec/audited_spec_helpers.rb +0 -36
  25. data/spec/rails_app/app/assets/config/manifest.js +0 -2
  26. data/spec/rails_app/config/application.rb +0 -42
  27. data/spec/rails_app/config/database.yml +0 -26
  28. data/spec/rails_app/config/environment.rb +0 -5
  29. data/spec/rails_app/config/environments/test.rb +0 -52
  30. data/spec/rails_app/config/initializers/backtrace_silencers.rb +0 -7
  31. data/spec/rails_app/config/initializers/inflections.rb +0 -2
  32. data/spec/rails_app/config/initializers/secret_token.rb +0 -3
  33. data/spec/rails_app/config/routes.rb +0 -3
  34. data/spec/spec_helper.rb +0 -24
  35. data/spec/support/active_record/models.rb +0 -182
  36. data/spec/support/active_record/postgres/1_change_audited_changes_type_to_json.rb +0 -11
  37. data/spec/support/active_record/postgres/2_change_audited_changes_type_to_jsonb.rb +0 -11
  38. data/spec/support/active_record/schema.rb +0 -90
  39. data/test/db/version_1.rb +0 -17
  40. data/test/db/version_2.rb +0 -18
  41. data/test/db/version_3.rb +0 -18
  42. data/test/db/version_4.rb +0 -19
  43. data/test/db/version_5.rb +0 -17
  44. data/test/db/version_6.rb +0 -19
  45. data/test/install_generator_test.rb +0 -62
  46. data/test/test_helper.rb +0 -18
  47. data/test/upgrade_generator_test.rb +0 -97
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4d9407750d2b70edd5e934c0b0544ba52230a3e3ac4955194029b6b7370c8fe7
4
- data.tar.gz: 863fc4f2e8d1cc188664f4a346db886f7dfdd4bf6c6b56f3371eacb4d75497dd
3
+ metadata.gz: 28d476d84afb21e81a0c0b1783412e269b99957fb35db487439d20835ec85f17
4
+ data.tar.gz: 1c6509c2c25eadd237a60009be8881ccbd9dd36dad55ad0066cfeeec0d2c6910
5
5
  SHA512:
6
- metadata.gz: cb853e42fb4e6ff1493f3864a0c5833e730b27e90f14d8b8529ad11c3dd66052c8bd3739433e4c08decd84ecb5525a244ab8a831bf70a7a21654c398e220b8c7
7
- data.tar.gz: 36d1acab56d4011d8766f0a3f0126ecae8fff5a7469a3ac00a43d6ccc3e1f09eee5c8e8054d30367dbdf69caab3f49135020861ca16d10a76e5f44349e14a57f
6
+ metadata.gz: d7efc2eaa2441c855bb274138384105d589787fdd25051dc76d745ad0a12863d5508e77810afb20ef09b75bee710e6adaa944663ab7c640aec6fdc9e47916ab8
7
+ data.tar.gz: bbf7594de2786a3947bb0dae6395a2c2bd9b5a43c87f7770b6abfd7bf0dfbf172b1a9ac112cfa38791691ced136fcd4bc2e78c02062675aa647ac90eb4277cfe
data/audited.gemspec ADDED
@@ -0,0 +1,38 @@
1
+ $:.push File.expand_path("../lib", __FILE__)
2
+ require "audited/version"
3
+
4
+ Gem::Specification.new do |gem|
5
+ gem.name = "audited"
6
+ gem.version = Audited::VERSION
7
+
8
+ gem.authors = ["Brandon Keepers", "Kenneth Kalmer", "Daniel Morrison", "Brian Ryckbost", "Steve Richert", "Ryan Glover"]
9
+ gem.email = "info@collectiveidea.com"
10
+ gem.description = "Log all changes to your models"
11
+ gem.summary = gem.description
12
+ gem.homepage = "https://github.com/collectiveidea/audited"
13
+ gem.license = "MIT"
14
+
15
+ gem.files = `git ls-files`.split($\).reject { |f| f =~ /^(\.gemspec|\.git|\.standard|\.yard|gemfiles|test|spec)/ }
16
+
17
+ gem.required_ruby_version = ">= 2.3.0"
18
+
19
+ gem.add_dependency "activerecord", ">= 5.2", "< 7.2"
20
+ gem.add_dependency "activesupport", ">= 5.2", "< 7.2"
21
+
22
+ gem.add_development_dependency "appraisal"
23
+ gem.add_development_dependency "rails", ">= 5.2", "< 7.2"
24
+ gem.add_development_dependency "rspec-rails"
25
+ gem.add_development_dependency "standard"
26
+ gem.add_development_dependency "single_cov"
27
+
28
+ # JRuby support for the test ENV
29
+ if defined?(JRUBY_VERSION)
30
+ gem.add_development_dependency "activerecord-jdbcsqlite3-adapter", "~> 1.3"
31
+ gem.add_development_dependency "activerecord-jdbcpostgresql-adapter", "~> 1.3"
32
+ gem.add_development_dependency "activerecord-jdbcmysql-adapter", "~> 1.3"
33
+ else
34
+ gem.add_development_dependency "sqlite3", ">= 1.3.6"
35
+ gem.add_development_dependency "mysql2", ">= 0.3.20"
36
+ gem.add_development_dependency "pg", ">= 0.18", "< 2.0"
37
+ end
38
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Audited
4
- VERSION = "5.5.0"
4
+ VERSION = "5.5.1.pre"
5
5
  end
data/lib/audited.rb CHANGED
@@ -1,9 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "active_record"
4
- require "request_store"
5
4
 
6
5
  module Audited
6
+ # Wrapper around ActiveSupport::CurrentAttributes
7
+ class RequestStore < ActiveSupport::CurrentAttributes
8
+ attribute :audited_store
9
+ end
10
+
7
11
  class << self
8
12
  attr_accessor \
9
13
  :auditing_enabled,
@@ -27,7 +31,7 @@ module Audited
27
31
  deprecator: ActiveSupport::Deprecation.new('6.0.0', 'Audited')
28
32
 
29
33
  def store
30
- RequestStore.store[:audited_store] ||= {}
34
+ RequestStore.audited_store ||= {}
31
35
  end
32
36
 
33
37
  def config
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: audited
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.5.0
4
+ version: 5.5.1.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Keepers
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2024-04-02 00:00:00.000000000 Z
16
+ date: 2024-04-05 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: activerecord
@@ -21,7 +21,7 @@ dependencies:
21
21
  requirements:
22
22
  - - ">="
23
23
  - !ruby/object:Gem::Version
24
- version: '5.0'
24
+ version: '5.2'
25
25
  - - "<"
26
26
  - !ruby/object:Gem::Version
27
27
  version: '7.2'
@@ -31,24 +31,30 @@ dependencies:
31
31
  requirements:
32
32
  - - ">="
33
33
  - !ruby/object:Gem::Version
34
- version: '5.0'
34
+ version: '5.2'
35
35
  - - "<"
36
36
  - !ruby/object:Gem::Version
37
37
  version: '7.2'
38
38
  - !ruby/object:Gem::Dependency
39
- name: request_store
39
+ name: activesupport
40
40
  requirement: !ruby/object:Gem::Requirement
41
41
  requirements:
42
- - - "~>"
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ version: '5.2'
45
+ - - "<"
43
46
  - !ruby/object:Gem::Version
44
- version: '1.2'
47
+ version: '7.2'
45
48
  type: :runtime
46
49
  prerelease: false
47
50
  version_requirements: !ruby/object:Gem::Requirement
48
51
  requirements:
49
- - - "~>"
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '5.2'
55
+ - - "<"
50
56
  - !ruby/object:Gem::Version
51
- version: '1.2'
57
+ version: '7.2'
52
58
  - !ruby/object:Gem::Dependency
53
59
  name: appraisal
54
60
  requirement: !ruby/object:Gem::Requirement
@@ -69,7 +75,7 @@ dependencies:
69
75
  requirements:
70
76
  - - ">="
71
77
  - !ruby/object:Gem::Version
72
- version: '5.0'
78
+ version: '5.2'
73
79
  - - "<"
74
80
  - !ruby/object:Gem::Version
75
81
  version: '7.2'
@@ -79,7 +85,7 @@ dependencies:
79
85
  requirements:
80
86
  - - ">="
81
87
  - !ruby/object:Gem::Version
82
- version: '5.0'
88
+ version: '5.2'
83
89
  - - "<"
84
90
  - !ruby/object:Gem::Version
85
91
  version: '7.2'
@@ -179,25 +185,13 @@ executables: []
179
185
  extensions: []
180
186
  extra_rdoc_files: []
181
187
  files:
182
- - ".github/workflows/buildlight.yml"
183
- - ".github/workflows/ci.yml"
184
- - ".github/workflows/publish_gem.yml"
185
- - ".gitignore"
186
- - ".standard.yml"
187
- - ".yardopts"
188
188
  - Appraisals
189
189
  - CHANGELOG.md
190
190
  - Gemfile
191
191
  - LICENSE
192
192
  - README.md
193
193
  - Rakefile
194
- - gemfiles/rails50.gemfile
195
- - gemfiles/rails51.gemfile
196
- - gemfiles/rails52.gemfile
197
- - gemfiles/rails60.gemfile
198
- - gemfiles/rails61.gemfile
199
- - gemfiles/rails70.gemfile
200
- - gemfiles/rails71.gemfile
194
+ - audited.gemspec
201
195
  - lib/audited-rspec.rb
202
196
  - lib/audited.rb
203
197
  - lib/audited/audit.rb
@@ -220,35 +214,6 @@ files:
220
214
  - lib/generators/audited/templates/rename_parent_to_association.rb
221
215
  - lib/generators/audited/templates/revert_polymorphic_indexes_order.rb
222
216
  - lib/generators/audited/upgrade_generator.rb
223
- - spec/audited/audit_spec.rb
224
- - spec/audited/auditor_spec.rb
225
- - spec/audited/rspec_matchers_spec.rb
226
- - spec/audited/sweeper_spec.rb
227
- - spec/audited_spec.rb
228
- - spec/audited_spec_helpers.rb
229
- - spec/rails_app/app/assets/config/manifest.js
230
- - spec/rails_app/config/application.rb
231
- - spec/rails_app/config/database.yml
232
- - spec/rails_app/config/environment.rb
233
- - spec/rails_app/config/environments/test.rb
234
- - spec/rails_app/config/initializers/backtrace_silencers.rb
235
- - spec/rails_app/config/initializers/inflections.rb
236
- - spec/rails_app/config/initializers/secret_token.rb
237
- - spec/rails_app/config/routes.rb
238
- - spec/spec_helper.rb
239
- - spec/support/active_record/models.rb
240
- - spec/support/active_record/postgres/1_change_audited_changes_type_to_json.rb
241
- - spec/support/active_record/postgres/2_change_audited_changes_type_to_jsonb.rb
242
- - spec/support/active_record/schema.rb
243
- - test/db/version_1.rb
244
- - test/db/version_2.rb
245
- - test/db/version_3.rb
246
- - test/db/version_4.rb
247
- - test/db/version_5.rb
248
- - test/db/version_6.rb
249
- - test/install_generator_test.rb
250
- - test/test_helper.rb
251
- - test/upgrade_generator_test.rb
252
217
  homepage: https://github.com/collectiveidea/audited
253
218
  licenses:
254
219
  - MIT
@@ -1,15 +0,0 @@
1
- name: Buildlight
2
-
3
- on:
4
- workflow_run:
5
- workflows:
6
- - CI
7
- branches:
8
- - main
9
-
10
- jobs:
11
- webhook:
12
- runs-on: ubuntu-latest
13
- steps:
14
- - name: Webhook
15
- uses: collectiveidea/buildlight@main
@@ -1,145 +0,0 @@
1
- name: CI
2
-
3
- on:
4
- - pull_request
5
- - push
6
-
7
- jobs:
8
- build:
9
- runs-on: ubuntu-latest
10
- strategy:
11
- fail-fast: false
12
- matrix:
13
- ruby: [2.3, 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2]
14
- appraisal:
15
- - rails50
16
- - rails51
17
- - rails52
18
- - rails60
19
- - rails61
20
- - rails70
21
- - rails71
22
- db: [POSTGRES, MYSQL, SQLITE]
23
- exclude:
24
- # MySQL has issues on Ruby 2.3
25
- # https://github.com/ruby/setup-ruby/issues/150
26
- - ruby: 2.3
27
- db: MYSQL
28
-
29
- # PostgreSQL is segfaulting on 2.3
30
- # Doesn't seem worth solving.
31
- - ruby: 2.3
32
- db: POSTGRES
33
-
34
- # Rails 5.0 supports Ruby 2.2-2.4
35
- - appraisal: rails50
36
- ruby: 2.5
37
- - appraisal: rails50
38
- ruby: 2.6
39
- - appraisal: rails50
40
- ruby: 2.7
41
- - appraisal: rails50
42
- ruby: 3.0
43
- - appraisal: rails50
44
- ruby: 3.1
45
- - appraisal: rails50
46
- ruby: 3.2
47
-
48
- # Rails 5.1 supports Ruby 2.2-2.5
49
- - appraisal: rails51
50
- ruby: 2.6
51
- - appraisal: rails51
52
- ruby: 2.7
53
- - appraisal: rails51
54
- ruby: 3.0
55
- - appraisal: rails51
56
- ruby: 3.1
57
- - appraisal: rails51
58
- ruby: 3.2
59
-
60
- # Rails 5.2 supports Ruby 2.2-2.5
61
- - appraisal: rails52
62
- ruby: 2.6
63
- - appraisal: rails52
64
- ruby: 2.7
65
- - appraisal: rails52
66
- ruby: 3.0
67
- - appraisal: rails52
68
- ruby: 3.1
69
- - appraisal: rails52
70
- ruby: 3.2
71
-
72
- # Rails 6.0 supports Ruby 2.5-2.7
73
- - appraisal: rails60
74
- ruby: 2.3
75
- - appraisal: rails60
76
- ruby: 2.4
77
- - appraisal: rails60
78
- ruby: 3.0
79
- - appraisal: rails60
80
- ruby: 3.1
81
- - appraisal: rails60
82
- ruby: 3.2
83
-
84
- # Rails 6.1 supports Ruby 2.5+
85
- - appraisal: rails61
86
- ruby: 2.3
87
- - appraisal: rails61
88
- ruby: 2.4
89
-
90
- # Rails 7 supports Ruby 2.7+
91
- - appraisal: rails70
92
- ruby: 2.3
93
- - appraisal: rails70
94
- ruby: 2.4
95
- - appraisal: rails70
96
- ruby: 2.5
97
- - appraisal: rails70
98
- ruby: 2.6
99
-
100
- # Rails 7.1 supports Ruby 2.7+
101
- - appraisal: rails71
102
- ruby: 2.3
103
- - appraisal: rails71
104
- ruby: 2.4
105
- - appraisal: rails71
106
- ruby: 2.5
107
- - appraisal: rails71
108
- ruby: 2.6
109
-
110
- services:
111
- postgres:
112
- image: postgres
113
- env:
114
- POSTGRES_USER: postgres
115
- POSTGRES_PASSWORD: postgres
116
- POSTGRES_DB: audited_test
117
- ports:
118
- - 5432:5432
119
- # needed because the postgres container does not provide a healthcheck
120
- options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
121
-
122
- env:
123
- DB_DATABASE: audited_test
124
- DB_USER: root
125
- DB_PASSWORD: 'root'
126
- DB_HOST: localhost
127
-
128
- steps:
129
- - name: Setup MySQL
130
- run: |
131
- sudo /etc/init.d/mysql start
132
- mysql -e 'CREATE DATABASE audited_test;' -uroot -proot
133
- mysql -e 'SHOW DATABASES;' -uroot -proot
134
- - uses: actions/checkout@v3
135
- - name: Copy Gemfile
136
- run: sed 's/\.\././' gemfiles/${{ matrix.appraisal }}.gemfile > Gemfile
137
- - name: Set up Ruby ${{ matrix.ruby }}
138
- uses: ruby/setup-ruby@v1
139
- with:
140
- ruby-version: ${{ matrix.ruby }}
141
- bundler-cache: true
142
- - name: Run tests
143
- env:
144
- DB: ${{ matrix.db }}
145
- run: bundle exec rake
@@ -1,28 +0,0 @@
1
- name: Publish Gem
2
-
3
- on:
4
- push:
5
- tags:
6
- - v*
7
-
8
- jobs:
9
- push:
10
- if: github.repository == 'collectiveidea/audited'
11
- runs-on: ubuntu-latest
12
- environment: publishing
13
-
14
- permissions:
15
- contents: write
16
- id-token: write
17
-
18
- steps:
19
- # Set up
20
- - uses: actions/checkout@v4
21
- - name: Set up Ruby
22
- uses: ruby/setup-ruby@v1
23
- with:
24
- bundler-cache: true
25
- ruby-version: ruby
26
-
27
- # Release
28
- - uses: rubygems/release-gem@v1
data/.gitignore DELETED
@@ -1,17 +0,0 @@
1
- *.iml
2
- *.ipr
3
- *.iws
4
- *.log
5
- *.swp
6
- .bundle
7
- .rakeTasks
8
- .ruby-gemset
9
- .ruby-version
10
- .rvmrc
11
- .yardoc
12
- doc/
13
- Gemfile.lock
14
- gemfiles/*.lock
15
- pkg
16
- tmp/*
17
- audited_test.sqlite3.db
data/.standard.yml DELETED
@@ -1,5 +0,0 @@
1
- ruby_version: 2.3
2
- ignore:
3
- - lib/generators/audited/templates/**/*
4
- - vendor/bundle/**/*
5
- - gemfiles/vendor/bundle/**/*
data/.yardopts DELETED
@@ -1,3 +0,0 @@
1
- --no-private
2
- --title acts_as_audited
3
- --exclude lib/generators
@@ -1,12 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~> 5.0.0"
6
- gem "mysql2", ">= 0.3.18", "< 0.6.0"
7
- gem "pg", ">= 0.18", "< 2.0"
8
- gem "sqlite3", "~> 1.3.6"
9
- gem "psych", "~> 3.1"
10
- gem "loofah", "2.20.0"
11
-
12
- gemspec name: "audited", path: "../"
@@ -1,12 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~> 5.1.4"
6
- gem "mysql2", ">= 0.3.18", "< 0.6.0"
7
- gem "pg", ">= 0.18", "< 2.0"
8
- gem "sqlite3", "~> 1.3.6"
9
- gem "psych", "~> 3.1"
10
- gem "loofah", "2.20.0"
11
-
12
- gemspec name: "audited", path: "../"
@@ -1,12 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", ">= 5.2.8.1", "< 5.3"
6
- gem "mysql2", ">= 0.4.4", "< 0.6.0"
7
- gem "pg", ">= 0.18", "< 2.0"
8
- gem "sqlite3", "~> 1.3.6"
9
- gem "psych", "~> 3.1"
10
- gem "loofah", "2.20.0"
11
-
12
- gemspec name: "audited", path: "../"
@@ -1,10 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", ">= 6.0.0", "< 6.1"
6
- gem "mysql2", ">= 0.4.4"
7
- gem "pg", ">= 0.18", "< 2.0"
8
- gem "sqlite3", "~> 1.4"
9
-
10
- gemspec name: "audited", path: "../"
@@ -1,10 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", ">= 6.1.0", "< 6.2"
6
- gem "mysql2", ">= 0.4.4"
7
- gem "pg", ">= 1.1", "< 2.0"
8
- gem "sqlite3", "~> 1.4"
9
-
10
- gemspec name: "audited", path: "../"
@@ -1,10 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", ">= 7.0.0", "< 7.1"
6
- gem "mysql2", ">= 0.4.4"
7
- gem "pg", ">= 1.1"
8
- gem "sqlite3", ">= 1.4"
9
-
10
- gemspec name: "audited", path: "../"
@@ -1,10 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", ">= 7.1.0.beta1", "< 7.2"
6
- gem "mysql2", ">= 0.4.4"
7
- gem "pg", ">= 1.1"
8
- gem "sqlite3", ">= 1.4"
9
-
10
- gemspec name: "audited", path: "../"