grape-throttler 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -1
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +22 -19
- data/grape-throttler.gemspec +2 -1
- data/lib/grape-throttler/middleware/throttle_middleware.rb +3 -3
- data/lib/grape-throttler/version.rb +1 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23649e5064815579ccbe89ac57e8cd0c89801e4b0d61408f6c22316306c460ce
|
4
|
+
data.tar.gz: 54c9cc293c8282098623d99a90ad269cbf8b93cfd9213a3bb973e46826cfeb89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2bd7d4a974958130752b80b70a9fd478381935bd900f86314d056035014fffcb4600b89cf69ee88dc4b443f941c229a311a2ddeda152947a5b7e1158dd57b326
|
7
|
+
data.tar.gz: a53096891e5edab11b5c9f132c9a2aa81e636b4dabe0ffe02a1b75e7a3c6c80bd3c1c4f4faaac5458f37ba3ec49553424482a9d6c540bc8e260386054017b059
|
data/.rubocop.yml
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
require:
|
2
2
|
- rubocop-performance
|
3
|
+
- rubocop-rake
|
3
4
|
- rubocop-rspec
|
4
5
|
AllCops:
|
5
|
-
TargetRubyVersion:
|
6
|
+
TargetRubyVersion: 3.0
|
6
7
|
NewCops: enable
|
7
8
|
DisplayCopNames: true
|
8
9
|
DisplayStyleGuide: true
|
@@ -38,6 +39,8 @@ RSpec/FilePath:
|
|
38
39
|
- 'spec/grape-throttler/version_spec.rb'
|
39
40
|
RSpec/MultipleExpectations:
|
40
41
|
Enabled: false
|
42
|
+
Style/ArgumentsForwarding:
|
43
|
+
Enabled: false
|
41
44
|
Style/Documentation:
|
42
45
|
Enabled: false
|
43
46
|
Style/ExpandPathArguments:
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
grape-throttler (1.
|
4
|
+
grape-throttler (1.2.0)
|
5
5
|
grape (>= 0.16.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
activesupport (6.1.
|
10
|
+
activesupport (6.1.4)
|
11
11
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
12
12
|
i18n (>= 1.6, < 2)
|
13
13
|
minitest (>= 5.1)
|
@@ -16,17 +16,17 @@ GEM
|
|
16
16
|
ast (2.4.2)
|
17
17
|
builder (3.2.4)
|
18
18
|
colorize (0.8.1)
|
19
|
-
concurrent-ruby (1.1.
|
19
|
+
concurrent-ruby (1.1.9)
|
20
20
|
diff-lcs (1.4.4)
|
21
21
|
dry-configurable (0.12.1)
|
22
22
|
concurrent-ruby (~> 1.0)
|
23
23
|
dry-core (~> 0.5, >= 0.5.0)
|
24
|
-
dry-container (0.
|
24
|
+
dry-container (0.8.0)
|
25
25
|
concurrent-ruby (~> 1.0)
|
26
26
|
dry-configurable (~> 0.1, >= 0.1.3)
|
27
|
-
dry-core (0.
|
27
|
+
dry-core (0.7.1)
|
28
28
|
concurrent-ruby (~> 1.0)
|
29
|
-
dry-inflector (0.2.
|
29
|
+
dry-inflector (0.2.1)
|
30
30
|
dry-logic (1.2.0)
|
31
31
|
concurrent-ruby (~> 1.0)
|
32
32
|
dry-core (~> 0.5, >= 0.5)
|
@@ -56,7 +56,7 @@ GEM
|
|
56
56
|
mustermann-grape (1.0.1)
|
57
57
|
mustermann (>= 1.0.0)
|
58
58
|
parallel (1.20.1)
|
59
|
-
parser (3.0.
|
59
|
+
parser (3.0.2.0)
|
60
60
|
ast (~> 2.4.1)
|
61
61
|
rack (2.2.3)
|
62
62
|
rack-accept (0.4.5)
|
@@ -64,8 +64,8 @@ GEM
|
|
64
64
|
rack-test (1.1.0)
|
65
65
|
rack (>= 1.0, < 3)
|
66
66
|
rainbow (3.0.0)
|
67
|
-
rake (13.0.
|
68
|
-
redis (4.
|
67
|
+
rake (13.0.6)
|
68
|
+
redis (4.3.1)
|
69
69
|
regexp_parser (2.1.1)
|
70
70
|
rexml (3.2.5)
|
71
71
|
rspec (3.10.0)
|
@@ -81,28 +81,30 @@ GEM
|
|
81
81
|
diff-lcs (>= 1.2.0, < 2.0)
|
82
82
|
rspec-support (~> 3.10.0)
|
83
83
|
rspec-support (3.10.2)
|
84
|
-
rubocop (1.
|
84
|
+
rubocop (1.18.3)
|
85
85
|
parallel (~> 1.10)
|
86
86
|
parser (>= 3.0.0.0)
|
87
87
|
rainbow (>= 2.2.2, < 4.0)
|
88
88
|
regexp_parser (>= 1.8, < 3.0)
|
89
89
|
rexml
|
90
|
-
rubocop-ast (>= 1.
|
90
|
+
rubocop-ast (>= 1.7.0, < 2.0)
|
91
91
|
ruby-progressbar (~> 1.7)
|
92
92
|
unicode-display_width (>= 1.4.0, < 3.0)
|
93
|
-
rubocop-ast (1.
|
93
|
+
rubocop-ast (1.8.0)
|
94
94
|
parser (>= 3.0.1.1)
|
95
|
-
rubocop-performance (1.11.
|
95
|
+
rubocop-performance (1.11.4)
|
96
96
|
rubocop (>= 1.7.0, < 2.0)
|
97
97
|
rubocop-ast (>= 0.4.0)
|
98
|
-
rubocop-
|
98
|
+
rubocop-rake (0.6.0)
|
99
|
+
rubocop (~> 1.0)
|
100
|
+
rubocop-rspec (2.4.0)
|
99
101
|
rubocop (~> 1.0)
|
100
102
|
rubocop-ast (>= 1.1.0)
|
101
103
|
ruby-progressbar (1.11.0)
|
102
|
-
ruby2_keywords (0.0.
|
103
|
-
ruby_parser (3.
|
104
|
-
sexp_processor (~> 4.
|
105
|
-
sexp_processor (4.15.
|
104
|
+
ruby2_keywords (0.0.5)
|
105
|
+
ruby_parser (3.16.0)
|
106
|
+
sexp_processor (~> 4.15, >= 4.15.1)
|
107
|
+
sexp_processor (4.15.3)
|
106
108
|
tzinfo (2.0.4)
|
107
109
|
concurrent-ruby (~> 1.0)
|
108
110
|
unicode-display_width (2.0.0)
|
@@ -121,7 +123,8 @@ DEPENDENCIES
|
|
121
123
|
rspec
|
122
124
|
rubocop
|
123
125
|
rubocop-performance
|
126
|
+
rubocop-rake
|
124
127
|
rubocop-rspec
|
125
128
|
|
126
129
|
BUNDLED WITH
|
127
|
-
2.2.
|
130
|
+
2.2.24
|
data/grape-throttler.gemspec
CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
)
|
26
26
|
else
|
27
27
|
raise 'RubyGems 2.0 or newer is required to protect against ' \
|
28
|
-
|
28
|
+
'public gem pushes.'
|
29
29
|
end
|
30
30
|
|
31
31
|
# Specify which files should be added to the gem when it is released.
|
@@ -47,5 +47,6 @@ Gem::Specification.new do |spec|
|
|
47
47
|
spec.add_development_dependency 'rspec'
|
48
48
|
spec.add_development_dependency 'rubocop'
|
49
49
|
spec.add_development_dependency 'rubocop-performance'
|
50
|
+
spec.add_development_dependency 'rubocop-rake'
|
50
51
|
spec.add_development_dependency 'rubocop-rspec'
|
51
52
|
end
|
@@ -56,11 +56,11 @@ module GrapeThrottler
|
|
56
56
|
# rubocop:disable Lint/AssignmentInCondition
|
57
57
|
def find_limit_and_period(throttle_options)
|
58
58
|
if limit = throttle_options[:hourly]
|
59
|
-
period =
|
59
|
+
period = 3_600
|
60
60
|
elsif limit = throttle_options[:daily]
|
61
|
-
period =
|
61
|
+
period = 86_400
|
62
62
|
elsif limit = throttle_options[:monthly]
|
63
|
-
period =
|
63
|
+
period = 2_629_746
|
64
64
|
elsif period = throttle_options[:period]
|
65
65
|
limit = throttle_options[:limit]
|
66
66
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grape-throttler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juan Gomez
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: grape
|
@@ -136,6 +136,20 @@ dependencies:
|
|
136
136
|
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: rubocop-rake
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
139
153
|
- !ruby/object:Gem::Dependency
|
140
154
|
name: rubocop-rspec
|
141
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -195,7 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
195
209
|
- !ruby/object:Gem::Version
|
196
210
|
version: '0'
|
197
211
|
requirements: []
|
198
|
-
rubygems_version: 3.2.
|
212
|
+
rubygems_version: 3.2.24
|
199
213
|
signing_key:
|
200
214
|
specification_version: 4
|
201
215
|
summary: Middleware for Grape to add endpoint-specific throttling.
|