boxcar_publisher 1.0.0 → 1.0.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: faa4a93da71f1e0fa2f7f8c6c2e0dd3d8cde0424
4
- data.tar.gz: a1d2deff6ade74808d9ef26a1495e82b0b6acb3c
3
+ metadata.gz: 2b985b49865d8beec8fff112190e0511d650bff3
4
+ data.tar.gz: f11f1c40339da2e7c88993f6477e9a13b9911896
5
5
  SHA512:
6
- metadata.gz: 46e97b377eec7f1fe9106d65bad9042ea90165a74bfc83b3cfb2ef81168f7fc72a6055d36cc581a59d28e6c2a1772fe1875a19885685b72a3fa2052d7765bea7
7
- data.tar.gz: 0e0b236480b4d50dfd7513402a6f6a68638adf17d8f53970f2c79c58aaeb45cba6d415d9e672189a1f381541dd4e484128d488b20cadf3d574ec4c8748fe4ec6
6
+ metadata.gz: b0d816dd768bf814133d443cee6af6fc3bb050251526a52dcf64075433dd817e3bd76f2333be8b50839e319815290b750619b38fe47571eb392b23cae2445cdf
7
+ data.tar.gz: c03a9703f2a56858971d1bc7baef973fa87b2a47ee3373895bc41aabf7922177eea4efcd0d7ad81c1f687869d93141dcd2358def9a0f81b774c2666a6f81bf36
data/README.md CHANGED
@@ -1,25 +1,38 @@
1
1
  boxcar\_publisher
2
2
  =================
3
3
 
4
+ A simple Ruby interface to the [Boxcar Push API](http://developer.boxcar.io/api/publisher/).
5
+
4
6
  Installation
5
7
  -----
6
8
 
7
- ```
9
+ ```ruby
8
10
  gem install boxcar_publisher
9
11
  ```
10
12
 
11
13
  Usage
12
14
  -----
13
15
 
14
- ```
16
+ ```ruby
15
17
  BoxcarPublisher.setup do |config|
16
18
  config.access_key 'THIS_IS_MY_ACCESS_KEY'
17
19
  config.secret_key 'THIS_IS_MY_SECRET_KEY'
18
20
  end
19
21
 
22
+ # Create a new push notification (POST /api/push)
23
+ # Returns a BoxcarPublisher::Push instance
20
24
  push = BoxcarPublisher::Push.new aps: { alert: 'Hello world' }, tags: ['@all'], id: '12345'
25
+ # => #<BoxcarPublisher::Push:0x007f8491892ea8 @id="472317", @url="http://boxcar-api.io/api/push/472317">
21
26
  push.id
22
27
  # => 12345
28
+
29
+ # Get the state of an existing push (GET /api/push/{id})
30
+ # Returns a hash with the current state of the push
23
31
  push.state
24
32
  # => {:state=>"delivered", :created_at=>2015-05-27 22:28:10 -0700, :last_delivered_at=>2015-05-27 22:28:10 -0700, :sent=>1, :errors=>0, :opened=>0}
33
+
34
+ # Delete a queued push (DELETE /api/push/{id})
35
+ # Returns nil on success; raises an error on failure
36
+ push.delete
37
+ # => nil
25
38
  ```
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'boxcar_publisher'
3
- spec.version = '1.0.0'
3
+ spec.version = '1.0.1'
4
4
  spec.date = Date.today.to_s
5
5
  spec.summary = "Publisher API for boxcar.io"
6
6
  spec.description = "Send push notifications with Boxcar.io"
@@ -51,5 +51,10 @@ class BoxcarPublisher
51
51
  end
52
52
  end
53
53
  end
54
+
55
+ def delete
56
+ result = BoxcarPublisher._conn.delete "push/#{id}"
57
+ raise "Expected repsonse to have HTTP status 202, received #{result.status}" unless result.status == 202
58
+ end
54
59
  end
55
60
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: boxcar_publisher
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tony Novak
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-27 00:00:00.000000000 Z
11
+ date: 2015-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -46,6 +46,7 @@ extra_rdoc_files: []
46
46
  files:
47
47
  - LICENSE
48
48
  - README.md
49
+ - boxcar_publisher-1.0.0.gem
49
50
  - boxcar_publisher.gemspec
50
51
  - lib/boxcar_publisher.rb
51
52
  homepage: http://rubygems.org/gems/boxcar_publisher