appsignal 2.3.1 → 2.3.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
  SHA1:
3
- metadata.gz: ed164d0e73d1000a37c8a10ee2e467f28c999228
4
- data.tar.gz: daf2ae18da6c18f75f962aa4a3098fc1df1c2d8e
3
+ metadata.gz: d5aa85a93e18c0f2eaea8092efacae7a033f139b
4
+ data.tar.gz: 6cffdf6eacf9c4a7e25ec324b9e24e8638b05341
5
5
  SHA512:
6
- metadata.gz: c650fb63e59abdfcc63b1ebed5bb447063ee9dbae4c051ecf70dc072ffc6dfd0dbf55a43522a07d17c8a724c966fa3e2483896dfd3beef2614593945bdcb257b
7
- data.tar.gz: 1694a0a89dea32073445f3b939a384f0535983d32d8da0752dcba88d266bdc339033787cde8dd20d70841770dfcb23b0a9383e60e948d7c0fc4544a077706370
6
+ metadata.gz: f53eb19a35f673c2f6b79e8e9a20ccc20f09c9d604c1c4221284fa166b41fba0b1b55787ae8888092672a9fd5ffc822a8c2fb672ed385de345f90ba1ecf00072
7
+ data.tar.gz: 4813fbced178b4deded50623519c96e87b8d8382b1c8e8ba1bcf396758546999ba6c2e6ce35944f04e476725fad37b039b4c398b6c67e701ea8aa31c5c775514
@@ -1,3 +1,7 @@
1
+ # 2.3.2
2
+ * Improve Rake argument handling. Allow for more detailed view of which
3
+ arguments a tasks receives. PR #328
4
+
1
5
  # 2.3.1
2
6
  * Fix ActiveSupport::Notifications hook not supporting non-string names for
3
7
  events. PR #324
@@ -132,7 +132,8 @@ module Appsignal
132
132
  return
133
133
  end
134
134
 
135
- puts " Your diagnostics report has been sent to AppSignal."
135
+ puts " Please email us at support@appsignal.com with the following"
136
+ puts " support token."
136
137
  begin
137
138
  response_data = JSON.parse(response.body)
138
139
  puts " Your support token: #{response_data["token"]}"
@@ -15,11 +15,15 @@ module Appsignal
15
15
  def execute(*args)
16
16
  execute_without_appsignal(*args)
17
17
  rescue => error
18
+ # Format given arguments and cast to hash if possible
19
+ params, _ = args
20
+ params = params.to_hash if params.respond_to?(:to_hash)
21
+
18
22
  transaction = Appsignal::Transaction.create(
19
23
  SecureRandom.uuid,
20
24
  Appsignal::Transaction::BACKGROUND_JOB,
21
25
  Appsignal::Transaction::GenericRequest.new(
22
- :params => args
26
+ :params => params
23
27
  )
24
28
  )
25
29
  transaction.set_action(name)
@@ -1,5 +1,5 @@
1
1
  require "yaml"
2
2
 
3
3
  module Appsignal
4
- VERSION = "2.3.1".freeze
4
+ VERSION = "2.3.2".freeze
5
5
  end
@@ -104,7 +104,7 @@ describe Appsignal::CLI::Diagnose, :api_stub => true, :report => true do
104
104
  run
105
105
  expect(output).to include "Diagnostics report",
106
106
  "Send diagnostics report to AppSignal? (Y/n): ",
107
- "Your diagnostics report has been sent to AppSignal."
107
+ "Please email us at support@appsignal.com with the following\n support token."
108
108
  end
109
109
 
110
110
  it "outputs the support token from the server" do
@@ -2,6 +2,8 @@ require "rake"
2
2
 
3
3
  describe Appsignal::Hooks::RakeHook do
4
4
  let(:task) { Rake::Task.new("task:name", Rake::Application.new) }
5
+ let(:arguments) { Rake::TaskArguments.new(["foo"], ["bar"]) }
6
+ let(:generic_request) { Appsignal::Transaction::GenericRequest.new({}) }
5
7
  before(:context) do
6
8
  Appsignal.config = project_fixture_config
7
9
  expect(Appsignal.active?).to be_truthy
@@ -47,8 +49,24 @@ describe Appsignal::Hooks::RakeHook do
47
49
  expect(Appsignal).to receive(:stop).with("rake").ordered
48
50
  end
49
51
 
52
+ it "adds the task arguments to the request" do
53
+ expect(Appsignal::Transaction::GenericRequest).to receive(:new)
54
+ .with(:params => { :foo => "bar" })
55
+ .and_return(generic_request)
56
+ end
57
+
58
+ context "when first argument is not a `Rake::TaskArguments`" do
59
+ let(:arguments) { nil }
60
+
61
+ it "adds the first argument regardless" do
62
+ expect(Appsignal::Transaction::GenericRequest).to receive(:new)
63
+ .with(:params => nil)
64
+ .and_return(generic_request)
65
+ end
66
+ end
67
+
50
68
  after do
51
- expect { task.execute("foo") }.to raise_error VerySpecificError
69
+ expect { task.execute(arguments) }.to raise_error VerySpecificError
52
70
  end
53
71
  end
54
72
  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.3.1
4
+ version: 2.3.2
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: 2017-07-26 00:00:00.000000000 Z
12
+ date: 2017-08-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack