recurly 2.0.2 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of recurly might be problematic. Click here for more details.

data/README.markdown CHANGED
@@ -12,7 +12,7 @@ Recurly is packaged as a Ruby gem. We recommend you install it with
12
12
  [Bundler](http://gembundler.com/) by adding the following line to your Gemfile:
13
13
 
14
14
  ``` ruby
15
- gem 'recurly', '~> 2.0.2'
15
+ gem 'recurly', '~> 2.0.3'
16
16
  ```
17
17
 
18
18
  Recurly will automatically use [Nokogiri](http://nokogiri.org/) (for a nice
@@ -45,6 +45,16 @@ The default currency is USD. To override with a different code:
45
45
  Recurly.default_currency = 'EUR' # Assign nil to disable the default entirely.
46
46
  ```
47
47
 
48
+ The client library currently uses a Net::HTTP adapter. If you need to
49
+ configure the settings passed to Net::HTTP (e.g., an SSL certificates path),
50
+ make sure you assign them before you make any requests:
51
+
52
+ ``` ruby
53
+ Recurly::API.net_http = {
54
+ :ca_path => "/etc/ssl/certs"
55
+ }
56
+ ```
57
+
48
58
 
49
59
  ## Usage
50
60
 
@@ -52,7 +62,7 @@ Instructions and examples are available on
52
62
  [Recurly's documentation site](http://docs.recurly.com/api/basics).
53
63
 
54
64
  Recurly's gem API is available
55
- [here](http://rubydoc.info/gems/recurly/2.0.2/frames).
65
+ [here](http://rubydoc.info/gems/recurly/2.0.3/frames).
56
66
 
57
67
 
58
68
  ## Contributing
@@ -4,6 +4,23 @@ module Recurly
4
4
  class API
5
5
  module Net
6
6
  module HTTPAdapter
7
+ # A hash of Net::HTTP settings configured before the request.
8
+ #
9
+ # @return [Hash]
10
+ def net_http
11
+ @net_http ||= {}
12
+ end
13
+
14
+ # Used to store any Net::HTTP settings.
15
+ #
16
+ # @example
17
+ # Recurly::API.net_http = {
18
+ # :verify_mode => OpenSSL::SSL::VERIFY_PEER,
19
+ # :ca_path => "/etc/ssl/certs",
20
+ # :ca_file => "/opt/local/share/curl/curl-ca-bundle.crt"
21
+ # }
22
+ attr_writer :net_http
23
+
7
24
  private
8
25
 
9
26
  METHODS = {
@@ -30,6 +47,7 @@ module Recurly
30
47
  end
31
48
  http = ::Net::HTTP.new uri.host, uri.port
32
49
  http.use_ssl = uri.scheme == 'https'
50
+ net_http.each_pair { |key, value| http.send "#{key}=", value }
33
51
 
34
52
  if Recurly.logger
35
53
  Recurly.log :info, "===> %s %s" % [request.method, uri]
@@ -46,7 +46,7 @@ module Recurly
46
46
  end
47
47
 
48
48
  def plan_code
49
- plan.plan_code if plan.respond_to? :plan_code
49
+ self[:plan_code] ||= (plan.plan_code if plan.respond_to? :plan_code)
50
50
  end
51
51
 
52
52
  def plan_code= plan_code
@@ -2,7 +2,7 @@ module Recurly
2
2
  module Version
3
3
  MAJOR = 2
4
4
  MINOR = 0
5
- PATCH = 2
5
+ PATCH = 3
6
6
  PRE = nil
7
7
 
8
8
  VERSION = [MAJOR, MINOR, PATCH, PRE].compact.join('.').freeze
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: recurly
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 0
9
- - 2
10
- version: 2.0.2
9
+ - 3
10
+ version: 2.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Recurly