public_activity 1.6.3 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/README.md +26 -28
- data/Rakefile +6 -5
- data/lib/generators/public_activity/migration/migration_generator.rb +3 -1
- data/lib/generators/public_activity/migration/templates/migration.rb +12 -10
- data/lib/generators/public_activity/migration_upgrade/migration_upgrade_generator.rb +4 -1
- data/lib/generators/public_activity/migration_upgrade/templates/upgrade.rb +4 -2
- data/lib/generators/public_activity.rb +2 -0
- data/lib/public_activity/actions/creation.rb +3 -1
- data/lib/public_activity/actions/destruction.rb +2 -0
- data/lib/public_activity/actions/update.rb +2 -0
- data/lib/public_activity/activity.rb +3 -1
- data/lib/public_activity/common.rb +16 -0
- data/lib/public_activity/config.rb +2 -0
- data/lib/public_activity/models/activist.rb +3 -1
- data/lib/public_activity/models/activity.rb +3 -1
- data/lib/public_activity/models/adapter.rb +3 -1
- data/lib/public_activity/models/trackable.rb +3 -1
- data/lib/public_activity/orm/active_record/activist.rb +2 -0
- data/lib/public_activity/orm/active_record/activity.rb +29 -11
- data/lib/public_activity/orm/active_record/adapter.rb +7 -0
- data/lib/public_activity/orm/active_record/trackable.rb +2 -0
- data/lib/public_activity/orm/active_record.rb +3 -1
- data/lib/public_activity/orm/mongo_mapper/activist.rb +2 -0
- data/lib/public_activity/orm/mongo_mapper/activity.rb +2 -0
- data/lib/public_activity/orm/mongo_mapper/adapter.rb +7 -0
- data/lib/public_activity/orm/mongo_mapper/trackable.rb +2 -0
- data/lib/public_activity/orm/mongo_mapper.rb +3 -1
- data/lib/public_activity/orm/mongoid/activist.rb +2 -0
- data/lib/public_activity/orm/mongoid/activity.rb +2 -0
- data/lib/public_activity/orm/mongoid/adapter.rb +7 -0
- data/lib/public_activity/orm/mongoid/trackable.rb +2 -0
- data/lib/public_activity/orm/mongoid.rb +3 -1
- data/lib/public_activity/renderable.rb +5 -2
- data/lib/public_activity/roles/deactivatable.rb +2 -0
- data/lib/public_activity/roles/tracked.rb +2 -0
- data/lib/public_activity/testing.rb +2 -0
- data/lib/public_activity/utility/store_controller.rb +2 -0
- data/lib/public_activity/utility/view_helpers.rb +2 -0
- data/lib/public_activity/version.rb +3 -1
- data/lib/public_activity.rb +2 -0
- data/test/migrations/001_create_activities.rb +1 -1
- data/test/migrations/002_create_articles.rb +2 -3
- data/test/migrations/003_create_users.rb +2 -2
- data/test/migrations/004_add_nonstandard_to_activities.rb +2 -2
- data/test/test_activist.rb +39 -36
- data/test/test_activity.rb +39 -38
- data/test/test_common.rb +66 -48
- data/test/test_controller_integration.rb +19 -11
- data/test/test_generators.rb +7 -17
- data/test/test_helper.rb +20 -24
- data/test/test_testing.rb +13 -10
- data/test/test_tracking.rb +171 -147
- data/test/test_view_helpers.rb +8 -6
- metadata +49 -40
- data/lib/generators/public_activity/activity/activity_generator.rb +0 -17
- data/lib/generators/public_activity/activity/templates/activity.rb +0 -3
- data/test/migrations_base.rb +0 -5
data/test/test_view_helpers.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'test_helper'
|
2
4
|
|
3
5
|
describe 'ViewHelpers Rendering' do
|
@@ -22,15 +24,15 @@ describe 'ViewHelpers Rendering' do
|
|
22
24
|
@view_flow.expects(:set).twice.with('name', ActiveSupport::SafeBuffer.new)
|
23
25
|
|
24
26
|
single_content_for('name', 'content')
|
25
|
-
@name
|
26
|
-
@content
|
27
|
+
assert_equal @name, 'name'
|
28
|
+
assert_equal @content, 'content'
|
27
29
|
single_content_for('name', 'content2')
|
28
|
-
@name
|
29
|
-
@content
|
30
|
+
assert_equal @name, 'name'
|
31
|
+
assert_equal @content, 'content2'
|
30
32
|
end
|
31
33
|
|
32
|
-
def content_for(name, content
|
34
|
+
def content_for(name, content)
|
33
35
|
@name = name
|
34
36
|
@content = content
|
35
37
|
end
|
36
|
-
end
|
38
|
+
end
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: public_activity
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotrek Okoński
|
8
8
|
- Kuba Okoński
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-05-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|
@@ -17,28 +17,28 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version:
|
20
|
+
version: 5.0.0
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version:
|
27
|
+
version: 5.0.0
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: railties
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
32
|
- - ">="
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version:
|
34
|
+
version: 5.0.0
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - ">="
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version:
|
41
|
+
version: 5.0.0
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: i18n
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -59,84 +59,98 @@ dependencies:
|
|
59
59
|
requirements:
|
60
60
|
- - ">="
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: '
|
62
|
+
version: '5.0'
|
63
63
|
type: :runtime
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
67
|
- - ">="
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: '
|
69
|
+
version: '5.0'
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: appraisal
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
70
84
|
- !ruby/object:Gem::Dependency
|
71
85
|
name: sqlite3
|
72
86
|
requirement: !ruby/object:Gem::Requirement
|
73
87
|
requirements:
|
74
88
|
- - "~>"
|
75
89
|
- !ruby/object:Gem::Version
|
76
|
-
version: 1.
|
90
|
+
version: 1.4.1
|
77
91
|
type: :development
|
78
92
|
prerelease: false
|
79
93
|
version_requirements: !ruby/object:Gem::Requirement
|
80
94
|
requirements:
|
81
95
|
- - "~>"
|
82
96
|
- !ruby/object:Gem::Version
|
83
|
-
version: 1.
|
97
|
+
version: 1.4.1
|
84
98
|
- !ruby/object:Gem::Dependency
|
85
99
|
name: mocha
|
86
100
|
requirement: !ruby/object:Gem::Requirement
|
87
101
|
requirements:
|
88
|
-
- - "
|
102
|
+
- - ">="
|
89
103
|
- !ruby/object:Gem::Version
|
90
|
-
version:
|
104
|
+
version: '0'
|
91
105
|
type: :development
|
92
106
|
prerelease: false
|
93
107
|
version_requirements: !ruby/object:Gem::Requirement
|
94
108
|
requirements:
|
95
|
-
- - "
|
109
|
+
- - ">="
|
96
110
|
- !ruby/object:Gem::Version
|
97
|
-
version:
|
111
|
+
version: '0'
|
98
112
|
- !ruby/object:Gem::Dependency
|
99
113
|
name: simplecov
|
100
114
|
requirement: !ruby/object:Gem::Requirement
|
101
115
|
requirements:
|
102
|
-
- - "
|
116
|
+
- - ">="
|
103
117
|
- !ruby/object:Gem::Version
|
104
|
-
version: 0
|
118
|
+
version: '0'
|
105
119
|
type: :development
|
106
120
|
prerelease: false
|
107
121
|
version_requirements: !ruby/object:Gem::Requirement
|
108
122
|
requirements:
|
109
|
-
- - "
|
123
|
+
- - ">="
|
110
124
|
- !ruby/object:Gem::Version
|
111
|
-
version: 0
|
125
|
+
version: '0'
|
112
126
|
- !ruby/object:Gem::Dependency
|
113
127
|
name: test-unit
|
114
128
|
requirement: !ruby/object:Gem::Requirement
|
115
129
|
requirements:
|
116
|
-
- - "
|
130
|
+
- - ">="
|
117
131
|
- !ruby/object:Gem::Version
|
118
|
-
version:
|
132
|
+
version: '0'
|
119
133
|
type: :development
|
120
134
|
prerelease: false
|
121
135
|
version_requirements: !ruby/object:Gem::Requirement
|
122
136
|
requirements:
|
123
|
-
- - "
|
137
|
+
- - ">="
|
124
138
|
- !ruby/object:Gem::Version
|
125
|
-
version:
|
139
|
+
version: '0'
|
126
140
|
- !ruby/object:Gem::Dependency
|
127
141
|
name: minitest
|
128
142
|
requirement: !ruby/object:Gem::Requirement
|
129
143
|
requirements:
|
130
|
-
- - "
|
144
|
+
- - ">="
|
131
145
|
- !ruby/object:Gem::Version
|
132
|
-
version:
|
146
|
+
version: '0'
|
133
147
|
type: :development
|
134
148
|
prerelease: false
|
135
149
|
version_requirements: !ruby/object:Gem::Requirement
|
136
150
|
requirements:
|
137
|
-
- - "
|
151
|
+
- - ">="
|
138
152
|
- !ruby/object:Gem::Version
|
139
|
-
version:
|
153
|
+
version: '0'
|
140
154
|
- !ruby/object:Gem::Dependency
|
141
155
|
name: redcarpet
|
142
156
|
requirement: !ruby/object:Gem::Requirement
|
@@ -155,16 +169,16 @@ dependencies:
|
|
155
169
|
name: yard
|
156
170
|
requirement: !ruby/object:Gem::Requirement
|
157
171
|
requirements:
|
158
|
-
- - "
|
172
|
+
- - ">="
|
159
173
|
- !ruby/object:Gem::Version
|
160
|
-
version: 0
|
174
|
+
version: '0'
|
161
175
|
type: :development
|
162
176
|
prerelease: false
|
163
177
|
version_requirements: !ruby/object:Gem::Requirement
|
164
178
|
requirements:
|
165
|
-
- - "
|
179
|
+
- - ">="
|
166
180
|
- !ruby/object:Gem::Version
|
167
|
-
version: 0
|
181
|
+
version: '0'
|
168
182
|
- !ruby/object:Gem::Dependency
|
169
183
|
name: pry
|
170
184
|
requirement: !ruby/object:Gem::Requirement
|
@@ -192,8 +206,6 @@ files:
|
|
192
206
|
- README.md
|
193
207
|
- Rakefile
|
194
208
|
- lib/generators/public_activity.rb
|
195
|
-
- lib/generators/public_activity/activity/activity_generator.rb
|
196
|
-
- lib/generators/public_activity/activity/templates/activity.rb
|
197
209
|
- lib/generators/public_activity/migration/migration_generator.rb
|
198
210
|
- lib/generators/public_activity/migration/templates/migration.rb
|
199
211
|
- lib/generators/public_activity/migration_upgrade/migration_upgrade_generator.rb
|
@@ -235,7 +247,6 @@ files:
|
|
235
247
|
- test/migrations/002_create_articles.rb
|
236
248
|
- test/migrations/003_create_users.rb
|
237
249
|
- test/migrations/004_add_nonstandard_to_activities.rb
|
238
|
-
- test/migrations_base.rb
|
239
250
|
- test/mongo_mapper.yml
|
240
251
|
- test/mongoid.yml
|
241
252
|
- test/test_activist.rb
|
@@ -255,7 +266,7 @@ homepage: https://github.com/pokonski/public_activity
|
|
255
266
|
licenses:
|
256
267
|
- MIT
|
257
268
|
metadata: {}
|
258
|
-
post_install_message:
|
269
|
+
post_install_message:
|
259
270
|
rdoc_options: []
|
260
271
|
require_paths:
|
261
272
|
- lib
|
@@ -263,16 +274,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
263
274
|
requirements:
|
264
275
|
- - ">="
|
265
276
|
- !ruby/object:Gem::Version
|
266
|
-
version:
|
277
|
+
version: 2.5.0
|
267
278
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
268
279
|
requirements:
|
269
280
|
- - ">="
|
270
281
|
- !ruby/object:Gem::Version
|
271
282
|
version: '0'
|
272
283
|
requirements: []
|
273
|
-
|
274
|
-
|
275
|
-
signing_key:
|
284
|
+
rubygems_version: 3.3.13
|
285
|
+
signing_key:
|
276
286
|
specification_version: 4
|
277
287
|
summary: Easy activity tracking for ActiveRecord models
|
278
288
|
test_files:
|
@@ -280,7 +290,6 @@ test_files:
|
|
280
290
|
- test/migrations/002_create_articles.rb
|
281
291
|
- test/migrations/003_create_users.rb
|
282
292
|
- test/migrations/004_add_nonstandard_to_activities.rb
|
283
|
-
- test/migrations_base.rb
|
284
293
|
- test/mongo_mapper.yml
|
285
294
|
- test/mongoid.yml
|
286
295
|
- test/test_activist.rb
|
@@ -1,17 +0,0 @@
|
|
1
|
-
require 'generators/public_activity'
|
2
|
-
require 'rails/generators/active_record'
|
3
|
-
|
4
|
-
module PublicActivity
|
5
|
-
module Generators
|
6
|
-
# Activity generator that creates activity model file from template
|
7
|
-
class ActivityGenerator < ActiveRecord::Generators::Base
|
8
|
-
extend Base
|
9
|
-
|
10
|
-
argument :name, :type => :string, :default => 'activity'
|
11
|
-
# Create model in project's folder
|
12
|
-
def generate_files
|
13
|
-
copy_file 'activity.rb', "app/models/#{name}.rb"
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|