crevalle-pulse 0.1.0 → 0.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4412573e5d3220a5f0adc995ff3746fc717a431f
4
- data.tar.gz: b142587f036db6d99a2e3ea024b12ac8e05c561e
3
+ metadata.gz: 64f773c201b0b5c8dfa6e9a32ed35f193526b059
4
+ data.tar.gz: 0449f7775fc83d4110c518615781d1549339fefa
5
5
  SHA512:
6
- metadata.gz: f2561db2a22c5811673bc19a8c0390798412686cd8753d90e3cd7132ea75e9e89b63040bc711c3cac24d3296b99759eed7522f7cc9957ffb2e298aaab6780231
7
- data.tar.gz: 14f3bcdc3cbcf043d2b007c1744c2d1036bdad5f961552cf34a4e4f957ff010fb292f6af6ec906d6fc5952ddf52114c59b073546578409bc71c15a10db41dbe1
6
+ metadata.gz: 6c1e833376a178614ece2861322b4b9f8924292d9e441873584245b3d1bb985c0774b706129216fca445d93f182c2b6f1c143be924966cedc70c8a36fc5a7eee
7
+ data.tar.gz: a2b5f94a4346d4903cd273e7d5602f27da07b4efa93269afa2eea14b3018f4b7d3c8e9b82addfc6b928c900a2691c1187962f201905e167838af64c36f7a156c
data/README.md CHANGED
@@ -25,10 +25,24 @@ Drop in your api key:
25
25
  ```ruby
26
26
  # config/initializers/pulse.rb
27
27
 
28
- Crevalle::Pulse.config.api_key = 'your-api-uuid'.
28
+ Crevalle::Pulse.config.api_key = 'your-api-uuid'
29
29
  ```
30
30
 
31
- You're ready to send heartbeats! Anywhere in your code, such as when a user signs up, call `Crevalle::Pulse.beat 'myapp.user-signup'` to send a beat to the Pulse server. This request runs in a separate thread, so you can drop the notification into your normal codepaths without worrying about performance.
31
+ You're ready to send heartbeats! Anywhere in your code, such as when a user signs up, call
32
+
33
+ ```ruby
34
+ Crevalle::Pulse.beat 'myapp.user-signup'
35
+ ```
36
+ to send a beat to the Pulse server. This request runs in a separate thread, so you can drop the notification into your normal codepaths without worrying about performance.
37
+
38
+
39
+ ## Testing
40
+
41
+ You probably don't want bunches of heartbeats sent while you're running tests. To disable beat sending, put the following in your `spec_helper.rb`:
42
+
43
+ ```ruby
44
+ Crevalle::Pulse.config.disabled = true
45
+ ```
32
46
 
33
47
 
34
48
  © 2015 Crevalle Technologies, LLC
@@ -18,6 +18,8 @@ module Crevalle
18
18
  raise ArgumentError, 'please supply a beat name' if name.nil? || name == ''
19
19
  raise 'Please configure with an api key' if config.api_key.nil?
20
20
 
21
+ return false if config.disabled?
22
+
21
23
  uri = URI.parse "#{config.host}#{config.endpoint}"
22
24
  http = Net::HTTP.new(uri.host, uri.port)
23
25
  http.use_ssl = true
@@ -47,6 +49,14 @@ module Crevalle
47
49
  def endpoint
48
50
  '/api/v1/beats'
49
51
  end
52
+
53
+ def disabled= d
54
+ @disabled = d
55
+ end
56
+
57
+ def disabled?
58
+ !!@disabled
59
+ end
50
60
  end
51
61
  end
52
62
  end
@@ -1,5 +1,5 @@
1
1
  module Crevalle
2
2
  module Pulse
3
- VERSION = '0.1.0'
3
+ VERSION = '0.1.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crevalle-pulse
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Desmond Bowe