boxcar_client 0.0.1 → 0.0.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: 89a32f3ae3b5f034c20a2b6533aef7f3d8870c7f
4
- data.tar.gz: 51562beaa0a64294a9c39b87a0742c4dcce432d5
3
+ metadata.gz: f0f7a69c0bbfead517a59779b521013fa85a2544
4
+ data.tar.gz: 50f25ab1138b2863a51a51c9174cfcbc8640c26e
5
5
  SHA512:
6
- metadata.gz: c2c3fdd27535279611c5b485414a8803df4f633da0bb5c207903275bb2788783680568625bdb318511d374bfd0807e2b9201fe3beebe5ac8b9ef5d2bcbc6f022
7
- data.tar.gz: 8ad6180e6933ca21929b17c1972da77e29b3e04be555a0a052fc843f637a71a2825851bf0befd1c9c46b28800298d3f7d9c06ea11b2b18d73e681efc84bf690d
6
+ metadata.gz: 38302c5bb149811f6a8099e14e167fbcd43d5ca3be1193e4b12730677117d347c3c9d3aa88bf62f48be16c7d10a9189aac8b7cf6bcbab2ce44e4dd991071bc92
7
+ data.tar.gz: b331d7ac16f29386c6a439359af92b7e9b04d166012ea2b789d00ab9a4bd49b38ea97ef2854b94338f99d549d855f6acda33151c9a18f69e5b361788f01a6c0f
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Boxcar
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
- TODO: Write usage instructions here
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 'boxcar/version'
4
+ require 'boxcar_client/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "boxcar_client"
8
- spec.version = Boxcar::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 "boxcar/version"
2
- require "boxcar/configuration"
3
- require "boxcar/agent"
4
- require "boxcar/notifier"
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 Boxcar
9
+ module BoxcarClient
10
10
  class << self
11
11
  attr_writer :configuration
12
12
 
@@ -1,4 +1,4 @@
1
- module Boxcar
1
+ module BoxcarClient
2
2
  class Agent
3
3
  def initialize(push_url, data)
4
4
  @push_url = push_url
@@ -1,4 +1,4 @@
1
- module Boxcar
1
+ module BoxcarClient
2
2
  class Configuration
3
3
  attr_accessor :api_key, :icon_url, :from_screen_name
4
4
 
@@ -1,7 +1,7 @@
1
- module Boxcar
1
+ module BoxcarClient
2
2
  class Notifier
3
3
  def self.push(user_data)
4
- Agent.new(Boxcar.configuration.push_url, push_data(user_data)).push
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]' => Boxcar.configuration.icon_url,
19
- 'notification[from_screen_name]' => Boxcar.configuration.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
@@ -0,0 +1,3 @@
1
+ module BoxcarClient
2
+ VERSION = "0.0.2"
3
+ 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.1
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
- - boxcar.gemspec
54
- - lib/boxcar.rb
55
- - lib/boxcar/agent.rb
56
- - lib/boxcar/configuration.rb
57
- - lib/boxcar/notifier.rb
58
- - lib/boxcar/version.rb
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
@@ -1,3 +0,0 @@
1
- module Boxcar
2
- VERSION = "0.0.1"
3
- end