knu 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -4
- data/knu.gemspec +1 -2
- data/lib/knu/knu.rb +8 -5
- data/lib/knu/version.rb +1 -1
- data/lib/knu.rb +1 -1
- metadata +2 -18
data/Gemfile.lock
CHANGED
data/knu.gemspec
CHANGED
@@ -6,7 +6,7 @@ require "knu/version"
|
|
6
6
|
Gem::Specification.new do |gem|
|
7
7
|
gem.name = "knu"
|
8
8
|
gem.version = Knu::VERSION
|
9
|
-
gem.date = "2012-03-
|
9
|
+
gem.date = "2012-03-13"
|
10
10
|
gem.summary = "Client Knu Webservice"
|
11
11
|
gem.description = "Client Knu Webservice"
|
12
12
|
gem.authors = ["Rodrigo Panachi"]
|
@@ -20,7 +20,6 @@ Gem::Specification.new do |gem|
|
|
20
20
|
gem.require_paths = ["lib"]
|
21
21
|
|
22
22
|
gem.add_runtime_dependency "rack"
|
23
|
-
gem.add_runtime_dependency "httpi"
|
24
23
|
gem.add_runtime_dependency "crack"
|
25
24
|
|
26
25
|
gem.add_development_dependency "rake"
|
data/lib/knu/knu.rb
CHANGED
@@ -66,13 +66,16 @@ class Knu
|
|
66
66
|
end
|
67
67
|
|
68
68
|
def request(xml)
|
69
|
-
|
69
|
+
uri = URI.parse(WEBSERVICE_URL)
|
70
|
+
|
71
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
72
|
+
http.use_ssl = true
|
73
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
74
|
+
|
75
|
+
request = Net::HTTP::Post.new(uri.request_uri)
|
70
76
|
request.body = xml
|
71
|
-
request.open_timeout = 10 # sec
|
72
|
-
request.read_timeout = 30 # sec
|
73
|
-
request.auth.ssl.verify_mode = :none
|
74
77
|
|
75
|
-
response =
|
78
|
+
response = http.request(request)
|
76
79
|
handle_response(response.body)
|
77
80
|
end
|
78
81
|
|
data/lib/knu/version.rb
CHANGED
data/lib/knu.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-03-
|
12
|
+
date: 2012-03-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|
@@ -27,22 +27,6 @@ dependencies:
|
|
27
27
|
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: '0'
|
30
|
-
- !ruby/object:Gem::Dependency
|
31
|
-
name: httpi
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
|
-
requirements:
|
35
|
-
- - ! '>='
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
version: '0'
|
38
|
-
type: :runtime
|
39
|
-
prerelease: false
|
40
|
-
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- - ! '>='
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
version: '0'
|
46
30
|
- !ruby/object:Gem::Dependency
|
47
31
|
name: crack
|
48
32
|
requirement: !ruby/object:Gem::Requirement
|