postageapp 1.0.11 → 1.0.12

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml ADDED
@@ -0,0 +1,8 @@
1
+ rvm:
2
+ - 1.8.7
3
+ - 1.9.2
4
+ - ree
5
+ gemfile:
6
+ - test/gemfiles/Gemfile.rails-2.3.x
7
+ - test/gemfiles/Gemfile.rails-3.0.x
8
+ - test/gemfiles/Gemfile.rails-3.1.x
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gem 'json'
4
+
5
+ group :development do
6
+ gem 'jeweler'
7
+ end
8
+
9
+ group :test do
10
+ gem 'rails'
11
+ gem 'mocha'
12
+ end
data/README.md CHANGED
@@ -1,5 +1,4 @@
1
- [PostageApp](http://postageapp.com) Ruby Gem
2
- =======================================
1
+ # [PostageApp](http://postageapp.com) Ruby Gem [![Build Status](http://travis-ci.org/postageapp/postageapp-ruby.png)](http://travis-ci.org/postageapp/postageapp-ruby)
3
2
 
4
3
  This is the gem used to integrate Ruby apps with PostageApp service.
5
4
  Personalized, mass email sending can be offloaded to PostageApp via JSON based API.
@@ -54,6 +53,12 @@ Here's an example of sending a message ([See full API documentation](http://help
54
53
  'content' => {
55
54
  'text/plain' => 'text email content',
56
55
  'text/html' => 'html email content'
56
+ },
57
+ 'attachments' => {
58
+ 'document.pdf' => {
59
+ 'content_type' => 'application/pdf',
60
+ 'content' => Base64.encode64(File.open('/path/to/document.pdf', 'rb').read)
61
+ }
57
62
  }
58
63
  })
59
64
  response = request.send
data/Rakefile CHANGED
@@ -1,23 +1,32 @@
1
1
  require 'rubygems'
2
- require 'rake'
3
2
 
3
+ require 'bundler'
4
4
  begin
5
- require 'jeweler'
6
- Jeweler::Tasks.new do |gem|
7
- gem.name = 'postageapp'
8
- gem.summary = 'Easier way to send email from web apps'
9
- gem.description = 'Gem that interfaces with PostageApp.com service to send emails from web apps'
10
- gem.email = 'oleg@twg.ca'
11
- gem.homepage = 'http://github.com/postageapp/postageapp-ruby'
12
- gem.authors = ['Oleg Khabarov, The Working Group Inc']
13
-
14
- gem.add_dependency 'json', '>=1.4.6'
15
- gem.add_development_dependency 'mocha', '>= 0.9.8'
16
- end
17
- Jeweler::GemcutterTasks.new
18
- rescue LoadError
19
- puts 'Jeweler (or a dependency) not available. Install it with: gem install jeweler'
5
+ Bundler.setup(:default, :development)
6
+ rescue Bundler::BundlerError => e
7
+ $stderr.puts e.message
8
+ $stderr.puts "Run `bundle install` to install missing gems"
9
+ exit e.status_code
10
+ end
11
+
12
+ require 'rake'
13
+
14
+ require 'jeweler'
15
+ Jeweler::Tasks.new do |gem|
16
+ # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
17
+ gem.name = 'postageapp'
18
+ gem.summary = 'Easier way to send email from web apps'
19
+ gem.description = 'Gem that interfaces with PostageApp.com service to send emails from web apps'
20
+ gem.email = 'oleg@twg.ca'
21
+ gem.homepage = 'http://github.com/postageapp/postageapp-ruby'
22
+ gem.authors = ['Oleg Khabarov, The Working Group Inc']
23
+ gem.license = 'MIT'
24
+ # Include your dependencies below. Runtime dependencies are required when using your gem,
25
+ # and development dependencies are only needed for development (ie running rake tasks, tests, etc)
26
+ # gem.add_runtime_dependency 'jabber4r', '> 0.1'
27
+ # gem.add_development_dependency 'rspec', '> 1.2.3'
20
28
  end
29
+ Jeweler::RubygemsDotOrgTasks.new
21
30
 
22
31
  require 'rake/testtask'
23
32
  Rake::TestTask.new(:test) do |test|
@@ -26,29 +35,4 @@ Rake::TestTask.new(:test) do |test|
26
35
  test.verbose = true
27
36
  end
28
37
 
29
- begin
30
- require 'rcov/rcovtask'
31
- Rcov::RcovTask.new do |test|
32
- test.libs << 'test'
33
- test.pattern = 'test/**/*_test.rb'
34
- test.verbose = true
35
- end
36
- rescue LoadError
37
- task :rcov do
38
- abort 'RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov'
39
- end
40
- end
41
-
42
- task :test => :check_dependencies
43
-
44
- task :default => :test
45
-
46
- require 'rake/rdoctask'
47
- Rake::RDocTask.new do |rdoc|
48
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
49
-
50
- rdoc.rdoc_dir = 'rdoc'
51
- rdoc.title = "postageapp #{version}"
52
- rdoc.rdoc_files.include('README*')
53
- rdoc.rdoc_files.include('lib/**/*.rb')
54
- end
38
+ task :default => :test
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.11
1
+ 1.0.12
@@ -49,7 +49,14 @@ module PostageApp::FailedRequest
49
49
  def self.initialize_request(uid)
50
50
  return false if !store_path
51
51
 
52
- Marshal.load(File.read(file_path(uid))) if File.exists?(file_path(uid))
52
+ if File.exists?(file_path(uid))
53
+ begin
54
+ Marshal.load(File.read(file_path(uid)))
55
+ rescue
56
+ File.delete(file_path(uid))
57
+ return false
58
+ end
59
+ end
53
60
  end
54
61
 
55
62
  protected
data/postageapp.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{postageapp}
8
- s.version = "1.0.11"
8
+ s.version = "1.0.12"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Oleg Khabarov, The Working Group Inc"]
12
- s.date = %q{2011-06-22}
12
+ s.date = %q{2011-09-14}
13
13
  s.description = %q{Gem that interfaces with PostageApp.com service to send emails from web apps}
14
14
  s.email = %q{oleg@twg.ca}
15
15
  s.extra_rdoc_files = [
@@ -18,6 +18,8 @@ Gem::Specification.new do |s|
18
18
  ]
19
19
  s.files = [
20
20
  ".document",
21
+ ".travis.yml",
22
+ "Gemfile",
21
23
  "LICENSE",
22
24
  "README.md",
23
25
  "Rakefile",
@@ -43,6 +45,9 @@ Gem::Specification.new do |s|
43
45
  "rails/init.rb",
44
46
  "test/configuration_test.rb",
45
47
  "test/failed_request_test.rb",
48
+ "test/gemfiles/Gemfile.rails-2.3.x",
49
+ "test/gemfiles/Gemfile.rails-3.0.x",
50
+ "test/gemfiles/Gemfile.rails-3.1.x",
46
51
  "test/helper.rb",
47
52
  "test/live_test.rb",
48
53
  "test/mailer/action_mailer_2/notifier.rb",
@@ -71,23 +76,24 @@ Gem::Specification.new do |s|
71
76
  "test/response_test.rb"
72
77
  ]
73
78
  s.homepage = %q{http://github.com/postageapp/postageapp-ruby}
79
+ s.licenses = ["MIT"]
74
80
  s.require_paths = ["lib"]
75
- s.rubygems_version = %q{1.7.2}
81
+ s.rubygems_version = %q{1.6.2}
76
82
  s.summary = %q{Easier way to send email from web apps}
77
83
 
78
84
  if s.respond_to? :specification_version then
79
85
  s.specification_version = 3
80
86
 
81
87
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
82
- s.add_runtime_dependency(%q<json>, [">= 1.4.6"])
83
- s.add_development_dependency(%q<mocha>, [">= 0.9.8"])
88
+ s.add_runtime_dependency(%q<json>, [">= 0"])
89
+ s.add_development_dependency(%q<jeweler>, [">= 0"])
84
90
  else
85
- s.add_dependency(%q<json>, [">= 1.4.6"])
86
- s.add_dependency(%q<mocha>, [">= 0.9.8"])
91
+ s.add_dependency(%q<json>, [">= 0"])
92
+ s.add_dependency(%q<jeweler>, [">= 0"])
87
93
  end
88
94
  else
89
- s.add_dependency(%q<json>, [">= 1.4.6"])
90
- s.add_dependency(%q<mocha>, [">= 0.9.8"])
95
+ s.add_dependency(%q<json>, [">= 0"])
96
+ s.add_dependency(%q<jeweler>, [">= 0"])
91
97
  end
92
98
  end
93
99
 
@@ -34,6 +34,12 @@ class FailedRequestTest < Test::Unit::TestCase
34
34
  assert !PostageApp::FailedRequest.initialize_request('not_there')
35
35
  end
36
36
 
37
+ def test_initialize_requests_with_bad_file
38
+ file_path = File.join(PostageApp::FailedRequest.store_path, '1234567890')
39
+ FileUtils.touch(file_path)
40
+ assert !PostageApp::FailedRequest.initialize_request('1234567890')
41
+ end
42
+
37
43
  def test_store_for_wrong_call_type
38
44
  request = PostageApp::Request.new(:get_project_info)
39
45
  assert !PostageApp::FailedRequest.store(request)
@@ -0,0 +1,12 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gem 'json'
4
+
5
+ group :development do
6
+ gem 'jeweler'
7
+ end
8
+
9
+ group :test do
10
+ gem 'rails', '2.3.14'
11
+ gem 'mocha'
12
+ end
@@ -0,0 +1,12 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gem 'json'
4
+
5
+ group :development do
6
+ gem 'jeweler'
7
+ end
8
+
9
+ group :test do
10
+ gem 'rails', '3.0.10'
11
+ gem 'mocha'
12
+ end
@@ -0,0 +1,12 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gem 'json'
4
+
5
+ group :development do
6
+ gem 'jeweler'
7
+ end
8
+
9
+ group :test do
10
+ gem 'rails', '3.1.0'
11
+ gem 'mocha'
12
+ end
data/test/helper.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'rubygems'
2
2
  require 'test/unit'
3
+ require 'fileutils'
3
4
 
4
5
  $LOAD_PATH.unshift(File.dirname(__FILE__))
5
6
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
metadata CHANGED
@@ -1,50 +1,51 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: postageapp
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.12
4
5
  prerelease:
5
- version: 1.0.11
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Oleg Khabarov, The Working Group Inc
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2011-06-22 00:00:00 Z
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
12
+ date: 2011-09-14 00:00:00.000000000 -04:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
16
  name: json
17
- prerelease: false
18
- requirement: &id001 !ruby/object:Gem::Requirement
17
+ requirement: &70287819364600 !ruby/object:Gem::Requirement
19
18
  none: false
20
- requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
23
- version: 1.4.6
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
22
+ version: '0'
24
23
  type: :runtime
25
- version_requirements: *id001
26
- - !ruby/object:Gem::Dependency
27
- name: mocha
28
24
  prerelease: false
29
- requirement: &id002 !ruby/object:Gem::Requirement
25
+ version_requirements: *70287819364600
26
+ - !ruby/object:Gem::Dependency
27
+ name: jeweler
28
+ requirement: &70287819362900 !ruby/object:Gem::Requirement
30
29
  none: false
31
- requirements:
32
- - - ">="
33
- - !ruby/object:Gem::Version
34
- version: 0.9.8
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
35
34
  type: :development
36
- version_requirements: *id002
37
- description: Gem that interfaces with PostageApp.com service to send emails from web apps
35
+ prerelease: false
36
+ version_requirements: *70287819362900
37
+ description: Gem that interfaces with PostageApp.com service to send emails from web
38
+ apps
38
39
  email: oleg@twg.ca
39
40
  executables: []
40
-
41
41
  extensions: []
42
-
43
- extra_rdoc_files:
42
+ extra_rdoc_files:
44
43
  - LICENSE
45
44
  - README.md
46
- files:
45
+ files:
47
46
  - .document
47
+ - .travis.yml
48
+ - Gemfile
48
49
  - LICENSE
49
50
  - README.md
50
51
  - Rakefile
@@ -70,6 +71,9 @@ files:
70
71
  - rails/init.rb
71
72
  - test/configuration_test.rb
72
73
  - test/failed_request_test.rb
74
+ - test/gemfiles/Gemfile.rails-2.3.x
75
+ - test/gemfiles/Gemfile.rails-3.0.x
76
+ - test/gemfiles/Gemfile.rails-3.1.x
73
77
  - test/helper.rb
74
78
  - test/live_test.rb
75
79
  - test/mailer/action_mailer_2/notifier.rb
@@ -96,32 +100,33 @@ files:
96
100
  - test/rails_initialization_test.rb
97
101
  - test/request_test.rb
98
102
  - test/response_test.rb
103
+ has_rdoc: true
99
104
  homepage: http://github.com/postageapp/postageapp-ruby
100
- licenses: []
101
-
105
+ licenses:
106
+ - MIT
102
107
  post_install_message:
103
108
  rdoc_options: []
104
-
105
- require_paths:
109
+ require_paths:
106
110
  - lib
107
- required_ruby_version: !ruby/object:Gem::Requirement
111
+ required_ruby_version: !ruby/object:Gem::Requirement
108
112
  none: false
109
- requirements:
110
- - - ">="
111
- - !ruby/object:Gem::Version
112
- version: "0"
113
- required_rubygems_version: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - ! '>='
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
117
+ segments:
118
+ - 0
119
+ hash: -1447981717329273579
120
+ required_rubygems_version: !ruby/object:Gem::Requirement
114
121
  none: false
115
- requirements:
116
- - - ">="
117
- - !ruby/object:Gem::Version
118
- version: "0"
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
119
126
  requirements: []
120
-
121
127
  rubyforge_project:
122
- rubygems_version: 1.7.2
128
+ rubygems_version: 1.6.2
123
129
  signing_key:
124
130
  specification_version: 3
125
131
  summary: Easier way to send email from web apps
126
132
  test_files: []
127
-