roost 0.0.2 → 0.0.3

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: 3435183de140fbf7856cb3e9cb4ccdcf41a107dc
4
- data.tar.gz: bd2ac38e4d6ec339ac2bfb34a56c79ec0d758b9f
3
+ metadata.gz: 77377fdae341f44fe67ef2cfd7dbf48d6074b1fb
4
+ data.tar.gz: 0d774da3a5932e1dfea1aa1b183ef3c65f7a8cd0
5
5
  SHA512:
6
- metadata.gz: 8e3c5caffd6980a72d1eed3e5cb5654e3224a2a5895096e7b8ade023415dcb9a7f0ec84513f777ac31682a87115f30381f3bdffe2ee53a1786a6e936f62dcd54
7
- data.tar.gz: 03571ee0241d252f253d443ed0b6b38049e295ef88a245556969921a082d896af4304ccefaade2b3b18cbff44cffca2691abaefb6a380ba14e0928f1f07eb23b
6
+ metadata.gz: 16acce3631d7fac1a49e25713a14bfe2e9459a1c6598622273ebcb72e05d466d0e88183b3a57a98a1da406b3eacc8a23ebe8e46ba2e090748ab65d848669e866
7
+ data.tar.gz: b8bdfd4636e6e049ac53af2d511be2e32c535139148ca4fbc4db6b0754336f8e82698df6fda7ee8318052712d50583c5e9ea3839f93f34d70397c023226ad92a
@@ -1,4 +1,4 @@
1
- Copyright (c) 2014 Rick Byington
1
+ Copyright (c) 2015 Roost
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -1,12 +1,9 @@
1
1
  # Roost
2
2
 
3
- This is the official Ruby Gem for the Roost API.
4
-
5
- Roost is the easy way to send Safari Push Notifications to your website visitors.
6
- Desktop Push Notifications provide a new marketing channel to drive visitors back to your site.
7
- With Safari on OS X Mavericks, visitors receive notifications in the top right corner of their computer screen.
8
- This ‘gentle’ touch is great for status updates or trending information. To learn more see roost.me
3
+ This is the official Ruby gem for the Roost API.
9
4
 
