Gonzalo Rodriguez
6af29fb44e
Avoid 'defined?' buggy behavior in ruby 2.5.0. Fixes #253
...
'defined?' is buggy in ruby 2.5.0, which under certain circumstances
users using rack-attack can hit. See issue #253 .
I reported (https://bugs.ruby-lang.org/issues/14407 ) and
fixed (https://github.com/ruby/ruby/pull/1800 ) the issue in
ruby already, but i guess i would take some time before there's
a new ruby release including that fix.
So for now we would need to circumvent this bug by using
'const_defined?' instead of 'defined?' for this particular case.
More details:
Anyone using:
* ruby 2.5.0
* redis
* rack-attack without redis-store and using at least one throttle
* having a toplevel class named Store
will hit this ruby 2.5.0 bug https://bugs.ruby-lang.org/issues/14407
That's because of the following buggy behavior of 'defined?' under ruby
2.5:
```
$ ruby -v
ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-linux]
$ irb
> class Redis
> end
=> nil
> class Store
> end
=> nil
> defined?(::Redis::Store)
=> "constant"
> ::Redis::Store
NameError (uninitialized constant Redis::Store
Did you mean? Store)
```
2018-01-29 12:25:18 -03:00
Tieg Zaharia
d7cc49117f
Merge pull request #267 from grzuy/freeze_constants
...
Do not allow mutating constants
2018-01-25 14:51:06 -05:00
Tieg Zaharia
7048599054
Merge pull request #268 from grzuy/cleanup_self
...
Cleanup unnecessary self references
2018-01-25 14:49:58 -05:00
Gonzalo Rodriguez
b7eb7851cf
Cleanup unnecessary self references
2018-01-25 15:52:20 -03:00
Gonzalo Rodriguez
7286517c2f
Do not allow mutating constants
2018-01-25 12:22:40 -03:00
Corey Farwell
6f545e2665
Merge pull request #262 from grzuy/legibility
...
Attempt to improve legibility
2018-01-23 17:46:03 -05:00
Corey Farwell
f91f3a403c
Merge pull request #264 from grzuy/drop_support_for_rails_3
...
Drop support for unmaintaned Rails 3
2018-01-23 17:45:29 -05:00
Corey Farwell
66bb16e97a
Merge pull request #263 from grzuy/remove_warnings
...
Fixes warnings in test output
2018-01-23 17:24:11 -05:00
Gonzalo Rodriguez
218a320a3d
Fixes warning instead of hiding it
...
Warning was: 'warning: instance variable @data not initialized'
2018-01-23 16:56:42 -03:00
Gonzalo Rodriguez
34ee066eac
Drop support for Rails 3
2018-01-23 16:12:16 -03:00
Gonzalo Rodriguez
e8102910bf
Fixes warning 'DEPRECATED: Use assert_nil if expecting nil from ...'
2018-01-23 15:07:49 -03:00
Corey Farwell
03ade2e056
Merge pull request #261 from grzuy/test_against_supported_only
...
Only test against actively supported rubies and gems
2018-01-23 12:15:48 -05:00
Gonzalo
79d21fc3ac
Attempt to improve legibility
2018-01-19 12:00:38 -03:00
Gonzalo
b4436fbeb2
Try fix TravisCI build
...
See:
https://github.com/travis-ci/travis-ci/issues/8978#issuecomment-354036443
2018-01-17 14:03:08 -03:00
Gonzalo
a19f92738d
Test against actively supported rubies and gems
...
https://www.ruby-lang.org/en/downloads/branches://www.ruby-lang.org/en/downloads/branches/
http://guides.rubyonrails.org/maintenance_policy.html
https://www.ruby-lang.org/en/downloads/releases/
2018-01-17 13:49:24 -03:00
Corey Farwell
d5b89f2f74
Merge pull request #260 from grzuy/update_hash_syntax_in_docs
...
Update docs to use new ruby hash syntax
2018-01-17 09:55:30 -05:00
Gonzalo
aeca8e52b3
Update to new ruby hash syntax in docs
2018-01-17 11:05:22 -03:00
Corey Farwell
62d64e5eed
Merge pull request #252 from garside/master
...
Fixing whitespace issue
2018-01-05 17:48:21 -05:00
Eric Garside
5a7114e126
Fixing whitespace issue
2018-01-05 17:38:19 -05:00
Corey Farwell
92ef924269
Merge pull request #246 from mattias-lundell/patch-1
...
Fix alignment of columns
2018-01-05 14:00:55 -05:00
Aaron Suggs
7b77f6e134
Merge pull request #242 from olleolleolle/patch-1
...
Travis: jruby-9.1.14.0
2017-11-15 09:32:52 -05:00
Olle Jonsson
9835c1028c
Travis: jruby-9.1.14.0
2017-11-12 14:12:16 +01:00
Mattias Lundell
c37b477d15
Fix alignment of columns
2017-10-11 13:55:19 +02:00
Olle Jonsson
32b64780d9
Travis: jruby-9.1.13.0
2017-09-08 13:10:40 +02:00
Aaron Suggs
037e52ba5d
Merge pull request #240 from olleolleolle/patch-1
...
Travis: use latest jruby-9.1.12.0
2017-08-21 10:44:47 -04:00
Olle Jonsson
6e15637513
Travis: use latest jruby-9.1.12.0
2017-08-17 20:17:48 +02:00
Aaron Suggs
809474fa7b
Merge pull request #231 from olleolleolle/patch-1
...
Travis: use jruby-9.1.10.0
2017-06-09 13:15:47 -04:00
Olle Jonsson
9e23f1acd1
Travis: use jruby-9.1.10.0
2017-05-26 12:30:17 +02:00
Aaron Suggs
26124874e2
Merge pull request #223 from marcgg/patch-1
...
Typo in comment
2017-04-03 16:26:05 -04:00
Marc G Gauthier
98b0ab866d
Typo in comment
2017-02-21 17:07:26 +01:00
Aaron Suggs
dc308add10
README: add section for maintainers
2017-02-09 22:26:57 -05:00
Aaron Suggs
301f2473f2
Merge pull request #215 from olleolleolle/patch-1
...
README: Badges as SVG not PNG
2017-01-16 13:23:17 -05:00
Olle Jonsson
7285e721aa
README: Badges as SVG not PNG
2017-01-16 12:24:25 +01:00
Aaron Suggs
f3e468a588
Merge pull request #214 from olleolleolle/patch-1
...
Travis: use JRuby latest stable 9.1.7.0
2017-01-16 06:21:26 -05:00
Olle Jonsson
05ed73ce53
Travis: use JRuby latest stable 9.1.7.0
2017-01-16 10:17:40 +01:00
Aaron Suggs
d85d318572
Merge pull request #204 from ktheory/license
...
Add LICENSE file
2016-10-24 09:52:51 -04:00
Aaron Suggs
c249488950
travis: switch to jruby 9.x
2016-10-24 09:28:46 -04:00
Aaron Suggs
ebf62e1536
Add LICENSE file
2016-10-23 21:40:18 -04:00
Aaron Suggs
8936cc647a
Merge pull request #195 from envato/add_testing_instructions
...
added discussion about how to run test suite
2016-08-26 05:53:29 -04:00
Aaron Suggs
68158ee133
Merge pull request #198 from kickstarter/fix-deprecated-args
...
Fix args to deprecated methods
2016-08-11 13:58:26 -04:00
Aaron Suggs
ebfa081e6d
Fix args to deprecated methods
...
Fixes #197
2016-08-11 13:39:22 -04:00
Aaron Suggs
e5cf56ae46
v5.0.0
...
No beta.
And update Changelog (for the last time)
2016-08-09 12:59:43 -04:00
Julian Doherty (madlep)
2c853bae9d
it's minitest, not rspec
2016-08-04 22:51:14 +10:00
Julian Doherty (madlep)
9402908db9
added discussion about how to run test suite
2016-08-04 21:49:43 +10:00
Aaron Suggs
53699d624b
Merge pull request #193 from ktheory/ratelimit-headers
...
README: add example for returning X-RateLimit-* headers
2016-08-03 14:05:14 -04:00
Aaron Suggs
b07537d51e
README: add example for returning X-RateLimit-* headers
2016-08-03 14:04:00 -04:00
Aaron Suggs
7860a82b5a
Merge pull request #187 from mferrier/spec-throttle-block-nil
...
add a spec to specify the behavior of non-matching throttle blocks
2016-07-18 11:33:12 -04:00
Mike Ferrier
031efcd123
add a spec to specify the behavior of non-matching throttle blocks
2016-07-13 10:20:08 -04:00
Aaron Suggs
88e3ed0efd
Merge pull request #188 from ktheory/fix-redis-activesupport
...
[tests] Fix gotcha with new activesupport redis versions
2016-07-11 16:02:57 -04:00
Aaron Suggs
ff22014a03
[tests] Fix gotcha with new activesupport redis versions
...
This fixes the error:
uninitialized constant ActiveSupport::VERSION
when loading active_support/cache/redis_store
2016-07-11 15:23:06 -04:00