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 CHANGED
@@ -1,9 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- knu (0.0.1)
4
+ knu (0.0.3)
5
5
  crack
6
- httpi
7
6
  rack
8
7
 
9
8
  GEM
@@ -11,8 +10,6 @@ GEM
11
10
  specs:
12
11
  crack (0.3.2)
13
12
  diff-lcs (1.1.3)
14
- httpi (2.0.2)
15
- rack
16
13
  nokogiri (1.5.6)
17
14
  rack (1.5.2)
18
15
  rake (10.0.3)
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-12"
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
- request = HTTPI::Request.new(WEBSERVICE_URL)
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 = HTTPI.post(request)
78
+ response = http.request(request)
76
79
  handle_response(response.body)
77
80
  end
78
81
 
data/lib/knu/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Knu
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/knu.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  require "knu/knu"
2
2
  require "knu/version"
3
3
 
4
- require "httpi"
4
+ require "net/http"
5
5
  require "crack"
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.2
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 00:00:00.000000000 Z
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