appsignal 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/appsignal/config.rb +3 -5
- data/lib/appsignal/version.rb +1 -1
- data/spec/lib/appsignal/config_spec.rb +48 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5af9c6943591c44c841e99c1e8b9f14d40e1c8e
|
4
|
+
data.tar.gz: 54532725587a4ffeaeb4a9f09fbc32cc65785c80
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30cfc725282a8da8974425a8d2da61cf397509d9096f2a87b221e8f6dea3dca3580eb823210c69ba65d1894e3c0cb748db644b9fa899b9d61248734c146728ca
|
7
|
+
data.tar.gz: 93a4d1bfdbd1bb7f5eeff536a72f662576c5f6e790c0e46c71ddec4d356df9a1af624950be92d2e66bd70b9fe0c53b2e99bacfd468e532fbd5ca56b597302a1c
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
# 2.0.1
|
2
|
+
* Fix configuration load order regression for the `APPSIGNAL_PUSH_API_KEY`
|
3
|
+
environment variable's activation behavior. PR #208
|
4
|
+
|
1
5
|
# 2.0.0
|
2
6
|
* Add `Appsignal.instrument_sql` convenience methods. PR #136
|
3
7
|
* Use `Appsignal.instrument` internally instead of ActiveSupport
|
data/lib/appsignal/config.rb
CHANGED
@@ -150,6 +150,9 @@ module Appsignal
|
|
150
150
|
def detect_from_system
|
151
151
|
config_hash[:running_in_container] = true if Appsignal::System.container?
|
152
152
|
config_hash[:log] = 'stdout' if Appsignal::System.heroku?
|
153
|
+
|
154
|
+
# Make active by default if APPSIGNAL_PUSH_API_KEY is present
|
155
|
+
config_hash[:active] = true if ENV['APPSIGNAL_PUSH_API_KEY']
|
153
156
|
end
|
154
157
|
|
155
158
|
def load_from_disk
|
@@ -180,11 +183,6 @@ module Appsignal
|
|
180
183
|
def load_from_environment
|
181
184
|
config = {}
|
182
185
|
|
183
|
-
# Make active by default if APPSIGNAL_PUSH_API_KEY is present
|
184
|
-
if ENV['APPSIGNAL_PUSH_API_KEY']
|
185
|
-
config[:active] = true
|
186
|
-
end
|
187
|
-
|
188
186
|
# Configuration with string type
|
189
187
|
%w(APPSIGNAL_PUSH_API_KEY APPSIGNAL_APP_NAME APPSIGNAL_PUSH_API_ENDPOINT
|
190
188
|
APPSIGNAL_FRONTEND_ERROR_CATCHING_PATH APPSIGNAL_HTTP_PROXY
|
data/lib/appsignal/version.rb
CHANGED
@@ -2,6 +2,24 @@ describe Appsignal::Config do
|
|
2
2
|
describe "config based on the system" do
|
3
3
|
let(:config) { project_fixture_config(:none) }
|
4
4
|
|
5
|
+
describe ":active" do
|
6
|
+
subject { config[:active] }
|
7
|
+
|
8
|
+
context "with APPSIGNAL_PUSH_API_KEY env variable" do
|
9
|
+
before { ENV["APPSIGNAL_PUSH_API_KEY"] = "abc" }
|
10
|
+
|
11
|
+
it "becomes active" do
|
12
|
+
expect(subject).to be_true
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
context "without APPSIGNAL_PUSH_API_KEY env variable" do
|
17
|
+
it "remains inactive" do
|
18
|
+
expect(subject).to be_false
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
5
23
|
describe ":running_in_container" do
|
6
24
|
subject { config[:running_in_container] }
|
7
25
|
|
@@ -92,16 +110,38 @@ describe Appsignal::Config do
|
|
92
110
|
end
|
93
111
|
|
94
112
|
describe "overriding system detected config" do
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
113
|
+
describe ":running_in_container" do
|
114
|
+
let(:config) do
|
115
|
+
described_class.new(
|
116
|
+
"non-existing-path",
|
117
|
+
"production",
|
118
|
+
:running_in_container => true
|
119
|
+
)
|
120
|
+
end
|
121
|
+
subject { config[:running_in_container] }
|
122
|
+
|
123
|
+
it "overrides system detected config" do
|
124
|
+
expect(subject).to be_true
|
125
|
+
end
|
101
126
|
end
|
102
127
|
|
103
|
-
|
104
|
-
|
128
|
+
describe ":active" do
|
129
|
+
subject { config[:active] }
|
130
|
+
|
131
|
+
context "with APPSIGNAL_PUSH_API_KEY env variable" do
|
132
|
+
let(:config) do
|
133
|
+
described_class.new(
|
134
|
+
"non-existing-path",
|
135
|
+
"production",
|
136
|
+
:active => false
|
137
|
+
)
|
138
|
+
end
|
139
|
+
before { ENV["APPSIGNAL_PUSH_API_KEY"] = "abc" }
|
140
|
+
|
141
|
+
it "sets given config rather than env variable" do
|
142
|
+
expect(subject).to be_false
|
143
|
+
end
|
144
|
+
end
|
105
145
|
end
|
106
146
|
end
|
107
147
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appsignal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Beekman
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-11-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|