bigcommerce-oauth-api 1.4.1 → 1.4.2

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: 7ba098105b05e84a8943eb2bdea8c55f535a6d79
4
- data.tar.gz: 39b16841f846996dec05b66059de51c5ac0b2ac5
3
+ metadata.gz: 40bedc8bbe5c9f8e79843bcc2a699b8abe8f5579
4
+ data.tar.gz: a8df9242b984e6aa21b6c556d0871c023230b328
5
5
  SHA512:
6
- metadata.gz: 8a577194ff7933ebc652065cde142d1ea163a42beff6453fb5d3f2437fafffe350396944068ad6a353df024a342846da24084c3865e05c3bbdaa0b18e3dba732
7
- data.tar.gz: deb9bc17ce5806bc6425d3c21c862d187942b369a09ade027f390d23e8cf10053aa34705f9cd4a2492492ba419d57964012beb9f3926960312454c7411dead08
6
+ metadata.gz: a012109cd0603937f2f28fc866e152e170e386cb82bf2fa86f84e5189ebc7042a84ee3aa70981d1439f92bf0efd27bd8ca1d7d4ddf26bfb8c371841d2017ae89
7
+ data.tar.gz: 48c87c77862f2edd33a708c6c45a86001a1dd9c4cac8bdc826a844ee131a462efca958e6db9bca1ceb535785f2479d08480d2674c3e8b8d005f723b420a6f04a
@@ -1,3 +1,9 @@
1
+ ### 1.4.2 (2017-07-09)
2
+
3
+ Other:
4
+
5
+ - update gem dependencies
6
+
1
7
  ### 1.4.1 (2017-06-25)
2
8
 
3
9
  Features:
@@ -3,7 +3,7 @@ require File.expand_path('../lib/bigcommerce-oauth-api/version', __FILE__)
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'bigcommerce-oauth-api'
5
5
  s.version = BigcommerceOAuthAPI::VERSION.dup
6
- s.date = '2017-06-25'
6
+ s.date = '2017-07-09'
7
7
  s.summary = "Ruby client library for Bigcommerce APIs with OAuth and basic authentication support"
8
8
  s.description = "Connect Ruby applications to Bigcommerce APIs through OAuth or basic authentication"
9
9
  s.authors = ["Christian Orthmann"]
@@ -14,13 +14,13 @@ Gem::Specification.new do |s|
14
14
  s.homepage = 'http://rubygems.org/gems/bigcommerce-oauth-api'
15
15
  s.license = 'MIT'
16
16
 
17
- s.add_development_dependency('rake', '~> 10')
17
+ s.add_development_dependency('rake', '~> 12')
18
18
  s.add_development_dependency('rspec', '~> 3')
19
- s.add_development_dependency('webmock', '~> 1')
19
+ s.add_development_dependency('webmock', '~> 3')
20
20
  s.add_development_dependency('simplecov', '~> 0')
21
21
  s.add_development_dependency('simplecov-rcov', '~> 0')
22
22
  s.add_development_dependency('yard', '~> 0')
23
23
  s.add_runtime_dependency('faraday', '~> 0')
24
24
  s.add_runtime_dependency('faraday_middleware', '~> 0')
25
- s.add_runtime_dependency('activesupport', '>= 3.0.0', '< 5.0.0')
25
+ s.add_runtime_dependency('activesupport', '>= 3.0.0', '< 6.0.0')
26
26
  end
@@ -1,3 +1,3 @@
1
1
  module BigcommerceOAuthAPI
2
- VERSION = '1.4.1'.freeze
2
+ VERSION = '1.4.2'.freeze
3
3
  end
@@ -1,13 +1,14 @@
1
1
  require 'simplecov'
2
2
  require 'simplecov-rcov'
3
3
  require 'codeclimate-test-reporter'
4
+ require 'base64'
4
5
 
6
+ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
7
+ SimpleCov::Formatter::HTMLFormatter,
8
+ SimpleCov::Formatter::RcovFormatter,
9
+ CodeClimate::TestReporter::Formatter
10
+ ])
5
11
  SimpleCov.start do
6
- formatter SimpleCov::Formatter::MultiFormatter[
7
- SimpleCov::Formatter::HTMLFormatter,
8
- SimpleCov::Formatter::RcovFormatter,
9
- CodeClimate::TestReporter::Formatter
10
- ]
11
12
  add_group('BigcommerceOAuthAPI', 'lib/bigcommerce-oauth-api')
12
13
  add_group('Faraday', 'lib/faraday')
13
14
  add_group('Specs', 'spec')
@@ -26,26 +27,31 @@ WebMock.disable_net_connect!(:allow => 'codeclimate.com')
26
27
  def client_request_url(client, path)
27
28
  if client.is_legacy?
28
29
  protocol, domain = client.endpoint.split('://')
29
- "#{protocol}://#{client.user_name}:#{client.api_key}@#{domain}/api/v2/#{path}"
30
+ "#{protocol}://#{domain}/api/v2/#{path}"
30
31
  else
31
32
  "#{client.endpoint}/#{client.store_hash}/v2/#{path}"
32
33
  end
33
34
  end
34
35
 
36
+ def with_basic_auth(client, stub)
37
+ return stub unless client.is_legacy?
38
+ stub.with(headers: { 'Authorization' => "Basic #{Base64.encode64(client.user_name+':'+client.api_key).chomp}"})
39
+ end
40
+
35
41
  def stub_get(client, path)
36
- stub_request(:get, client_request_url(client, path))
42
+ with_basic_auth(client,stub_request(:get, client_request_url(client, path)))
37
43
  end
38
44
 
39
45
  def stub_post(client, path)
40
- stub_request(:post, client_request_url(client, path))
46
+ with_basic_auth(client,stub_request(:post, client_request_url(client, path)))
41
47
  end
42
48
 
43
49
  def stub_put(client, path)
44
- stub_request(:put, client_request_url(client, path))
50
+ with_basic_auth(client,stub_request(:put, client_request_url(client, path)))
45
51
  end
46
52
 
47
53
  def stub_delete(client, path)
48
- stub_request(:delete, client_request_url(client, path))
54
+ with_basic_auth(client,stub_request(:delete, client_request_url(client, path)))
49
55
  end
50
56
 
51
57
  def a_get(client, path)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bigcommerce-oauth-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Orthmann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-25 00:00:00.000000000 Z
11
+ date: 2017-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '10'
19
+ version: '12'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '10'
26
+ version: '12'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1'
47
+ version: '3'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1'
54
+ version: '3'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: simplecov
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -131,7 +131,7 @@ dependencies:
131
131
  version: 3.0.0
132
132
  - - "<"
133
133
  - !ruby/object:Gem::Version
134
- version: 5.0.0
134
+ version: 6.0.0
135
135
  type: :runtime
136
136
  prerelease: false
137
137
  version_requirements: !ruby/object:Gem::Requirement
@@ -141,7 +141,7 @@ dependencies:
141
141
  version: 3.0.0
142
142
  - - "<"
143
143
  - !ruby/object:Gem::Version
144
- version: 5.0.0
144
+ version: 6.0.0
145
145
  description: Connect Ruby applications to Bigcommerce APIs through OAuth or basic
146
146
  authentication
147
147
  email: christian.orthmann@gmail.com