formatted-metrics 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,9 @@
1
+ class String
2
+ def underscore
3
+ self.gsub(/::/, '/').
4
+ gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
5
+ gsub(/([a-z\d])([A-Z])/,'\1_\2').
6
+ tr("-", "_").
7
+ downcase
8
+ end unless method_defined?(:underscore)
9
+ end
@@ -38,7 +38,7 @@ module Metrics
38
38
  #
39
39
  # Returns a String namespace for the metric.
40
40
  def metric_namespace
41
- to_s.gsub(/::/, '.').downcase
41
+ to_s.gsub(/::/, '.').underscore
42
42
  end
43
43
 
44
44
  # Public: Wraps the method with a call to instrument the duration of the
@@ -1,3 +1,3 @@
1
1
  module FormattedMetrics
2
- VERSION = '1.0.3'
2
+ VERSION = '1.0.4'
3
3
  end
data/lib/metrics.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'rack/instrumentation'
2
+ require 'metrics/core_ext'
2
3
  require 'metrics/railtie' if defined?(Rails)
3
4
 
4
5
  module Metrics
@@ -6,7 +6,7 @@ describe Metrics::Instrumentable do
6
6
  include Metrics::Instrumentable
7
7
 
8
8
  def self.to_s
9
- 'Some::Module'
9
+ 'SomeCrazy::Module'
10
10
  end
11
11
 
12
12
  def initialize
@@ -29,7 +29,7 @@ describe Metrics::Instrumentable do
29
29
 
30
30
  describe '#instrument' do
31
31
  it 'instruments the duration of the method' do
32
- klass.any_instance.should_receive(:instrument).with('some.module.long_method').and_yield
32
+ klass.any_instance.should_receive(:instrument).with('some_crazy.module.long_method').and_yield
33
33
  expect(klass.new.long_method).to eq 'foo'
34
34
  end
35
35
 
metadata CHANGED
@@ -1,18 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: formatted-metrics
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Eric J. Holmes
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2013-09-25 00:00:00.000000000 Z
12
+ date: 2013-09-26 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: bundler
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
19
  - - ~>
18
20
  - !ruby/object:Gem::Version
@@ -20,6 +22,7 @@ dependencies:
20
22
  type: :development
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
27
  - - ~>
25
28
  - !ruby/object:Gem::Version
@@ -27,6 +30,7 @@ dependencies:
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: rake
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
35
  - - ! '>='
32
36
  - !ruby/object:Gem::Version
@@ -34,6 +38,7 @@ dependencies:
34
38
  type: :development
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
43
  - - ! '>='
39
44
  - !ruby/object:Gem::Version
@@ -41,6 +46,7 @@ dependencies:
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: rspec
43
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
44
50
  requirements:
45
51
  - - ~>
46
52
  - !ruby/object:Gem::Version
@@ -48,6 +54,7 @@ dependencies:
48
54
  type: :development
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
51
58
  requirements:
52
59
  - - ~>
53
60
  - !ruby/object:Gem::Version
@@ -70,6 +77,7 @@ files:
70
77
  - lib/formatted-metrics.rb
71
78
  - lib/metrics.rb
72
79
  - lib/metrics/configuration.rb
80
+ - lib/metrics/core_ext.rb
73
81
  - lib/metrics/formatters/base.rb
74
82
  - lib/metrics/formatters/l2met.rb
75
83
  - lib/metrics/grouping.rb
@@ -89,26 +97,33 @@ files:
89
97
  homepage: http://github.com/remind101/formatted-metrics
90
98
  licenses:
91
99
  - MIT
92
- metadata: {}
93
100
  post_install_message:
94
101
  rdoc_options: []
95
102
  require_paths:
96
103
  - lib
97
104
  required_ruby_version: !ruby/object:Gem::Requirement
105
+ none: false
98
106
  requirements:
99
107
  - - ! '>='
100
108
  - !ruby/object:Gem::Version
101
109
  version: '0'
110
+ segments:
111
+ - 0
112
+ hash: -116079147036176157
102
113
  required_rubygems_version: !ruby/object:Gem::Requirement
114
+ none: false
103
115
  requirements:
104
116
  - - ! '>='
105
117
  - !ruby/object:Gem::Version
106
118
  version: '0'
119
+ segments:
120
+ - 0
121
+ hash: -116079147036176157
107
122
  requirements: []
108
123
  rubyforge_project:
109
- rubygems_version: 2.0.3
124
+ rubygems_version: 1.8.23
110
125
  signing_key:
111
- specification_version: 4
126
+ specification_version: 3
112
127
  summary: Easily output formatted metrics to stdout
113
128
  test_files:
114
129
  - spec/metrics/formatters/l2met_spec.rb
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: 7a49f0faab052704e66f51de8caa1d7b87ee38e7
4
- data.tar.gz: a5d70350b860e82bc2f6bbafd3f9401bb9fe4506
5
- !binary "U0hBNTEy":
6
- metadata.gz: b5c760f13ca2e109992cab773bec7547a8c89e5ae751216e8c1778e841715531e9e7439eeaf804144c11c076071795595a1895d432ac6494c1d4773d6e7119c2
7
- data.tar.gz: 9662661ebb0ec099da74950c0cd8aafb6ae77a77cac7c99ff7ec8ba9123f15b5f6882da6982ead3c846da4f114b3c6f08b133a33e298f690ec855c31211ba533