Skip to content

Commit c8ed62c

Browse files
authored
Merge pull request #177 from j05h/ruby-3.2-support
Add support for Ruby 3.2
2 parents eec22ad + 3f1c8ad commit c8ed62c

File tree

10 files changed

+79
-56
lines changed

10 files changed

+79
-56
lines changed

Diff for: .circleci/config.yml

+19-19
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@ orbs:
77
defaults: &defaults
88
notify_failure: false
99

10-
ruby_2_6_defaults: &ruby_2_6_defaults
11-
<<: *defaults
12-
e:
13-
name: ruby/ruby
14-
ruby-version: '2.6'
15-
1610
ruby_2_7_defaults: &ruby_2_7_defaults
1711
<<: *defaults
1812
e:
@@ -31,21 +25,14 @@ ruby_3_1_defaults: &ruby_3_1_defaults
3125
name: ruby/ruby
3226
ruby-version: '3.1'
3327

28+
ruby_3_2_defaults: &ruby_3_2_defaults
29+
<<: *defaults
30+
e:
31+
name: ruby/ruby
32+
ruby-version: '3.2'
33+
3434
workflows:
3535
version: 2
36-
ruby_2_6:
37-
jobs:
38-
- ruby/bundle-audit:
39-
<<: *ruby_2_6_defaults
40-
name: ruby-2_6-bundle_audit
41-
- ruby/rubocop:
42-
<<: *ruby_2_6_defaults
43-
name: ruby-2_6-rubocop
44-
- ruby/rspec-unit:
45-
<<: *ruby_2_6_defaults
46-
name: ruby-2_6-rspec_unit
47-
db: false
48-
code-climate: false
4936
ruby_2_7:
5037
jobs:
5138
- ruby/bundle-audit:
@@ -84,3 +71,16 @@ workflows:
8471
name: ruby-3_1-rspec_unit
8572
db: false
8673
code-climate: false
74+
ruby_3_2:
75+
jobs:
76+
- ruby/bundle-audit:
77+
<<: *ruby_3_2_defaults
78+
name: ruby-3_2-bundle_audit
79+
- ruby/rubocop:
80+
<<: *ruby_3_2_defaults
81+
name: ruby-3_2-rubocop
82+
- ruby/rspec-unit:
83+
<<: *ruby_3_2_defaults
84+
name: ruby-3_2-rspec_unit
85+
db: false
86+
code-climate: false

Diff for: .rubocop.yml

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
AllCops:
2-
TargetRubyVersion: 2.6
2+
TargetRubyVersion: 2.7
33
NewCops: enable
44
SuggestExtensions: false
55
Exclude:
@@ -30,10 +30,5 @@ Style/FormatStringToken:
3030
Naming/VariableNumber:
3131
Enabled: false
3232

33-
########################################################################################################################
34-
# TO FIX
35-
########################################################################################################################
36-
37-
# we should deprecate Ruby < 2.7 support ASAP
3833
Gemspec/RequiredRubyVersion:
39-
Enabled: false
34+
Enabled: true

Diff for: CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Your contribution here.
33

