puzzle 0.2.2 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.2
1
+ 0.3.0
@@ -13,11 +13,23 @@ module Puzzle
13
13
  # @return [String] The API token for your user.
14
14
  attr_accessor :token
15
15
 
16
+ # @return [String] The path to the certificate
17
+ attr_accessor :ca_path
18
+
19
+ # @return [String] The path to the certificate
20
+ attr_accessor :ca_file
21
+
22
+ # @return [String] The verification method used by ssl
23
+ attr_accessor :verify_mode
24
+
16
25
  # Instantiated from {Puzzle.configuration}. Sets defaults.
17
26
  def initialize
18
27
  self.host = "www.jigsaw.com"
19
28
  self.port = 443
20
29
  self.format = "json"
30
+ self.verify_mode = OpenSSL::SSL::VERIFY_PEER
31
+ self.ca_path = '/etc/ssl/certs' if File.exists?('/etc/ssl/certs') # Ubuntu
32
+ self.ca_file = '/opt/local/share/curl/curl-ca-bundle.crt' if File.exists?('/opt/local/share/curl/curl-ca-bundle.crt') # Mac OS X
21
33
  end
22
34
  end
23
35
  end
@@ -39,13 +39,16 @@ module Puzzle
39
39
 
40
40
  def self.request
41
41
  http = Net::HTTP.new(Puzzle.configuration.host, Puzzle.configuration.port)
42
+ http.verify_mode = Puzzle.configuration.verify_mode
43
+ http.ca_path = Puzzle.configuration.ca_path
44
+ http.ca_file = Puzzle.configuration.ca_file
42
45
  http.use_ssl = true
43
46
  http
44
47
  end
45
48
 
46
49
  def self.uri(path, options = {})
47
50
  format = Puzzle.configuration.format
48
- "/rest/#{path}.#{format}?#{hash_to_query_string(options)}"
51
+ "/rest#{path}.#{format}?#{hash_to_query_string(options)}"
49
52
  end
50
53
 
51
54
  def self.hash_to_query_string(hash)
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "puzzle"
8
- s.version = "0.2.2"
8
+ s.version = "0.3.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Simon Gingras"]
12
- s.date = "2011-12-05"
12
+ s.date = "2011-12-13"
13
13
  s.description = "Puzzle makes it easy to acces the jigsaw REST api"
14
14
  s.email = "thegingman@gmail.com"
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: puzzle
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.2
5
+ version: 0.3.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Simon Gingras
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-12-05 00:00:00 Z
13
+ date: 2011-12-13 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: json
@@ -107,7 +107,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
- hash: 1169810377787967225
110
+ hash: 1916436741450112247
111
111
  segments:
112
112
  - 0
113
113
  version: "0"