drnic-ruby-efax 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/lib/efax.rb +6 -6
  3. data/ruby-efax.gemspec +1 -1
  4. metadata +1 -1
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.1
1
+ 1.1.0
data/lib/efax.rb CHANGED
@@ -80,15 +80,15 @@ module EFax
80
80
  end
81
81
 
82
82
  class OutboundRequest < Request
83
- def self.post(name, company, fax_number, subject, html_content)
84
- xml_request = xml(name, company, fax_number, subject, html_content)
83
+ def self.post(name, company, fax_number, subject, content, content_type = :html)
84
+ xml_request = xml(name, company, fax_number, subject, content, content_type)
85
85
  response = Net::HTTPS.start(EFax::URI.host, EFax::URI.port) do |https|
86
86
  https.post(EFax::URI.path, params(xml_request), EFax::HEADERS)
87
87
  end
88
88
  OutboundResponse.new(response)
89
89
  end
90
90
 
91
- def self.xml(name, company, fax_number, subject, html_content)
91
+ def self.xml(name, company, fax_number, subject, content, content_type = :html)
92
92
  xml_request = ""
93
93
  xml = Builder::XmlMarkup.new(:target => xml_request, :indent => 2 )
94
94
  xml.instruct! :xml, :version => '1.0'
@@ -116,9 +116,9 @@ module EFax
116
116
  end
117
117
  xml.Files do
118
118
  xml.File do
119
- encoded_html = Base64.encode64(html_content).delete("\n")
120
- xml.FileContents(encoded_html)
121
- xml.FileType("html")
119
+ encoded_content = Base64.encode64(content).delete("\n")
120
+ xml.FileContents(encoded_content)
121
+ xml.FileType(content_type.to_s)
122
122
  end
123
123
  end
124
124
  end
data/ruby-efax.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ruby-efax}
8
- s.version = "1.0.1"
8
+ s.version = "1.1.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Szymon Nowak", "Pawel Kozlowski"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: drnic-ruby-efax
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Szymon Nowak