44
* [#000](https://github.com/bigcommerce/bigcommerce-api-ruby/pull/000): Brief description here. - [@username](https://github.com/username).
5+
* [#174](https://github.com/bigcommerce/bigcommerce-api-ruby/pull/174): Drop support for ruby 2.6; Add support for Ruby 3.2 - [@j05h](https://github.com/j05h).
56

67
## 1.0.2
78

Diff for: CONTRIBUTING.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ git checkout -b my-feature-branch
2727
Ensure that you can build the project and run tests.
2828

2929
```
30-
bundle install
31-
bundle exec rake
30+
bin/setup
3231
```
3332

3433
#### Installing the gem locally (useful to run examples)
@@ -86,7 +85,8 @@ git push origin my-feature-branch
8685

8786
#### Make a Pull Request
8887

89-
Go to https://github.com/contributor/bigcommerce-api-ruby and select your feature branch. Click the 'Pull Request' button and fill out the form. Pull requests are usually reviewed within a few days.
88+
Go to https://github.com/contributor/bigcommerce-api-ruby and select your feature branch. Click the 'Pull Request'
89+
button and fill out the form. Pull requests are usually reviewed within a few days.
9090

9191
#### Rebase
9292

@@ -115,4 +115,5 @@ git push origin my-feature-branch -f
115115

116116
#### Check on Your Pull Request
117117

118-
Go back to your pull request after a few minutes and see whether it passed muster with Travis-CI. Everything should look green, otherwise fix issues and amend your commit as described above.
118+
Go back to your pull request after a few minutes and see whether it passed muster with CircleCI. Everything should
119+
look green, otherwise fix issues and amend your commit as described above.

Diff for: Gemfile

+11
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,14 @@
33
source 'https://rubygems.org'
44

55
gemspec
6+
7+
gem 'bundler'
8+
gem 'bundler-audit', '~> 0.6'
9+
gem 'dotenv', '>= 2.0'
10+
gem 'pry', '>= 0.12'
11+
gem 'rake', '>= 12.0'
12+
gem 'rspec', '~> 3.8'
13+
gem 'rspec_junit_formatter', '~> 0.4'
14+
gem 'rubocop', '~> 1.0'
15+
gem 'rubocop-performance', '>= 1.5'
16+
gem 'simplecov', '~> 0.15'

Diff for: README.md

+25-11
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
[![Test Coverage](https://api.codeclimate.com/v1/badges/d1ba1b74a2a74a26e8b4/test_coverage)](https://codeclimate.com/github/bigcommerce/bigcommerce-api-ruby/test_coverage)
66
[![Maintainability](https://api.codeclimate.com/v1/badges/d1ba1b74a2a74a26e8b4/maintainability)](https://codeclimate.com/github/bigcommerce/bigcommerce-api-ruby/maintainability)
77

8-
This is the official BigCommerce API client to support our Stores API. You can find more information about becoming a BigCommerce developer here: [developer.bigcommerce.com](http://developer.bigcommerce.com).
8+
This is the official BigCommerce API client to support our Stores API. You can find more information about becoming a
9+
BigCommerce developer here: [developer.bigcommerce.com](http://developer.bigcommerce.com).
910

1011

1112
## Installation
@@ -23,18 +24,21 @@ gem 'bigcommerce', '~> 1.0'
2324

2425
## Requirements
2526

26-
- Ruby 2.0.0 or newer (Ruby 2.7+ is preferred)
27+
- Ruby 2.7.5 or newer (Ruby 3.0+ is preferred)
2728

2829
## Getting Started
2930
To make requests to our API, you must register as a developer and have your credentials ready.
3031

31-
Also very important: For the OAuth authentication mechanism, the resources to which you have acccess depend on the scopes that the merchant has granted to your application. For more information about Store API scopes, see: [OAuth Scopes](https://developer.bigcommerce.com/api/scopes).
32+
Also very important: For the OAuth authentication mechanism, the resources to which you have acccess depend on the
33+
scopes that the merchant has granted to your application. For more information about Store API scopes,
34+
see: [OAuth Scopes](https://developer.bigcommerce.com/api/scopes).
3235

3336
## Authentication
3437
We currently have two different authentication schemes that you can select, depending on your use case.
3538

3639
### OAuth
37-
OAuth apps can be submitted to [BigCommerce App Store](https://www.bigcommerce.com/apps), allowing other merchants to install these apps in their BigCommerce stores.
40+
OAuth apps can be submitted to [BigCommerce App Store](https://www.bigcommerce.com/apps), allowing other merchants to install these apps in their
41+
BigCommerce stores.
3842

3943
__[More Information](https://developer.bigcommerce.com/api/using-oauth-intro)__
4044

@@ -62,7 +66,9 @@ end
6266

6367
### Basic Authentication (Legacy)
6468

65-
To get all the basic auth credentials, simply visit your store admin page, and navigate to the `Advanced Settings` > `Legacy API Settings`. Once there, you can create a new legacy API account on which to authenticate.
69+
To get all the basic auth credentials, simply visit your store admin page, and navigate to the
70+
`Advanced Settings` > `Legacy API Settings`. Once there, you can create a new legacy API account on which to authenticate.
71+
6672

6773
```rb
6874
Bigcommerce.configure do |config|
@@ -75,7 +81,8 @@ end
7581

7682
__SSL Configuration__
7783

78-
If you are using your own, self-signed, certificate, you can pass SSL options to Faraday. This is not required, but might be useful in special edge cases.
84+
If you are using your own, self-signed, certificate, you can pass SSL options to Faraday. This is not required, but
85+
might be useful in special edge cases.
7986

8087
```rb
8188
Bigcommerce.configure do |config|
@@ -95,7 +102,8 @@ For more information about configuring SSL with Faraday, please see the followin
95102
- [Faraday: Setting up SSL certificates](https://github.com/lostisland/faraday/wiki/Setting-up-SSL-certificates)
96103

97104
### Customer Login API
98-
If you want to generate tokens for storefront login using the Customer Login API, you need to configure your app's client secret.
105+
If you want to generate tokens for storefront login using the Customer Login API, you need to configure your app's
106+
client secret.
99107

100108
- ```store_hash```: The store hash of the store you are operating against.
101109
- ```client_id```: Obtained from the on the BigCommerce [Developer Portal's](http://developer.bigcommerce.com) "My Apps" section.
@@ -110,7 +118,8 @@ end
110118
```
111119

112120
## Usage
113-
For full examples of using the API client, please see the [examples folder](examples) and refer to BigCommerce's [developer documentation](https://developer.bigcommerce.com/api).
121+
For full examples of using the API client, please see the [examples folder](examples) and refer to
122+
BigCommerce's [developer documentation](https://developer.bigcommerce.com/api).
114123

115124
Example:
116125

@@ -129,11 +138,16 @@ Bigcommerce::System.time
129138

130139
### Thread Safety
131140

132-
The `Bigcommerce.configure` method is NOT thread-safe. This mechanism is designed for applications or CLI's (command-line interfaces) where thread safety is not a concern. If you need to guarantee thread safety, we support this alternative mechanism to make thread-safe API requests:
141+
The `Bigcommerce.configure` method is NOT thread-safe. This mechanism is designed for applications or
142+
CLIs (command-line interfaces) where thread safety is not a concern. If you need to guarantee thread safety, we support
143+
this alternative mechanism to make thread-safe API requests:
133144

134-
Rather then setting up a single `connection` for all API requests, you would construct a new connection for each thread. If you can ensure that each of these connections is stored in a thread-safe manner, you can pass the `connection` as you query the resource.
145+
Rather then setting up a single `connection` for all API requests, construct a new connection for each thread.
146+
If you can ensure that each of these connections is stored in a thread-safe manner, you can pass the `connection` as
147+
you query the resource.
135148

136-
This connection is nothing more than a `Faraday::Connection` – so if you want to write your own, or to use your own adapters, you can feel free. Please refer to this gem's [connection class](https://github.com/bigcommerce/bigcommerce-api-ruby/blob/master/lib/bigcommerce/connection.rb) for more details.
149+
This connection is nothing more than a `Faraday::Connection` – so if you want to write your own, or to use your own
150+
adapters, you can feel free. Please refer to this gem's [connection class](https://github.com/bigcommerce/bigcommerce-api-ruby/blob/master/lib/bigcommerce/connection.rb) for more details.
137151

138152
##### OAuth
139153

Diff for: RELEASING.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Releasing Bigcommerce API Client
22

3-
There're no particular rules about when to release the Bigcommerce API client. Release bug fixes frequently, features not so frequently, and breaking API changes rarely.
3+
There are no particular rules about when to release the Bigcommerce API client. Release bug fixes frequently, features
4+
not so frequently, and breaking API changes rarely.
45

56
### Before A Release
67

@@ -11,7 +12,8 @@ bundle install
1112
bundle exec rake
1213
```
1314

14-
This will ensure both style and that all the specs pass locally. Next, check that the last build succeeded in [CircleCI](https://app.circleci.com/pipelines/github/bigcommerce/bigcommerce-api-ruby) for all supported platforms.
15+
This will ensure both style and that all the specs pass locally. Next, check that the last build succeeded
16+
in [CircleCI](https://app.circleci.com/pipelines/github/bigcommerce/bigcommerce-api-ruby) for all supported platforms.
1517

1618
Increment the version, modify [lib/bigcommerce/version.rb](lib/bigcommerce/version.rb).
1719

Diff for: bigcommerce.gemspec

+1-12
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
77
s.name = 'bigcommerce'
88
s.version = Bigcommerce::VERSION
99
s.platform = Gem::Platform::RUBY
10-
s.required_ruby_version = '>= 2.0.0'
10+
s.required_ruby_version = '>= 2.7.5'
1111
s.license = 'MIT'
1212

1313
s.authors = ['BigCommerce Engineering']
@@ -19,17 +19,6 @@ Gem::Specification.new do |s|
1919
s.require_paths = ['lib']
2020
s.files = Dir['README.md', 'lib/**/*', 'bigcommerce.gemspec']
2121

22-
s.add_development_dependency 'bundler'
23-
s.add_development_dependency 'bundler-audit', '~> 0.6'
24-
s.add_development_dependency 'dotenv', '>= 2.0'
25-
s.add_development_dependency 'pry', '>= 0.12'
26-
s.add_development_dependency 'rake', '>= 12.0'
27-
s.add_development_dependency 'rspec', '~> 3.8'
28-
s.add_development_dependency 'rspec_junit_formatter', '~> 0.4'
29-
s.add_development_dependency 'rubocop', '~> 1.0'
30-
s.add_development_dependency 'rubocop-performance', '>= 1.5'
31-
s.add_development_dependency 'simplecov', '~> 0.15'
32-
3322
s.add_dependency 'faraday', '~> 1.1.0'
3423
s.add_dependency 'faraday_middleware', '~> 1.0'
3524
s.add_dependency 'hashie', '>= 3.4', '~> 4'

Diff for: bin/setup

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
IFS=$'\n\t'
4+
set -vx
5+
6+
bundle install
7+
bundle exec rspec -p
8+
bundle exec rubocop -P
9+
bundle audit update
10+
bundle audit

Diff for: lib/bigcommerce/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module Bigcommerce
4-
VERSION = '1.0.2'
4+
VERSION = '1.1.0.pre'
55
end

0 commit comments

Comments
 (0)