fastly 1.7.0 → 1.8.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5c4e9505c38a1b0faecb9f4736028f0f65e97aeb
4
- data.tar.gz: 0551e76c05ef7cf3ef0a6273ad9b3c5386741c44
3
+ metadata.gz: 07ab59c8a33988a1cdba00d6e6e62fcedd7a2809
4
+ data.tar.gz: d221e2543260cc4c304c56f83279611e46292e6d
5
5
  SHA512:
6
- metadata.gz: a097ce55c406517e7d35e70beb08381bf7f49f5e0aac21f42be35d1fe3c2a2b9c78ce17342675590484d9e71501e2d84e73098f6310795d3fc146c748de8f7b8
7
- data.tar.gz: fef8fa3bb0a808fc7644107592c9195e77d85708cacad79c42a11cfbcf17f878597177045ec7b072a8f791974c401f91fba52bad31a0b07c0797840301417ff9
6
+ metadata.gz: 2e9b68fbf8853932a05b2cecdfbd7a43915040d4e32e2ee35425875cb117efc4dff2fd9ed82254eb8d805d9aa38ba619fb022e5536c634b214a06dee60f46f7f
7
+ data.tar.gz: 2df93cc60a1f698386dc1a0ea2590d7fb2060d4136386fe10ae8356e81a4378bc58517b51b34ab82c2049519ea6f2a33a6d5ae6ac60bbf137b77c13376b44c9d
data/README.md CHANGED
@@ -182,6 +182,16 @@ fastly-ruby has not been audited for thread-safety. If you are performing
182
182
  actions that require multiple threads (such as performing many purges) we
183
183
  recommend you use the API directly.
184
184
 
185
+ ### Debugging notes
186
+
187
+ You can pass a `:debug` argument to the initializer. This will output verbose HTTP logs for all API interactions. For example, the following will print logs to STDERR:
188
+
189
+ ```
190
+ client = Fastly.new(debug: STDERR, api_key: 'YOUR_API_KEY')
191
+ ```
192
+
193
+ This option should not be used in a production setting as all HTTP headers, request parameters, and bodies will be logged, which may include sensitive information.
194
+
185
195
  ## Contributing
186
196
 
187
197
  1. Fork it
@@ -11,6 +11,7 @@ group :development, :test do
11
11
  gem "minitest", "~> 5.3.4"
12
12
  gem "pry"
13
13
  gem "webmock"
14
+ gem "public_suffix", "~> 1.4.6"
14
15
  end
15
16
 
16
17
  gemspec :path => "../"
@@ -18,18 +18,19 @@ class Fastly
18
18
  @customer = opts.fetch(:customer, nil)
19
19
  @oldpurge = opts.fetch(:use_old_purge_method, false)
20
20
 
21
- base = opts.fetch(:base_url, DEFAULT_URL)
22
- uri = URI.parse(base)
23
- options = if uri.is_a? URI::HTTPS
24
- {
25
- use_ssl: true,
26
- verify_mode: OpenSSL::SSL::VERIFY_PEER
27
- }
28
- else
29
- {}
30
- end
31
-
32
- @http = Net::HTTP.start(uri.host, uri.port, options)
21
+ base = opts.fetch(:base_url, DEFAULT_URL)
22
+ uri = URI.parse(base)
23
+
24
+ @http = Net::HTTP.new(uri.host, uri.port, :ENV, nil, nil, nil)
25
+
26
+ # handle TLS connections outside of development
27
+ @http.verify_mode = OpenSSL::SSL::VERIFY_PEER
28
+ @http.use_ssl = uri.scheme.downcase == 'https'
29
+
30
+ # debug http interactions if specified
31
+ @http.set_debug_output(opts[:debug]) if opts[:debug]
32
+
33
+ @http.start
33
34
 
34
35
  return self unless fully_authed?
35
36
 
@@ -1,4 +1,4 @@
1
1
  # The current version of the library
2
2
  class Fastly
3
- VERSION = "1.7.0"
3
+ VERSION = "1.8.0"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastly
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fastly
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-24 00:00:00.000000000 Z
11
+ date: 2017-01-17 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Client library for the Fastly acceleration system
14
14
  email:
@@ -100,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
100
  version: '0'
101
101
  requirements: []
102
102
  rubyforge_project:
103
- rubygems_version: 2.5.1
103
+ rubygems_version: 2.5.2
104
104
  signing_key:
105
105
  specification_version: 4
106
106
  summary: Client library for the Fastly acceleration system