rails_throttle 0.1.0 → 0.2.0

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: 0ac0a027c97f8d22db38bedc1700b9f0834475000d44dd23819296f32bfc8a1e
4
- data.tar.gz: a6280ac0701ce08f4bb085608b9e834f509aedc414e9079d076c297fc99fb865
3
+ metadata.gz: 492c5d6e293b452d648df87c5324fbc88a4673127b7a023449d2a238e058fcc4
4
+ data.tar.gz: 0ce27efa3cacce1d6ef4d2b48c7784a0cde6b8fb5a40612590fdd7854dd6eef9
5
5
  SHA512:
6
- metadata.gz: b2c92b80a09e7176a2e8d0179987484ce45f22eeb64e7b49d3943d15cfa735aed7836e1b4487574ce59423d5fead2ade6eb8711a169c4a0ac5cdd79a2ef00526
7
- data.tar.gz: cdc44864b318e5c91655e4befc1b3bcecc8ae4d1ee9cd6cef638bea22099e22191bbd367ace6314b2993596d91176b39cda57ea7d15a5a3c8b7bbfae98e2c52f
6
+ metadata.gz: ab45d55646fe2e81133db0383e40ca071b0ad49df68d106a283ba49bfdffc179dfbe7a225a2dfadf8129afc351ba8116381c23e4953da9a9c4bad9ec8c859433
7
+ data.tar.gz: 5f9d4a40294454bd0377fb13d5af9da328f4b80330cb70d4038cf48d3fb3eaf04d3e583d1a0ee4cc93f777018b333f9f093436693088d664a6e11820a1d31920
data/.circleci/config.yml CHANGED
@@ -32,7 +32,7 @@ jobs:
32
32
  - run:
33
33
  name: Rubocop
34
34
  command:
35
- bundle install rubocop
35
+ gem install rubocop
36
36
  bundle exec rubocop
37
37
 
38
38
  - store_test_results:
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # RailsThrottle
1
+ # RailsThrottle [![CircleCI](https://circleci.com/gh/peterzhu2118/rails_throttle/tree/master.svg?style=svg)](https://circleci.com/gh/peterzhu2118/rails_throttle/tree/master) [![Gem Version](https://badge.fury.io/rb/rails_throttle.svg)](https://badge.fury.io/rb/rails_throttle)
2
2
 
3
3
  RailsThrottle is a simple library used to throttle code in your Rails application.
4
4
 
@@ -20,7 +20,7 @@ Or install it yourself as:
20
20
 
21
21
  ## Usage
22
22
 
23
- - See full documentation here:
23
+ - See full documentation here: https://www.rubydoc.info/gems/rails_throttle/0.1.0/RailsThrottle/Throttle
24
24
  - Example configuration (for production, you can configure other environments in a similar way):
25
25
  ```ruby
26
26
  # In config/environments/production.rb
@@ -13,7 +13,7 @@ module RailsThrottle
13
13
  # parameters).
14
14
  # @yieldparam [String] key The key that was passed in.
15
15
  # @yieldparam [Integer] value The current value of the throttle counter.
16
- # @return [Integer] The current value of the throttle counter.
16
+ # @return [Integer] The value of the block, or the current value of the throttle counter if no block is given.
17
17
  def self.increment(key, options = {}, &block)
18
18
  raise "Key cannot be blank" if key.blank?
19
19
 
@@ -42,9 +42,9 @@ module RailsThrottle
42
42
  else
43
43
  block.call(key, value)
44
44
  end
45
+ else
46
+ value
45
47
  end
46
-
47
- value
48
48
  end
49
49
 
50
50
  # Decrements the counter for a given key.
@@ -1,3 +1,3 @@
1
1
  module RailsThrottle
2
- VERSION = "0.1.0".freeze
2
+ VERSION = "0.2.0".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_throttle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Zhu
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-04-24 00:00:00.000000000 Z
11
+ date: 2019-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport