dopis_online_client 0.2.4 → 1.0.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/.travis.yml +5 -0
- data/Gemfile +1 -1
- data/LICENSE +3 -1
- data/README.md +20 -0
- data/Rakefile +3 -4
- data/dopis_online_client.gemspec +29 -27
- data/lib/dopis_online_client.rb +20 -4
- data/lib/dopis_online_client/request.rb +104 -30
- data/lib/dopis_online_client/response.rb +4 -6
- data/lib/dopis_online_client/version.rb +1 -1
- data/test/fixtures/success.xml +20 -10
- data/test/test_helper.rb +4 -2
- data/test/unit/dopis_online_client_test.rb +1 -1
- data/test/unit/request_test.rb +21 -8
- data/test/unit/response_test.rb +5 -5
- metadata +32 -14
- data/README.rdoc +0 -20
data/.travis.yml
ADDED
data/Gemfile
CHANGED
data/LICENSE
CHANGED
data/README.md
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# dopis_online_client
|
2
|
+
|
3
|
+
[](https://travis-ci.org/kraxnet/dopis_online_client)
|
4
|
+
|
5
|
+
DopisOnline je služba České pošty, s.p., která "umožnuje zákazníkovi podání dokumentu v elektronické formě (formát PDF), přičemž dodáná je uskutečněno formou klasického vytištěného dopisu."
|
6
|
+
|
7
|
+
Vice informaci na https://online.postservis.cz/Download/DopisOnline/DopisOnline.pdf
|
8
|
+
|
9
|
+
## Usage:
|
10
|
+
|
11
|
+
require 'lib/dopis_online_client'
|
12
|
+
|
13
|
+
DopisOnlineClient.base_uri 'https://online.postservis.cz/cmdedopis'
|
14
|
+
DopisOnlineClient.auth('jmeno','heslo')
|
15
|
+
|
16
|
+
DopisOnlineClient::Request.send("letter.pdf")
|
17
|
+
|
18
|
+
## Copyright
|
19
|
+
|
20
|
+
Copyright (c) 2009-2013 Jiří Kubíček, KRAXNET s.r.o.. See LICENSE for details.
|
data/Rakefile
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
require 'bundler'
|
2
|
-
Bundler::GemHelper.install_tasks
|
1
|
+
require 'bundler/gem_tasks'
|
3
2
|
|
4
3
|
task :default => :test
|
5
4
|
|
@@ -29,7 +28,7 @@ begin
|
|
29
28
|
require 'sdoc'
|
30
29
|
rescue LoadError
|
31
30
|
end
|
32
|
-
require '
|
31
|
+
require 'rdoc/task'
|
33
32
|
Rake::RDocTask.new do |rdoc|
|
34
33
|
rdoc.rdoc_dir = 'rdoc'
|
35
34
|
rdoc.title = "Tire"
|
@@ -50,4 +49,4 @@ rescue LoadError
|
|
50
49
|
task :rcov do
|
51
50
|
abort "RCov is not available. In order to run rcov, you must: sudo gem install rcov"
|
52
51
|
end
|
53
|
-
end
|
52
|
+
end
|
data/dopis_online_client.gemspec
CHANGED
@@ -1,37 +1,39 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
4
|
require "dopis_online_client/version"
|
4
5
|
|
5
|
-
Gem::Specification.new do |
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.name = "dopis_online_client"
|
8
|
+
gem.version = DopisOnlineClient::VERSION
|
9
|
+
gem.platform = Gem::Platform::RUBY
|
10
|
+
gem.authors = ["Jiri Kubicek", "Josef Pospisil"]
|
11
|
+
gem.email = ["jiri.kubicek@kraxnet.cz", "josef.pospisil@laststar.eu"]
|
12
|
+
gem.homepage = "http://github.com/kraxnet/dopis_online_client"
|
13
|
+
gem.summary = %q{Dopis Online Client Library}
|
14
|
+
gem.description = %q{Klientská knihovna pro práci se službou Dopis Online České pošty}
|
14
15
|
|
15
|
-
|
16
|
+
gem.rubyforge_project = "dopis_online_client"
|
16
17
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
18
|
+
gem.files = `git ls-files`.split($/)
|
19
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
20
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
21
|
+
gem.require_paths = ["lib"]
|
21
22
|
|
22
|
-
|
23
|
-
|
23
|
+
gem.extra_rdoc_files = [ "README.md", "LICENSE" ]
|
24
|
+
gem.rdoc_options = [ "--charset=UTF-8" ]
|
24
25
|
|
25
|
-
|
26
|
+
gem.required_rubygems_version = ">= 1.3.6"
|
26
27
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
28
|
+
gem.add_dependency "rake", ">= 0.8.0"
|
29
|
+
gem.add_dependency "bundler", ">= 1.0"
|
30
|
+
gem.add_dependency "httmultiparty"
|
31
|
+
gem.add_dependency "multi_xml"
|
32
|
+
gem.add_dependency "builder"
|
31
33
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
34
|
+
gem.add_development_dependency "turn"
|
35
|
+
gem.add_development_dependency "shoulda"
|
36
|
+
gem.add_development_dependency "sdoc"
|
37
|
+
gem.add_development_dependency "simplecov"
|
38
|
+
gem.add_development_dependency "fakeweb"
|
37
39
|
end
|
data/lib/dopis_online_client.rb
CHANGED
@@ -6,22 +6,38 @@ require 'dopis_online_client/status_request'
|
|
6
6
|
|
7
7
|
module DopisOnlineClient
|
8
8
|
|
9
|
-
|
9
|
+
# Public: Sets the service uri
|
10
|
+
#
|
11
|
+
# uri - string with base uri of the service
|
12
|
+
#
|
13
|
+
def self.base_uri(path = nil)
|
10
14
|
path ? @base_uri = path : @base_uri
|
11
15
|
end
|
12
16
|
|
17
|
+
# Public: Sets authentication credentials
|
18
|
+
#
|
19
|
+
# username - string with username
|
20
|
+
# password - password
|
21
|
+
#
|
13
22
|
def self.auth(username, password)
|
14
|
-
@username=username
|
15
|
-
@password=password
|
23
|
+
@username = username
|
24
|
+
@password = password
|
16
25
|
end
|
17
26
|
|
27
|
+
# Public: Gets the current username
|
28
|
+
#
|
29
|
+
# Returns string with the username
|
30
|
+
#
|
18
31
|
def self.username
|
19
32
|
@username
|
20
33
|
end
|
21
34
|
|
35
|
+
# Public: Gets the current password
|
36
|
+
#
|
37
|
+
# Returns string with the password
|
38
|
+
#
|
22
39
|
def self.password
|
23
40
|
@password
|
24
41
|
end
|
25
|
-
|
26
42
|
end
|
27
43
|
|
@@ -1,46 +1,120 @@
|
|
1
|
+
require 'builder'
|
2
|
+
require 'base64'
|
3
|
+
require 'ostruct'
|
4
|
+
|
1
5
|
module DopisOnlineClient
|
2
6
|
class Request
|
3
7
|
|
4
8
|
include HTTMultiParty
|
5
9
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
DEFAULTS = {:postage_type => 195, # common
|
11
|
+
:coupon_type => 0, # do not print
|
12
|
+
:print_type => 0, # one-sided print
|
13
|
+
:sender_type => 2, # from 1st page of the document
|
14
|
+
:recipient_type => 2,
|
15
|
+
:format => :xml
|
16
|
+
}
|
17
|
+
|
18
|
+
|
19
|
+
attr_reader :pdf_file_path, :options
|
20
|
+
|
21
|
+
# Public: Sends the request to the service
|
22
|
+
#
|
23
|
+
# pdf_file_path - string with the path to the pdf file, that will be send
|
24
|
+
# params - hash with the additional parameters
|
25
|
+
#
|
26
|
+
# Returns new DopisOnlineClient::Response
|
27
|
+
#
|
28
|
+
def self.send(pdf_file_path, params = {})
|
29
|
+
@request = new(pdf_file_path, params).deliver
|
30
|
+
end
|
31
|
+
|
32
|
+
# Public: Initializes library
|
33
|
+
#
|
34
|
+
# pdf_file_path - string with the path to the pdf file, that will be send
|
35
|
+
# params - hash with the additional parameters
|
36
|
+
#
|
37
|
+
def initialize(pdf_file_path, params = {})
|
38
|
+
params.merge!(DEFAULTS)
|
39
|
+
@options = OpenStruct.new(params)
|
40
|
+
@pdf_file_path = pdf_file_path
|
14
41
|
self.class.base_uri DopisOnlineClient.base_uri
|
15
42
|
end
|
16
|
-
|
43
|
+
|
44
|
+
# Public: Delivers payload to service
|
45
|
+
#
|
46
|
+
# Returns new DopisOnlineClient::Response
|
47
|
+
#
|
17
48
|
def deliver
|
18
|
-
response = self.class.post '/dopisonline.php', :body =>
|
19
|
-
:user => DopisOnlineClient.username,
|
20
|
-
:passwd => DopisOnlineClient.password,
|
21
|
-
:barvatisku => @color,
|
22
|
-
:typvyplatneho => @postage_type,
|
23
|
-
:typuhrady => @payment_type,
|
24
|
-
:typvystupu => @format.to_s,
|
25
|
-
:soubor => File.new(@pdf_file_path)
|
26
|
-
}
|
49
|
+
response = self.class.post '/dopisonline/donApi.php', :body => body
|
27
50
|
parsed_response = parse_response(response.body)
|
28
51
|
DopisOnlineClient::Response.new(parsed_response, response.body, response.code)
|
29
52
|
end
|
30
|
-
|
53
|
+
|
54
|
+
# Internal: parses the body of the response
|
55
|
+
#
|
56
|
+
# body - string with service response
|
57
|
+
#
|
58
|
+
# Returns nil if the body is not present
|
59
|
+
#
|
31
60
|
def parse_response(body)
|
32
61
|
return nil if body.nil? or body.empty?
|
33
|
-
case
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
end
|
40
|
-
|
41
|
-
def self.send(params)
|
42
|
-
@request = new(params).deliver
|
62
|
+
case options.format
|
63
|
+
when :xml
|
64
|
+
MultiXml.parse(body)
|
65
|
+
else
|
66
|
+
body
|
67
|
+
end
|
43
68
|
end
|
44
69
|
|
70
|
+
# Internal: returns hash with request body
|
71
|
+
#
|
72
|
+
# Returns Hash with request body
|
73
|
+
#
|
74
|
+
def body
|
75
|
+
xml = Builder::XmlMarkup.new( :indent => 2 )
|
76
|
+
xml.instruct! :xml, :encoding => "UTF-8"
|
77
|
+
xml.dataroot do |dataroot|
|
78
|
+
dataroot.typvyplatneho options.postage_type
|
79
|
+
dataroot.typtisku options.print_type
|
80
|
+
dataroot.tiskpoukazky options.coupon_type
|
81
|
+
dataroot.typods options.sender_type
|
82
|
+
dataroot.typadr options.recipient_type
|
83
|
+
dataroot.odsid nil
|
84
|
+
dataroot.odsobrazek nil
|
85
|
+
dataroot.odsfirma nil
|
86
|
+
dataroot.odsosoba nil
|
87
|
+
dataroot.odsulice nil
|
88
|
+
dataroot.odscp nil
|
89
|
+
dataroot.odsco nil
|
90
|
+
dataroot.odsobec nil
|
91
|
+
dataroot.odspsc nil
|
92
|
+
dataroot.adrosloveni nil
|
93
|
+
dataroot.adrfirma nil
|
94
|
+
dataroot.adrosoba nil
|
95
|
+
dataroot.adrulice nil
|
96
|
+
dataroot.adrcp nil
|
97
|
+
dataroot.adrco nil
|
98
|
+
dataroot.adrobec nil
|
99
|
+
dataroot.adrpsc nil
|
100
|
+
dataroot.adriso nil
|
101
|
+
dataroot.soubory do |soubory|
|
102
|
+
soubory.soubor(:mimeType => "", :name => @pdf_file_path.split("/").last) do |soubor|
|
103
|
+
soubor.dataSoubor Base64.encode64(File.read(@pdf_file_path))
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
xml_file = Tempfile.new(["DopisOnlineNew_1_1", ".xml"])
|
109
|
+
xml_file.write xml.target!
|
110
|
+
xml_file.flush
|
111
|
+
xml_file.rewind
|
112
|
+
|
113
|
+
{
|
114
|
+
:user => DopisOnlineClient.username,
|
115
|
+
:password => DopisOnlineClient.password,
|
116
|
+
:soubor => xml_file
|
117
|
+
}
|
118
|
+
end
|
45
119
|
end
|
46
|
-
end
|
120
|
+
end
|
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'crack'
|
2
|
-
|
3
1
|
module DopisOnlineClient
|
4
2
|
class Response
|
5
3
|
attr_accessor :body, :code
|
@@ -22,22 +20,22 @@ module DopisOnlineClient
|
|
22
20
|
|
23
21
|
# Jméno odeslaného souboru
|
24
22
|
def filename
|
25
|
-
success_result["soubor"]
|
23
|
+
success_result["soubory"]["soubor"]["name"]
|
26
24
|
end
|
27
25
|
|
28
26
|
# Počet stránek
|
29
27
|
def pages_count
|
30
|
-
success_result["
|
28
|
+
success_result["pocet_stranek"].to_i
|
31
29
|
end
|
32
30
|
|
33
31
|
# Kód objednávky
|
34
32
|
def order_code
|
35
|
-
success_result["
|
33
|
+
success_result["kod_objednavky"]
|
36
34
|
end
|
37
35
|
|
38
36
|
# Podací číslo
|
39
37
|
def tracking_number
|
40
|
-
success_result["
|
38
|
+
success_result["podaci_cislo"]
|
41
39
|
end
|
42
40
|
|
43
41
|
# Datum podání
|
data/test/fixtures/success.xml
CHANGED
@@ -1,12 +1,22 @@
|
|
1
|
-
<?xml version="1.0" encoding="
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<zakazka>
|
3
|
-
<
|
4
|
-
|
5
|
-
<
|
6
|
-
<
|
7
|
-
<
|
8
|
-
<
|
9
|
-
<
|
10
|
-
<
|
11
|
-
<
|
3
|
+
<chyby stav="0">
|
4
|
+
</chyby>
|
5
|
+
<typvyplatneho>195</typvyplatneho>
|
6
|
+
<typtisku>0</typtisku>
|
7
|
+
<tiskpoukazky>0</tiskpoukazky>
|
8
|
+
<kod_objednavky>20130717183959_77667</kod_objednavky>
|
9
|
+
<podaci_cislo></podaci_cislo>
|
10
|
+
<podaci_posta>370 20</podaci_posta>
|
11
|
+
<datum_podani>2013-07-17</datum_podani>
|
12
|
+
<cena>11.31 Kč</cena>
|
13
|
+
<pocet_listu>1</pocet_listu>
|
14
|
+
<pocet_stranek>1</pocet_stranek>
|
15
|
+
<xmlsoubor>DopisOnlineNew_1_120130717-84759-1z06ta5.xml</xmlsoubor>
|
16
|
+
<soubory>
|
17
|
+
<soubor name="1234.pdf">
|
18
|
+
<pozice>1</pozice>
|
19
|
+
<pocet_stranek>1</pocet_stranek>
|
20
|
+
</soubor>
|
21
|
+
</soubory>
|
12
22
|
</zakazka>
|
data/test/test_helper.rb
CHANGED
data/test/unit/request_test.rb
CHANGED
@@ -4,20 +4,33 @@ module DopisOnlineClient
|
|
4
4
|
class RequestTest < Test::Unit::TestCase
|
5
5
|
|
6
6
|
context "Request#deliver" do
|
7
|
-
|
8
7
|
setup do
|
9
|
-
FakeWeb.register_uri(:post, "https://online3.postservis.cz/
|
8
|
+
FakeWeb.register_uri(:post, "https://online3.postservis.cz/dopisonline/donApi.php",
|
9
|
+
:body => File.read(File.join(File.dirname(__FILE__), '../fixtures/success.xml')))
|
10
10
|
|
11
|
-
DopisOnlineClient.base_uri 'https://online3.postservis.cz/
|
12
|
-
DopisOnlineClient.auth('jmeno','heslo')
|
13
|
-
@
|
11
|
+
DopisOnlineClient.base_uri 'https://online3.postservis.cz/'
|
12
|
+
DopisOnlineClient.auth('jmeno', 'heslo')
|
13
|
+
@filename = File.join(File.dirname(__FILE__), '../fixtures/letter.pdf')
|
14
|
+
@request = DopisOnlineClient::Request.new(@filename)
|
14
15
|
end
|
15
16
|
|
16
|
-
should "
|
17
|
-
assert_equal
|
17
|
+
should "set default options for sending" do
|
18
|
+
assert_equal 195, @request.options.postage_type
|
19
|
+
assert_equal 0, @request.options.coupon_type
|
20
|
+
assert_equal 0, @request.options.print_type
|
21
|
+
assert_equal 2, @request.options.sender_type
|
22
|
+
assert_equal 2, @request.options.recipient_type
|
23
|
+
assert_equal :xml, @request.options.format
|
18
24
|
end
|
19
25
|
|
20
|
-
|
26
|
+
should "set pdf_file_path" do
|
27
|
+
assert_equal @filename, @request.pdf_file_path
|
28
|
+
end
|
21
29
|
|
30
|
+
should "return DopisOnlineClient::Response" do
|
31
|
+
assert DopisOnlineClient::Response === @request.deliver
|
32
|
+
end
|
33
|
+
end
|
22
34
|
end
|
23
35
|
end
|
36
|
+
|
data/test/unit/response_test.rb
CHANGED
@@ -12,14 +12,14 @@ module DopisOnlineClient
|
|
12
12
|
assert_equal 0, response.failure_code
|
13
13
|
assert_nil response.failure_message
|
14
14
|
|
15
|
-
assert_equal "
|
15
|
+
assert_equal "1234.pdf", response.filename
|
16
16
|
assert_equal 1, response.pages_count
|
17
|
-
assert_equal
|
18
|
-
assert_equal
|
17
|
+
assert_equal "20130717183959_77667", response.order_code
|
18
|
+
assert_equal nil, response.tracking_number
|
19
19
|
# assert_equal Date.parse("2009-06-08"), response.success_result["datumpodani"]
|
20
20
|
assert_not_nil response.price
|
21
21
|
assert_equal false, response.color
|
22
|
-
assert_equal
|
22
|
+
assert_equal "195", response.shipping_method
|
23
23
|
end
|
24
24
|
|
25
25
|
should "parse failure correctly" do
|
@@ -33,7 +33,7 @@ module DopisOnlineClient
|
|
33
33
|
|
34
34
|
def load_response_from_file(filename)
|
35
35
|
body = File.read(File.join(File.dirname(__FILE__),'../fixtures',filename))
|
36
|
-
parsed_response =
|
36
|
+
parsed_response = MultiXml.parse(body)
|
37
37
|
DopisOnlineClient::Response.new(parsed_response, body, 200)
|
38
38
|
end
|
39
39
|
|
metadata
CHANGED
@@ -1,21 +1,22 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dopis_online_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
|
+
- 1
|
7
8
|
- 0
|
8
|
-
-
|
9
|
-
|
10
|
-
version: 0.2.4
|
9
|
+
- 1
|
10
|
+
version: 1.0.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jiri Kubicek
|
14
|
+
- Josef Pospisil
|
14
15
|
autorequire:
|
15
16
|
bindir: bin
|
16
17
|
cert_chain: []
|
17
18
|
|
18
|
-
date:
|
19
|
+
date: 2013-07-18 00:00:00 Z
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
21
22
|
name: rake
|
@@ -63,7 +64,7 @@ dependencies:
|
|
63
64
|
type: :runtime
|
64
65
|
version_requirements: *id003
|
65
66
|
- !ruby/object:Gem::Dependency
|
66
|
-
name:
|
67
|
+
name: multi_xml
|
67
68
|
prerelease: false
|
68
69
|
requirement: &id004 !ruby/object:Gem::Requirement
|
69
70
|
none: false
|
@@ -77,7 +78,7 @@ dependencies:
|
|
77
78
|
type: :runtime
|
78
79
|
version_requirements: *id004
|
79
80
|
- !ruby/object:Gem::Dependency
|
80
|
-
name:
|
81
|
+
name: builder
|
81
82
|
prerelease: false
|
82
83
|
requirement: &id005 !ruby/object:Gem::Requirement
|
83
84
|
none: false
|
@@ -88,10 +89,10 @@ dependencies:
|
|
88
89
|
segments:
|
89
90
|
- 0
|
90
91
|
version: "0"
|
91
|
-
type: :
|
92
|
+
type: :runtime
|
92
93
|
version_requirements: *id005
|
93
94
|
- !ruby/object:Gem::Dependency
|
94
|
-
name:
|
95
|
+
name: turn
|
95
96
|
prerelease: false
|
96
97
|
requirement: &id006 !ruby/object:Gem::Requirement
|
97
98
|
none: false
|
@@ -105,7 +106,7 @@ dependencies:
|
|
105
106
|
type: :development
|
106
107
|
version_requirements: *id006
|
107
108
|
- !ruby/object:Gem::Dependency
|
108
|
-
name:
|
109
|
+
name: shoulda
|
109
110
|
prerelease: false
|
110
111
|
requirement: &id007 !ruby/object:Gem::Requirement
|
111
112
|
none: false
|
@@ -119,7 +120,7 @@ dependencies:
|
|
119
120
|
type: :development
|
120
121
|
version_requirements: *id007
|
121
122
|
- !ruby/object:Gem::Dependency
|
122
|
-
name:
|
123
|
+
name: sdoc
|
123
124
|
prerelease: false
|
124
125
|
requirement: &id008 !ruby/object:Gem::Requirement
|
125
126
|
none: false
|
@@ -133,7 +134,7 @@ dependencies:
|
|
133
134
|
type: :development
|
134
135
|
version_requirements: *id008
|
135
136
|
- !ruby/object:Gem::Dependency
|
136
|
-
name:
|
137
|
+
name: simplecov
|
137
138
|
prerelease: false
|
138
139
|
requirement: &id009 !ruby/object:Gem::Requirement
|
139
140
|
none: false
|
@@ -146,21 +147,37 @@ dependencies:
|
|
146
147
|
version: "0"
|
147
148
|
type: :development
|
148
149
|
version_requirements: *id009
|
150
|
+
- !ruby/object:Gem::Dependency
|
151
|
+
name: fakeweb
|
152
|
+
prerelease: false
|
153
|
+
requirement: &id010 !ruby/object:Gem::Requirement
|
154
|
+
none: false
|
155
|
+
requirements:
|
156
|
+
- - ">="
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
hash: 3
|
159
|
+
segments:
|
160
|
+
- 0
|
161
|
+
version: "0"
|
162
|
+
type: :development
|
163
|
+
version_requirements: *id010
|
149
164
|
description: "Klientsk\xC3\xA1 knihovna pro pr\xC3\xA1ci se slu\xC5\xBEbou Dopis Online \xC4\x8Cesk\xC3\xA9 po\xC5\xA1ty"
|
150
165
|
email:
|
151
166
|
- jiri.kubicek@kraxnet.cz
|
167
|
+
- josef.pospisil@laststar.eu
|
152
168
|
executables: []
|
153
169
|
|
154
170
|
extensions: []
|
155
171
|
|
156
172
|
extra_rdoc_files:
|
157
|
-
- README.
|
173
|
+
- README.md
|
158
174
|
- LICENSE
|
159
175
|
files:
|
160
176
|
- .gitignore
|
177
|
+
- .travis.yml
|
161
178
|
- Gemfile
|
162
179
|
- LICENSE
|
163
|
-
- README.
|
180
|
+
- README.md
|
164
181
|
- Rakefile
|
165
182
|
- dopis_online_client.gemspec
|
166
183
|
- lib/dopis_online_client.rb
|
@@ -222,3 +239,4 @@ test_files:
|
|
222
239
|
- test/unit/request_test.rb
|
223
240
|
- test/unit/response_test.rb
|
224
241
|
- test/unit/status_request_test.rb
|
242
|
+
has_rdoc:
|
data/README.rdoc
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
= dopis_online_client
|
2
|
-
|
3
|
-
DopisOnline je sluzba Ceske posty, s.p., ktera "umoznuje zakaznikovi podani dokumentu v elektronické formě (formát PDF), přičemž dodání je uskutečněno formou klasického vytištěného dopisu."
|
4
|
-
|
5
|
-
Vice informaci na https://online.postservis.cz/Download/DopisOnline/DopisOnline.pdf
|
6
|
-
|
7
|
-
== Usage:
|
8
|
-
|
9
|
-
require 'lib/dopis_online_client'
|
10
|
-
|
11
|
-
DopisOnlineClient.base_uri 'https://online.postservis.cz/cmdedopis'
|
12
|
-
DopisOnlineClient.auth('jmeno','heslo')
|
13
|
-
|
14
|
-
DopisOnlineClient::Request.send(
|
15
|
-
:pdf_file_path=>"letter.pdf"
|
16
|
-
)
|
17
|
-
|
18
|
-
== Copyright
|
19
|
-
|
20
|
-
Copyright (c) 2009 Jiri Kubicek, KRAXNET s.r.o.. See LICENSE for details.
|