thredded-workgroup 0.2.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +23 -6
  3. data/.rubocop_todo.yml +392 -0
  4. data/.travis.yml +20 -28
  5. data/CHANGELOG.md +18 -0
  6. data/Gemfile +1 -0
  7. data/Guardfile +17 -40
  8. data/README.md +27 -10
  9. data/RELEASE_CHECKLIST.md +1 -2
  10. data/Rakefile +5 -0
  11. data/app/assets/config/thredded_workgroup_manifest.js +3 -0
  12. data/app/assets/images/thredded/workgroup/envelope-o.svg +2 -0
  13. data/app/assets/images/thredded/workgroup/envelope-open-o.svg +2 -0
  14. data/app/assets/javascripts/thredded/workgroup/components/followers.es6 +24 -0
  15. data/app/assets/javascripts/thredded/workgroup/components/overflow.es6 +60 -0
  16. data/app/assets/javascripts/thredded/workgroup/components/topics.es6 +151 -0
  17. data/app/assets/javascripts/thredded/workgroup/core/thredded_workgroup.js +1 -0
  18. data/app/assets/javascripts/thredded/workgroup/core/touch.es6 +16 -0
  19. data/app/assets/javascripts/thredded/workgroup/index.js +3 -0
  20. data/app/assets/javascripts/thredded-workgroup.js +1 -13
  21. data/app/assets/stylesheets/thredded/workgroup/_followers.scss +51 -0
  22. data/app/assets/stylesheets/thredded/workgroup/_navs.scss +29 -7
  23. data/app/assets/stylesheets/thredded/workgroup/_overflow.scss +71 -0
  24. data/app/assets/stylesheets/thredded/workgroup/_topics.scss +186 -16
  25. data/app/assets/stylesheets/thredded-workgroup.scss +2 -0
  26. data/app/controllers/concerns/thredded/workgroup/all_unread_followed_topics.rb +35 -0
  27. data/app/controllers/thredded/application_controller.rb +23 -0
  28. data/app/controllers/thredded/posts_controller.rb +3 -2
  29. data/app/controllers/thredded/workgroup/application_controller.rb +1 -0
  30. data/app/controllers/thredded/workgroup/navs_controller.rb +1 -0
  31. data/app/controllers/thredded/workgroup/read_states_controller.rb +14 -0
  32. data/app/controllers/thredded/workgroup/topics_controller.rb +18 -0
  33. data/app/helpers/thredded/application_helper.rb +1 -0
  34. data/app/helpers/thredded/workgroup/application_helper.rb +1 -0
  35. data/app/jobs/thredded/workgroup/mark_all_topics_read_job.rb +13 -0
  36. data/app/view_hooks/thredded/all_view_hooks.rb +9 -0
  37. data/app/view_hooks/thredded/workgroup/view_hooks.rb +28 -0
  38. data/app/view_models/thredded/topic_view.rb +17 -0
  39. data/app/view_models/thredded/topics_page_view.rb +1 -0
  40. data/app/views/thredded/shared/nav/_unread_topics.html.erb +1 -0
  41. data/app/views/thredded/topics/_followers.html.erb +23 -0
  42. data/app/views/thredded/topics/_topic.html.erb +25 -28
  43. data/app/views/thredded/workgroup/navs/_personal_nav.html.erb +7 -1
  44. data/app/views/thredded/workgroup/navs/all_topics.html.erb +1 -1
  45. data/app/views/thredded/workgroup/navs/awaiting.html.erb +1 -1
  46. data/app/views/thredded/workgroup/navs/following.html.erb +1 -1
  47. data/app/views/thredded/workgroup/navs/unread.html.erb +1 -1
  48. data/app/views/thredded/workgroup/topics/_controls.html.erb +21 -0
  49. data/app/views/thredded/workgroup/topics/_last_post.html.erb +11 -0
  50. data/app/views/thredded/workgroup/topics/_last_post_with_controls.html.erb +12 -0
  51. data/app/views/thredded/workgroup/topics/_topics_with_last_post.html.erb +16 -0
  52. data/bin/rails.rb +1 -0
  53. data/bin/rspec +1 -0
  54. data/bin/update_from_thredded +2 -1
  55. data/config/locales/en.yml +11 -0
  56. data/config/routes.rb +9 -0
  57. data/docs/followers-above-post.png +0 -0
  58. data/docs/navbar.png +0 -0
  59. data/lib/thredded/workgroup/engine.rb +11 -2
  60. data/lib/thredded/workgroup/thredded_route_delegator.rb +1 -0
  61. data/lib/thredded/workgroup/version.rb +2 -1
  62. data/lib/thredded/workgroup.rb +1 -0
  63. data/shared.gemfile +23 -16
  64. data/thredded-workgroup.gemspec +14 -18
  65. metadata +83 -88
  66. data/app/assets/javascripts/thredded/workgroup/follow.js +0 -36
  67. data/app/assets/javascripts/thredded/workgroup/topics.js +0 -18
  68. data/app/views/thredded/topics/_topics_with_last_post.html.erb +0 -14
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f28a842a59d912a9783e4e78221ac3e69be33e5f1591c1f797775b0b9a484edd
4
- data.tar.gz: ffbe48d420241715d23dbaa34d2a6a71734c10c256532454d57d5e178e71ca66
3
+ metadata.gz: 5efefc1d7010c94166f28b7c5eef2f1068aed1e7695b7b322e39a51456b6b46b
4
+ data.tar.gz: 7557fd4b245b16ccabfc6e2c1bacd5d93e2688ba222ddb424330774cbe38d9a8
5
5
  SHA512:
6
- metadata.gz: ce3484294af2edbe09f9bff0952b528c3714dee4b72623c55e7eab7375c25f9ec745a7cd9a7c7f2fcc0dc7bac4c06a4d1653312c5b3c8099ffb8aef41db52594
7
- data.tar.gz: f4c04872bbed1da6e80ef89e2d6dafda15ca070b8fc408d0a19f75110bd5eb2841f83c69449ad177cb0a4d3ae654ac05ef608572e80db9768d59a17adf3295b6
6
+ metadata.gz: b7c4da998f27f48915f3cc3c55fb85d34f62d754d9adb14e579faa9a88cf24b5932a2d270521955968a8557e3bb33f573f9f75f8fadce867248040a699075ec5
7
+ data.tar.gz: 4f596f4e2fe49ac827056557a7ec902f7686684ccde0db38c21470726118d12d6ecada6d0857e8906aaad26f00e66c59c4e29a8775b8aef21f726579c5de5342
data/.rubocop.yml CHANGED
@@ -1,8 +1,19 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
3
+ require:
4
+ - rubocop-performance
5
+ - rubocop-rails
6
+ - rubocop-rspec
7
+
1
8
  AllCops:
2
- TargetRubyVersion: 2.3
9
+ TargetRubyVersion: 2.6
3
10
  Exclude:
4
11
  - 'spec/dummy/db/**/*'
5
12
  - 'vendor/**/*'
13
+ DisplayCopNames: true
14
+ NewCops: enable
15
+ CacheRootDirectory: tmp # ie. tmp/rubocop_cache
16
+ UseCache: true
6
17
 
7
18
  Metrics/AbcSize:
8
19
  Enabled: false
@@ -10,7 +21,10 @@ Metrics/AbcSize:
10
21
  Metrics/ClassLength:
11
22
  Max: 125
12
23
 
13
- Metrics/LineLength:
24
+ Metrics/BlockLength:
25
+ Exclude:
26
+ - 'spec/factories/*'
27
+ Layout/LineLength:
14
28
  Max: 120
15
29
 
16
30
  Metrics/MethodLength:
@@ -29,10 +43,10 @@ Style/CollectionMethods:
29
43
  Style/Documentation:
30
44
  Enabled: false
31
45
 
32
- Style/MultilineMethodCallIndentation:
46
+ Layout/MultilineMethodCallIndentation:
33
47
  EnforcedStyle: indented
34
48
 
35
- Style/PredicateName:
49
+ Naming/PredicateName:
36
50
  Exclude:
37
51
  - spec/**/*.rb
38
52
 
@@ -42,7 +56,10 @@ Style/SignalException:
42
56
  Style/StringLiterals:
43
57
  EnforcedStyle: double_quotes
44
58
 
45
- Style/TrailingCommaInLiteral:
59
+ Style/TrailingCommaInArrayLiteral:
60
+ Enabled: false
61
+
62
+ Style/TrailingCommaInHashLiteral:
46
63
  Enabled: false
47
64
 
48
65
  Style/TrailingCommaInArguments:
@@ -61,5 +78,5 @@ Rails/FindBy:
61
78
  - app/models/**/*.rb
62
79
  - app/view_models/**/*.rb
63
80
 
64
- Lint/EndAlignment:
81
+ Layout/EndAlignment:
65
82
  AutoCorrect: true
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,392 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2022-02-26 17:50:27 UTC using RuboCop version 1.25.1.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 1
10
+ # Cop supports --auto-correct.
11
+ # Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include.
12
+ # Include: **/*.gemfile, **/Gemfile, **/gems.rb
13
+ Bundler/OrderedGems:
14
+ Exclude:
15
+ - 'shared.gemfile'
16
+
17
+ # Offense count: 7
18
+ # Cop supports --auto-correct.
19
+ # Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include.
20
+ # Include: **/*.gemspec
21
+ Gemspec/OrderedDependencies:
22
+ Exclude:
23
+ - 'thredded-workgroup.gemspec'
24
+
25
+ # Offense count: 1
26
+ # Cop supports --auto-correct.
27
+ # Configuration parameters: Include.
28
+ # Include: **/*.gemspec
29
+ Gemspec/RequireMFA:
30
+ Exclude:
31
+ - 'thredded-workgroup.gemspec'
32
+
33
+ # Offense count: 1
34
+ # Configuration parameters: Include.
35
+ # Include: **/*.gemspec
36
+ Gemspec/RequiredRubyVersion:
37
+ Exclude:
38
+ - 'thredded-workgroup.gemspec'
39
+
40
+ # Offense count: 6
41
+ # Cop supports --auto-correct.
42
+ Layout/EmptyLineAfterGuardClause:
43
+ Exclude:
44
+ - 'app/controllers/thredded/application_controller.rb'
45
+ - 'spec/dummy/app/controllers/application_controller.rb'
46
+ - 'spec/dummy/app/controllers/concerns/store_location_fullpath.rb'
47
+ - 'spec/dummy/app/controllers/sessions_controller.rb'
48
+ - 'spec/support/system/fake_content.rb'
49
+
50
+ # Offense count: 1
51
+ # Cop supports --auto-correct.
52
+ # Configuration parameters: EmptyLineBetweenMethodDefs, EmptyLineBetweenClassDefs, EmptyLineBetweenModuleDefs, AllowAdjacentOneLineDefs, NumberOfEmptyLines.
53
+ Layout/EmptyLineBetweenDefs:
54
+ Exclude:
55
+ - 'app/controllers/thredded/application_controller.rb'
56
+
57
+ # Offense count: 1
58
+ # Cop supports --auto-correct.
59
+ Layout/EmptyLines:
60
+ Exclude:
61
+ - 'Rakefile'
62
+
63
+ # Offense count: 1
64
+ # Cop supports --auto-correct.
65
+ # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces.
66
+ # SupportedStyles: space, no_space
67
+ # SupportedStylesForEmptyBraces: space, no_space
68
+ Layout/SpaceBeforeBlockBraces:
69
+ Exclude:
70
+ - 'spec/system/user_marks_topic_as_read_spec.rb'
71
+
72
+ # Offense count: 2
73
+ # Cop supports --auto-correct.
74
+ # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters.
75
+ # SupportedStyles: space, no_space
76
+ # SupportedStylesForEmptyBraces: space, no_space
77
+ Layout/SpaceInsideBlockBraces:
78
+ Exclude:
79
+ - 'spec/system/user_marks_topic_as_read_spec.rb'
80
+
81
+ # Offense count: 2
82
+ # Cop supports --auto-correct.
83
+ Lint/AmbiguousOperatorPrecedence:
84
+ Exclude:
85
+ - 'spec/factories/thredded.rb'
86
+
87
+ # Offense count: 2
88
+ # Configuration parameters: AllowedMethods.
89
+ # AllowedMethods: enums
90
+ Lint/ConstantDefinitionInBlock:
91
+ Exclude:
92
+ - 'spec/lib/thredded/all_view_hooks_spec.rb'
93
+
94
+ # Offense count: 1
95
+ # Configuration parameters: MaximumRangeSize.
96
+ Lint/MissingCopEnableDirective:
97
+ Exclude:
98
+ - 'thredded-workgroup.gemspec'
99
+
100
+ # Offense count: 1
101
+ # Cop supports --auto-correct-all.
102
+ Lint/NonDeterministicRequireOrder:
103
+ Exclude:
104
+ - 'spec/spec_helper.rb'
105
+
106
+ # Offense count: 1
107
+ # Cop supports --auto-correct.
108
+ Lint/RedundantCopDisableDirective:
109
+ Exclude:
110
+ - 'thredded-workgroup.gemspec'
111
+
112
+ # Offense count: 1
113
+ # Cop supports --auto-correct.
114
+ Lint/SendWithMixinArgument:
115
+ Exclude:
116
+ - 'lib/thredded/workgroup/route_delegator.rb'
117
+
118
+ # Offense count: 11
119
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
120
+ # IgnoredMethods: refine
121
+ Metrics/BlockLength:
122
+ Max: 126
123
+
124
+ # Offense count: 1
125
+ # Configuration parameters: MinSize.
126
+ Performance/CollectionLiteralInLoop:
127
+ Exclude:
128
+ - 'spec/support/system/fake_content.rb'
129
+
130
+ # Offense count: 1
131
+ # Cop supports --auto-correct.
132
+ Performance/RegexpMatch:
133
+ Exclude:
134
+ - 'Rakefile'
135
+
136
+ # Offense count: 4
137
+ # Cop supports --auto-correct.
138
+ RSpec/Capybara/CurrentPathExpectation:
139
+ Exclude:
140
+ - 'spec/system/user_adds_post_and_is_redirected_spec.rb'
141
+ - 'spec/system/user_marks_post_as_unread_spec.rb'
142
+
143
+ # Offense count: 7
144
+ # Configuration parameters: Prefixes.
145
+ # Prefixes: when, with, without
146
+ RSpec/ContextWording:
147
+ Exclude:
148
+ - 'spec/controllers/thredded/topics_controller_spec.rb'
149
+ - 'spec/system/views_navs_spec.rb'
150
+
151
+ # Offense count: 1
152
+ # Cop supports --auto-correct.
153
+ # Configuration parameters: SkipBlocks, EnforcedStyle.
154
+ # SupportedStyles: described_class, explicit
155
+ RSpec/DescribedClass:
156
+ Exclude:
157
+ - 'spec/view_models/topic_view_spec.rb'
158
+
159
+ # Offense count: 5
160
+ # Cop supports --auto-correct.
161
+ # Configuration parameters: AllowConsecutiveOneLiners.
162
+ RSpec/EmptyLineAfterExample:
163
+ Exclude:
164
+ - 'spec/lib/thredded/all_view_hooks_spec.rb'
165
+ - 'spec/system/views_navs_spec.rb'
166
+
167
+ # Offense count: 8
168
+ # Cop supports --auto-correct.
169
+ RSpec/EmptyLineAfterFinalLet:
170
+ Exclude:
171
+ - 'spec/controllers/thredded/topics_controller_spec.rb'
172
+ - 'spec/lib/thredded/all_view_hooks_spec.rb'
173
+ - 'spec/system/main_app_pages_spec.rb'
174
+ - 'spec/system/user_clicks_to_follow_unfollow_topic_spec.rb'
175
+ - 'spec/system/views_navs_spec.rb'
176
+ - 'spec/view_models/topic_view_spec.rb'
177
+
178
+ # Offense count: 7
179
+ # Cop supports --auto-correct.
180
+ RSpec/EmptyLineAfterHook:
181
+ Exclude:
182
+ - 'spec/system/main_app_pages_spec.rb'
183
+ - 'spec/system/user_clicks_to_follow_unfollow_topic_spec.rb'
184
+ - 'spec/system/views_navs_spec.rb'
185
+ - 'spec/view_models/topic_view_spec.rb'
186
+
187
+ # Offense count: 10
188
+ # Configuration parameters: CountAsOne.
189
+ RSpec/ExampleLength:
190
+ Max: 9
191
+
192
+ # Offense count: 18
193
+ # Cop supports --auto-correct.
194
+ # Configuration parameters: Include.
195
+ # Include: spec/factories.rb, spec/factories/**/*.rb, features/support/factories/**/*.rb
196
+ RSpec/FactoryBot/FactoryClassName:
197
+ Exclude:
198
+ - 'spec/factories/thredded.rb'
199
+
200
+ # Offense count: 1
201
+ # Cop supports --auto-correct.
202
+ # Configuration parameters: EnforcedStyle.
203
+ # SupportedStyles: implicit, each, example
204
+ RSpec/HookArgument:
205
+ Exclude:
206
+ - 'spec/spec_helper.rb'
207
+
208
+ # Offense count: 2
209
+ RSpec/LeakyConstantDeclaration:
210
+ Exclude:
211
+ - 'spec/lib/thredded/all_view_hooks_spec.rb'
212
+
213
+ # Offense count: 7
214
+ RSpec/LetSetup:
215
+ Exclude:
216
+ - 'spec/controllers/thredded/topics_controller_spec.rb'
217
+ - 'spec/system/user_adds_post_and_is_redirected_spec.rb'
218
+ - 'spec/system/user_clicks_to_follow_unfollow_topic_spec.rb'
219
+ - 'spec/system/views_navs_spec.rb'
220
+
221
+ # Offense count: 1
222
+ # Configuration parameters: .
223
+ # SupportedStyles: have_received, receive
224
+ RSpec/MessageSpies:
225
+ EnforcedStyle: receive
226
+
227
+ # Offense count: 11
228
+ RSpec/MultipleExpectations:
229
+ Max: 4
230
+
231
+ # Offense count: 12
232
+ # Configuration parameters: AllowSubject.
233
+ RSpec/MultipleMemoizedHelpers:
234
+ Max: 8
235
+
236
+ # Offense count: 2
237
+ # Configuration parameters: IgnoreSharedExamples.
238
+ RSpec/NamedSubject:
239
+ Exclude:
240
+ - 'spec/view_models/topic_view_spec.rb'
241
+
242
+ # Offense count: 6
243
+ # Cop supports --auto-correct.
244
+ RSpec/ScatteredLet:
245
+ Exclude:
246
+ - 'spec/system/user_adds_post_and_is_redirected_spec.rb'
247
+ - 'spec/system/user_clicks_to_follow_unfollow_topic_spec.rb'
248
+ - 'spec/system/views_navs_spec.rb'
249
+
250
+ # Offense count: 1
251
+ # Cop supports --auto-correct.
252
+ Rails/ApplicationRecord:
253
+ Exclude:
254
+ - 'spec/dummy/app/models/user.rb'
255
+
256
+ # Offense count: 1
257
+ # Configuration parameters: EnforcedStyle.
258
+ # SupportedStyles: slashes, arguments
259
+ Rails/FilePath:
260
+ Exclude:
261
+ - 'spec/spec_helper.rb'
262
+
263
+ # Offense count: 2
264
+ # Configuration parameters: Include.
265
+ # Include: spec/**/*.rb, test/**/*.rb
266
+ Rails/I18nLocaleAssignment:
267
+ Exclude:
268
+ - 'spec/dummy/app/controllers/concerns/set_locale.rb'
269
+
270
+ # Offense count: 1
271
+ # Configuration parameters: Include.
272
+ # Include: app/controllers/**/*.rb
273
+ Rails/LexicallyScopedActionFilter:
274
+ Exclude:
275
+ - 'app/controllers/thredded/workgroup/navs_controller.rb'
276
+
277
+ # Offense count: 4
278
+ # Cop supports --auto-correct-all.
279
+ # Configuration parameters: Include.
280
+ # Include: **/Rakefile, **/*.rake
281
+ Rails/RakeEnvironment:
282
+ Exclude:
283
+ - 'Rakefile'
284
+
285
+ # Offense count: 1
286
+ # Configuration parameters: Include.
287
+ # Include: spec/**/*.rb, test/**/*.rb
288
+ Rails/TimeZoneAssignment:
289
+ Exclude:
290
+ - 'spec/spec_helper.rb'
291
+
292
+ # Offense count: 1
293
+ Style/CombinableLoops:
294
+ Exclude:
295
+ - 'spec/lib/thredded/all_view_hooks_spec.rb'
296
+
297
+ # Offense count: 1
298
+ # Cop supports --auto-correct.
299
+ # Configuration parameters: EnforcedStyle.
300
+ # SupportedStyles: compact, expanded
301
+ Style/EmptyMethod:
302
+ Exclude:
303
+ - 'spec/support/authentication_support.rb'
304
+
305
+ # Offense count: 1
306
+ # Cop supports --auto-correct.
307
+ Style/Encoding:
308
+ Exclude:
309
+ - 'thredded-workgroup.gemspec'
310
+
311
+ # Offense count: 8
312
+ # Cop supports --auto-correct.
313
+ Style/ExpandPathArguments:
314
+ Exclude:
315
+ - 'Rakefile'
316
+ - 'bin/rails.rb'
317
+ - 'spec/dummy/config.ru'
318
+ - 'spec/gemfiles/rails_5_2.gemfile'
319
+ - 'spec/spec_helper.rb'
320
+ - 'thredded-workgroup.gemspec'
321
+
322
+ # Offense count: 1
323
+ # Cop supports --auto-correct.
324
+ Style/GlobalStdStream:
325
+ Exclude:
326
+ - 'spec/dummy/config/environments/production.rb'
327
+
328
+ # Offense count: 1
329
+ # Cop supports --auto-correct.
330
+ Style/IfUnlessModifier:
331
+ Exclude:
332
+ - 'spec/system/user_clicks_to_follow_unfollow_topic_spec.rb'
333
+
334
+ # Offense count: 1
335
+ Style/OpenStructUse:
336
+ Exclude:
337
+ - 'spec/factories/thredded.rb'
338
+
339
+ # Offense count: 4
340
+ # Cop supports --auto-correct.
341
+ # Configuration parameters: PreferredDelimiters.
342
+ Style/PercentLiteralDelimiters:
343
+ Exclude:
344
+ - 'Rakefile'
345
+ - 'lib/thredded/workgroup/engine.rb'
346
+
347
+ # Offense count: 2
348
+ # Cop supports --auto-correct-all.
349
+ # Configuration parameters: Methods.
350
+ Style/RedundantArgument:
351
+ Exclude:
352
+ - 'spec/lib/thredded/all_view_hooks_spec.rb'
353
+ - 'spec/support/system/fake_content.rb'
354
+
355
+ # Offense count: 2
356
+ # Cop supports --auto-correct.
357
+ Style/RedundantBegin:
358
+ Exclude:
359
+ - 'Rakefile'
360
+ - 'spec/dummy/bin/yarn'
361
+
362
+
363
+ # Offense count: 2
364
+ # Cop supports --auto-correct.
365
+ # Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods.
366
+ # AllowedMethods: present?, blank?, presence, try, try!
367
+ Style/SafeNavigation:
368
+ Exclude:
369
+ - 'Rakefile'
370
+ - 'spec/system/user_adds_post_and_is_redirected_spec.rb'
371
+
372
+ # Offense count: 3
373
+ # Cop supports --auto-correct.
374
+ Style/StderrPuts:
375
+ Exclude:
376
+ - 'Rakefile'
377
+
378
+ # Offense count: 2
379
+ # Cop supports --auto-correct-all.
380
+ # Configuration parameters: Mode.
381
+ Style/StringConcatenation:
382
+ Exclude:
383
+ - 'spec/support/system/fake_content.rb'
384
+
385
+ # Offense count: 3
386
+ # Cop supports --auto-correct.
387
+ # Configuration parameters: EnforcedStyle, MinSize.
388
+ # SupportedStyles: percent, brackets
389
+ Style/SymbolArray:
390
+ Exclude:
391
+ - 'Rakefile'
392
+ - 'spec/spec_helper.rb'
data/.travis.yml CHANGED
@@ -1,45 +1,37 @@
1
- # use travis defaults from capybara-webkit
2
- sudo: required
3
- dist: trusty
4
-
5
- addons:
6
- apt:
7
- sources:
8
- - ubuntu-sdk-team
9
- packages:
10
- - libqt5webkit5-dev
11
- - qtdeclarative5-dev
1
+ dist: bionic
12
2
 
