dead_mans_snitch 1.0.3 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 82587e1051da4dfaabbfeebfa52d7a421a39d78d
4
+ data.tar.gz: 075ed87e7d6dc585c57457d165e2b192aa1c74ae
5
+ SHA512:
6
+ metadata.gz: f7d1d8a590c082b2cb90d97288aa117c0dcd60da45db4ca786c739f561bafe992c3acab0fdfc54fa5de8aa6bb3bff070eba1026a937e04b02ac5ca2afdaebe91
7
+ data.tar.gz: 5c1cfbcdc9524a183385fd5d5f1b671807c87cfbba589fbb02592641b23a9d1efb0c7b2b849ac0e61e0b34a60477657adc62e6cd6692e2d6913565f4dfbd7992
@@ -19,3 +19,11 @@ require 'dead_mans_snitch'
19
19
  DeadMansSnitch.report 'your-snitch-id'
20
20
  DeadMansSnitch.report 'your-snitch-id', 'optional message'
21
21
  </pre>
22
+
23
+
24
+ To build and deploy:
25
+
26
+ <pre>
27
+ gem build dead_mans_snitch.gemspec
28
+ gem push dead_mans_snitch-[[version]].gem
29
+ </pre>
@@ -15,6 +15,29 @@ class DeadMansSnitch
15
15
  request.set_form_data( "m" => message )
16
16
  response = http.request(request)
17
17
  rescue Exception => e
18
+ false
19
+ end
20
+ end
21
+
22
+ def self.report_with_time snitch_id
23
+ start = Time.now
24
+ result = yield
25
+ finish = Time.now
26
+
27
+ report snitch_id, "Took: #{Utils.seconds_to_human(finish - start)}, #{result}"
28
+ end
29
+
30
+ module Utils
31
+ def self.seconds_to_human seconds
32
+ raise ArgumentError if seconds.nil? || seconds < 0
33
+
34
+ seconds = seconds.to_i
35
+ hours = seconds / 3600
36
+ seconds = seconds % 3600
37
+ minutes = seconds / 60
38
+ seconds = seconds % 60
39
+
40
+ "#{hours}h #{minutes}m #{seconds}s"
18
41
  end
19
42
  end
20
43
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dead_mans_snitch
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
5
- prerelease:
4
+ version: 1.1.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Kyle Burton <kyle.burton@gmail.com>
@@ -10,7 +9,49 @@ autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
11
  date: 2012-10-07 00:00:00.000000000 Z
13
- dependencies: []
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 3.0.0
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 3.0.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: webmock
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
14
55
  description: A gem to make using https://deadmanssnitch.com simple.
15
56
  email:
16
57
  - kburton@gmail.com
@@ -23,26 +64,25 @@ files:
23
64
  - lib/dead_mans_snitch.rb
24
65
  homepage: https://github.com/kyleburton/dead-mans-snitch
25
66
  licenses: []
67
+ metadata: {}
26
68
  post_install_message:
27
69
  rdoc_options: []
28
70
  require_paths:
29
71
  - lib
30
72
  required_ruby_version: !ruby/object:Gem::Requirement
31
- none: false
32
73
  requirements:
33
- - - ! '>='
74
+ - - ">="
34
75
  - !ruby/object:Gem::Version
35
76
  version: '0'
36
77
  required_rubygems_version: !ruby/object:Gem::Requirement
37
- none: false
38
78
  requirements:
39
- - - ! '>='
79
+ - - ">="
40
80
  - !ruby/object:Gem::Version
41
81
  version: '0'
42
82
  requirements: []
43
83
  rubyforge_project:
44
- rubygems_version: 1.8.19
84
+ rubygems_version: 2.5.1
45
85
  signing_key:
46
- specification_version: 3
86
+ specification_version: 4
47
87
  summary: A gem to make using https://deadmanssnitch.com simple.
48
88
  test_files: []