judoscale-rails 1.8.1 → 1.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/judoscale/rails/config.rb +2 -1
- data/lib/judoscale/rails/railtie.rb +6 -6
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d8b3234f5b38e406752bc3c41dfa9b9c082d11e4b91f601e5ce44d7c813e294
|
4
|
+
data.tar.gz: 8eedc0cf76ad08501f21e526acd05dbe25f293bca890b1d04846145b99e83120
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6264a06c16e8ded6e787442f04b0e5c6545c695c86118a4e95109360764ce04e0335858e346428a74200f2bbf021e27497f00e43c17bf1fa265ca05b70ef30ad
|
7
|
+
data.tar.gz: 3db9bd2e80abd07c82685bd5273e7f444381a97af2d6fb404855806bb418828f35e9382963aa5822b4c7281fa4dfac79d9074c3176773308229b888be312c42d
|
@@ -3,11 +3,12 @@ require "judoscale/config"
|
|
3
3
|
module Judoscale
|
4
4
|
module Rails
|
5
5
|
module Config
|
6
|
-
attr_accessor :start_reporter_after_initialize
|
6
|
+
attr_accessor :start_reporter_after_initialize, :rake_task_ignore_regex
|
7
7
|
|
8
8
|
def reset
|
9
9
|
super
|
10
10
|
@start_reporter_after_initialize = true
|
11
|
+
@rake_task_ignore_regex = /assets:|db:/
|
11
12
|
end
|
12
13
|
end
|
13
14
|
|
@@ -12,9 +12,9 @@ module Judoscale
|
|
12
12
|
class Railtie < ::Rails::Railtie
|
13
13
|
include Judoscale::Logger
|
14
14
|
|
15
|
-
def
|
16
|
-
# This is gross, but we can't find a more reliable way to detect if we're in a Rails console.
|
17
|
-
caller.any? { |call| call.include?("console_command.rb") }
|
15
|
+
def in_rails_console_or_runner?
|
16
|
+
# This is gross, but we can't find a more reliable way to detect if we're in a Rails console/runner.
|
17
|
+
caller.any? { |call| call.include?("console_command.rb") || call.include?("runner_command.rb") }
|
18
18
|
end
|
19
19
|
|
20
20
|
def in_rake_task?(task_regex)
|
@@ -36,9 +36,9 @@ module Judoscale
|
|
36
36
|
end
|
37
37
|
|
38
38
|
config.after_initialize do
|
39
|
-
if
|
40
|
-
logger.debug "No reporting since we're in a Rails console"
|
41
|
-
elsif in_rake_task?(
|
39
|
+
if in_rails_console_or_runner?
|
40
|
+
logger.debug "No reporting since we're in a Rails console or runner process"
|
41
|
+
elsif in_rake_task?(judoscale_config.rake_task_ignore_regex)
|
42
42
|
logger.debug "No reporting since we're in a build process"
|
43
43
|
elsif judoscale_config.start_reporter_after_initialize
|
44
44
|
Reporter.start
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: judoscale-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.8.
|
4
|
+
version: 1.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam McCrea
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2024-
|
13
|
+
date: 2024-10-16 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: judoscale-ruby
|
@@ -18,14 +18,14 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - '='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 1.8.
|
21
|
+
version: 1.8.2
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
26
|
- - '='
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: 1.8.
|
28
|
+
version: 1.8.2
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: railties
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|