rookout 0.1.39 → 0.1.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rookout/augs/aug_factory.rb +1 -0
- data/lib/rookout/augs/aug_rate_limiter.rb +1 -1
- data/lib/rookout/commit.rb +1 -1
- data/lib/rookout/config.rb +2 -0
- data/lib/rookout/exceptions.rb +17 -1
- data/lib/rookout/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7605e9deab6fab2b1456185132e9db8100f143e0486a6cbef13a20a368047ad1
|
|
4
|
+
data.tar.gz: 900c58be123cfad2b749a16dce8ed3e6fa572af1177ee3778fe9318c02a2f81b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0d4bf7792481a091c0110353cf727f44486b08dd099bba996ce83c7b05e88213f8a714dcbfb2840944876a49a8a794f2496c501c1c19ec5c341f1493ab925ace
|
|
7
|
+
data.tar.gz: 5069a96af2a1a11b0e7d07be6def3a42bdbf0b94658bc16ff652d06ae623295f5c9b4ea02cbee21cae3d68a236f283568d0136d04edcc51937c68c4a31ba635b
|
|
@@ -81,6 +81,7 @@ module Rookout
|
|
|
81
81
|
rate_limit = parse_rate_limit Rookout::Config.global_rate_limit, "0", 0, 0
|
|
82
82
|
@global_rate_limiter = AugRateLimiter.new(*rate_limit)
|
|
83
83
|
Logger.instance.debug "Using global rate limiter with configuration: #{rate_limit}"
|
|
84
|
+
Rookout::Config.using_global_rate_limiter = true
|
|
84
85
|
end
|
|
85
86
|
|
|
86
87
|
@global_rate_limiter
|
|
@@ -35,7 +35,7 @@ module Rookout
|
|
|
35
35
|
|
|
36
36
|
# If exceeding quota
|
|
37
37
|
if usage > @quota
|
|
38
|
-
warning = Processor::RookError.new Exceptions::RookRuleRateLimited.
|
|
38
|
+
warning = Processor::RookError.new Exceptions::RookRuleRateLimited.create
|
|
39
39
|
UserWarnings.notify_warning warning
|
|
40
40
|
return false
|
|
41
41
|
end
|
data/lib/rookout/commit.rb
CHANGED
data/lib/rookout/config.rb
CHANGED
|
@@ -77,8 +77,10 @@ module Rookout
|
|
|
77
77
|
Rookout::Config.true_values = ["y", "Y", "yes", "Yes", "YES", "true", "True", "TRUE", "1"]
|
|
78
78
|
|
|
79
79
|
attr_accessor :global_rate_limit
|
|
80
|
+
attr_accessor :using_global_rate_limiter
|
|
80
81
|
|
|
81
82
|
Rookout::Config.global_rate_limit = nil
|
|
83
|
+
Rookout::Config.using_global_rate_limiter = false
|
|
82
84
|
|
|
83
85
|
def update_config configuration
|
|
84
86
|
update_var2_config configuration
|
data/lib/rookout/exceptions.rb
CHANGED
|
@@ -95,13 +95,29 @@ module Rookout
|
|
|
95
95
|
end
|
|
96
96
|
end
|
|
97
97
|
|
|
98
|
-
class
|
|
98
|
+
class RookRuleAugRateLimited < ToolException
|
|
99
99
|
def initialize
|
|
100
100
|
super "Breakpoint was disabled due to rate-limiting. " \
|
|
101
101
|
"For more information: https://docs.rookout.com/docs/breakpoints-tasks.html#rate-limiting"
|
|
102
102
|
end
|
|
103
103
|
end
|
|
104
104
|
|
|
105
|
+
class RookRuleGlobalRateLimited < ToolException
|
|
106
|
+
def initialize
|
|
107
|
+
super "Breakpoint was disabled due to global rate-limiting. " \
|
|
108
|
+
"For more information: https://docs.rookout.com/docs/breakpoints-tasks.html#rate-limiting"
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
class RookRuleRateLimited
|
|
113
|
+
def self.create
|
|
114
|
+
if Rookout::Config.using_global_rate_limiter
|
|
115
|
+
return RookRuleGlobalRateLimited.new
|
|
116
|
+
end
|
|
117
|
+
RookRuleAugRateLimited.new
|
|
118
|
+
end
|
|
119
|
+
end
|
|
120
|
+
|
|
105
121
|
class RookInvalidToken < ToolException
|
|
106
122
|
def initialize token = ""
|
|
107
123
|
super "The Rookout token supplied #{token[0..6]} is not valid; please check the token and try again",
|
data/lib/rookout/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rookout
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.40
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Liran Haimovitch
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-09-
|
|
11
|
+
date: 2022-09-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: binding_of_caller
|