grape-throttler 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9d403d14a732f3f185b5a9d175165dceb3162d8dc263a4e95f450d1bfb9f0e88
4
- data.tar.gz: 66e8937eb07b2e2c09762030803eabdcc68c13b376aac3fc7ee1fc02496984c9
3
+ metadata.gz: 9934c03ccbf10c6882dc894cd6e523782e3816f46d1d913fe55708c6e8319958
4
+ data.tar.gz: 0dcf12981720976ea2610a7663f4449f6b2122a1e6e83e3a67a860fcfe85b2a1
5
5
  SHA512:
6
- metadata.gz: 633574dd952dfaf7ffe0deadc2640a1b07b7ee540b46962f21306b910f5d9eb4453169b72039cffdf4a1c51a7a3aa2074aca4590d0bf1baef13f7ed3fd3e0936
7
- data.tar.gz: e7770fb63e7aae40dacf0e4705430394e4ef5dfa46c07c6e6ee92225614a51bb992938232bd64800499cd304b5998848498ef765e36317c218515f48d464147b
6
+ metadata.gz: c5311346bf3903a17e77a4ad257a47a9cc779218b7cc05569e3b987b8a8f4f05090a04e16ea37d2f4a980a81ebcf14994bb2867b99a6b5afd936e21dde702952
7
+ data.tar.gz: 1e840e0d3d9ec6f7bec1ea3337b8f8c0c9ad7c6fccb012c7c3549c043ccf67784b27494765c509f7507e7408b7d232e9e349e14e80a1db709d74edda2f12edd9
data/.rubocop.yml CHANGED
@@ -2,9 +2,14 @@ require:
2
2
  - rubocop-performance
3
3
  - rubocop-rspec
4
4
  AllCops:
5
- TargetRubyVersion: 2.6
5
+ TargetRubyVersion: 2.7
6
+ NewCops: enable
6
7
  DisplayCopNames: true
7
8
  DisplayStyleGuide: true
9
+ Gemspec/RequiredRubyVersion:
10
+ Enabled: false
11
+ Layout/EmptyLinesAroundAttributeAccessor:
12
+ Enabled: true
8
13
  Layout/EmptyLinesAroundBlockBody:
9
14
  Exclude:
10
15
  - 'spec/**/**/*'
@@ -12,12 +17,18 @@ Layout/EmptyLinesAroundClassBody:
12
17
  EnforcedStyle: empty_lines_except_namespace
13
18
  Layout/EmptyLinesAroundModuleBody:
14
19
  EnforcedStyle: empty_lines_except_namespace
20
+ Layout/LineLength:
21
+ Max: 100
22
+ Layout/SpaceAroundMethodCallOperator:
23
+ Enabled: true
24
+ Lint/RaiseException:
25
+ Enabled: true
26
+ Lint/StructNewOverride:
27
+ Enabled: true
15
28
  Metrics/BlockLength:
16
29
  Exclude:
17
30
  - 'spec/**/**/*'
18
31
  - '*.gemspec'
19
- Metrics/LineLength:
20
- Max: 100
21
32
  Naming/FileName:
22
33
  Enabled: false
23
34
  RSpec/ExampleLength:
data/.travis.yml CHANGED
@@ -4,6 +4,7 @@ cache: bundler
4
4
  rvm:
5
5
  - 2.5
6
6
  - 2.6
7
+ - 2.7
7
8
  - ruby-head
8
9
  matrix:
9
10
  fast_finish: true
data/CHANGELOG.md CHANGED
@@ -6,9 +6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [1.1.1] - 2021-07-05
10
+ ### Changed
11
+ - Linter fixes
12
+
9
13
  ## [1.1.0] - 2019-11-25
10
14
  ### Added
11
15
  - Added CHANGELOG.md
16
+ - Added ruby 2.7 support
12
17
  ### Changed
13
18
  - Refactor code to clean up lint errors
14
19
 
