resource_quotable 0.2.0 → 1.1.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 +4 -4
- data/Changelog.md +61 -1
- data/Rakefile +0 -2
- data/Readme.md +25 -6
- data/app/models/resource_quotable/quotum.rb +3 -3
- data/lib/concerns/controllers/allowed_to_manage_quota_check.rb +1 -1
- data/lib/resource_quotable/version.rb +1 -1
- data/lib/resource_quotable.rb +7 -4
- metadata +50 -35
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 33dd72896d2dca3527e021abc3ed5787b71523ffbbee64444c092cdbe811c996
|
|
4
|
+
data.tar.gz: b0ca9eb4a4d5f3a8f9fa3233df3b5238fef96d3da327793c04330e8d5d014126
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bc1152d4af3d067926771392598fde7819d5bfd53b9aaae2bbceba3d0545cfb966700acceb0004bfc882786b223b833ca36a6e3315e3ad223693c7060b19e8bc
|
|
7
|
+
data.tar.gz: f87769505502cb8e208fd240e08e83b574986c2f5fefeb5e05f44b28b29503d33356b2241e97e6d2cbd3202615bf92d848de53cc5d40ebb006cc804078f2b296
|
data/Changelog.md
CHANGED
|
@@ -4,7 +4,67 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/).
|
|
6
6
|
|
|
7
|
-
## [0.
|
|
7
|
+
## [1.1.1](https://github.com/ngelx/resource_quotable/compare/v1.1.0...v1.1.1) (2025-11-06)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Miscellaneous Chores
|
|
11
|
+
|
|
12
|
+
* release 1.1.1 ([a2beabd](https://github.com/ngelx/resource_quotable/commit/a2beabde20f97d8a16da7fb4e9c350e7c727f6b2))
|
|
13
|
+
|
|
14
|
+
## [1.1.0](https://github.com/ngelx/resource_quotable/compare/v1.0.0...v1.1.0) (2025-11-06)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* Added support for rails 8 ([08f3fa9](https://github.com/ngelx/resource_quotable/commit/08f3fa9d8aaeee70d5eed1ce33385b0efbb692f0))
|
|
20
|
+
|
|
21
|
+
## [1.0.0](https://github.com/ngelx/resource_quotable/compare/v0.4.0...v1.0.0) (2025-11-06)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### ⚠ BREAKING CHANGES
|
|
25
|
+
|
|
26
|
+
* version bump. Forcing new release
|
|
27
|
+
|
|
28
|
+
### Features
|
|
29
|
+
|
|
30
|
+
* version bump. Forcing new release ([3839216](https://github.com/ngelx/resource_quotable/commit/3839216c9ad23fc695524c133e7a3daafc390017))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### Miscellaneous Chores
|
|
34
|
+
|
|
35
|
+
* release 1.0.0 ([0c57697](https://github.com/ngelx/resource_quotable/commit/0c57697244e90aabf4d359d4003d24c9ea0d34d7))
|
|
36
|
+
|
|
37
|
+
## [0.4.0](https://github.com/ngelx/resource_quotable/compare/v0.3.0...v0.4.0) (2025-11-05)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
### ⚠ BREAKING CHANGES
|
|
41
|
+
|
|
42
|
+
* Removed support for rails < 7
|
|
43
|
+
|
|
44
|
+
### Features
|
|
45
|
+
|
|
46
|
+
* Added Support to Rails 7 and ruby 3.4 ([7fe72af](https://github.com/ngelx/resource_quotable/commit/7fe72afdba63effab7d03bc3bb91ebd7ae5afdb8))
|
|
47
|
+
|
|
48
|
+
## 1.0.0 (2025-11-05)
|
|
49
|
+
|
|
50
|
+
### Changed
|
|
51
|
+
|
|
52
|
+
* Support for rails 7
|
|
53
|
+
* Support for ruby 3.4
|
|
54
|
+
* Added devcontainer for development environment
|
|
55
|
+
* Breaking changes:
|
|
56
|
+
* Removed support for rails < 7
|
|
57
|
+
|
|
58
|
+
## 0.3.0 (2023-06-27)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
### Features
|
|
62
|
+
|
|
63
|
+
* moved to github actions CI ([91dcfbd](https://github.com/ngelx/resource_quotable/commit/91dcfbd24f646a37dddfe41baf5be841c4d0deab))
|
|
64
|
+
* Support for rails > 6 ([2b0947f](https://github.com/ngelx/resource_quotable/commit/2b0947fada278ea9b8d4f6ff26f8e941d0eccf9d))
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
## [0.2.0] (29/9/22)
|
|
8
68
|
### Changed
|
|
9
69
|
- Change Quota system to allow user group configuration.
|
|
10
70
|
|
data/Rakefile
CHANGED
data/Readme.md
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
# ResourceQuotable
|
|
2
2
|
A Rails quota limit gem for resources. UNDER DEVELOPMENT
|
|
3
3
|
|
|
4
|
+
[](https://badge.fury.io/rb/resource_quotable)
|
|
5
|
+

|
|
6
|
+
[](https://codeclimate.com/github/ngelx/resource_quotable/test_coverage)
|
|
7
|
+
[](https://codeclimate.com/github/ngelx/resource_quotable/maintainability)
|
|
8
|
+
|
|
4
9
|
## Installation
|
|
5
10
|
Add this line to your application's Gemfile:
|
|
6
11
|
|
|
@@ -164,7 +169,7 @@ class ApplicationController < ActionController::Base
|
|
|
164
169
|
# hook after every action
|
|
165
170
|
# default: nil
|
|
166
171
|
def resource_quotable_after
|
|
167
|
-
# ...
|
|
172
|
+
# ...
|
|
168
173
|
end
|
|
169
174
|
|
|
170
175
|
# ...
|
|
@@ -194,13 +199,27 @@ ResourceQuotable::Reset::Daily.call
|
|
|
194
199
|
|
|
195
200
|
## Contributing
|
|
196
201
|
|
|
202
|
+
Development environment is available in a devcontainer. You can use it to develop the gem.
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
$ docker compose -f .devcontainer/compose.yaml build
|
|
206
|
+
$ docker compose -f .devcontainer/compose.yaml run --rm rails-app bundle install
|
|
207
|
+
$ docker compose -f .devcontainer/compose.yaml run --rm rails-app bundle rails db:setup
|
|
208
|
+
$ docker compose -f .devcontainer/compose.yaml run --rm rails-app bundle rspec
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
The project follows conventional commit messages. See [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) for more details.
|
|
212
|
+
|
|
197
213
|
```bash
|
|
198
|
-
$
|
|
199
|
-
$
|
|
200
|
-
$
|
|
201
|
-
$
|
|
202
|
-
$
|
|
214
|
+
$ git commit -m "feat: add new feature"
|
|
215
|
+
$ git commit -m "fix: fix bug"
|
|
216
|
+
$ git commit -m "refactor: refactor code"
|
|
217
|
+
$ git commit -m "test: add tests"
|
|
218
|
+
$ git commit -m "docs: add documentation"
|
|
219
|
+
$ git commit -m "chore: other changes"
|
|
203
220
|
```
|
|
204
221
|
|
|
222
|
+
Version are automatically bumped by the release workflow. See [Release Please](https://github.com/googleapis/release-please) for more details.
|
|
223
|
+
|
|
205
224
|
## License
|
|
206
225
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
|
@@ -29,15 +29,15 @@ module ResourceQuotable
|
|
|
29
29
|
|
|
30
30
|
validates :resource_class, :action, :period, :limit, presence: true
|
|
31
31
|
|
|
32
|
-
enum action
|
|
32
|
+
enum :action, ResourceQuotable.actions, suffix: true
|
|
33
33
|
|
|
34
|
-
enum period
|
|
34
|
+
enum :period, {
|
|
35
35
|
any: 0,
|
|
36
36
|
daily: 1,
|
|
37
37
|
weekly: 2,
|
|
38
38
|
monthly: 3,
|
|
39
39
|
yearly: 4
|
|
40
|
-
},
|
|
40
|
+
}, suffix: true
|
|
41
41
|
|
|
42
42
|
def to_s
|
|
43
43
|
"#{period.to_s.capitalize} #{action} #{resource_class}."
|
data/lib/resource_quotable.rb
CHANGED
|
@@ -62,7 +62,10 @@ module ResourceQuotable # :nodoc:
|
|
|
62
62
|
end
|
|
63
63
|
|
|
64
64
|
# Extend ActiveRecord::Base with associations
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
ActiveSupport.on_load(:active_record) do
|
|
66
|
+
include ResourceQuotable::ActsAsQuotable
|
|
67
|
+
include ResourceQuotable::ActsAsQuotaTrackable
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
ActiveSupport.on_load(:action_controller) { include ResourceQuotable::AllowedToManageQuotaCheck }
|
|
71
|
+
ActiveSupport.on_load(:action_view) { include ResourceQuotable::Helper }
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: resource_quotable
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 1.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ngel
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: kaminari
|
|
@@ -36,62 +35,62 @@ dependencies:
|
|
|
36
35
|
requirements:
|
|
37
36
|
- - ">="
|
|
38
37
|
- !ruby/object:Gem::Version
|
|
39
|
-
version: '
|
|
38
|
+
version: '7'
|
|
40
39
|
- - "<"
|
|
41
40
|
- !ruby/object:Gem::Version
|
|
42
|
-
version: '
|
|
41
|
+
version: '9'
|
|
43
42
|
type: :runtime
|
|
44
43
|
prerelease: false
|
|
45
44
|
version_requirements: !ruby/object:Gem::Requirement
|
|
46
45
|
requirements:
|
|
47
46
|
- - ">="
|
|
48
47
|
- !ruby/object:Gem::Version
|
|
49
|
-
version: '
|
|
48
|
+
version: '7'
|
|
50
49
|
- - "<"
|
|
51
50
|
- !ruby/object:Gem::Version
|
|
52
|
-
version: '
|
|
51
|
+
version: '9'
|
|
53
52
|
- !ruby/object:Gem::Dependency
|
|
54
|
-
name:
|
|
53
|
+
name: annotaterb
|
|
55
54
|
requirement: !ruby/object:Gem::Requirement
|
|
56
55
|
requirements:
|
|
57
56
|
- - "~>"
|
|
58
57
|
- !ruby/object:Gem::Version
|
|
59
|
-
version: '
|
|
58
|
+
version: '4.20'
|
|
60
59
|
type: :development
|
|
61
60
|
prerelease: false
|
|
62
61
|
version_requirements: !ruby/object:Gem::Requirement
|
|
63
62
|
requirements:
|
|
64
63
|
- - "~>"
|
|
65
64
|
- !ruby/object:Gem::Version
|
|
66
|
-
version: '
|
|
65
|
+
version: '4.20'
|
|
67
66
|
- !ruby/object:Gem::Dependency
|
|
68
|
-
name: database_cleaner
|
|
67
|
+
name: database_cleaner
|
|
69
68
|
requirement: !ruby/object:Gem::Requirement
|
|
70
69
|
requirements:
|
|
71
70
|
- - "~>"
|
|
72
71
|
- !ruby/object:Gem::Version
|
|
73
|
-
version: '2.
|
|
72
|
+
version: '2.1'
|
|
74
73
|
type: :development
|
|
75
74
|
prerelease: false
|
|
76
75
|
version_requirements: !ruby/object:Gem::Requirement
|
|
77
76
|
requirements:
|
|
78
77
|
- - "~>"
|
|
79
78
|
- !ruby/object:Gem::Version
|
|
80
|
-
version: '2.
|
|
79
|
+
version: '2.1'
|
|
81
80
|
- !ruby/object:Gem::Dependency
|
|
82
81
|
name: factory_bot_rails
|
|
83
82
|
requirement: !ruby/object:Gem::Requirement
|
|
84
83
|
requirements:
|
|
85
84
|
- - "~>"
|
|
86
85
|
- !ruby/object:Gem::Version
|
|
87
|
-
version: '6.
|
|
86
|
+
version: '6.5'
|
|
88
87
|
type: :development
|
|
89
88
|
prerelease: false
|
|
90
89
|
version_requirements: !ruby/object:Gem::Requirement
|
|
91
90
|
requirements:
|
|
92
91
|
- - "~>"
|
|
93
92
|
- !ruby/object:Gem::Version
|
|
94
|
-
version: '6.
|
|
93
|
+
version: '6.5'
|
|
95
94
|
- !ruby/object:Gem::Dependency
|
|
96
95
|
name: ffaker
|
|
97
96
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -112,14 +111,14 @@ dependencies:
|
|
|
112
111
|
requirements:
|
|
113
112
|
- - "~>"
|
|
114
113
|
- !ruby/object:Gem::Version
|
|
115
|
-
version: '0.
|
|
114
|
+
version: '0.10'
|
|
116
115
|
type: :development
|
|
117
116
|
prerelease: false
|
|
118
117
|
version_requirements: !ruby/object:Gem::Requirement
|
|
119
118
|
requirements:
|
|
120
119
|
- - "~>"
|
|
121
120
|
- !ruby/object:Gem::Version
|
|
122
|
-
version: '0.
|
|
121
|
+
version: '0.10'
|
|
123
122
|
- !ruby/object:Gem::Dependency
|
|
124
123
|
name: rails-controller-testing
|
|
125
124
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -134,20 +133,34 @@ dependencies:
|
|
|
134
133
|
- - "~>"
|
|
135
134
|
- !ruby/object:Gem::Version
|
|
136
135
|
version: '1.0'
|
|
136
|
+
- !ruby/object:Gem::Dependency
|
|
137
|
+
name: rspec_junit_formatter
|
|
138
|
+
requirement: !ruby/object:Gem::Requirement
|
|
139
|
+
requirements:
|
|
140
|
+
- - "~>"
|
|
141
|
+
- !ruby/object:Gem::Version
|
|
142
|
+
version: '0.6'
|
|
143
|
+
type: :development
|
|
144
|
+
prerelease: false
|
|
145
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
146
|
+
requirements:
|
|
147
|
+
- - "~>"
|
|
148
|
+
- !ruby/object:Gem::Version
|
|
149
|
+
version: '0.6'
|
|
137
150
|
- !ruby/object:Gem::Dependency
|
|
138
151
|
name: rspec-rails
|
|
139
152
|
requirement: !ruby/object:Gem::Requirement
|
|
140
153
|
requirements:
|
|
141
154
|
- - "~>"
|
|
142
155
|
- !ruby/object:Gem::Version
|
|
143
|
-
version: '
|
|
156
|
+
version: '7.0'
|
|
144
157
|
type: :development
|
|
145
158
|
prerelease: false
|
|
146
159
|
version_requirements: !ruby/object:Gem::Requirement
|
|
147
160
|
requirements:
|
|
148
161
|
- - "~>"
|
|
149
162
|
- !ruby/object:Gem::Version
|
|
150
|
-
version: '
|
|
163
|
+
version: '7.0'
|
|
151
164
|
- !ruby/object:Gem::Dependency
|
|
152
165
|
name: rubocop
|
|
153
166
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -177,47 +190,47 @@ dependencies:
|
|
|
177
190
|
- !ruby/object:Gem::Version
|
|
178
191
|
version: '2.15'
|
|
179
192
|
- !ruby/object:Gem::Dependency
|
|
180
|
-
name:
|
|
193
|
+
name: shoulda-matchers
|
|
181
194
|
requirement: !ruby/object:Gem::Requirement
|
|
182
195
|
requirements:
|
|
183
196
|
- - "~>"
|
|
184
197
|
- !ruby/object:Gem::Version
|
|
185
|
-
version: '
|
|
198
|
+
version: '5.1'
|
|
186
199
|
type: :development
|
|
187
200
|
prerelease: false
|
|
188
201
|
version_requirements: !ruby/object:Gem::Requirement
|
|
189
202
|
requirements:
|
|
190
203
|
- - "~>"
|
|
191
204
|
- !ruby/object:Gem::Version
|
|
192
|
-
version: '
|
|
205
|
+
version: '5.1'
|
|
193
206
|
- !ruby/object:Gem::Dependency
|
|
194
|
-
name:
|
|
207
|
+
name: simplecov
|
|
195
208
|
requirement: !ruby/object:Gem::Requirement
|
|
196
209
|
requirements:
|
|
197
210
|
- - "~>"
|
|
198
211
|
- !ruby/object:Gem::Version
|
|
199
|
-
version: '
|
|
212
|
+
version: '0.21'
|
|
200
213
|
type: :development
|
|
201
214
|
prerelease: false
|
|
202
215
|
version_requirements: !ruby/object:Gem::Requirement
|
|
203
216
|
requirements:
|
|
204
217
|
- - "~>"
|
|
205
218
|
- !ruby/object:Gem::Version
|
|
206
|
-
version: '
|
|
219
|
+
version: '0.21'
|
|
207
220
|
- !ruby/object:Gem::Dependency
|
|
208
|
-
name:
|
|
221
|
+
name: sqlite3
|
|
209
222
|
requirement: !ruby/object:Gem::Requirement
|
|
210
223
|
requirements:
|
|
211
224
|
- - "~>"
|
|
212
225
|
- !ruby/object:Gem::Version
|
|
213
|
-
version: '
|
|
226
|
+
version: '2.1'
|
|
214
227
|
type: :development
|
|
215
228
|
prerelease: false
|
|
216
229
|
version_requirements: !ruby/object:Gem::Requirement
|
|
217
230
|
requirements:
|
|
218
231
|
- - "~>"
|
|
219
232
|
- !ruby/object:Gem::Version
|
|
220
|
-
version: '
|
|
233
|
+
version: '2.1'
|
|
221
234
|
description: Flexible quota system for resources.
|
|
222
235
|
email:
|
|
223
236
|
- ngel@protonmail.com
|
|
@@ -289,15 +302,18 @@ files:
|
|
|
289
302
|
- lib/resource_quotable/helper.rb
|
|
290
303
|
- lib/resource_quotable/version.rb
|
|
291
304
|
- lib/tasks/resource_quotable_tasks.rake
|
|
292
|
-
homepage: https://
|
|
305
|
+
homepage: https://github.com/ngelx/resource_quotable
|
|
293
306
|
licenses:
|
|
294
307
|
- MIT
|
|
295
308
|
metadata:
|
|
296
|
-
homepage_uri: https://
|
|
297
|
-
|
|
298
|
-
changelog_uri: https://
|
|
309
|
+
homepage_uri: https://github.com/ngelx/resource_quotable
|
|
310
|
+
documentation_uri: https://github.com/ngelx/resource_quotable
|
|
311
|
+
changelog_uri: https://github.com/ngelx/resource_quotable/blob/main/Changelog.md
|
|
312
|
+
source_code_uri: https://github.com/ngelx/resource_quotable
|
|
313
|
+
bug_tracker_uri: https://github.com/ngelx/resource_quotable/issues
|
|
314
|
+
wiki_uri: https://github.com/ngelx/resource_quotable/wiki
|
|
299
315
|
rubygems_mfa_required: 'true'
|
|
300
|
-
post_install_message: 'Please see https://
|
|
316
|
+
post_install_message: 'Please see https://github.com/ngelx/resource_quotable/blob/master/Readme.md
|
|
301
317
|
for details on how to finish the setup.
|
|
302
318
|
|
|
303
319
|
'
|
|
@@ -315,8 +331,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
315
331
|
- !ruby/object:Gem::Version
|
|
316
332
|
version: '0'
|
|
317
333
|
requirements: []
|
|
318
|
-
rubygems_version: 3.
|
|
319
|
-
signing_key:
|
|
334
|
+
rubygems_version: 3.6.9
|
|
320
335
|
specification_version: 4
|
|
321
336
|
summary: Quota system for resource
|
|
322
337
|
test_files: []
|