wor-simple_crud 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.github/workflows/ci.yml +52 -0
- data/.gitignore +338 -0
- data/.overcommit.yml +15 -0
- data/.rubocop.yml +16 -0
- data/Appraisals +40 -0
- data/CHANGELOG.md +12 -0
- data/Gemfile +42 -0
- data/LICENSE.md +22 -0
- data/README.md +286 -0
- data/Rakefile +6 -0
- data/lib/simple_crud/authorization/action_policy_adapter.rb +22 -0
- data/lib/simple_crud/authorization/adapter.rb +20 -0
- data/lib/simple_crud/authorization/can_can_can_adapter.rb +22 -0
- data/lib/simple_crud/authorization/pundit_adapter.rb +21 -0
- data/lib/simple_crud/config.rb +24 -0
- data/lib/simple_crud/pagination/adapter.rb +14 -0
- data/lib/simple_crud/pagination/kaminari_adapter.rb +19 -0
- data/lib/simple_crud/pagination/pagy_adapter.rb +22 -0
- data/lib/simple_crud/pagination/will_paginate_adapter.rb +22 -0
- data/lib/simple_crud/pagination/wor_paginate_adapter.rb +17 -0
- data/lib/simple_crud/rspec.rb +11 -0
- data/lib/simple_crud/simple_crud_controller.rb +125 -0
- data/lib/simple_crud/version.rb +5 -0
- data/lib/simple_crud.rb +12 -0
- data/lib/spec/matchers/have_been_serialized_with.rb +30 -0
- data/lib/spec/response_helper.rb +10 -0
- data/lib/spec/shared_contexts/authenticate_user.rb +11 -0
- data/lib/spec/shared_examples/helpers.rb +50 -0
- data/lib/spec/shared_examples/simple_crud_for_create.rb +49 -0
- data/lib/spec/shared_examples/simple_crud_for_destroy.rb +68 -0
- data/lib/spec/shared_examples/simple_crud_for_index.rb +56 -0
- data/lib/spec/shared_examples/simple_crud_for_show.rb +51 -0
- data/lib/spec/shared_examples/simple_crud_for_update.rb +61 -0
- data/lib/spec/shared_examples/unauthorized_when_not_logged_in.rb +10 -0
- data/pull_request_template.md +3 -0
- data/spec/dummy/Rakefile +8 -0
- data/spec/dummy/app/assets/config/manifest.js +6 -0
- data/spec/dummy/app/controllers/application_controller.rb +38 -0
- data/spec/dummy/app/controllers/dummy_models_controller.rb +23 -0
- data/spec/dummy/app/controllers/without_pagination/dummy_models_controller.rb +15 -0
- data/spec/dummy/app/models/application_record.rb +5 -0
- data/spec/dummy/app/models/concerns/.keep +0 -0
- data/spec/dummy/app/models/dummy_model.rb +7 -0
- data/spec/dummy/app/models/dummy_model_policy.rb +34 -0
- data/spec/dummy/app/models/user.rb +11 -0
- data/spec/dummy/app/serializers/dummy_model_serializer.rb +5 -0
- data/spec/dummy/bin/bundle +5 -0
- data/spec/dummy/bin/rails +6 -0
- data/spec/dummy/bin/rake +6 -0
- data/spec/dummy/bin/setup +35 -0
- data/spec/dummy/bin/update +30 -0
- data/spec/dummy/config/application.rb +17 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +7 -0
- data/spec/dummy/config/environments/development.rb +46 -0
- data/spec/dummy/config/environments/test.rb +47 -0
- data/spec/dummy/config/initializers/devise.rb +303 -0
- data/spec/dummy/config/locales/devise.en.yml +65 -0
- data/spec/dummy/config/puma.rb +49 -0
- data/spec/dummy/config/routes.rb +10 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/config/spring.rb +8 -0
- data/spec/dummy/config.ru +7 -0
- data/spec/dummy/db/migrate/20170626184159_create_dummy_models.rb +10 -0
- data/spec/dummy/db/migrate/20200110191019_devise_create_users.rb +43 -0
- data/spec/dummy/db/migrate/20200120165657_add_user_id_to_dummy_models.rb +7 -0
- data/spec/dummy/db/schema.rb +36 -0
- data/spec/dummy/lib/assets/.keep +0 -0
- data/spec/dummy/log/.keep +0 -0
- data/spec/dummy/spec/factories/dummy_models.rb +9 -0
- data/spec/dummy/spec/factories/users.rb +8 -0
- data/spec/dummy_controller_spec.rb +19 -0
- data/spec/dummy_model_policy_spec.rb +29 -0
- data/spec/dummy_model_serializer_spec.rb +36 -0
- data/spec/simple_crud/authorization/action_policy_adapter_spec.rb +58 -0
- data/spec/simple_crud/authorization/can_can_can_adapter_spec.rb +53 -0
- data/spec/simple_crud/pagination/adapters_spec.rb +48 -0
- data/spec/simple_crud_configuration_spec.rb +61 -0
- data/spec/simple_crud_controller_spec.rb +41 -0
- data/spec/spec_helper.rb +60 -0
- data/spec/spy.rb +41 -0
- data/spec/without_pagination/dummy_models_controller_spec.rb +6 -0
- data/wor-simple_crud.gemspec +23 -0
- metadata +145 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 0f3a2ed3cb6cea9416a6a745959519ccfdd9fd3a35667432939ece4291368266
|
|
4
|
+
data.tar.gz: 6b0625c10d66661cff9b09959ddd7f1a0eae630c0a519fa34116855b38588377
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: c4b2ab3b62121f5409a0d11d498a094162f847027941deb4abb3c72dc0c5c623934c3aeee5a65c64149039fbf2c09d4e9f9a8e10da6818ad32e236545e592331
|
|
7
|
+
data.tar.gz: 75211a88220e4328897ba0c36ebd55b04742bc253874f711cf14e644ff5a9d595455003facfb7ad9896346e63570d6dffb36fbeb947e34261a17e38ddb60aa80
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
test:
|
|
10
|
+
name: "Ruby ${{ matrix.ruby }} / Rails ${{ matrix.rails }}"
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
fail-fast: false
|
|
14
|
+
matrix:
|
|
15
|
+
ruby: ['3.2', '3.3', '3.4']
|
|
16
|
+
rails: ['6.1', '7.0', '7.1', '7.2', '8.0', '8.1']
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v7
|
|
19
|
+
- uses: ruby/setup-ruby@v1
|
|
20
|
+
with:
|
|
21
|
+
ruby-version: ${{ matrix.ruby }}
|
|
22
|
+
bundler-cache: false
|
|
23
|
+
- name: Generate appraisal gemfiles
|
|
24
|
+
run: |
|
|
25
|
+
bundle install
|
|
26
|
+
bundle exec appraisal generate
|
|
27
|
+
- name: Install dependencies for this Rails version
|
|
28
|
+
env:
|
|
29
|
+
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails }}.gemfile
|
|
30
|
+
run: bundle install
|
|
31
|
+
- name: Prepare test database
|
|
32
|
+
env:
|
|
33
|
+
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails }}.gemfile
|
|
34
|
+
RAILS_ENV: test
|
|
35
|
+
working-directory: spec/dummy
|
|
36
|
+
run: bundle exec rails db:schema:load
|
|
37
|
+
- name: Run tests
|
|
38
|
+
env:
|
|
39
|
+
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails }}.gemfile
|
|
40
|
+
run: bundle exec rspec
|
|
41
|
+
|
|
42
|
+
lint:
|
|
43
|
+
name: RuboCop
|
|
44
|
+
runs-on: ubuntu-latest
|
|
45
|
+
steps:
|
|
46
|
+
- uses: actions/checkout@v7
|
|
47
|
+
- uses: ruby/setup-ruby@v1
|
|
48
|
+
with:
|
|
49
|
+
ruby-version: '3.4'
|
|
50
|
+
bundler-cache: true
|
|
51
|
+
- name: Run RuboCop
|
|
52
|
+
run: bundle exec rubocop lib spec --format simple
|
data/.gitignore
ADDED
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
spec/dummy/db/*.sqlite3
|
|
2
|
+
spec/dummy/db/*.sqlite3-journal
|
|
3
|
+
spec/dummy/db/*.sqlite3-shm
|
|
4
|
+
spec/dummy/db/*.sqlite3-wal
|
|
5
|
+
spec/dummy/log/*.log
|
|
6
|
+
spec/dummy/tmp/
|
|
7
|
+
|
|
8
|
+
/.bundle/
|
|
9
|
+
/.yardoc
|
|
10
|
+
/Gemfile.lock
|
|
11
|
+
/_yardoc/
|
|
12
|
+
/coverage/
|
|
13
|
+
/doc/
|
|
14
|
+
/pkg/
|
|
15
|
+
/spec/reports/
|
|
16
|
+
/tmp/
|
|
17
|
+
*.gem
|
|
18
|
+
Gemfile.lock
|
|
19
|
+
|
|
20
|
+
# Created by https://www.gitignore.io/api/ruby,rubymine,rails,emacs,vim,sublimetext,osx,macos,linux,windows
|
|
21
|
+
|
|
22
|
+
### Emacs ###
|
|
23
|
+
# -*- mode: gitignore; -*-
|
|
24
|
+
*~
|
|
25
|
+
\#*\#
|
|
26
|
+
/.emacs.desktop
|
|
27
|
+
/.emacs.desktop.lock
|
|
28
|
+
*.elc
|
|
29
|
+
auto-save-list
|
|
30
|
+
tramp
|
|
31
|
+
.\#*
|
|
32
|
+
|
|
33
|
+
# Org-mode
|
|
34
|
+
.org-id-locations
|
|
35
|
+
*_archive
|
|
36
|
+
|
|
37
|
+
# flymake-mode
|
|
38
|
+
*_flymake.*
|
|
39
|
+
|
|
40
|
+
# eshell files
|
|
41
|
+
/eshell/history
|
|
42
|
+
/eshell/lastdir
|
|
43
|
+
|
|
44
|
+
# elpa packages
|
|
45
|
+
/elpa/
|
|
46
|
+
|
|
47
|
+
# reftex files
|
|
48
|
+
*.rel
|
|
49
|
+
|
|
50
|
+
# AUCTeX auto folder
|
|
51
|
+
/auto/
|
|
52
|
+
|
|
53
|
+
# cask packages
|
|
54
|
+
.cask/
|
|
55
|
+
dist/
|
|
56
|
+
|
|
57
|
+
# Flycheck
|
|
58
|
+
flycheck_*.el
|
|
59
|
+
|
|
60
|
+
# server auth directory
|
|
61
|
+
/server/
|
|
62
|
+
|
|
63
|
+
# projectiles files
|
|
64
|
+
.projectile
|
|
65
|
+
|
|
66
|
+
# directory configuration
|
|
67
|
+
.dir-locals.el
|
|
68
|
+
|
|
69
|
+
### Linux ###
|
|
70
|
+
|
|
71
|
+
# temporary files which can be created if a process still has a handle open of a deleted file
|
|
72
|
+
.fuse_hidden*
|
|
73
|
+
|
|
74
|
+
# KDE directory preferences
|
|
75
|
+
.directory
|
|
76
|
+
|
|
77
|
+
# Linux trash folder which might appear on any partition or disk
|
|
78
|
+
.Trash-*
|
|
79
|
+
|
|
80
|
+
# .nfs files are created when an open file is removed but is still being accessed
|
|
81
|
+
.nfs*
|
|
82
|
+
|
|
83
|
+
### macOS ###
|
|
84
|
+
*.DS_Store
|
|
85
|
+
.AppleDouble
|
|
86
|
+
.LSOverride
|
|
87
|
+
|
|
88
|
+
# Icon must end with two \r
|
|
89
|
+
Icon
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
# Thumbnails
|
|
93
|
+
._*
|
|
94
|
+
|
|
95
|
+
# Files that might appear in the root of a volume
|
|
96
|
+
.DocumentRevisions-V100
|
|
97
|
+
.fseventsd
|
|
98
|
+
.Spotlight-V100
|
|
99
|
+
.TemporaryItems
|
|
100
|
+
.Trashes
|
|
101
|
+
.VolumeIcon.icns
|
|
102
|
+
.com.apple.timemachine.donotpresent
|
|
103
|
+
|
|
104
|
+
# Directories potentially created on remote AFP share
|
|
105
|
+
.AppleDB
|
|
106
|
+
.AppleDesktop
|
|
107
|
+
Network Trash Folder
|
|
108
|
+
Temporary Items
|
|
109
|
+
.apdisk
|
|
110
|
+
|
|
111
|
+
### OSX ###
|
|
112
|
+
|
|
113
|
+
# Icon must end with two \r
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
# Thumbnails
|
|
117
|
+
|
|
118
|
+
# Files that might appear in the root of a volume
|
|
119
|
+
|
|
120
|
+
# Directories potentially created on remote AFP share
|
|
121
|
+
|
|
122
|
+
### Rails ###
|
|
123
|
+
*.rbc
|
|
124
|
+
capybara-*.html
|
|
125
|
+
.rspec
|
|
126
|
+
/log
|
|
127
|
+
/tmp
|
|
128
|
+
/db/*.sqlite3
|
|
129
|
+
/db/*.sqlite3-journal
|
|
130
|
+
/public/system
|
|
131
|
+
/coverage/
|
|
132
|
+
/spec/tmp
|
|
133
|
+
**.orig
|
|
134
|
+
rerun.txt
|
|
135
|
+
pickle-email-*.html
|
|
136
|
+
|
|
137
|
+
# TODO Comment out this rule if you are OK with secrets being uploaded to the repo
|
|
138
|
+
config/initializers/secret_token.rb
|
|
139
|
+
|
|
140
|
+
# Only include if you have production secrets in this file, which is no longer a Rails default
|
|
141
|
+
# config/secrets.yml
|
|
142
|
+
|
|
143
|
+
# dotenv
|
|
144
|
+
# TODO Comment out this rule if environment variables can be committed
|
|
145
|
+
.env
|
|
146
|
+
|
|
147
|
+
## Environment normalization:
|
|
148
|
+
/.bundle
|
|
149
|
+
/vendor/bundle
|
|
150
|
+
|
|
151
|
+
# these should all be checked in to normalize the environment:
|
|
152
|
+
# Gemfile.lock, .ruby-version, .ruby-gemset
|
|
153
|
+
|
|
154
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
|
155
|
+
.rvmrc
|
|
156
|
+
|
|
157
|
+
# if using bower-rails ignore default bower_components path bower.json files
|
|
158
|
+
/vendor/assets/bower_components
|
|
159
|
+
*.bowerrc
|
|
160
|
+
bower.json
|
|
161
|
+
|
|
162
|
+
# Ignore pow environment settings
|
|
163
|
+
.powenv
|
|
164
|
+
|
|
165
|
+
# Ignore Byebug command history file.
|
|
166
|
+
.byebug_history
|
|
167
|
+
|
|
168
|
+
### Ruby ###
|
|
169
|
+
*.gem
|
|
170
|
+
/.config
|
|
171
|
+
/InstalledFiles
|
|
172
|
+
/pkg/
|
|
173
|
+
/spec/reports/
|
|
174
|
+
/spec/examples.txt
|
|
175
|
+
/test/tmp/
|
|
176
|
+
/test/version_tmp/
|
|
177
|
+
/tmp/
|
|
178
|
+
|
|
179
|
+
# Used by dotenv library to load environment variables.
|
|
180
|
+
# .env
|
|
181
|
+
|
|
182
|
+
## Specific to RubyMotion:
|
|
183
|
+
.dat*
|
|
184
|
+
.repl_history
|
|
185
|
+
build/
|
|
186
|
+
*.bridgesupport
|
|
187
|
+
build-iPhoneOS/
|
|
188
|
+
build-iPhoneSimulator/
|
|
189
|
+
|
|
190
|
+
## Specific to RubyMotion (use of CocoaPods):
|
|
191
|
+
#
|
|
192
|
+
# We recommend against adding the Pods directory to your .gitignore. However
|
|
193
|
+
# you should judge for yourself, the pros and cons are mentioned at:
|
|
194
|
+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
|
195
|
+
#
|
|
196
|
+
# vendor/Pods/
|
|
197
|
+
|
|
198
|
+
## Documentation cache and generated files:
|
|
199
|
+
/.yardoc/
|
|
200
|
+
/_yardoc/
|
|
201
|
+
/doc/
|
|
202
|
+
/rdoc/
|
|
203
|
+
|
|
204
|
+
## Environment normalization:
|
|
205
|
+
/.bundle/
|
|
206
|
+
/lib/bundler/man/
|
|
207
|
+
|
|
208
|
+
# for a library or gem, you might want to ignore these files since the code is
|
|
209
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
210
|
+
# Gemfile.lock
|
|
211
|
+
# .ruby-version
|
|
212
|
+
# .ruby-gemset
|
|
213
|
+
|
|
214
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
|
215
|
+
|
|
216
|
+
### RubyMine ###
|
|
217
|
+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
|
|
218
|
+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
|
|
219
|
+
|
|
220
|
+
# User-specific stuff:
|
|
221
|
+
.idea/**/workspace.xml
|
|
222
|
+
.idea/**/tasks.xml
|
|
223
|
+
|
|
224
|
+
# Sensitive or high-churn files:
|
|
225
|
+
.idea/**/dataSources/
|
|
226
|
+
.idea/**/dataSources.ids
|
|
227
|
+
.idea/**/dataSources.xml
|
|
228
|
+
.idea/**/dataSources.local.xml
|
|
229
|
+
.idea/**/sqlDataSources.xml
|
|
230
|
+
.idea/**/dynamic.xml
|
|
231
|
+
.idea/**/uiDesigner.xml
|
|
232
|
+
|
|
233
|
+
# Gradle:
|
|
234
|
+
.idea/**/gradle.xml
|
|
235
|
+
.idea/**/libraries
|
|
236
|
+
|
|
237
|
+
# Mongo Explorer plugin:
|
|
238
|
+
.idea/**/mongoSettings.xml
|
|
239
|
+
|
|
240
|
+
## File-based project format:
|
|
241
|
+
*.iws
|
|
242
|
+
|
|
243
|
+
## Plugin-specific files:
|
|
244
|
+
|
|
245
|
+
# IntelliJ
|
|
246
|
+
/out/
|
|
247
|
+
|
|
248
|
+
# mpeltonen/sbt-idea plugin
|
|
249
|
+
.idea_modules/
|
|
250
|
+
|
|
251
|
+
# JIRA plugin
|
|
252
|
+
atlassian-ide-plugin.xml
|
|
253
|
+
|
|
254
|
+
# Crashlytics plugin (for Android Studio and IntelliJ)
|
|
255
|
+
com_crashlytics_export_strings.xml
|
|
256
|
+
crashlytics.properties
|
|
257
|
+
crashlytics-build.properties
|
|
258
|
+
fabric.properties
|
|
259
|
+
|
|
260
|
+
### RubyMine Patch ###
|
|
261
|
+
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
|
|
262
|
+
|
|
263
|
+
# *.iml
|
|
264
|
+
# modules.xml
|
|
265
|
+
# .idea/misc.xml
|
|
266
|
+
# *.ipr
|
|
267
|
+
|
|
268
|
+
### SublimeText ###
|
|
269
|
+
# cache files for sublime text
|
|
270
|
+
*.tmlanguage.cache
|
|
271
|
+
*.tmPreferences.cache
|
|
272
|
+
*.stTheme.cache
|
|
273
|
+
|
|
274
|
+
# workspace files are user-specific
|
|
275
|
+
*.sublime-workspace
|
|
276
|
+
|
|
277
|
+
# project files should be checked into the repository, unless a significant
|
|
278
|
+
# proportion of contributors will probably not be using SublimeText
|
|
279
|
+
# *.sublime-project
|
|
280
|
+
|
|
281
|
+
# sftp configuration file
|
|
282
|
+
sftp-config.json
|
|
283
|
+
|
|
284
|
+
# Package control specific files
|
|
285
|
+
Package Control.last-run
|
|
286
|
+
Package Control.ca-list
|
|
287
|
+
Package Control.ca-bundle
|
|
288
|
+
Package Control.system-ca-bundle
|
|
289
|
+
Package Control.cache/
|
|
290
|
+
Package Control.ca-certs/
|
|
291
|
+
Package Control.merged-ca-bundle
|
|
292
|
+
Package Control.user-ca-bundle
|
|
293
|
+
oscrypto-ca-bundle.crt
|
|
294
|
+
bh_unicode_properties.cache
|
|
295
|
+
|
|
296
|
+
# Sublime-github package stores a github token in this file
|
|
297
|
+
# https://packagecontrol.io/packages/sublime-github
|
|
298
|
+
GitHub.sublime-settings
|
|
299
|
+
|
|
300
|
+
### Vim ###
|
|
301
|
+
# swap
|
|
302
|
+
[._]*.s[a-v][a-z]
|
|
303
|
+
[._]*.sw[a-p]
|
|
304
|
+
[._]s[a-v][a-z]
|
|
305
|
+
[._]sw[a-p]
|
|
306
|
+
# session
|
|
307
|
+
Session.vim
|
|
308
|
+
# temporary
|
|
309
|
+
.netrwhist
|
|
310
|
+
# auto-generated tag files
|
|
311
|
+
tags
|
|
312
|
+
|
|
313
|
+
### Windows ###
|
|
314
|
+
# Windows thumbnail cache files
|
|
315
|
+
Thumbs.db
|
|
316
|
+
ehthumbs.db
|
|
317
|
+
ehthumbs_vista.db
|
|
318
|
+
|
|
319
|
+
# Folder config file
|
|
320
|
+
Desktop.ini
|
|
321
|
+
|
|
322
|
+
# Recycle Bin used on file shares
|
|
323
|
+
$RECYCLE.BIN/
|
|
324
|
+
|
|
325
|
+
# Windows Installer files
|
|
326
|
+
*.cab
|
|
327
|
+
*.msi
|
|
328
|
+
*.msm
|
|
329
|
+
*.msp
|
|
330
|
+
|
|
331
|
+
# Windows shortcuts
|
|
332
|
+
*.lnk
|
|
333
|
+
|
|
334
|
+
# End of https://www.gitignore.io/api/ruby,rubymine,rails,emacs,vim,sublimetext,osx,macos,linux,windows
|
|
335
|
+
|
|
336
|
+
### Appraisal ###
|
|
337
|
+
/gemfiles/*.gemfile
|
|
338
|
+
/gemfiles/*.gemfile.lock
|
data/.overcommit.yml
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
PrePush:
|
|
2
|
+
ALL:
|
|
3
|
+
problem_on_unmodified_line: report
|
|
4
|
+
requires_files: false
|
|
5
|
+
quiet: false
|
|
6
|
+
|
|
7
|
+
RuboCop:
|
|
8
|
+
enabled: true
|
|
9
|
+
command: ['bash', '-c', 'bundle exec rubocop lib spec']
|
|
10
|
+
|
|
11
|
+
RSpec:
|
|
12
|
+
enabled: true
|
|
13
|
+
command: ['bundle', 'exec', 'rspec']
|
|
14
|
+
env:
|
|
15
|
+
BUNDLE_GEMFILE: gemfiles/rails_8.1.gemfile
|
data/.rubocop.yml
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
plugins:
|
|
2
|
+
- rubocop-rspec
|
|
3
|
+
|
|
4
|
+
AllCops:
|
|
5
|
+
TargetRubyVersion: 3.2
|
|
6
|
+
NewCops: disable
|
|
7
|
+
SuggestExtensions: false
|
|
8
|
+
|
|
9
|
+
# dummy_controller_spec.rb doubles as the shared-examples exercise spec.
|
|
10
|
+
RSpec/SpecFilePathFormat:
|
|
11
|
+
Exclude:
|
|
12
|
+
- spec/dummy_controller_spec.rb
|
|
13
|
+
|
|
14
|
+
RSpec/SpecFilePathSuffix:
|
|
15
|
+
Exclude:
|
|
16
|
+
- spec/dummy_controller_spec.rb
|
data/Appraisals
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# sqlite3 is pinned per Rails version here, not in the Gemfile: activerecord
|
|
2
|
+
# 6.1/7.0 hard-pin "~> 1.4" internally, 8.0/8.1 need ">= 2.1", and Bundler
|
|
3
|
+
# won't allow the same gem pinned twice in one Gemfile.
|
|
4
|
+
|
|
5
|
+
appraise 'rails-6.1' do
|
|
6
|
+
gem 'rails', '~> 6.1.0'
|
|
7
|
+
|
|
8
|
+
# activesupport 6.1.x uses mutex_m/benchmark/logger without declaring
|
|
9
|
+
# them, and none is bundled by default on Ruby 3.4+/4.0+ anymore.
|
|
10
|
+
gem 'mutex_m'
|
|
11
|
+
gem 'benchmark'
|
|
12
|
+
gem 'logger'
|
|
13
|
+
|
|
14
|
+
gem 'sqlite3', '~> 1.4'
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
appraise 'rails-7.0' do
|
|
18
|
+
gem 'rails', '~> 7.0.0'
|
|
19
|
+
gem 'sqlite3', '~> 1.4'
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
appraise 'rails-7.1' do
|
|
23
|
+
gem 'rails', '~> 7.1.0'
|
|
24
|
+
gem 'sqlite3', '~> 2.9'
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
appraise 'rails-7.2' do
|
|
28
|
+
gem 'rails', '~> 7.2.0'
|
|
29
|
+
gem 'sqlite3', '~> 2.9'
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
appraise 'rails-8.0' do
|
|
33
|
+
gem 'rails', '~> 8.0.0'
|
|
34
|
+
gem 'sqlite3', '~> 2.9'
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
appraise 'rails-8.1' do
|
|
38
|
+
gem 'rails', '~> 8.1.0'
|
|
39
|
+
gem 'sqlite3', '~> 2.9'
|
|
40
|
+
end
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
## Change log
|
|
2
|
+
|
|
3
|
+
### V0.2.1
|
|
4
|
+
* Rename the published gem from `simple_crud` to `wor-simple_crud`. `simple_crud` is already taken on RubyGems by an unrelated gem, and RubyGems also rejects names that differ from an existing one only by hyphen/underscore (so `simple-crud` was rejected too). Install with `gem 'wor-simple_crud', require: 'simple_crud'` (the require path is unchanged).
|
|
5
|
+
* Drop the last Wolox references now that this gem lives at icoluccio/simple-crud, and point the wor-paginate link and CI/gem badges at their new homes.
|
|
6
|
+
* Support Rails 6.1 through 8.1 (previously untested past very old Rails/Ruby versions): add an Appraisal-based test matrix, replace Travis CI with GitHub Actions, and drop the abandoned `devise_jwt_controllers` and `fictium` dependencies, which capped Rails compatibility at old versions.
|
|
7
|
+
* Fix several bugs found while getting the CRUD shared examples to 100% coverage (authorization checks that never actually ran, mismatched test fixtures, a dead `SimpleCrud.configure` that always raised).
|
|
8
|
+
* Add an overcommit pre-push hook (RuboCop + full spec suite) and tighten `.rubocop.yml` to the default cop set.
|
|
9
|
+
* Make both authorization and pagination pluggable via `SimpleCrud::Authorization::Adapter` / `SimpleCrud::Pagination::Adapter` (`SimpleCrud.configure { |c| c.authorization_adapter = ...; c.pagination_adapter = ... }`). Pundit and wor-paginate remain the defaults but are no longer hard dependencies of the gem: an app that sets `authorize: false` / `paginate: false` everywhere needs neither installed. Ship CanCanCan and Action Policy as ready-to-use authorization adapters, and Kaminari, will_paginate, and Pagy as ready-to-use pagination adapters (none of the six libraries is a hard dependency, require the one you use).
|
|
10
|
+
|
|
11
|
+
### V0.1
|
|
12
|
+
Release!
|
data/Gemfile
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
source 'https://rubygems.org'
|
|
2
|
+
|
|
3
|
+
# Declare your gem's dependencies in simple-crud.gemspec.
|
|
4
|
+
# Bundler will treat runtime dependencies like base dependencies, and
|
|
5
|
+
# development dependencies will be added by default to the :development group.
|
|
6
|
+
gemspec
|
|
7
|
+
|
|
8
|
+
# Declare any dependencies that are still in development here instead of in
|
|
9
|
+
# your gemspec. These might include edge Rails or gems from your path or
|
|
10
|
+
# Git. Remember to move these dependencies to your gemspec before releasing
|
|
11
|
+
# your gem to rubygems.org.
|
|
12
|
+
|
|
13
|
+
# To use a debugger
|
|
14
|
+
# gem 'byebug', group: [:development, :test]
|
|
15
|
+
|
|
16
|
+
group :development, :test do
|
|
17
|
+
gem 'action_policy', '~> 0.7.6', require: false
|
|
18
|
+
gem 'active_model_serializers', '~> 0.10.16'
|
|
19
|
+
gem 'appraisal', '~> 2.5'
|
|
20
|
+
gem 'byebug', '~> 13.0'
|
|
21
|
+
gem 'cancancan', '~> 3.6', require: false
|
|
22
|
+
gem 'database_cleaner-active_record', '~> 2.2', require: 'database_cleaner/active_record'
|
|
23
|
+
gem 'devise', '>= 4.9', '< 6'
|
|
24
|
+
gem 'devise-jwt', '~> 0.13'
|
|
25
|
+
gem 'factory_bot_rails', '~> 6.5'
|
|
26
|
+
gem 'faker', '~> 3.8'
|
|
27
|
+
gem 'kaminari', '~> 1.2', require: false
|
|
28
|
+
gem 'overcommit', '~> 0.72'
|
|
29
|
+
gem 'pagy', '~> 43.0', require: false
|
|
30
|
+
gem 'pundit', '~> 2.5'
|
|
31
|
+
gem 'rake', '~> 13.4'
|
|
32
|
+
gem 'rspec', '~> 3.13'
|
|
33
|
+
gem 'rspec-rails', '>= 6.0', '< 9'
|
|
34
|
+
gem 'rubocop', '~> 1.88'
|
|
35
|
+
gem 'rubocop-rspec', '~> 3.10'
|
|
36
|
+
gem 'simplecov', '~> 1.0'
|
|
37
|
+
# sqlite3 is pinned per Rails version in Appraisals instead, since the
|
|
38
|
+
# required range differs across supported versions.
|
|
39
|
+
gem 'webmock', '~> 3.26'
|
|
40
|
+
gem 'will_paginate', '~> 4.0', require: false
|
|
41
|
+
gem 'wor-paginate', '~> 0.4'
|
|
42
|
+
end
|
data/LICENSE.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2017 Wolox
|
|
4
|
+
Copyright (c) 2026 Ignacio Coluccio
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in
|
|
14
|
+
all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
22
|
+
THE SOFTWARE.
|