librato-rails 0.3.0 → 0.3.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.
data/README.md CHANGED
@@ -7,6 +7,8 @@ Report key statistics for your Rails app to [Librato Metrics](https://metrics.li
7
7
 
8
8
  **NOTE: This is currently in alpha development and is not yet officially supported**
9
9
 
10
+ **IMPORTANT NOTE: If you are currently using a version prior to the rename to librato-rails, note that the env variable names for configuration and the name of the config files have changed. See the new names in configuration, below.**
11
+
10
12
  ## Installation
11
13
 
12
14
  In your `Gemfile` add:
@@ -22,8 +24,8 @@ If you don't have a Metrics account already, [sign up](https://metrics.librato.c
22
24
  Create a `config/librato.yml` like the following:
23
25
 
24
26
  production:
25
- email: <your-email>
26
- api_key: <your-api-key>
27
+ user: <your-email>
28
+ token: <your-api-key>
27
29
 
28
30
  OR provide `LIBRATO_METRICS_USER` and `LIBRATO_METRICS_TOKEN` environment variables. If both env variables and a config file are present, environment variables will take precendence.
29
31
 
@@ -1,5 +1,5 @@
1
1
  module Librato
2
2
  module Rails
3
- VERSION = "0.3.0"
3
+ VERSION = "0.3.1"
4
4
  end
5
5
  end
data/lib/librato/rails.rb CHANGED
@@ -19,15 +19,15 @@ module Librato
19
19
 
20
20
  module Rails
21
21
  extend SingleForwardable
22
- CONFIG_SETTABLE = %w{api_key email flush_interval prefix source}
22
+ CONFIG_SETTABLE = %w{user token flush_interval prefix source}
23
23
  FORKING_SERVERS = [:unicorn, :passenger]
24
24
 
25
25
  mattr_accessor :config_file
26
26
  self.config_file = 'config/librato.yml'
27
27
 
28
28
  # config options
29
- mattr_accessor :api_key
30
- mattr_accessor :email
29
+ mattr_accessor :user
30
+ mattr_accessor :token
31
31
  mattr_accessor :flush_interval
32
32
  mattr_accessor :prefix
33
33
 
@@ -64,8 +64,8 @@ module Librato
64
64
  settable.each { |key| self.send("#{key}=", env_specific[key]) }
65
65
  end
66
66
  end
67
- self.api_key = ENV['LIBRATO_METRICS_TOKEN'] if ENV['LIBRATO_METRICS_TOKEN']
68
- self.email = ENV['LIBRATO_METRICS_USER'] if ENV['LIBRATO_METRICS_USER']
67
+ self.token = ENV['LIBRATO_METRICS_TOKEN'] if ENV['LIBRATO_METRICS_TOKEN']
68
+ self.user = ENV['LIBRATO_METRICS_USER'] if ENV['LIBRATO_METRICS_USER']
69
69
  end
70
70
 
71
71
  # check to see if we've forked into a process where a worker
@@ -181,7 +181,7 @@ module Librato
181
181
  def prepare_client
182
182
  check_config
183
183
  client = Librato::Metrics::Client.new
184
- client.authenticate email, api_key
184
+ client.authenticate user, token
185
185
  client.api_endpoint = @api_endpoint if @api_endpoint
186
186
  client.custom_user_agent = user_agent
187
187
  client