data/Gemfile.lock CHANGED
@@ -1,101 +1,112 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- grape-throttler (1.1.0)
4
+ grape-throttler (1.1.1)
5
5
  grape (>= 0.16.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- activesupport (6.0.1)
10
+ activesupport (6.1.3.2)
11
11
  concurrent-ruby (~> 1.0, >= 1.0.2)
12
- i18n (>= 0.7, < 2)
13
- minitest (~> 5.1)
14
- tzinfo (~> 1.1)
15
- zeitwerk (~> 2.2)
16
- ast (2.4.0)
17
- axiom-types (0.1.1)
18
- descendants_tracker (~> 0.0.4)
19
- ice_nine (~> 0.11.0)
20
- thread_safe (~> 0.3, >= 0.3.1)
21
- builder (3.2.3)
22
- coercible (1.0.0)
23
- descendants_tracker (~> 0.0.1)
12
+ i18n (>= 1.6, < 2)
13
+ minitest (>= 5.1)
14
+ tzinfo (~> 2.0)
15
+ zeitwerk (~> 2.3)
16
+ ast (2.4.2)
17
+ builder (3.2.4)
24
18
  colorize (0.8.1)
25
- concurrent-ruby (1.1.5)
26
- descendants_tracker (0.0.4)
27
- thread_safe (~> 0.3, >= 0.3.1)
28
- diff-lcs (1.3)
29
- equalizer (0.0.11)
30
- fakeredis (0.7.0)
31
- redis (>= 3.2, < 5.0)
32
- fasterer (0.8.1)
19
+ concurrent-ruby (1.1.8)
20
+ diff-lcs (1.4.4)
21
+ dry-configurable (0.12.1)
22
+ concurrent-ruby (~> 1.0)
23
+ dry-core (~> 0.5, >= 0.5.0)
24
+ dry-container (0.7.2)
25
+ concurrent-ruby (~> 1.0)
26
+ dry-configurable (~> 0.1, >= 0.1.3)
27
+ dry-core (0.5.0)
28
+ concurrent-ruby (~> 1.0)
29
+ dry-inflector (0.2.0)
30
+ dry-logic (1.2.0)
31
+ concurrent-ruby (~> 1.0)
32
+ dry-core (~> 0.5, >= 0.5)
33
+ dry-types (1.5.1)
34
+ concurrent-ruby (~> 1.0)
35
+ dry-container (~> 0.3)
36
+ dry-core (~> 0.5, >= 0.5)
37
+ dry-inflector (~> 0.1, >= 0.1.2)
38
+ dry-logic (~> 1.0, >= 1.0.2)
39
+ fakeredis (0.8.0)
40
+ redis (~> 4.1)
41
+ fasterer (0.9.0)
33
42
  colorize (~> 0.7)
34
43
  ruby_parser (>= 3.14.1)
35
- grape (1.2.4)
44
+ grape (1.5.3)
36
45
  activesupport
37
46
  builder
47
+ dry-types (>= 1.1)
38
48
  mustermann-grape (~> 1.0.0)
39
49
  rack (>= 1.3.0)
40
50
  rack-accept
41
- virtus (>= 1.0.0)
42
- i18n (1.7.0)
51
+ i18n (1.8.10)
43
52
  concurrent-ruby (~> 1.0)
44
- ice_nine (0.11.2)
45
- jaro_winkler (1.5.4)
46
- minitest (5.13.0)
47
- mustermann (1.0.3)
48
- mustermann-grape (1.0.0)
49
- mustermann (~> 1.0.0)
50
- parallel (1.19.1)
51
- parser (2.6.5.0)
52
- ast (~> 2.4.0)
53
- rack (2.0.7)
53
+ minitest (5.14.4)
54
+ mustermann (1.1.1)
55
+ ruby2_keywords (~> 0.0.1)
56
+ mustermann-grape (1.0.1)
57
+ mustermann (>= 1.0.0)
58
+ parallel (1.20.1)
59
+ parser (3.0.1.1)
60
+ ast (~> 2.4.1)
61
+ rack (2.2.3)
54
62
  rack-accept (0.4.5)
55
63
  rack (>= 0.4)
56
64
  rack-test (1.1.0)
57
65
  rack (>= 1.0, < 3)
58
66
  rainbow (3.0.0)
59
- rake (13.0.1)
60
- redis (4.1.3)
61
- rspec (3.9.0)
62
- rspec-core (~> 3.9.0)
63
- rspec-expectations (~> 3.9.0)
64
- rspec-mocks (~> 3.9.0)
65
- rspec-core (3.9.0)
66
- rspec-support (~> 3.9.0)
67
- rspec-expectations (3.9.0)
67
+ rake (13.0.3)
68
+ redis (4.2.5)
69
+ regexp_parser (2.1.1)
70
+ rexml (3.2.5)
71
+ rspec (3.10.0)
72
+ rspec-core (~> 3.10.0)
73
+ rspec-expectations (~> 3.10.0)
74
+ rspec-mocks (~> 3.10.0)
75
+ rspec-core (3.10.1)
76
+ rspec-support (~> 3.10.0)
77
+ rspec-expectations (3.10.1)
68
78
  diff-lcs (>= 1.2.0, < 2.0)
69
- rspec-support (~> 3.9.0)
70
- rspec-mocks (3.9.0)
79
+ rspec-support (~> 3.10.0)
80
+ rspec-mocks (3.10.2)
71
81
  diff-lcs (>= 1.2.0, < 2.0)
72
- rspec-support (~> 3.9.0)
73
- rspec-support (3.9.0)
74
- rubocop (0.76.0)
75
- jaro_winkler (~> 1.5.1)
82
+ rspec-support (~> 3.10.0)
83
+ rspec-support (3.10.2)
84
+ rubocop (1.14.0)
76
85
  parallel (~> 1.10)
77
- parser (>= 2.6)
86
+ parser (>= 3.0.0.0)
78
87
  rainbow (>= 2.2.2, < 4.0)
88
+ regexp_parser (>= 1.8, < 3.0)
89
+ rexml
90
+ rubocop-ast (>= 1.5.0, < 2.0)
79
91
  ruby-progressbar (~> 1.7)
80
- unicode-display_width (>= 1.4.0, < 1.7)
81
- rubocop-performance (1.5.1)
82
- rubocop (>= 0.71.0)
83
- rubocop-rspec (1.37.0)
84
- rubocop (>= 0.68.1)
85
- ruby-progressbar (1.10.1)
86
- ruby_parser (3.14.1)
92
+ unicode-display_width (>= 1.4.0, < 3.0)
93
+ rubocop-ast (1.5.0)
94
+ parser (>= 3.0.1.1)
95
+ rubocop-performance (1.11.3)
96
+ rubocop (>= 1.7.0, < 2.0)
97
+ rubocop-ast (>= 0.4.0)
98
+ rubocop-rspec (2.3.0)
99
+ rubocop (~> 1.0)
100
+ rubocop-ast (>= 1.1.0)
101
+ ruby-progressbar (1.11.0)
102
+ ruby2_keywords (0.0.4)
103
+ ruby_parser (3.15.1)
87
104
  sexp_processor (~> 4.9)
88
- sexp_processor (4.13.0)
89
- thread_safe (0.3.6)
90
- tzinfo (1.2.5)
91
- thread_safe (~> 0.1)
92
- unicode-display_width (1.6.0)
93
- virtus (1.0.5)
94
- axiom-types (~> 0.1)
95
- coercible (~> 1.0)
96
- descendants_tracker (~> 0.0, >= 0.0.3)
97
- equalizer (~> 0.0, >= 0.0.9)
98
- zeitwerk (2.2.1)
105
+ sexp_processor (4.15.2)
106
+ tzinfo (2.0.4)
107
+ concurrent-ruby (~> 1.0)
108
+ unicode-display_width (2.0.0)
109
+ zeitwerk (2.4.2)
99
110
 
100
111
  PLATFORMS
101
112
  ruby
@@ -113,4 +124,4 @@ DEPENDENCIES
113
124
  rubocop-rspec
114
125
 
115
126
  BUNDLED WITH
116
- 1.17.3
127
+ 2.2.17
data/README.md CHANGED
@@ -53,7 +53,7 @@ The `user_key` parameter is a function that can be used to determine a custom id
53
53
 
54
54
  **Logging**
55
55
 
56
- The gem will log errors to STDOUT by default. If you prefer a different logger you can use the `logger` option to pass in your own logger.
56
+ The gem will log errors to $stdout by default. If you prefer a different logger you can use the `logger` option to pass in your own logger.
57
57
 
58
58
  ```ruby
59
59
  use GrapeThrottler::Middleware::ThrottleMiddleware, cache: Redis.new, logger: Logger.new('my_custom_log.log')
@@ -4,13 +4,13 @@ module GrapeThrottler
4
4
  module Middleware
5
5
  class ThrottleMiddleware < Grape::Middleware::Base
6
6
 
7
- COUNTER_START ||= 0
7
+ COUNTER_START = 0
8
8
 
9
9
  # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength
10
10
  # rubocop:disable Metrics/PerceivedComplexity, Lint/AssignmentInCondition
11
11
  def before
12
12
  endpoint = env['api.endpoint']
13
- logger = options[:logger] || Logger.new(STDOUT)
13
+ logger = options[:logger] || Logger.new($stdout)
14
14
 
15
15
  return unless throttle_options = endpoint.route_setting(:throttle)
16
16
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module GrapeThrottler
4
4
 
5
- VERSION ||= '1.1.0'
5
+ VERSION = '1.1.1'
6
6
 
7
7
  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.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-11-26 00:00:00.000000000 Z
11
+ date: 2021-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: grape
@@ -150,7 +150,7 @@ dependencies:
150
150
  - - ">="
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
- description:
153
+ description:
154
154
  email:
155
155
  - j.gomez@drexed.com
156
156
  executables: []
@@ -180,7 +180,7 @@ homepage: http://drexed.github.io/grape-throttler
180
180
  licenses:
181
181
  - MIT
182
182
  metadata: {}
183
- post_install_message:
183
+ post_install_message:
184
184
  rdoc_options: []
185
185
  require_paths:
186
186
  - lib
@@ -195,8 +195,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
195
195
  - !ruby/object:Gem::Version
196
196
  version: '0'
197
197
  requirements: []
198
- rubygems_version: 3.0.6
199
- signing_key:
198
+ rubygems_version: 3.2.17
199
+ signing_key:
200
200
  specification_version: 4
201
201
  summary: Middleware for Grape to add endpoint-specific throttling.
202
202
  test_files: []