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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f95719e2e2be1ad6b5432efc058e665e0f10c0f5
4
- data.tar.gz: 728ab009d5477a6e8ecfd07660d2e40c013e52d5
3
+ metadata.gz: 27871ec34b5ab2bb24c584562a646931855745d4
4
+ data.tar.gz: 82156be355ece58115b1880651c98aa14ec47d60
5
5
  SHA512:
6
- metadata.gz: 8c66ef13e29d9b58b74c16bed76b3f272161a861bdc5f36ba824c90ada6abf09bc7f1a8d11dc01de150d297cd43133371d83ad35632d6945b874d8ecf5fcf18e
7
- data.tar.gz: ddcee25b534ce9f06ac50e6ab515e68aa079d2dcf3b17ebb4c846a003c712295379fe38231dc8d7af29b50ff023cafaab97bb743a3c28c1a71bc9f275232f717
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/collectiveidea/snitcher.png?branch=master)](https://travis-ci.org/collectiveidea/snitcher)
7
- [![Code Climate](https://codeclimate.com/github/collectiveidea/snitcher.png)](https://codeclimate.com/github/collectiveidea/snitcher)
8
- [![Coverage Status](https://coveralls.io/repos/collectiveidea/snitcher/badge.png)](https://coveralls.io/r/collectiveidea/snitcher)
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
 
@@ -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 = URI.parse("https://nosnch.in/#{token}")
23
- timeout = opts.fetch(:timeout, 2)
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
 
@@ -1,3 +1,3 @@
1
1
  module Snitcher
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
@@ -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.1
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-06-23 00:00:00.000000000 Z
11
+ date: 2015-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler