govuk_app_config 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: '089341e237b45993c1de26ae8fcc53b765c37f1f'
4
- data.tar.gz: '096f6ff793400709eaf33bd73efcacb0068896d0'
3
+ metadata.gz: 4791548002b6883ab4483008296f2df6a8151865
4
+ data.tar.gz: 1dcbcb6a7e6790cb555ca4f776266667a94183aa
5
5
  SHA512:
6
- metadata.gz: 84d313cb9e2ae553f7a87184578b7cb6946e963cd132614736c0b9e4ad7b49e37e2602bbf14cf3723ce3fb1a3b59e9cedf440a9077859edbbccc42284dc062bc
7
- data.tar.gz: 5e00d1dee3208dd26ddec7046f6bf7ab3049c840bb5975a9ffd49ad7f43a1753d1f5304337cbc3b32786f788b6a115590a5f2e7e2799d7a17fcdc6b5632229da
6
+ metadata.gz: 8ebacb7a67fa6da41352fce27f2331b5ecf26244bf0a14525d4de17d478282a4b3a73f72b54bc1a308064ef0abbf57967640a6c5748cda254f7de9b899606d63
7
+ data.tar.gz: dfe3d0ff930dbe2e2073e3fed0d925635f00d1002410d7385d05b4c02552b5a1e52baae6c5719fab2d3a485fe38efed16d805772c05726a5819aee368d47ad5d
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.0
4
+
5
+ * Add `time` and `gauge` to `GovukStatsd`
6
+ * Add `GovukError.configure` as an alias to `Raven.configure`
7
+
3
8
  ## 0.2.0
4
9
 
5
10
  * First actual release with support for Sentry
data/README.md CHANGED
@@ -16,12 +16,12 @@ And then execute:
16
16
 
17
17
  ### Automatic error reporting
18
18
 
19
- If you include `govuk_app_config` in your `Gemfile`, Rails' autoloading mechanism will make sure that your application is configured to send errors Sentry.
19
+ If you include `govuk_app_config` in your `Gemfile`, Rails' autoloading mechanism will make sure that your application is configured to send errors to Sentry.
20
20
 
21
21
  If you use the gem outside of Rails you'll have to explicitly require it:
22
22
 
23
23
  ```rb
24
- require 'govuk_app_config/configure'
24
+ require 'govuk_app_config'
25
25
  ```
26
26
 
27
27
  Your app will have to have the following environment variables set:
@@ -55,6 +55,18 @@ GovukError.notify(
55
55
  )
56
56
  ```
57
57
 
58
+ ### Error configuration
59
+
60
+ You can exclude certain errors from being reported using this:
61
+
62
+ ```ruby
63
+ GovukError.configure do |config|
64
+ config.excluded_exceptions << "RetryableError"
65
+ end
66
+ ```
67
+
68
+ `GovukError.configure` has the same options as the Sentry client, Raven. See [the Raven docs for all configuration options](https://docs.sentry.io/clients/ruby/config).
69
+
58
70
  ## License
59
71
 
60
- [MIT License][LICENSE.md]
72
+ [MIT License](LICENSE.md)
data/Rakefile CHANGED
@@ -1,2 +1,6 @@
1
1
  require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
2
6
  task :default => :spec
@@ -2,7 +2,7 @@ if defined?(Airbrake)
2
2
  raise "This gem isn't compatible with Airbrake. Please remove it from the Gemfile."
3
3
  end
4
4
 
5
- Raven.configure do |config|
5
+ GovukError.configure do |config|
6
6
  # We need this until https://github.com/getsentry/raven-ruby/pull/736 is released
7
7
  config.current_environment = ENV["SENTRY_CURRENT_ENV"]
8
8
 
@@ -10,4 +10,10 @@ module GovukError
10
10
 
11
11
  Raven.capture_exception(exception_or_message, args)
12
12
  end
13
+
14
+ def self.configure
15
+ Raven.configure do |config|
16
+ yield(config)
17
+ end
18
+ end
13
19
  end
@@ -1,9 +1,9 @@
1
1
  require "statsd"
2
+ require "forwardable"
2
3
 
3
4
  module GovukStatsd
4
- def self.increment(*args)
5
- client.increment(*args)
6
- end
5
+ extend SingleForwardable
6
+ def_delegators :client, :increment, :time, :gauge
7
7
 
8
8
  def self.client
9
9
  @statsd_client ||= begin
@@ -1,3 +1,3 @@
1
1
  module GovukAppConfig
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_app_config
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-08-23 00:00:00.000000000 Z
11
+ date: 2017-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: statsd-ruby