snitcher 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -4
- data/lib/snitcher.rb +3 -6
- data/lib/snitcher/version.rb +1 -1
- data/spec/snitcher_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 27871ec34b5ab2bb24c584562a646931855745d4
|
4
|
+
data.tar.gz: 82156be355ece58115b1880651c98aa14ec47d60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3bf4288bea7ae411853643790614e4fa7850f0ba57f9586e8e57170852198e8e67d64900832e1b16f8e0c4cf0c1dea495872c792aa690c4d73f40ced3fe86c65
|
7
|
+
data.tar.gz: 9b1dbe9bde047d543996ad4bb14025a4058559cf8ecad36f46aaf183a83cbc052007ce8a93b97cb907ec15737ca8b0657cd4f01e7b6b1b8f404fa1991c2eced4
|
data/README.md
CHANGED
@@ -3,10 +3,9 @@
|
|
3
3
|
Simple API client for [Dead Man's Snitch](https://deadmanssnitch.com)
|
4
4
|
|
5
5
|
[![Gem Version](https://badge.fury.io/rb/snitcher.png)](http://badge.fury.io/rb/snitcher)
|
6
|
-
[![Build Status](https://travis-ci.org/
|
7
|
-
[![Code Climate](https://codeclimate.com/github/
|
8
|
-
[![Coverage Status](https://coveralls.io/repos/
|
9
|
-
[![Dependency Status](https://gemnasium.com/collectiveidea/snitcher.png)](https://gemnasium.com/collectiveidea/snitcher)
|
6
|
+
[![Build Status](https://travis-ci.org/deadmanssnitch/snitcher.png?branch=master)](https://travis-ci.org/deadmanssnitch/snitcher)
|
7
|
+
[![Code Climate](https://codeclimate.com/github/deadmanssnitch/snitcher.png)](https://codeclimate.com/github/deadmanssnitch/snitcher)
|
8
|
+
[![Coverage Status](https://coveralls.io/repos/deadmanssnitch/snitcher/badge.png)](https://coveralls.io/r/deadmanssnitch/snitcher)
|
10
9
|
|
11
10
|
![Snitches get Stitches](doc/get_them_stitches.jpg)
|
12
11
|
|
data/lib/snitcher.rb
CHANGED
@@ -19,8 +19,9 @@ module Snitcher
|
|
19
19
|
#
|
20
20
|
# Returns true if the check-in succeeded or false if it failed
|
21
21
|
def snitch(token, opts = {})
|
22
|
-
uri
|
23
|
-
|
22
|
+
uri = URI.parse("https://nosnch.in/#{token}")
|
23
|
+
uri.query = URI.encode_www_form(:m => opts[:message]) if opts[:message]
|
24
|
+
timeout = opts.fetch(:timeout, 2)
|
24
25
|
|
25
26
|
opts = {
|
26
27
|
:open_timeout => timeout,
|
@@ -30,10 +31,6 @@ module Snitcher
|
|
30
31
|
}
|
31
32
|
|
32
33
|
Net::HTTP.start(uri.host, uri.port, opts) do |http|
|
33
|
-
if message = opts[:message]
|
34
|
-
uri.query = URI.encode_www_form(:m => message)
|
35
|
-
end
|
36
|
-
|
37
34
|
request = Net::HTTP::Get.new(uri.request_uri)
|
38
35
|
request["User-Agent"] = user_agent
|
39
36
|
|
data/lib/snitcher/version.rb
CHANGED
data/spec/snitcher_spec.rb
CHANGED
@@ -50,7 +50,7 @@ describe Snitcher do
|
|
50
50
|
it "includes the message as a query param" do
|
51
51
|
Snitcher.snitch(token, :message => "A thing just happened")
|
52
52
|
|
53
|
-
expect(a_request(:get, "https://nosnch.in/#{token}?m=A%20thing%20just%20happened"))
|
53
|
+
expect(a_request(:get, "https://nosnch.in/#{token}?m=A%20thing%20just%20happened")).to have_been_made
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snitcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Collective Idea
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|