boxcar_client 0.0.1 → 0.0.2
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 +4 -4
- data/README.md +19 -2
- data/{boxcar.gemspec → boxcar_client.gemspec} +2 -2
- data/lib/{boxcar.rb → boxcar_client.rb} +5 -5
- data/lib/{boxcar → boxcar_client}/agent.rb +1 -1
- data/lib/{boxcar → boxcar_client}/configuration.rb +1 -1
- data/lib/{boxcar → boxcar_client}/notifier.rb +4 -4
- data/lib/boxcar_client/version.rb +3 -0
- metadata +7 -7
- data/lib/boxcar/version.rb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0f7a69c0bbfead517a59779b521013fa85a2544
|
4
|
+
data.tar.gz: 50f25ab1138b2863a51a51c9174cfcbc8640c26e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38302c5bb149811f6a8099e14e167fbcd43d5ca3be1193e4b12730677117d347c3c9d3aa88bf62f48be16c7d10a9189aac8b7cf6bcbab2ce44e4dd991071bc92
|
7
|
+
data.tar.gz: b331d7ac16f29386c6a439359af92b7e9b04d166012ea2b789d00ab9a4bd49b38ea97ef2854b94338f99d549d855f6acda33151c9a18f69e5b361788f01a6c0f
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# BoxcarClient
|
2
2
|
|
3
3
|
TODO: Write a gem description
|
4
4
|
|
@@ -18,7 +18,24 @@ Or install it yourself as:
|
|
18
18
|
|
19
19
|
## Usage
|
20
20
|
|
21
|
-
|
21
|
+
1. Add the following into config/initializers/boxcar.rb:
|
22
|
+
|
23
|
+
BoxcarClient.configure do |config|
|
24
|
+
config.api_key = '<API_KEY>'
|
25
|
+
config.icon_url = '<ICON_URL>'
|
26
|
+
config.from_screen_name = '<NAME>'
|
27
|
+
end
|
28
|
+
|
29
|
+
2. To send a push notification from anywhere in your application:
|
30
|
+
|
31
|
+
BoxcarClient::Notifier.push(
|
32
|
+
:message => "A push from Rails",
|
33
|
+
:email => "unni@bangthetable.com",
|
34
|
+
:source_url => "http://google.com"
|
35
|
+
)
|
36
|
+
|
37
|
+
|
38
|
+
|
22
39
|
|
23
40
|
## Contributing
|
24
41
|
|
@@ -1,11 +1,11 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
lib = File.expand_path('../lib', __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require '
|
4
|
+
require 'boxcar_client/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "boxcar_client"
|
8
|
-
spec.version =
|
8
|
+
spec.version = BoxcarClient::VERSION
|
9
9
|
spec.authors = ["Srihari, Unni"]
|
10
10
|
spec.email = ["srih4ri@gmail.com, unni@bangthetable.com"]
|
11
11
|
spec.description = %q{A ruby wrapper for BoxCar API}
|
@@ -1,12 +1,12 @@
|
|
1
|
-
require "
|
2
|
-
require "
|
3
|
-
require "
|
4
|
-
require "
|
1
|
+
require "boxcar_client/version"
|
2
|
+
require "boxcar_client/configuration"
|
3
|
+
require "boxcar_client/agent"
|
4
|
+
require "boxcar_client/notifier"
|
5
5
|
|
6
6
|
require "net/http"
|
7
7
|
require "uri"
|
8
8
|
|
9
|
-
module
|
9
|
+
module BoxcarClient
|
10
10
|
class << self
|
11
11
|
attr_writer :configuration
|
12
12
|
|
@@ -1,7 +1,7 @@
|
|
1
|
-
module
|
1
|
+
module BoxcarClient
|
2
2
|
class Notifier
|
3
3
|
def self.push(user_data)
|
4
|
-
Agent.new(
|
4
|
+
Agent.new(BoxcarClient.configuration.push_url, push_data(user_data)).push
|
5
5
|
end
|
6
6
|
|
7
7
|
def self.push_data(user_data)
|
@@ -15,8 +15,8 @@ module Boxcar
|
|
15
15
|
private
|
16
16
|
def self.default_params
|
17
17
|
{
|
18
|
-
'notification[icon_url]' =>
|
19
|
-
'notification[from_screen_name]' =>
|
18
|
+
'notification[icon_url]' => BoxcarClient.configuration.icon_url,
|
19
|
+
'notification[from_screen_name]' => BoxcarClient.configuration.from_screen_name
|
20
20
|
}
|
21
21
|
end
|
22
22
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: boxcar_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Srihari, Unni
|
@@ -50,12 +50,12 @@ files:
|
|
50
50
|
- LICENSE.txt
|
51
51
|
- README.md
|
52
52
|
- Rakefile
|
53
|
-
-
|
54
|
-
- lib/
|
55
|
-
- lib/
|
56
|
-
- lib/
|
57
|
-
- lib/
|
58
|
-
- lib/
|
53
|
+
- boxcar_client.gemspec
|
54
|
+
- lib/boxcar_client.rb
|
55
|
+
- lib/boxcar_client/agent.rb
|
56
|
+
- lib/boxcar_client/configuration.rb
|
57
|
+
- lib/boxcar_client/notifier.rb
|
58
|
+
- lib/boxcar_client/version.rb
|
59
59
|
homepage: ''
|
60
60
|
licenses:
|
61
61
|
- MIT
|
data/lib/boxcar/version.rb
DELETED