recorder 0.1.23 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +4 -0
- data/.rubocop.yml +27 -0
- data/Gemfile +2 -0
- data/README.md +33 -3
- data/Rakefile +5 -3
- data/bin/console +4 -3
- data/lib/generators/recorder/install_generator.rb +14 -12
- data/lib/generators/recorder/templates/add_index_by_user_id_to_recorder_revisions.rb +2 -0
- data/lib/generators/recorder/templates/add_number_column_to_recorder_revisions.rb +23 -21
- data/lib/generators/recorder/templates/create_recorder_revisions.rb +4 -2
- data/lib/recorder/changeset.rb +14 -12
- data/lib/recorder/config.rb +13 -5
- data/lib/recorder/manager.rb +18 -0
- data/lib/recorder/observer.rb +11 -18
- data/lib/recorder/rails/controller_concern.rb +10 -7
- data/lib/recorder/rails/railtie.rb +8 -4
- data/lib/recorder/revision.rb +75 -54
- data/lib/recorder/sidekiq/revisions_worker.rb +4 -3
- data/lib/recorder/store.rb +36 -0
- data/lib/recorder/tape/data.rb +83 -0
- data/lib/recorder/tape/record.rb +39 -0
- data/lib/recorder/tape.rb +32 -79
- data/lib/recorder/version.rb +3 -13
- data/lib/recorder.rb +14 -10
- data/recorder.gemspec +24 -23
- metadata +40 -36
data/lib/recorder/version.rb
CHANGED
@@ -1,15 +1,5 @@
|
|
1
|
-
|
2
|
-
# :nodoc:
|
3
|
-
module VERSION
|
4
|
-
MAJOR = 0
|
5
|
-
MINOR = 1
|
6
|
-
PATCH = 23
|
7
|
-
PRE = nil
|
8
|
-
|
9
|
-
STRING = [MAJOR, MINOR, PATCH, PRE].compact.join(".").freeze
|
1
|
+
# frozen_string_literal: true
|
10
2
|
|
11
|
-
|
12
|
-
|
13
|
-
end
|
14
|
-
end
|
3
|
+
module Recorder
|
4
|
+
VERSION = '1.1.0'
|
15
5
|
end
|
data/lib/recorder.rb
CHANGED
@@ -1,12 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'recorder/config'
|
2
4
|
require 'recorder/version'
|
5
|
+
|
3
6
|
require 'recorder/changeset'
|
7
|
+
require 'recorder/store'
|
8
|
+
require 'recorder/manager'
|
4
9
|
require 'recorder/observer'
|
10
|
+
|
5
11
|
require 'recorder/rails/controller_concern'
|
6
12
|
require 'recorder/rails/railtie' if defined? ::Rails::Railtie
|
7
13
|
|
8
|
-
require 'request_store'
|
9
|
-
|
10
14
|
module Recorder
|
11
15
|
class << self
|
12
16
|
# Switches Recorder on or off.
|
@@ -25,13 +29,13 @@ module Recorder
|
|
25
29
|
# Sets Recorder information from the controller.
|
26
30
|
# @api public
|
27
31
|
def info=(hash)
|
28
|
-
|
32
|
+
store.params.merge!(hash)
|
29
33
|
end
|
30
34
|
|
31
35
|
# Sets Recorder meta information.
|
32
36
|
# @api public
|
33
37
|
def meta=(hash)
|
34
|
-
|
38
|
+
store.params[:meta] = hash
|
35
39
|
end
|
36
40
|
|
37
41
|
# Returns a boolean indicating whether "protected attibutes" should be
|
@@ -48,15 +52,15 @@ module Recorder
|
|
48
52
|
@config
|
49
53
|
end
|
50
54
|
|
51
|
-
# Returns version of Recorder as +String+
|
52
|
-
def version
|
53
|
-
VERSION::STRING
|
54
|
-
end
|
55
|
-
|
56
55
|
# Thread-safe hash to hold Recorder's data.
|
57
56
|
# @api private
|
58
57
|
def store
|
59
|
-
|
58
|
+
@store ||= Recorder::Store.new
|
59
|
+
end
|
60
|
+
|
61
|
+
# Returns version of Recorder as +String+
|
62
|
+
def version
|
63
|
+
VERSION::STRING
|
60
64
|
end
|
61
65
|
end
|
62
66
|
end
|
data/recorder.gemspec
CHANGED
@@ -1,35 +1,36 @@
|
|
1
|
-
#
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
5
|
require 'recorder/version'
|
5
6
|
|
6
7
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name
|
8
|
-
spec.version
|
9
|
-
spec.authors
|
10
|
-
spec.email
|
8
|
+
spec.name = 'recorder'
|
9
|
+
spec.version = Recorder::VERSION
|
10
|
+
spec.authors = ['Igor Alexandrov']
|
11
|
+
spec.email = ['igor.alexandrov@jetrockets.ru']
|
11
12
|
|
12
|
-
spec.summary
|
13
|
-
spec.description
|
14
|
-
spec.homepage
|
15
|
-
spec.license
|
13
|
+
spec.summary = 'Rails model auditor'
|
14
|
+
spec.description = 'Recorder tracks changes of your Rails models'
|
15
|
+
spec.homepage = 'https://github.com/jetrockets/recorder'
|
16
|
+
spec.license = 'MIT'
|
16
17
|
|
17
|
-
spec.files
|
18
|
-
spec.bindir
|
19
|
-
spec.executables
|
20
|
-
spec.require_paths = [
|
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']
|
21
22
|
|
22
|
-
spec.add_dependency 'activerecord', '>=
|
23
|
-
spec.add_dependency 'activesupport', '>=
|
24
|
-
spec.add_dependency 'request_store'
|
23
|
+
spec.add_dependency 'activerecord', '>= 5.0'
|
24
|
+
spec.add_dependency 'activesupport', '>= 5.0'
|
25
25
|
spec.add_dependency 'pg'
|
26
|
+
spec.add_dependency 'request_store'
|
26
27
|
|
27
|
-
spec.add_development_dependency 'bundler',
|
28
|
-
spec.add_development_dependency 'rake', "~> 10.0"
|
29
|
-
spec.add_development_dependency 'rspec-rails', "~> 3.5"
|
30
|
-
spec.add_development_dependency 'generator_spec'
|
28
|
+
spec.add_development_dependency 'bundler', '>= 2.0'
|
31
29
|
spec.add_development_dependency 'database_cleaner'
|
32
|
-
spec.add_development_dependency '
|
33
|
-
spec.add_development_dependency '
|
30
|
+
spec.add_development_dependency 'generator_spec'
|
31
|
+
spec.add_development_dependency 'jetrockets-standard'
|
32
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
33
|
+
spec.add_development_dependency 'rspec-rails', '~> 3.5'
|
34
|
+
spec.add_development_dependency 'timecop', '~> 0.8.1'
|
34
35
|
spec.add_development_dependency 'yard'
|
35
36
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: recorder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Igor Alexandrov
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -16,30 +16,30 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '5.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '5.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activesupport
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '5.0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '5.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: pg
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
@@ -53,7 +53,7 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: request_store
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
@@ -70,46 +70,46 @@ dependencies:
|
|
70
70
|
name: bundler
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '2.0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '2.0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: database_cleaner
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
89
|
+
version: '0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - "
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
96
|
+
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: generator_spec
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - "
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
103
|
+
version: '0'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- - "
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
110
|
+
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
112
|
+
name: jetrockets-standard
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - ">="
|
@@ -123,33 +123,33 @@ dependencies:
|
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
126
|
+
name: rake
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
|
-
- - "
|
129
|
+
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: '0'
|
131
|
+
version: '13.0'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
|
-
- - "
|
136
|
+
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: '0'
|
138
|
+
version: '13.0'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
|
-
name:
|
140
|
+
name: rspec-rails
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
143
|
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version:
|
145
|
+
version: '3.5'
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version:
|
152
|
+
version: '3.5'
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: timecop
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -187,6 +187,7 @@ extra_rdoc_files: []
|
|
187
187
|
files:
|
188
188
|
- ".gitignore"
|
189
189
|
- ".rspec"
|
190
|
+
- ".rubocop.yml"
|
190
191
|
- ".travis.yml"
|
191
192
|
- Gemfile
|
192
193
|
- LICENSE.txt
|
@@ -202,19 +203,23 @@ files:
|
|
202
203
|
- lib/recorder.rb
|
203
204
|
- lib/recorder/changeset.rb
|
204
205
|
- lib/recorder/config.rb
|
206
|
+
- lib/recorder/manager.rb
|
205
207
|
- lib/recorder/observer.rb
|
206
208
|
- lib/recorder/rails/controller_concern.rb
|
207
209
|
- lib/recorder/rails/railtie.rb
|
208
210
|
- lib/recorder/revision.rb
|
209
211
|
- lib/recorder/sidekiq/revisions_worker.rb
|
212
|
+
- lib/recorder/store.rb
|
210
213
|
- lib/recorder/tape.rb
|
214
|
+
- lib/recorder/tape/data.rb
|
215
|
+
- lib/recorder/tape/record.rb
|
211
216
|
- lib/recorder/version.rb
|
212
217
|
- recorder.gemspec
|
213
218
|
homepage: https://github.com/jetrockets/recorder
|
214
219
|
licenses:
|
215
220
|
- MIT
|
216
221
|
metadata: {}
|
217
|
-
post_install_message:
|
222
|
+
post_install_message:
|
218
223
|
rdoc_options: []
|
219
224
|
require_paths:
|
220
225
|
- lib
|
@@ -229,9 +234,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
229
234
|
- !ruby/object:Gem::Version
|
230
235
|
version: '0'
|
231
236
|
requirements: []
|
232
|
-
|
233
|
-
|
234
|
-
signing_key:
|
237
|
+
rubygems_version: 3.2.15
|
238
|
+
signing_key:
|
235
239
|
specification_version: 4
|
236
240
|
summary: Rails model auditor
|
237
241
|
test_files: []
|