elibom 0.1.0 → 0.2.0

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.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/elibom.rb +11 -1
  3. metadata +21 -9
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 2cb4c2a09c7c07d4a9305fdbc2b3657e6ef8a00f
4
+ data.tar.gz: 2a130f51cae6e98ee775b21c5f12899210e95735
5
+ SHA512:
6
+ metadata.gz: 9f0cb25d30e70ba3d29e871eb04e989cac128b9b7b6fd4296bccec30ea8ea67fb7d0e8075d426d7e45feaa6b4d79bae119e50e7319b9cee3e86465a3c0511c6e
7
+ data.tar.gz: 072eda6131c62d086cdd7b4918ce220393723d09ed68751b10a1c3e49437dbbfb37e607e1f20d5ac8f3f6bc30ec9af3d57ebd9ead3d723a3eb8c59fc08559ef8
data/lib/elibom.rb CHANGED
@@ -8,7 +8,7 @@ module Elibom
8
8
  class Client
9
9
 
10
10
  def initialize(options={})
11
- @host = options[:host] || "http://www.elibom.com"
11
+ @host = options[:host] || "https://www.elibom.com"
12
12
  @user = options[:user]
13
13
  @api_password = options[:api_password]
14
14
 
@@ -49,6 +49,11 @@ module Elibom
49
49
  uri = URI.parse("#{@host}#{resource}")
50
50
  http = Net::HTTP.new(uri.host, uri.port)
51
51
 
52
+ if uri.scheme == 'https'
53
+ http.use_ssl = true
54
+ # http.verify_mode = OpenSSL::SSL::VERIFY_NONE
55
+ end
56
+
52
57
  request = Net::HTTP::Get.new(uri.request_uri)
53
58
  request.basic_auth @user, @api_password
54
59
  request['Accept'] = 'application/json'
@@ -67,6 +72,11 @@ module Elibom
67
72
  uri = URI.parse("#{@host}#{resource}")
68
73
  http = Net::HTTP.new(uri.host, uri.port)
69
74
 
75
+ if uri.scheme == 'https'
76
+ http.use_ssl = true
77
+ # http.verify_mode = OpenSSL::SSL::VERIFY_NONE
78
+ end
79
+
70
80
  request = Net::HTTP::Post.new(uri.path)
71
81
  request.basic_auth @user, @api_password
72
82
  request['Content-Type'] = 'application/json'
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elibom
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
5
- prerelease:
4
+ version: 0.2.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - German Escobar
@@ -10,7 +9,21 @@ autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
11
  date: 2013-07-28 00:00:00.000000000 Z
13
- dependencies: []
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: json
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
14
27
  description: A client of the Elibom API
15
28
  email: german.escobar@elibom.com
16
29
  executables: []
@@ -20,26 +33,25 @@ files:
20
33
  - lib/elibom.rb
21
34
  homepage: http://rubygems.org/gems/elibom
22
35
  licenses: []
36
+ metadata: {}
23
37
  post_install_message:
24
38
  rdoc_options: []
25
39
  require_paths:
26
40
  - lib
27
41
  required_ruby_version: !ruby/object:Gem::Requirement
28
- none: false
29
42
  requirements:
30
- - - ! '>='
43
+ - - '>='
31
44
  - !ruby/object:Gem::Version
32
45
  version: '0'
33
46
  required_rubygems_version: !ruby/object:Gem::Requirement
34
- none: false
35
47
  requirements:
36
- - - ! '>='
48
+ - - '>='
37
49
  - !ruby/object:Gem::Version
38
50
  version: '0'
39
51
  requirements: []
40
52
  rubyforge_project:
41
- rubygems_version: 1.8.23
53
+ rubygems_version: 2.0.6
42
54
  signing_key:
43
- specification_version: 3
55
+ specification_version: 4
44
56
  summary: Elibom API client
45
57
  test_files: []