5
+ [Web Push by Roost](https://goroost.com) allows websites to send notifications to their site visitors for
6
+ updates about new posts, content, or other information. Available in Chrome (Android and desktop) and Safari (desktop).
10
7
 
11
8
  ## Installation
12
9
 
@@ -24,15 +21,18 @@ Or install it yourself as:
24
21
 
25
22
  ## Usage
26
23
 
27
- To send notifications you first need to create an account on http://roost.me.
24
+ To send notifications you will first need to create an account on the [Roost website](https://goroost.com).
28
25
 
29
- Then make sure you have ENV["ROOST_APPKEY"] and ENV["ROOST_APPSECRET"] set.
30
- These can be found in the http://roost.me dashboard under settings.
31
- If you are using the Heroku Add-On these are already configured for you.
26
+ Set your Roost app key and app secret to the following environment variables: ENV["ROOST_APPKEY"] / ENV["ROOST_APPSECRET"]
27
+ These can be found in the [Roost dashboard](https://dashboard.goroost.com) under settings -> API.
32
28
 
33
- Once you have some registered Safari visitors on your site you can use the following code to send them a message.
29
+ Easliy send notifications through Roost. Notifications incule text (alert) and a landing page URL (url).
34
30
  ```
35
- response = Roost::API.send({alert:'Welcome to Roost',url:'http://roost.me'})
31
+ alert = 'Thanks for subscribing for notifications'
32
+ url = 'https://goroost.com'
33
+
34
+ response = Roost::API.send({alert: alert,url: url})
35
+
36
36
  if response['success'] == true
37
37
  ..success..
38
38
  else
@@ -42,7 +42,7 @@ Once you have some registered Safari visitors on your site you can use the follo
42
42
 
43
43
  ## Contributing
44
44
 
45
- 1. Fork it ( http://github.com/rickbyington/roost/fork )
45
+ 1. Fork it ( https://github.com/RoostPush/Roost-Ruby-Gem )
46
46
  2. Create your feature branch (`git checkout -b my-new-feature`)
47
47
  3. Commit your changes (`git commit -am 'Add some feature'`)
48
48
  4. Push to the branch (`git push origin my-new-feature`)
@@ -1,9 +1,10 @@
1
- require "roost/version"
1
+ require 'roost/version'
2
2
  require 'json'
3
+ require 'net/http'
3
4
 
4
5
  module Roost
5
- class API
6
- def self.send(opts)
6
+ class API
7
+ def self.send(opts)
7
8
  opts = opts||{}
8
9
 
9
10
  key = opts[:app_key]||ENV["ROOST_APPKEY"]
@@ -13,15 +14,15 @@ module Roost
13
14
  raise "opts.alert must be given." if opts[:alert].nil? || opts[:alert].empty?
14
15
  raise "opts.url must be given." if opts[:url].nil? || opts[:url].empty?
15
16
 
16
- uri = URI.parse("https://get.roost.me/api/push")
17
+ uri = URI.parse("https://go.goroost.com/api/push")
17
18
  http = Net::HTTP.new(uri.host, uri.port)
18
19
  http.use_ssl = true
19
20
  request = Net::HTTP::Post.new(uri.path, initheader = {'Content-Type' =>'application/json'})
20
21
  request.basic_auth key,secret
21
22
 
22
23
  request.body = {
23
- alert:opts[:alert],
24
- url:opts[:url]
24
+ alert:opts[:alert],
25
+ url:opts[:url]
25
26
  }.to_json
26
27
 
27
28
  response = http.request(request)
@@ -29,11 +30,11 @@ module Roost
29
30
  return JSON.parse(response.body)
30
31
  else
31
32
  return {
32
- "success"=>false,
33
- "message"=>response.message,
34
- "code"=>response.code
33
+ "success"=>false,
34
+ "message"=>response.message,
35
+ "code"=>response.code
35
36
  }
36
37
  end
37
- end
38
- end
38
+ end
39
+ end
39
40
  end
@@ -1,3 +1,3 @@
1
1
  module Roost
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -4,21 +4,21 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require 'roost/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
- spec.name = "roost"
7
+ spec.name = 'roost'
8
8
  spec.version = Roost::VERSION
9
- spec.authors = ["Notice Software","Rick Byington"]
10
- spec.email = ["support@noticesoftware.com"]
11
- spec.summary = %q{Official Roost.me Ruby API library.}
9
+ spec.authors = ['Roost', 'Dan Stever', 'Rick Byington']
10
+ spec.email = ['support@goroost.com']
11
+ spec.summary = %q{Official Ruby Gem for the Roost API.}
12
12
  spec.description = %q{}
13
- spec.homepage = ""
14
- spec.license = "MIT"
13
+ spec.homepage = 'https://goroost.com'
14
+ spec.license = 'MIT'
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0")
17
17
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_development_dependency "bundler", "~> 1.5"
22
- spec.add_development_dependency "rake"
23
- spec.add_development_dependency "rspec", "~> 2.6"
21
+ spec.add_development_dependency 'bundler', '~> 1.5'
22
+ spec.add_development_dependency 'rake'
23
+ spec.add_development_dependency 'rspec', '~> 2.6'
24
24
  end
metadata CHANGED
@@ -1,15 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roost
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
- - Notice Software
7
+ - Roost
8
+ - Dan Stever
8
9
  - Rick Byington
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2014-04-02 00:00:00.000000000 Z
13
+ date: 2015-06-03 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: bundler
@@ -55,7 +56,7 @@ dependencies:
55
56
  version: '2.6'
56
57
  description: ''
57
58
  email:
58
- - support@noticesoftware.com
59
+ - support@goroost.com
59
60
  executables: []
60
61
  extensions: []
61
62
  extra_rdoc_files: []
@@ -68,7 +69,7 @@ files:
68
69
  - lib/roost.rb
69
70
  - lib/roost/version.rb
70
71
  - roost.gemspec
71
- homepage: ''
72
+ homepage: https://goroost.com
72
73
  licenses:
73
74
  - MIT
74
75
  metadata: {}
@@ -88,8 +89,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
88
89
  version: '0'
89
90
  requirements: []
90
91
  rubyforge_project:
91
- rubygems_version: 2.2.1
92
+ rubygems_version: 2.4.5
92
93
  signing_key:
93
94
  specification_version: 4
94
- summary: Official Roost.me Ruby API library.
95
+ summary: Official Ruby Gem for the Roost API.
95
96
  test_files: []