dead_mans_snitch 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.textile +19 -0
  2. data/lib/dead_mans_snitch.rb +16 -0
  3. metadata +4 -3
data/README.textile CHANGED
@@ -1 +1,20 @@
1
1
  h1. Gem for "Dead Man's Snitch":https://deadmanssnitch.com/
2
+
3
+ h1. Example
4
+
5
+ Install the gem:
6
+
7
+ <pre>
8
+ gem install dead_mans_snitch
9
+ </pre>
10
+
11
+
12
+
13
+ Use the report function:
14
+
15
+ <pre>
16
+ require 'rubygems'
17
+ require 'dead_mans_snitch'
18
+
19
+ DeadMansSnitch.report 'your-snitch-id'
20
+ </pre>
@@ -0,0 +1,16 @@
1
+ require 'rubygems'
2
+ require 'net/http'
3
+ require 'net/https'
4
+ require 'uri'
5
+
6
+ class DeadMansSnitch
7
+ def self.report snitch_id
8
+ dead_mans_snitch_url = "https://nosnch.in/#{snitch_id}"
9
+ uri = URI.parse(dead_mans_snitch_url)
10
+ http = Net::HTTP.new(uri.host, uri.port)
11
+ http.use_ssl = true
12
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE
13
+ request = Net::HTTP::Get.new(uri.request_uri)
14
+ response = http.request(request)
15
+ end
16
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dead_mans_snitch
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 0
10
- version: 1.0.0
9
+ - 1
10
+ version: 1.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Kyle Burton <kyle.burton@gmail.com>
@@ -29,6 +29,7 @@ extra_rdoc_files:
29
29
  - README.textile
30
30
  files:
31
31
  - README.textile
32
+ - lib/dead_mans_snitch.rb
32
33
  homepage: https://github.com/kyleburton/dead-mans-snitch
33
34
  licenses: []
34
35