remnant 0.2.2 → 0.2.3

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/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- remnant (0.2.1)
4
+ remnant (0.2.2)
5
5
  statsd-ruby (= 1.0.0)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -37,9 +37,15 @@ Remnant.configure do
37
37
  # included in payload
38
38
  environment "production"
39
39
  end
40
+
41
+ Remnant::Rails.setup! # needed if on Rails 2.3.x
40
42
  ```
41
43
 
42
44
 
45
+ ###### Note
46
+ Remnant logs to statsd only if your environment is production, demo or staging.
47
+ For all other environments it logs via Rails.logger.info
48
+
43
49
  #### Author
44
50
 
45
51
 
data/lib/remnant/base.rb CHANGED
@@ -51,6 +51,11 @@ class Remnant
51
51
  Rails.logger.info "-----------------------------------------------"
52
52
  end
53
53
 
54
+ # run hook if given
55
+ unless Remnant.configuration.custom_hook.nil?
56
+ Remannt.configuration.custom_hook.call(Remnant::Discover.results)
57
+ end
58
+
54
59
  Remnant::Discover.results.clear
55
60
  end
56
61
  end
@@ -12,8 +12,12 @@ class Remnant
12
12
  # api key to use with payloads
13
13
  attr_reader :tag
14
14
 
15
+ # how often to use results
15
16
  attr_reader :sample_rate
16
17
 
18
+ # allow applications to run custom code with stats
19
+ attr_reader :custom_hook
20
+
17
21
  def host(value)
18
22
  @hostname = value
19
23
  end
@@ -34,6 +38,10 @@ class Remnant
34
38
  @sample_rate = value
35
39
  end
36
40
 
41
+ def hook(&block)
42
+ @custom_hook = block
43
+ end
44
+
37
45
  def defaults!
38
46
  # configure some defaults
39
47
 
@@ -1,3 +1,3 @@
1
1
  class Remnant
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remnant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-18 00:00:00.000000000 Z
12
+ date: 2012-12-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: statsd-ruby