appsignal 2.0.0 → 2.0.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b06d39d3717f054714a64e2961c466b4a9caed2e
4
- data.tar.gz: 62ebd705722d24809f4c2649ed777230fe1b66c3
3
+ metadata.gz: c5af9c6943591c44c841e99c1e8b9f14d40e1c8e
4
+ data.tar.gz: 54532725587a4ffeaeb4a9f09fbc32cc65785c80
5
5
  SHA512:
6
- metadata.gz: 04a76fba53a43dad673857e71532d96ddbbc4d2699593ee4b755076866f2c58199be03aaad577a2b2bf16c02d97c1180b175c3e889d70a18016cb44de131c2e5
7
- data.tar.gz: d174831943495a569f67b307eedc556524ab29a626053c9015154519e50267dfe64f4300de780f477847434e88172b3a985b076bbee1880ce1cc9a714ed62e40
6
+ metadata.gz: 30cfc725282a8da8974425a8d2da61cf397509d9096f2a87b221e8f6dea3dca3580eb823210c69ba65d1894e3c0cb748db644b9fa899b9d61248734c146728ca
7
+ data.tar.gz: 93a4d1bfdbd1bb7f5eeff536a72f662576c5f6e790c0e46c71ddec4d356df9a1af624950be92d2e66bd70b9fe0c53b2e99bacfd468e532fbd5ca56b597302a1c
@@ -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
@@ -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
@@ -1,5 +1,5 @@
1
1
  require 'yaml'
2
2
 
3
3
  module Appsignal
4
- VERSION = '2.0.0'
4
+ VERSION = '2.0.1'
5
5
  end
@@ -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
- let(:config) do
96
- described_class.new(
97
- "non-existing-path",
98
- "production",
99
- :running_in_container => true
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
- it "overrides system detected config" do
104
- expect(config[:running_in_container]).to be_true
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.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-10-26 00:00:00.000000000 Z
12
+ date: 2016-11-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack