appsignal 4.8.1 → 4.8.2

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
  SHA256:
3
- metadata.gz: abd23e04f7261e93ee807fcce645036be5069187ad68c23d954405f4db3cb69c
4
- data.tar.gz: 8fff3cc2fe093c596164b50309bf88aa72ee84fb036310d542f43dc1bf5bd938
3
+ metadata.gz: '07821b2ad2c12568afd9b12f8e3399055ca271f5fcd5548fa7fb98e74c45e29b'
4
+ data.tar.gz: a213da6461793f487e86633222afd41317a58278654f4231da4002abf1b4d45e
5
5
  SHA512:
6
- metadata.gz: ff006023cf00c20bae000105fac558b3d329c6e91bbbe8c15d268ec3f43076902cfe7dbe062f794b1394a617fcdff1ad4d685735c74a5fdf2986145397abe5f5
7
- data.tar.gz: 9edbcb359dbfb4414ffbfd83b00d4c9dc3424aeab0a6f1bf0eb10eee5c0887b43a185b48fdea30e98e7ec1b11ac3aedc735e6bbab69ac387fe2173db4a740878
6
+ metadata.gz: cf21e599bab1e856ca48cb5e367184c977c15be601236e61ca3d29beb14d26258cb156e9450a397518b59264bcced7644a3050c03c300d0ba650a385f1e5f033
7
+ data.tar.gz: 10fafdc1f77f5eaf68cde39e598206e5fb8e0779b1046a40df6e76e6e894528f5f05a546da68aa4d42482aa0080fb43a20ba60e153287c2f2de4142944686a8b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # AppSignal for Ruby gem Changelog
2
2
 
3
+ ## 4.8.2
4
+
5
+ _Published on 2026-02-05._
6
+
7
+ ### Added
8
+
9
+ - Log where `Appsignal.configure` is called. When a warning is emitted about `Appsignal.configure` being called from an application where `config/appsignal.yml` or `config/appsignal.rb` exist, log the location from which `Appsignal.configure` was called alongside the location of the configuration file. (patch [a9097107](https://github.com/appsignal/appsignal-ruby/commit/a90971075370bcf1d37f568d934dd8aeb71c1223))
10
+
11
+ ### Fixed
12
+
13
+ - Fix the `bundle exec appsignal install` CLI command on Ruby 4 by removing the dependency on the `ostruct` gem, which is no longer part of the standard library. (patch [d3bd5198](https://github.com/appsignal/appsignal-ruby/commit/d3bd5198486a762353bfbd7807f4d042a85a9d3d))
14
+
3
15
  ## 4.8.1
4
16
 
5
17
  _Published on 2025-12-16._
data/build_matrix.yml CHANGED
@@ -118,8 +118,7 @@ matrix:
118
118
  - "rails-8.1"
119
119
 
120
120
  ruby:
121
- - ruby: "4.0.0-preview2"
122
- - ruby: "3.5.0-preview1"
121
+ - ruby: "4.0.0"
123
122
  - ruby: "3.4.1"
124
123
  - ruby: "3.3.4"
125
124
  - ruby: "3.2.5"
@@ -145,8 +144,7 @@ matrix:
145
144
  - gem: "dry-monitor"
146
145
  only:
147
146
  ruby:
148
- - "4.0.0-preview2"
149
- - "3.5.0-preview1"
147
+ - "4.0.0"
150
148
  - "3.4.1"
151
149
  - "3.3.4"
152
150
  - "3.2.5"
@@ -156,7 +154,6 @@ matrix:
156
154
  - gem: "hanami-2.0"
157
155
  only:
158
156
  ruby:
159
- - "3.5.0-preview1"
160
157
  - "3.4.1"
161
158
  - "3.3.4"
162
159
  - "3.2.5"
@@ -165,7 +162,6 @@ matrix:
165
162
  - gem: "hanami-2.1"
166
163
  only:
167
164
  ruby:
168
- - "3.5.0-preview1"
169
165
  - "3.4.1"
170
166
  - "3.3.4"
171
167
  - "3.2.5"
@@ -174,7 +170,6 @@ matrix:
174
170
  - gem: "hanami-2.2"
175
171
  only:
176
172
  ruby:
177
- - "3.5.0-preview1"
178
173
  - "3.4.1"
179
174
  - "3.3.4"
180
175
  - "3.2.5"
@@ -184,12 +179,11 @@ matrix:
184
179
  - gem: "padrino"
185
180
  exclude:
186
181
  ruby:
187
- - "4.0.0-preview2"
182
+ - "4.0.0"
188
183
  - gem: "psych-3"
189
184
  only:
190
185
  ruby:
191
- - "4.0.0-preview2"
192
- - "3.5.0-preview1"
186
+ - "4.0.0"
193
187
  - "3.4.1"
194
188
  - "3.3.4"
195
189
  - "3.2.5"
@@ -199,8 +193,7 @@ matrix:
199
193
  - gem: "psych-4"
200
194
  only:
201
195
  ruby:
202
- - "4.0.0-preview2"
203
- - "3.5.0-preview1"
196
+ - "4.0.0"
204
197
  - "3.4.1"
205
198
  - "3.3.4"
206
199
  - "3.2.5"
@@ -227,8 +220,7 @@ matrix:
227
220
  - gem: "rails-7.0"
228
221
  only:
229
222
  ruby:
230
- - "4.0.0-preview2"
231
- - "3.5.0-preview1"
223
+ - "4.0.0"
232
224
  - "3.4.1"
233
225
  - "3.3.4"
234
226
  - "3.2.5"
@@ -239,8 +231,7 @@ matrix:
239
231
  - gem: "rails-7.1"
240
232
  only:
241
233
  ruby:
242
- - "4.0.0-preview2"
243
- - "3.5.0-preview1"
234
+ - "4.0.0"
244
235
  - "3.4.1"
245
236
  - "3.3.4"
246
237
  - "3.2.5"
@@ -250,8 +241,7 @@ matrix:
250
241
  - gem: "rails-7.2"
251
242
  only:
252
243
  ruby:
253
- - "4.0.0-preview2"
254
- - "3.5.0-preview1"
244
+ - "4.0.0"
255
245
  - "3.4.1"
256
246
  - "3.3.4"
257
247
  - "3.2.5"
@@ -260,15 +250,13 @@ matrix:
260
250
  - gem: "rails-8.0"
261
251
  only:
262
252
  ruby:
263
- - "4.0.0-preview2"
264
- - "3.5.0-preview1"
253
+ - "4.0.0"
265
254
  - "3.4.1"
266
255
  - "3.3.4"
267
256
  - "3.2.5"
268
257
  - gem: "rails-8.1"
269
258
  only:
270
259
  ruby:
271
- - "3.5.0-preview1"
272
260
  - "3.4.1"
273
261
  - "3.3.4"
274
262
  - "3.2.5"
@@ -280,12 +268,10 @@ matrix:
280
268
  - gem: "sidekiq-7"
281
269
  only:
282
270
  ruby:
283
- - "4.0.0-preview2"
284
- - "3.5.0-preview1"
271
+ - "4.0.0"
285
272
  - "3.4.1"
286
273
  - gem: "sidekiq-8"
287
274
  only:
288
275
  ruby:
289
- - "4.0.0-preview2"
290
- - "3.5.0-preview1"
276
+ - "4.0.0"
291
277
  - "3.4.1"
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "erb"
4
- require "ostruct"
5
4
  require "io/console"
6
5
  require "appsignal/demo"
7
6
 
@@ -366,7 +365,7 @@ module Appsignal
366
365
  def write_config_file(template_path, path, data)
367
366
  file_contents = File.read(template_path)
368
367
  template = ERB.new(file_contents, :trim_mode => "-")
369
- config = template.result(OpenStruct.new(data).instance_eval { binding })
368
+ config = template.result_with_hash(data)
370
369
 
371
370
  FileUtils.mkdir_p(File.join(Dir.pwd, "config"))
372
371
  File.write(path, config)
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Appsignal
4
4
  # @return [String]
5
- VERSION = "4.8.1"
5
+ VERSION = "4.8.2"
6
6
  end
data/lib/appsignal.rb CHANGED
@@ -184,12 +184,14 @@ module Appsignal
184
184
  if config
185
185
  # When calling `Appsignal.configure` from an app, not the
186
186
  # `config/appsignal.rb` file, with also a Ruby config file present.
187
+ caller_location = external_caller_location
187
188
  message = "The `Appsignal.configure` helper is called from within an " \
188
189
  "app while a `#{context.dsl_config_file}` file is present. " \
189
190
  "The `config/appsignal.rb` file is ignored when the " \
190
191
  "config is loaded with `Appsignal.configure` from within an app. " \
191
192
  "We recommend moving all config to the `config/appsignal.rb` file " \
192
193
  "or the `Appsignal.configure` helper in the app."
194
+ message += "\n Called from: #{caller_location}" if caller_location
193
195
  Appsignal::Utils::StdoutAndLoggerMessage.warning(message)
194
196
  else
195
197
  # Load it when no config is present
@@ -340,6 +342,7 @@ module Appsignal
340
342
  # When calling `Appsignal.configure` from a Rails initializer and a YAML
341
343
  # file is present. We will not load the YAML file in the future.
342
344
  if !config_file_context? && config.yml_config_file?
345
+ caller_location = external_caller_location
343
346
  message = "The `Appsignal.configure` helper is called while a " \
344
347
  "`config/appsignal.yml` file is present. In future versions the " \
345
348
  "`config/appsignal.yml` file will be ignored when loading the " \
@@ -347,6 +350,7 @@ module Appsignal
347
350
  "`config/appsignal.rb` file, or the `Appsignal.configure` helper " \
348
351
  "in Rails initializer file, and remove the " \
349
352
  "`config/appsignal.yml` file."
353
+ message += "\n Called from: #{caller_location}" if caller_location
350
354
  Appsignal::Utils::StdoutAndLoggerMessage.warning(message)
351
355
  end
352
356
 
@@ -616,6 +620,26 @@ module Appsignal
616
620
  end
617
621
  Appsignal::Environment.report_supported_gems
618
622
  end
623
+
624
+ # Returns a formatted string with the file and line number where
625
+ # Appsignal.configure was called from, excluding internal AppSignal frames.
626
+ #
627
+ # @return [String, nil] Formatted caller location or nil if not found
628
+ def external_caller_location
629
+ # Get the call stack, skipping this method itself
630
+ locations = caller_locations(1)
631
+ return unless locations
632
+
633
+ # Find the first location outside the AppSignal gem's lib directory
634
+ appsignal_lib_path = File.expand_path(__dir__)
635
+ external_location = locations.find do |location|
636
+ !location.path.start_with?(appsignal_lib_path)
637
+ end
638
+
639
+ return unless external_location
640
+
641
+ "#{external_location.path}:#{external_location.lineno}"
642
+ end
619
643
  end
620
644
 
621
645
  # @!visibility private
data/sig/appsignal.rbi CHANGED
@@ -8,7 +8,7 @@
8
8
  module Appsignal
9
9
  extend Appsignal::Helpers::Metrics
10
10
  extend Appsignal::Helpers::Instrumentation
11
- VERSION = T.let("4.8.1", T.untyped)
11
+ VERSION = T.let("4.8.2", T.untyped)
12
12
 
13
13
  class << self
14
14
  # The loaded AppSignal configuration.
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: 4.8.1
4
+ version: 4.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Beekman