limiter-ruby 0.2.2 → 0.2.4

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: 518ed6599aea915b29f2ef3cb38f6b6433d705133fcf6f0174e377caf6052c51
4
- data.tar.gz: 0af300b61d459be5c652b40cfde0cc25935ca44a571aa4d7a09c788ea33f9bbc
3
+ metadata.gz: 442bbfcc13722e3bbffe3edc6bb8ea56bfd19d84e4c13ba76dcd941b3bcdcb78
4
+ data.tar.gz: 6c931ecf9b1a4ac9395e651b624e86fb1e6c2e5ee206be86f8f302bef554e706
5
5
  SHA512:
6
- metadata.gz: d7de3cf3d5b6b4d42920d132dd93494542df5b2a39ab25281e9602329402a6691646cefef5588579311323a387bf979f775c020ff304300eabb60ebd1e69277c
7
- data.tar.gz: cf21fea34007d63eea33fa707d028a338f78da58d104276f4916ce4c2750e34369503b75f3e55662dce82b699dd6a611e739f8161e30e187b73b437cddb9bcc5
6
+ metadata.gz: 3328f0aa9e901c793feeb41a39ada21502a1e3edfb2960a5d8c18d7548e53e976fcb8bfb279c942a80a1514ee5d05aa431d17e0cd502b5c371ffca6aeab603e6
7
+ data.tar.gz: dc5ec8dfa8ac8ffc85888a4b9b18c88cddde408cff24f4df83cd1612b789b6d8e9705b1ecff0b309d337f3d694d0269d5d02247f9ce8e715a12abc009a6e387d
@@ -3,6 +3,8 @@
3
3
  module Limiter
4
4
  class Client
5
5
 
6
+ BASE_URL = "https://api.limiter.dev"
7
+
6
8
  attr_reader :namespace, :limit, :interval, :identifier, :token, :response
7
9
  delegate :exhausted?, :allowed?, :exceeded?, :resets_in, :to => :response
8
10
 
@@ -45,7 +47,10 @@ module Limiter
45
47
  end
46
48
 
47
49
  def request(params = {})
48
- HTTP.auth("Bearer #{Limiter.configuration.api_token}").get(url, params: params)
50
+ HTTP
51
+ .auth("Bearer #{Limiter.configuration.api_token}")
52
+ .headers("User-Agent" => "Limiter-Ruby/#{Limiter::VERSION}")
53
+ .get(BASE_URL + limiter_path, params: params)
49
54
  end
50
55
  end
51
56
  end
@@ -1,6 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Limiter
2
4
  class Configuration
3
- API_BASE_URL = "https://api.limiter.dev"
4
5
 
5
6
  attr_accessor :api_token, :raise_errors
6
7
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Limiter
4
- VERSION = "0.2.2"
4
+ VERSION = "0.2.4"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: limiter-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bilal Budhani