13
3
  language: ruby
14
4
  rvm:
15
- - 2.3
16
- # - 2.4 # not till rails 4.2.8 is released
5
+ - 2.6
17
6
  cache: bundler
18
7
  bundler_args: --path ../../vendor/bundle --without debug
19
8
  gemfile:
20
- - spec/gemfiles/rails_4_2.gemfile
21
- - spec/gemfiles/rails_5_0.gemfile
22
- - spec/gemfiles/rails_5_1.gemfile
23
9
  - spec/gemfiles/rails_5_2.gemfile
24
10
 
25
- env:
26
- global:
27
- - QMAKE=/usr/lib/x86_64-linux-gnu/qt5/bin/qmake
28
- matrix:
29
- # Username and password from http://docs.travis-ci.com/user/database-setup/
30
- - DB=sqlite3 DBC_VERBOSE=true
31
- # - DB=mysql2 DB_USERNAME=root DB_PASSWORD=""
32
- - DB=postgresql DB_USERNAME=postgres DB_PASSWORD=""
33
-
34
- matrix:
11
+ jobs:
35
12
  fast_finish: true
36
13
  allow_failures:
37
14
  - env: DB=sqlite3 DBC_VERBOSE=true
15
+ include:
16
+ - name: audit
17
+ gemfile: spec/gemfiles/rails_5_2.gemfile
18
+ before_script: ""
19
+ script:
20
+ - bundle show rubocop
21
+ - bundle exec rubocop
22
+ - cp $BUNDLE_GEMFILE Gemfile.lock
23
+ - bundle exec bundle-audit check --update -v
24
+ - gemfile: spec/gemfiles/rails_5_2.gemfile
25
+ rvm: 2.6
26
+ env: DB=postgresql DB_USERNAME=postgres DB_PASSWORD=""
27
+ services: postgresql
28
+ - gemfile: spec/gemfiles/rails_5_2.gemfile
29
+ rvm: 2.6
30
+ env: DB=sqlite3 DBC_VERBOSE=true
31
+
38
32
 
39
33
  before_script:
40
34
  - RAILS_ENV=test bundle exec rake db:create db:migrate
41
35
 
42
36
  script:
43
37
  - xvfb-run bundle exec rspec
44
- - bundle show rubocop
45
- - bundle exec rubocop
data/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ # v0.3.0, v0.3.1
2
+
3
+ This version supports:
4
+
5
+ * thredded v1.0 +
6
+ * rails 5.2
7
+
8
+ v0.3.1 was just a fix to a link in the gem
9
+
10
+ # v0.2.1
11
+
12
+ Support sprockets 4
13
+
14
+ This version supports:
15
+
16
+ * thredded v0.16.0+
17
+ * rails 4.2 - 5.2
18
+
1
19
  # v0.2.0
2
20
 
3
21
  It's the first actual release (the theoretical v0.1.0 was only on github and never released as a gem)
data/Gemfile CHANGED
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  source "https://rubygems.org"
3
4
 
4
5
  # if you switch rails version gemfile:
data/Guardfile CHANGED
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  # More info at https://github.com/guard/guard#readme
3
4
 
4
5
  ## Uncomment and set this to only include directories you want to watch
5
- # directories %w(app lib config test spec features) \
6
+ # directories %w(app lib config test spec system) \
6
7
  # .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}
7
8
 
8
9
  ## Note: if you are using the `directories` clause above and you are not
@@ -15,44 +16,7 @@
15
16
  #
16
17
  # and, you'll have to watch "config/Guardfile" instead of "Guardfile"
17
18
 
18
- guard "livereload" do
19
- extensions = {
20
- css: :css,
21
- scss: :css,
22
- sass: :css,
23
- js: :js,
24
- coffee: :js,
25
- html: :html,
26
- png: :png,
27
- gif: :gif,
28
- jpg: :jpg,
29
- jpeg: :jpeg,
30
- # less: :less, # uncomment if you want LESS stylesheets done in browser
31
- }
32
-
33
- rails_view_exts = %w(erb haml slim)
34
-
35
- # file types LiveReload may optimize refresh for
36
- compiled_exts = extensions.values.uniq
37
- watch(%r{public/.+\.(#{compiled_exts * '|'})})
38
-
39
- extensions.each do |ext, type|
40
- watch(%r{
41
- (?:app|vendor)
42
- (?:/assets/\w+/(?<path>[^.]+) # path+base without extension
43
- (?<ext>\.#{ext})) # matching extension (must be first encountered)
44
- (?:\.\w+|$) # other extensions
45
- }x) do |m|
46
- path = m[1]
47
- "/assets/#{path}.#{type}"
48
- end
49
- end
50
-
51
- # file needing a full reload of the page anyway
52
- watch(%r{app/views/.+\.(#{rails_view_exts * '|'})$})
53
- watch(%r{app/helpers/.+\.rb})
54
- watch(%r{config/locales/.+\.yml})
55
- end
19
+ interactor :off unless ENV["GUARD_USE_INTERACTOR"]
56
20
 
57
21
  # Guard-Rails supports a lot options with default values:
58
22
  # daemon: false # runs the server as a daemon.
@@ -71,7 +35,20 @@ end
71
35
  # zeus: false # enables zeus gem.
72
36
  # CLI: 'rails server' # customizes runner command. Omits all options except `pid_file`!
73
37
 
74
- guard "rails", port: 3012, root: "spec/dummy" do
38
+ host = ENV["UNSAFE_DEV"] ? "0.0.0.0" : "localhost"
39
+ port = ENV["RAILS_S_PORT"]&.to_i || 3012
40
+ guard "rails", host: host, port: port, root: "spec/dummy" do
75
41
  watch("Gemfile.lock")
76
42
  watch(%r{^(config|lib)/.*})
77
43
  end
44
+
45
+ guard "livereload", port: ENV["LIVERELOAD_PORT"]&.to_i || 35_734 do
46
+ watch(%r{app/views/.+\.(erb|haml|slim)$})
47
+ watch(%r{app/helpers/.+\.rb})
48
+ watch(%r{public/.+\.(css|js|html)})
49
+ watch(%r{config/locales/.+\.yml})
50
+ # Rails Assets Pipeline
51
+ watch(%r{(app|vendor)/assets/\w+/(.+\.(js|html)).*}) { |m| "/assets/#{m[2]}" }
52
+ watch(%r{(app|vendor)/assets/\w+/(.+)\.scss.*}) { |m| "/assets/#{m[2]}.css" }
53
+ watch(%r{spec/javascripts/(.+\.js)}) { |m| "/assets/#{m[1]}" }
54
+ end