microphite 0.5.4 → 0.5.5
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 +15 -0
- data/.gitignore +3 -0
- data/.travis.yml +0 -1
- data/CHANGELOG.md +4 -0
- data/README.md +4 -2
- data/lib/microphite/client/base.rb +2 -2
- data/lib/microphite/version.rb +1 -1
- data/microphite.gemspec +1 -0
- data/spec/spec_helper.rb +4 -0
- data/spec/support/client_shared_examples.rb +22 -0
- metadata +18 -16
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
NGEzZjk0MTcxYjA0NjhiMjBmOTA4ZDE3N2U2MmY1YzM1ZjJmNGMzOQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
ZjRmYTcxNDhjYzNlMmExYTM0M2QxYjYwNGM0ZGQxMmRhNDMxN2E2ZA==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
ZGFhZjgxNjUwYWNlNmU3NzAxMmE1ZTMxM2I5YzE2NjQzZWY3MDJiNGQxOGMx
|
10
|
+
NzQyNGYyNTEyOTBhYWUzYzg5NjQ4NzQwYjFmN2VlNzBkY2YwMDlhYTc2MmJk
|
11
|
+
NzVjZDczZDU1ZTY4YzcyMTlhMWIxYWQ2YzRjNzlkOWE5OTViOTQ=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
ZDI5ODcxZWUzYWVlNGRmOWU3MmY2OGRiNGZhMjNhYmRlMmY4MjM4Njg5ODhi
|
14
|
+
M2E5M2E2Y2M5MDAwMzI1M2VkZDNmMjJlNWFiNTA3N2IwYTk3M2Y0YmE2OTQw
|
15
|
+
MDczODRhZThlNTM2MjdjYjI2NGI2OTJiOGIzN2IyZjM3ZWExNGQ=
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
-
[](https://travis-ci.org/bz-technology/microphite)
|
2
|
-
|
3
1
|
Microphite
|
4
2
|
==========
|
3
|
+
[](http://rubygems.org/gems/microphite)
|
4
|
+
[](https://travis-ci.org/bz-technology/microphite)
|
5
|
+
[](https://codeclimate.com/github/bz-technology/microphite)
|
6
|
+
[](https://coveralls.io/r/bz-technology/microphite)
|
5
7
|
|
6
8
|
|
7
9
|
Overview
|
@@ -57,7 +57,7 @@ module Microphite
|
|
57
57
|
def prefix(prefix, &block)
|
58
58
|
prefixed = Private::Prefixed.new(self, prefix)
|
59
59
|
if block_given?
|
60
|
-
prefixed
|
60
|
+
block.call(prefixed)
|
61
61
|
end
|
62
62
|
prefixed
|
63
63
|
end
|
@@ -65,7 +65,7 @@ module Microphite
|
|
65
65
|
def time(key, &block)
|
66
66
|
if block_given?
|
67
67
|
before = now
|
68
|
-
result =
|
68
|
+
result = block.call
|
69
69
|
after = now
|
70
70
|
elapsed = after - before
|
71
71
|
gather(key => elapsed)
|
data/lib/microphite/version.rb
CHANGED
data/microphite.gemspec
CHANGED
@@ -16,6 +16,7 @@ Gem::Specification.new do |gem|
|
|
16
16
|
|
17
17
|
gem.add_development_dependency 'rake'
|
18
18
|
gem.add_development_dependency 'rspec'
|
19
|
+
gem.add_development_dependency 'coveralls'
|
19
20
|
|
20
21
|
gem.files = `git ls-files`.split("\n")
|
21
22
|
gem.test_files = `git ls-files -- spec/*`.split("\n")
|
data/spec/spec_helper.rb
CHANGED
@@ -43,6 +43,17 @@ shared_examples 'a microphite client' do |before, after|
|
|
43
43
|
it 'should return the evaluated block value' do
|
44
44
|
expect(@client.time(:key) { 42 }).to eq 42
|
45
45
|
end
|
46
|
+
|
47
|
+
it 'should preserve caller self' do
|
48
|
+
class Preserve
|
49
|
+
def a
|
50
|
+
end
|
51
|
+
def b(client)
|
52
|
+
client.time(:key) { a }
|
53
|
+
end
|
54
|
+
end
|
55
|
+
expect { Preserve.new.b(@client) }.not_to raise_error
|
56
|
+
end
|
46
57
|
end
|
47
58
|
|
48
59
|
describe :prefix do
|
@@ -52,6 +63,17 @@ shared_examples 'a microphite client' do |before, after|
|
|
52
63
|
prefixed.should respond_to method
|
53
64
|
end
|
54
65
|
end
|
66
|
+
|
67
|
+
it 'should preserve caller self' do
|
68
|
+
class Preserve
|
69
|
+
def a
|
70
|
+
end
|
71
|
+
def b(client)
|
72
|
+
client.prefix(:key) { a }
|
73
|
+
end
|
74
|
+
end
|
75
|
+
expect { Preserve.new.b(@client) }.not_to raise_error
|
76
|
+
end
|
55
77
|
end
|
56
78
|
|
57
79
|
describe :close do
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: microphite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
5
|
-
prerelease:
|
4
|
+
version: 0.5.5
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- BZ
|
@@ -17,7 +16,6 @@ dependencies:
|
|
17
16
|
- !ruby/object:Gem::Dependency
|
18
17
|
name: rake
|
19
18
|
requirement: !ruby/object:Gem::Requirement
|
20
|
-
none: false
|
21
19
|
requirements:
|
22
20
|
- - ! '>='
|
23
21
|
- !ruby/object:Gem::Version
|
@@ -25,7 +23,6 @@ dependencies:
|
|
25
23
|
type: :development
|
26
24
|
prerelease: false
|
27
25
|
version_requirements: !ruby/object:Gem::Requirement
|
28
|
-
none: false
|
29
26
|
requirements:
|
30
27
|
- - ! '>='
|
31
28
|
- !ruby/object:Gem::Version
|
@@ -33,7 +30,6 @@ dependencies:
|
|
33
30
|
- !ruby/object:Gem::Dependency
|
34
31
|
name: rspec
|
35
32
|
requirement: !ruby/object:Gem::Requirement
|
36
|
-
none: false
|
37
33
|
requirements:
|
38
34
|
- - ! '>='
|
39
35
|
- !ruby/object:Gem::Version
|
@@ -41,7 +37,20 @@ dependencies:
|
|
41
37
|
type: :development
|
42
38
|
prerelease: false
|
43
39
|
version_requirements: !ruby/object:Gem::Requirement
|
44
|
-
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
44
|
+
- !ruby/object:Gem::Dependency
|
45
|
+
name: coveralls
|
46
|
+
requirement: !ruby/object:Gem::Requirement
|
47
|
+
requirements:
|
48
|
+
- - ! '>='
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: '0'
|
51
|
+
type: :development
|
52
|
+
prerelease: false
|
53
|
+
version_requirements: !ruby/object:Gem::Requirement
|
45
54
|
requirements:
|
46
55
|
- - ! '>='
|
47
56
|
- !ruby/object:Gem::Version
|
@@ -80,33 +89,26 @@ files:
|
|
80
89
|
- tasks/test.rake
|
81
90
|
homepage: https://github.com/bz-technology/microphite
|
82
91
|
licenses: []
|
92
|
+
metadata: {}
|
83
93
|
post_install_message:
|
84
94
|
rdoc_options: []
|
85
95
|
require_paths:
|
86
96
|
- lib
|
87
97
|
required_ruby_version: !ruby/object:Gem::Requirement
|
88
|
-
none: false
|
89
98
|
requirements:
|
90
99
|
- - ! '>='
|
91
100
|
- !ruby/object:Gem::Version
|
92
101
|
version: '0'
|
93
|
-
segments:
|
94
|
-
- 0
|
95
|
-
hash: -3721843423147730065
|
96
102
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
103
|
requirements:
|
99
104
|
- - ! '>='
|
100
105
|
- !ruby/object:Gem::Version
|
101
106
|
version: '0'
|
102
|
-
segments:
|
103
|
-
- 0
|
104
|
-
hash: -3721843423147730065
|
105
107
|
requirements: []
|
106
108
|
rubyforge_project:
|
107
|
-
rubygems_version: 1.
|
109
|
+
rubygems_version: 2.1.11
|
108
110
|
signing_key:
|
109
|
-
specification_version:
|
111
|
+
specification_version: 4
|
110
112
|
summary: A tiny and fast, asynchronous graphite client
|
111
113
|
test_files:
|
112
114
|
- spec/client/noop_spec.rb
|