c2dm_batch 0.1.0 → 0.1.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.
data/c2dm_batch.gemspec CHANGED
@@ -6,7 +6,7 @@ $:.unshift lib unless $:.include?(lib)
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "c2dm_batch"
9
- s.version = '0.1.0'
9
+ s.version = '0.1.1'
10
10
  s.platform = Gem::Platform::RUBY
11
11
  s.authors = ["Alex Rockwell"]
12
12
  s.email = ["arockwell@gmail.com"]
data/lib/c2dm_batch.rb CHANGED
@@ -3,6 +3,7 @@ require "yaml"
3
3
  require "cgi"
4
4
  gem 'typhoeus', '= 0.2.4'
5
5
  require "typhoeus"
6
+ require 'logger'
6
7
 
7
8
  $:.unshift File.dirname(__FILE__)
8
9
 
@@ -7,9 +7,10 @@ module C2dmBatch
7
7
  @source = nil
8
8
 
9
9
  @hydra = Typhoeus::Hydra.new
10
+ @logger = Logger.new(STDOUT)
10
11
 
11
12
  class << self
12
- attr_accessor :auth_url, :send_url, :email, :password, :source
13
+ attr_accessor :auth_url, :send_url, :email, :password, :source, :logger
13
14
  end
14
15
 
15
16
  def self.authenticate!
@@ -64,7 +65,9 @@ module C2dmBatch
64
65
  if response.success?
65
66
  if response.body =~ /Error=(\w+)/
66
67
  errors << { :registration_id => notification[:registration_id], :error => $1 }
68
+ @logger.info("Error sending: #{pp notification}")
67
69
  else
70
+ @logger.info("Sent notification: #{pp notification}")
68
71
  requests.delete(request)
69
72
  end
70
73
  elsif response.code == 503
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: c2dm_batch
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Alex Rockwell
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-10-10 00:00:00 -07:00
18
+ date: 2011-10-13 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency