carbon_pms 0.0.1 → 0.1.0

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: ab132c8bdd45705a23f576dc2dad791b094dd4ab
4
- data.tar.gz: 70e2cebc7ce69b4d9029b336c52406ec80ccd102
3
+ metadata.gz: b3ffdfcb6db5f349446e8275ed8173f3b038365d
4
+ data.tar.gz: 959bdac39e6429debe347942634e75d799c9a226
5
5
  SHA512:
6
- metadata.gz: 8bffdd76d3b79508e3ac1bfa479442d052ce66b46d5ed9dfbaf3932c192430a0736780be0b0ec5fb96ca28b50a44f20bdf5ecbe8fc5dda917001fd193f39cc73
7
- data.tar.gz: 94b6513f41533d0e888fdb61bac7a65fac1e999925966cdff6fdc0564b0343e18c362afd5a9ebbde2ad41ac6c1601e00743dea7026c68e3a5b2aafcddab064dc
6
+ metadata.gz: ade9d6683be77b8ca93e505b3ba2506bb7597ef47cc186fe48a01c2c2eae2c5a16680860addd85c9695625c6321a64d69618fb44ca6c0fd9269d0d7f100cfd4f
7
+ data.tar.gz: 555bdc9c51685c1c12c57f0a4ac54e844cf7ecb3336835bf18d7c9e7d3f9aeeef45f5ef02b49924972faa67b9261b7e17a404f6d23c1ff45773de7c485cf9537
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # CarbonPms
2
2
 
3
+ [![Code Climate](https://codeclimate.com/github/chaione/carbon_pms.png)](https://codeclimate.com/github/chaione/carbon_pms)
4
+
3
5
  If you're not using a CarbonPMS server, then you don't need this.
4
6
 
5
7
  ## Installation
@@ -1,3 +1,5 @@
1
+ require 'httparty'
2
+
1
3
  module CarbonPms
2
4
  class Client
3
5
  include HTTParty
@@ -43,7 +45,7 @@ module CarbonPms
43
45
 
44
46
  # Sends a push notification to the APNS
45
47
  #
46
- # @param [Hash] options hash to construct an app
48
+ # @param [Hash] options hash to construct a notification
47
49
  # @option options [String] :device_token the device token to receive this push notification
48
50
  # @option options [String] :app the name of the app
49
51
  # @option options [String] :environment the environment this app is running in _(production, development, sandbox)_
@@ -56,6 +58,19 @@ module CarbonPms
56
58
  return post '/push/apns', query: options
57
59
  end
58
60
 
61
+ # Sends a push notification to GCM
62
+ #
63
+ # @param [Hash] options hash to construct a notification
64
+ # @option options [String] :registration_ids array of registration ids to receive this notification. You can send up to 1000 at once.
65
+ # @option options [String] :app the name of the app
66
+ # @option options [String] :environment the environment this app is running in _(production, development, sandbox)_
67
+ # @option options [Hash] :data any custom attributes to send
68
+ # @option options [String] :collapse_key signifies that this is a send-to-sync message. You can use up to 4 different collapse_keys at a time
69
+ # @option options [Integer] :expiry set the time to live of the message. Can be from 0 to 2,419,200 seconds.
70
+ def gcm_notification(options={})
71
+ return post '/push/gcm', query: options
72
+ end
73
+
59
74
  private
60
75
 
61
76
  def post(path, options={})
@@ -1,3 +1,3 @@
1
1
  module CarbonPms
2
- VERSION = "0.0.1"
2
+ VERSION = "0.1.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carbon_pms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Mason