diff --git a/.document b/.document
index ecf36731..6f40d63c 100644
--- a/.document
+++ b/.document
@@ -1,5 +1,4 @@
-README.rdoc
+README.md
lib/**/*.rb
bin/*
-features/**/*.feature
LICENSE
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
new file mode 100644
index 00000000..e21342e5
--- /dev/null
+++ b/.github/FUNDING.yml
@@ -0,0 +1,13 @@
+# These are supported funding model platforms
+
+github: [pboling] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
+patreon: galtzo # Replace with a single Patreon username
+open_collective: # Replace with a single Open Collective username
+ko_fi: pboling # Replace with a single Ko-fi username
+tidelift: rubygems/oauth2 # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
+community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
+liberapay: pboling # Replace with a single Liberapay username
+issuehunt: pboling # Replace with a single IssueHunt username
+otechie: # Replace with a single Otechie username
+lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
+custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 00000000..a0267668
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,8 @@
+version: 2
+updates:
+ - package-ecosystem: bundler
+ directory: "/"
+ schedule:
+ interval: daily
+ time: "04:28"
+ open-pull-requests-limit: 10
\ No newline at end of file
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
new file mode 100644
index 00000000..0dc599b6
--- /dev/null
+++ b/.github/workflows/codeql-analysis.yml
@@ -0,0 +1,70 @@
+# For most projects, this workflow file will not need changing; you simply need
+# to commit it to your repository.
+#
+# You may wish to alter this file to override the set of languages analyzed,
+# or to provide custom queries or build logic.
+#
+# ******** NOTE ********
+# We have attempted to detect the languages in your repository. Please check
+# the `language` matrix defined below to confirm you have the correct set of
+# supported CodeQL languages.
+#
+name: "CodeQL"
+
+on:
+ push:
+ branches: [ main, "*-stable" ]
+ pull_request:
+ # The branches below must be a subset of the branches above
+ branches: [ main, "*-stable" ]
+ schedule:
+ - cron: '35 1 * * 5'
+
+jobs:
+ analyze:
+ name: Analyze
+ runs-on: ubuntu-latest
+ permissions:
+ actions: read
+ contents: read
+ security-events: write
+
+ strategy:
+ fail-fast: false
+ matrix:
+ language: [ 'ruby' ]
+ # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
+ # Learn more about CodeQL language support at https://git.io/codeql-language-support
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v2
+
+ # Initializes the CodeQL tools for scanning.
+ - name: Initialize CodeQL
+ uses: github/codeql-action/init@v1
+ with:
+ languages: ${{ matrix.language }}
+ # If you wish to specify custom queries, you can do so here or in a config file.
+ # By default, queries listed here will override any specified in a config file.
+ # Prefix the list here with "+" to use these queries and those in the config file.
+ # queries: ./path/to/local/query, your-org/your-repo/queries@main
+
+ # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
+ # If this step fails, then you should remove it and run the build manually (see below)
+ - name: Autobuild
+ uses: github/codeql-action/autobuild@v1
+
+ # ℹ️ Command-line programs to run using the OS shell.
+ # 📚 https://git.io/JvXDl
+
+ # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
+ # and modify them (or add more) to build your code if your project
+ # uses a compiled language
+
+ #- run: |
+ # make bootstrap
+ # make release
+
+ - name: Perform CodeQL Analysis
+ uses: github/codeql-action/analyze@v1
diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml
new file mode 100644
index 00000000..8cb14169
--- /dev/null
+++ b/.github/workflows/coverage.yml
@@ -0,0 +1,109 @@
+name: Code Coverage
+
+env:
+ CI_CODECOV: true
+ COVER_ALL: true
+
+on:
+ push:
+ branches:
+ - 'main'
+ - '*-maintenance'
+ - '*-dev'
+ - '*-stable'
+ tags:
+ - '!*' # Do not execute on tags
+ pull_request:
+ branches:
+ - '*'
+ # Allow manually triggering the workflow.
+ workflow_dispatch:
+
+# Cancels all previous workflow runs for the same branch that have not yet completed.
+concurrency:
+ # The concurrency group contains the workflow name and the branch name.
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ test:
+ name: Specs with Coverage - Ruby ${{ matrix.ruby }} ${{matrix.gemfile}} ${{ matrix.name_extra || '' }}
+ if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')"
+ strategy:
+ fail-fast: false
+ matrix:
+ experimental: [false]
+ rubygems:
+ - latest
+ bundler:
+ - latest
+ ruby:
+ - "2.7"
+
+ runs-on: ubuntu-latest
+ continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }}
+ steps:
+ - uses: amancevice/setup-code-climate@v0
+ name: CodeClimate Install
+ if: matrix.ruby == '2.7' && github.event_name != 'pull_request' && always()
+ with:
+ cc_test_reporter_id: ${{ secrets.CC_TEST_REPORTER_ID }}
+
+ - name: Checkout
+ uses: actions/checkout@v2
+
+ - name: Setup Ruby & Bundle
+ uses: ruby/setup-ruby@v1
+ with:
+ ruby-version: ${{ matrix.ruby }}
+ rubygems: ${{ matrix.rubygems }}
+ bundler: ${{ matrix.bundler }}
+ bundler-cache: true
+
+ - name: CodeClimate Pre-build Notification
+ run: cc-test-reporter before-build
+ if: matrix.ruby == '2.7' && github.event_name != 'pull_request' && always()
+ continue-on-error: ${{ matrix.experimental != 'false' }}
+
+ - name: Run tests
+ run: bundle exec rake test
+
+ - name: Code Coverage Summary Report
+ uses: irongut/CodeCoverageSummary@v1.2.0
+ with:
+ filename: ./coverage/coverage.xml
+ badge: true
+ fail_below_min: true
+ format: markdown
+ hide_branch_rate: true
+ hide_complexity: true
+ indicators: true
+ output: both
+ thresholds: '95 97'
+ continue-on-error: ${{ matrix.experimental != 'false' }}
+
+ - name: Add Coverage PR Comment
+ uses: marocchino/sticky-pull-request-comment@v2
+ if: matrix.ruby == '2.7' && github.event_name == 'pull_request' && always()
+ with:
+ recreate: true
+ path: code-coverage-results.md
+ continue-on-error: ${{ matrix.experimental != 'false' }}
+
+ - name: Coveralls
+ uses: coverallsapp/github-action@master
+ if: matrix.ruby == '2.7' && github.event_name != 'pull_request' && always()
+ with:
+ github-token: ${{ secrets.GITHUB_TOKEN }}
+ continue-on-error: ${{ matrix.experimental != 'false' }}
+
+# Using the codecov gem instead.
+# - name: CodeCov
+# uses: codecov/codecov-action@v2
+# if: matrix.ruby == '2.7' && github.event_name != 'pull_request' && always()
+# with:
+# files: ./coverage/coverage.xml
+# flags: unittests
+# name: codecov-upload
+# fail_ci_if_error: true
+# continue-on-error: ${{ matrix.experimental != 'false' }}
diff --git a/.github/workflows/danger.yml b/.github/workflows/danger.yml
new file mode 100644
index 00000000..b8fdb277
--- /dev/null
+++ b/.github/workflows/danger.yml
@@ -0,0 +1,44 @@
+name: What's up Danger?
+
+on:
+ pull_request:
+ branches:
+ - 'main'
+ - '*-stable'
+
+jobs:
+ danger:
+ runs-on: ubuntu-latest
+ env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
+ BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
+ if: false
+ # if: github.event_name == 'pull_request' # if only run pull request when multiple trigger workflow
+ strategy:
+ fail-fast: false
+ matrix:
+ gemfile:
+ - f2
+ rubygems:
+ - latest
+ bundler:
+ - latest
+ ruby:
+ - 2.7
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2
+ - name: Setup Ruby & Bundle
+ uses: ruby/setup-ruby@v1
+ with:
+ ruby-version: ${{ matrix.ruby }}
+ rubygems: ${{ matrix.rubygems }}
+ bundler: ${{ matrix.bundler }}
+ bundler-cache: true
+ - uses: MeilCli/danger-action@v5
+ with:
+ plugins_file: 'Gemfile'
+ install_path: 'vendor/bundle'
+ danger_file: 'Dangerfile'
+ danger_id: 'danger-pr'
+ env:
+ DANGER_GITHUB_API_TOKEN: ${{ secrets.DANGER_GITHUB_API_TOKEN }}
diff --git a/.github/workflows/heads.yml b/.github/workflows/heads.yml
new file mode 100644
index 00000000..3cf68f50
--- /dev/null
+++ b/.github/workflows/heads.yml
@@ -0,0 +1,70 @@
+name: Heads
+
+on:
+ push:
+ branches:
+ - 'main'
+ - '*-maintenance'
+ - '*-dev'
+ - '*-stable'
+ tags:
+ - '!*' # Do not execute on tags
+ pull_request:
+ branches:
+ - '*'
+ # Allow manually triggering the workflow.
+ workflow_dispatch:
+
+# Cancels all previous workflow runs for the same branch that have not yet completed.
+concurrency:
+ # The concurrency group contains the workflow name and the branch name.
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ test:
+ name: Specs - Ruby ${{ matrix.ruby }} ${{matrix.gemfile}} ${{ matrix.name_extra || '' }}
+ env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
+ BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
+ if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')"
+ strategy:
+ fail-fast: false
+ matrix:
+ experimental: [true]
+ gemfile:
+ - f0
+ - f1
+ - f2
+ rubygems:
+ - latest
+ bundler:
+ - latest
+ ruby:
+ - truffleruby+graalvm-head
+ - truffleruby-head
+ - jruby-head
+ - ruby-head
+ include:
+ # Includes a new variable experimental with a value of false
+ # for the matrix legs matching rubygems: latest, which is all of them.
+ # This is here for parity with the unsupported.yml
+ # This is a hack. Combined with continue-on-error it should allow us
+ # to have a workflow with allowed failure.
+ # This is the "supported" build matrix, so only the "head" builds are experimental here.
+ - rubygems: latest
+ experimental: true
+
+ runs-on: ubuntu-latest
+ continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }}
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2
+ - name: Setup Ruby & Bundle
+ uses: ruby/setup-ruby@v1
+ with:
+ ruby-version: ${{ matrix.ruby }}
+ rubygems: ${{ matrix.rubygems }}
+ bundler: ${{ matrix.bundler }}
+ bundler-cache: true
+ - name: Run tests
+ run: bundle exec rake test
diff --git a/.github/workflows/macos-ancient.yml b/.github/workflows/macos-ancient.yml
new file mode 100644
index 00000000..ee26cd1a
--- /dev/null
+++ b/.github/workflows/macos-ancient.yml
@@ -0,0 +1,57 @@
+name: Old MacOS
+
+on:
+ push:
+ branches:
+ - 'main'
+ - '*-maintenance'
+ - '*-dev'
+ - '*-stable'
+ tags:
+ - '!*' # Do not execute on tags
+ pull_request:
+ branches:
+ - '*'
+ # Allow manually triggering the workflow.
+ workflow_dispatch:
+
+# Cancels all previous workflow runs for the same branch that have not yet completed.
+concurrency:
+ # The concurrency group contains the workflow name and the branch name.
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ test:
+ name: Specs - Ruby ${{ matrix.ruby }} ${{matrix.gemfile}} ${{ matrix.name_extra || '' }}
+ env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
+ BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
+ if: false
+ # if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')"
+ strategy:
+ fail-fast: false
+ matrix:
+ experimental: [true]
+ gemfile:
+ - f0
+ rubygems:
+ - "2.7.11"
+ ruby:
+ - "1.9"
+ - "2.0"
+ - "2.1"
+ - "2.2"
+
+ runs-on: macos-10.15
+ continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }}
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2
+ - name: Setup Ruby & Bundle
+ uses: ruby/setup-ruby@v1
+ with:
+ ruby-version: ${{ matrix.ruby }}
+ rubygems: ${{ matrix.rubygems }}
+ bundler-cache: true
+ - name: Run tests
+ run: bundle exec rake test
diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml
new file mode 100644
index 00000000..940f230c
--- /dev/null
+++ b/.github/workflows/macos.yml
@@ -0,0 +1,60 @@
+name: MacOS
+
+on:
+ push:
+ branches:
+ - 'main'
+ - '*-maintenance'
+ - '*-dev'
+ - '*-stable'
+ tags:
+ - '!*' # Do not execute on tags
+ pull_request:
+ branches:
+ - '*'
+ # Allow manually triggering the workflow.
+ workflow_dispatch:
+
+# Cancels all previous workflow runs for the same branch that have not yet completed.
+concurrency:
+ # The concurrency group contains the workflow name and the branch name.
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ test:
+ name: Specs - Ruby ${{ matrix.ruby }} ${{matrix.gemfile}} ${{ matrix.name_extra || '' }}
+ env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
+ BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
+ if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')"
+ strategy:
+ fail-fast: false
+ matrix:
+ experimental: [true]
+ gemfile:
+ - f2
+ rubygems:
+ - latest
+ bundler:
+ - latest
+ ruby:
+ - "2.7"
+ - "3.0"
+ - "3.1"
+ - truffleruby
+ - jruby
+
+ runs-on: macos-latest
+ continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }}
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2
+ - name: Setup Ruby & Bundle
+ uses: ruby/setup-ruby@v1
+ with:
+ ruby-version: ${{ matrix.ruby }}
+ rubygems: ${{ matrix.rubygems }}
+ bundler: ${{ matrix.bundler }}
+ bundler-cache: true
+ - name: Run tests
+ run: bundle exec rake test
diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml
new file mode 100644
index 00000000..a489dccc
--- /dev/null
+++ b/.github/workflows/style.yml
@@ -0,0 +1,42 @@
+name: Code Style Checks
+
+on:
+ push:
+ branches:
+ - 'main'
+ - '*-maintenance'
+ - '*-dev'
+ - '*-stable'
+ tags:
+ - '!*' # Do not execute on tags
+ pull_request:
+ branches:
+ - '*'
+
+jobs:
+ rubocop:
+ name: Rubocop
+ if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')"
+ strategy:
+ fail-fast: false
+ matrix:
+ experimental: [false]
+ rubygems:
+ - latest
+ bundler:
+ - latest
+ ruby:
+ - 2.7
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2
+ - name: Setup Ruby & Bundle
+ uses: ruby/setup-ruby@v1
+ with:
+ ruby-version: ${{ matrix.ruby }}
+ rubygems: ${{ matrix.rubygems }}
+ bundler: ${{ matrix.bundler }}
+ bundler-cache: true
+ - name: Run Rubocop
+ run: bundle exec rubocop -DES
diff --git a/.github/workflows/supported.yml b/.github/workflows/supported.yml
new file mode 100644
index 00000000..9fe394dd
--- /dev/null
+++ b/.github/workflows/supported.yml
@@ -0,0 +1,62 @@
+name: Official Support
+
+on:
+ push:
+ branches:
+ - 'main'
+ - '*-maintenance'
+ - '*-dev'
+ - '*-stable'
+ tags:
+ - '!*' # Do not execute on tags
+ pull_request:
+ branches:
+ - '*'
+ # Allow manually triggering the workflow.
+ workflow_dispatch:
+
+# Cancels all previous workflow runs for the same branch that have not yet completed.
+concurrency:
+ # The concurrency group contains the workflow name and the branch name.
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ test:
+ name: Specs - Ruby ${{ matrix.ruby }} ${{matrix.gemfile}} ${{ matrix.name_extra || '' }}
+ env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
+ BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
+ if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')"
+ strategy:
+ fail-fast: false
+ matrix:
+ experimental: [false]
+ gemfile:
+ - f0
+ - f1
+ - f2
+ rubygems:
+ - latest
+ bundler:
+ - latest
+ ruby:
+ - "2.7"
+ - "3.0"
+ - "3.1"
+ - truffleruby
+ - jruby
+
+ runs-on: ubuntu-latest
+ continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }}
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2
+ - name: Setup Ruby & Bundle
+ uses: ruby/setup-ruby@v1
+ with:
+ ruby-version: ${{ matrix.ruby }}
+ rubygems: ${{ matrix.rubygems }}
+ bundler: ${{ matrix.bundler }}
+ bundler-cache: true
+ - name: Run tests
+ run: bundle exec rake test
diff --git a/.github/workflows/unsupported.yml b/.github/workflows/unsupported.yml
new file mode 100644
index 00000000..53bc31e6
--- /dev/null
+++ b/.github/workflows/unsupported.yml
@@ -0,0 +1,70 @@
+name: Unofficial Support
+
+on:
+ push:
+ branches:
+ - 'main'
+ - '*-maintenance'
+ - '*-dev'
+ - '*-stable'
+ tags:
+ - '!*' # Do not execute on tags
+ pull_request:
+ branches:
+ - '*'
+ # Allow manually triggering the workflow.
+ workflow_dispatch:
+
+# Cancels all previous workflow runs for the same branch that have not yet completed.
+concurrency:
+ # The concurrency group contains the workflow name and the branch name.
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ test:
+ name: Specs - Ruby ${{ matrix.ruby }} ${{matrix.gemfile}} ${{ matrix.name_extra || '' }}
+ env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
+ BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
+ if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')"
+ strategy:
+ fail-fast: false
+ matrix:
+ experimental: [false]
+ gemfile:
+ - f0
+ - f1
+ - f2
+ rubygems:
+ - latest
+ bundler:
+ - latest
+ ruby:
+ - "2.3"
+ - "2.4"
+ - "2.5"
+ - "2.6"
+ exclude:
+ - ruby: "2.3"
+ gemfile: "f1"
+ - ruby: "2.3"
+ gemfile: "f2"
+ - ruby: "2.4"
+ gemfile: "f2"
+ - ruby: "2.5"
+ gemfile: "f2"
+
+ runs-on: ubuntu-20.04
+ continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }}
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2
+ - name: Setup Ruby & Bundle
+ uses: ruby/setup-ruby@v1
+ with:
+ ruby-version: ${{ matrix.ruby }}
+ rubygems: ${{ matrix.rubygems }}
+ bundler: ${{ matrix.bundler }}
+ bundler-cache: true
+ - name: Run tests
+ run: bundle exec rake test
diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml
new file mode 100644
index 00000000..cd848566
--- /dev/null
+++ b/.github/workflows/windows.yml
@@ -0,0 +1,59 @@
+name: Windows
+
+on:
+ push:
+ branches:
+ - 'main'
+ - '*-maintenance'
+ - '*-dev'
+ - '*-stable'
+ tags:
+ - '!*' # Do not execute on tags
+ pull_request:
+ branches:
+ - '*'
+ # Allow manually triggering the workflow.
+ workflow_dispatch:
+
+# Cancels all previous workflow runs for the same branch that have not yet completed.
+concurrency:
+ # The concurrency group contains the workflow name and the branch name.
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ test:
+ name: Specs - Ruby ${{ matrix.ruby }} ${{matrix.gemfile}} ${{ matrix.name_extra || '' }}
+ env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
+ BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
+ if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')"
+ strategy:
+ fail-fast: false
+ matrix:
+ experimental: [true]
+ gemfile:
+ - f2
+ rubygems:
+ - latest
+ bundler:
+ - latest
+ ruby:
+ - "2.7"
+ - "3.0"
+ - "3.1"
+ - jruby
+
+ runs-on: windows-latest
+ continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }}
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2
+ - name: Setup Ruby & Bundle
+ uses: ruby/setup-ruby@v1
+ with:
+ ruby-version: ${{ matrix.ruby }}
+ rubygems: ${{ matrix.rubygems }}
+ bundler: ${{ matrix.bundler }}
+ bundler-cache: true
+ - name: Run tests
+ run: bundle exec rake test
diff --git a/.gitignore b/.gitignore
index 36762cf9..6480a03a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,4 +16,4 @@ rdoc/*
/gemfiles/*.gemfile.lock
# CI bundle
-/gemfiles/vendor/
\ No newline at end of file
+/gemfiles/vendor/
diff --git a/.rspec b/.rspec
index 09127182..3629a4a1 100644
--- a/.rspec
+++ b/.rspec
@@ -1,2 +1,4 @@
--color
--order random
+--require helper
+--format=documentation
diff --git a/.rubocop.yml b/.rubocop.yml
index c6a41973..d83a5c0a 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -1,20 +1,40 @@
-require: rubocop-rspec
+inherit_gem:
+ rubocop-lts: rubocop-lts.yml
+
+require:
+ - 'rubocop-rspec'
+ - 'rubocop-thread_safety'
+
inherit_from:
- .rubocop_todo.yml
- .rubocop_rspec.yml
+
AllCops:
DisplayCopNames: true # Display the name of the failing cops
- TargetRubyVersion: 2.1
Exclude:
- 'gemfiles/vendor/**/*'
- 'vendor/**/*'
- '**/.irbrc'
-Gemspec/RequiredRubyVersion:
- Enabled: false
-
-Metrics/BlockLength:
- Enabled: false
+#Metrics/BlockLength:
+# IgnoredMethods:
+# - context
+# - describe
+# - it
+# - shared_context
+# - shared_examples
+# - shared_examples_for
+# - namespace
+# - draw
+
+#Gemspec/RequiredRubyVersion:
+# Enabled: false
+
+Style/PercentLiteralDelimiters:
+ PreferredDelimiters:
+ default: '[]'
+ '%i': '()'
+ '%w': '[]'
Metrics/BlockNesting:
Max: 2
@@ -22,19 +42,16 @@ Metrics/BlockNesting:
Metrics/LineLength:
Enabled: false
-Metrics/MethodLength:
- Max: 15
-
Metrics/ParameterLists:
Max: 4
-Layout/AccessModifierIndentation:
+Style/AccessModifierIndentation:
EnforcedStyle: outdent
-Layout/DotPosition:
+Style/DotPosition:
EnforcedStyle: trailing
-Layout/SpaceInsideHashLiteralBraces:
+Style/SpaceInsideHashLiteralBraces:
EnforcedStyle: no_space
Lint/UnusedBlockArgument:
@@ -44,13 +61,6 @@ Lint/UnusedBlockArgument:
- 'vendor/**/*'
- '**/.irbrc'
-RSpec/DescribeClass:
- Exclude:
- - 'spec/examples/*'
-
-RSpec/NestedGroups:
- Enabled: false
-
Style/ClassVars:
Enabled: false
@@ -67,14 +77,44 @@ Style/Documentation:
Style/DoubleNegation:
Enabled: false
-Style/EmptyMethod:
- EnforcedStyle: expanded
+#Style/EmptyMethod:
+# EnforcedStyle: expanded
Style/Encoding:
Enabled: false
-Style/TrailingCommaInArrayLiteral:
+Style/TrailingCommaInLiteral:
EnforcedStyleForMultiline: comma
-Style/TrailingCommaInHashLiteral:
- EnforcedStyleForMultiline: comma
+#Style/TrailingCommaInArrayLiteral:
+# EnforcedStyleForMultiline: comma
+#
+#Style/TrailingCommaInHashLiteral:
+# EnforcedStyleForMultiline: comma
+
+Style/HashSyntax:
+ EnforcedStyle: hash_rockets
+
+Style/Lambda:
+ Enabled: false
+
+Style/SymbolArray:
+ Enabled: false
+
+Style/EachWithObject:
+ Enabled: false
+
+# Once we drop Rubies that lack support for __dir__ we can turn this on.
+#Style/ExpandPathArguments:
+# Enabled: false
+
+# On Ruby 1.9 array.to_h isn't available, needs to be Hash[array]
+#Style/HashConversion:
+# Enabled: false
+
+# Turn back on once old Rubies are dropped
+Style/IfUnlessModifier:
+ Enabled: false
+
+#Style/SafeNavigation:
+# Enabled: false
diff --git a/.rubocop_rspec.yml b/.rubocop_rspec.yml
index 347777dc..b8ab6fa1 100644
--- a/.rubocop_rspec.yml
+++ b/.rubocop_rspec.yml
@@ -1,3 +1,7 @@
+RSpec/DescribeClass:
+ Exclude:
+ - 'spec/examples/*'
+
RSpec/FilePath:
Enabled: false
@@ -24,3 +28,6 @@ RSpec/NestedGroups:
RSpec/ExpectInHook:
Enabled: false
+
+RSpec/MultipleMemoizedHelpers:
+ Enabled: false
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index e7701734..64def32c 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -1,15 +1,29 @@
-Style/HashSyntax:
- EnforcedStyle: hash_rockets
+# This configuration was generated by
+# `rubocop --auto-gen-config`
+# on 2022-05-03 08:04:37 +0700 using RuboCop version 0.41.2.
+# The point is for the user to remove these configuration records
+# one by one as the offenses are removed from the code base.
+# Note that changes in the inspected code, or installation of new
+# versions of RuboCop, may require this file to be generated again.
-Style/Lambda:
- Enabled: false
+# Offense count: 1
+Lint/UselessAssignment:
+ Exclude:
+ - 'spec/oauth2/client_spec.rb'
-Style/SymbolArray:
- Enabled: false
+# Offense count: 4
+Metrics/AbcSize:
+ Max: 39
-Style/EachWithObject:
- Enabled: false
+# Offense count: 1
+Metrics/CyclomaticComplexity:
+ Max: 11
-# Once we drop Rubies that lack support for __dir__ we can turn this on.
-Style/ExpandPathArguments:
- Enabled: false
+# Offense count: 8
+# Configuration parameters: CountComments.
+Metrics/MethodLength:
+ Max: 37
+
+# Offense count: 1
+Metrics/PerceivedComplexity:
+ Max: 14
diff --git a/.ruby-version b/.ruby-version
deleted file mode 100644
index 68b3a4cd..00000000
--- a/.ruby-version
+++ /dev/null
@@ -1 +0,0 @@
-1.9.3-p551
diff --git a/.simplecov b/.simplecov
new file mode 100644
index 00000000..77f4b3f3
--- /dev/null
+++ b/.simplecov
@@ -0,0 +1,41 @@
+# frozen_string_literal: true
+
+# To get coverage
+# On Local, default (HTML) output, it just works, coverage is turned on:
+# bundle exec rspec spec
+# On Local, all output formats:
+# COVER_ALL=true bundle exec rspec spec
+#
+# On CI, all output formats, the ENV variables CI is always set,
+# and COVER_ALL, and CI_CODECOV, are set in the coverage.yml workflow only,
+# so coverage only runs in that workflow, and outputs all formats.
+#
+if RUN_COVERAGE
+ SimpleCov.start do
+ enable_coverage :branch
+ primary_coverage :branch
+
+ if ENV['COVER_ALL']
+ require 'codecov'
+ require 'simplecov-lcov'
+ require 'simplecov-cobertura'
+
+ SimpleCov::Formatter::LcovFormatter.config do |c|
+ c.report_with_single_file = true
+ c.single_report_path = 'coverage/lcov.info'
+ end
+
+ SimpleCov.formatters = [
+ SimpleCov::Formatter::CoberturaFormatter,
+ SimpleCov::Formatter::HTMLFormatter,
+ SimpleCov::Formatter::LcovFormatter,
+ SimpleCov::Formatter::Codecov,
+ ]
+ else
+ formatter SimpleCov::Formatter::HTMLFormatter
+ end
+
+ add_filter '/spec'
+ minimum_coverage(85)
+ end
+end
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 79b25172..00000000
--- a/.travis.yml
+++ /dev/null
@@ -1,68 +0,0 @@
-before_install:
- # rubygems 2.7.8 and greater include bundler
- # - Ruby 2.2, and under, get RubyGems ~> 2.7.10, (includes bundler 1.17.3)
- # - Anything else, including Ruby 2.3, and above, gets RubyGems ~> 3, and update bundler to latest
- # - NOTE ON JRUBY: identifies as RUBY_VERSION ~> 1.9, 2.0, 2.3, or 2.5.
- # - NOTE ON TRUFFLERUBY: identifies as RUBY_VERSION ~> 2.6
- - |
- rv="$(ruby -e 'STDOUT.write RUBY_VERSION')"
- echo "Discovered Ruby Version of =====> $rv"
- if [ "$rv" \< "2.3" ]; then
- gem update --system 2.7.10
- elif [ "$rv" \< "2.4" ]; then
- gem update --system 2.7.10 --no-document
- elif [ "$rv" = "2.5.3" ]; then
- # JRUBY 9.2 Identifies as 2.5.3, and it fails to update rubygems
- gem install --no-document bundler "bundler:>=2.0"
- else
- gem update --system --no-document --conservative
- gem install --no-document bundler "bundler:>=2.0"
- fi
-
-bundler_args: --no-deployment --jobs 3 --retry 3
-
-cache: bundler
-
-language: ruby
-
-matrix:
- allow_failures:
- - rvm: jruby-head
- - rvm: ruby-head
- - rvm: truffleruby
- - rvm: jruby-9.0 # targets MRI v2.0
- gemfile: gemfiles/jruby_9.0.gemfile
- fast_finish: true
- include:
-# - rvm: jruby-1.7 # targets MRI v1.9
-# gemfile: gemfiles/jruby_1.7.gemfile
- - rvm: 1.9
- gemfile: gemfiles/ruby_1.9.gemfile
- - rvm: 2.0
- gemfile: gemfiles/ruby_2.0.gemfile
- - rvm: 2.1
- gemfile: gemfiles/ruby_2.1.gemfile
- # DEPRECATION WARNING
- # oauth2 1.x series releases are the last to support Ruby versions above
- # oauth2 2.x series releases will support Ruby versions below, and not above
- - rvm: jruby-9.1 # targets MRI v2.3
- gemfile: gemfiles/jruby_9.1.gemfile
- - rvm: 2.2
- gemfile: gemfiles/ruby_2.2.gemfile
- - rvm: 2.3
- gemfile: gemfiles/ruby_2.3.gemfile
- - rvm: 2.4
- gemfile: gemfiles/ruby_2.4.gemfile
- - rvm: jruby-9.2 # targets MRI v2.5
- gemfile: gemfiles/jruby_9.2.gemfile
- - rvm: 2.5
- gemfile: gemfiles/ruby_2.5.gemfile
- - rvm: 2.6
- gemfile: gemfiles/ruby_2.6.gemfile
- - rvm: jruby-head
- gemfile: gemfiles/jruby_head.gemfile
- - rvm: ruby-head
- gemfile: gemfiles/ruby_head.gemfile
- - rvm: truffleruby
-
-sudo: false
diff --git a/CHANGELOG.md b/CHANGELOG.md
index fa957410..e445e555 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,19 +1,67 @@
-# Change Log
+# Changelog
All notable changes to this project will be documented in this file.
## [unreleased]
-- no changes yet
+## [1.4.11] - 2022-09-16
+- Complete migration to main branch as default (@pboling)
+- Complete migration to Gitlab, updating all links, and references in VCS-managed files (@pboling)
+
+## [1.4.10] - 2022-07-01
+- FIPS Compatibility [#587](https://gitlab.com/oauth-xx/oauth2/-/merge_requests/587) (@akostadinov)
+
+## [1.4.9] - 2022-02-20
+- Fixes compatibility with Faraday v2 [572](https://gitlab.com/oauth-xx/oauth2/-/issues/572)
+- Includes supported versions of Faraday in test matrix:
+ - Faraday ~> 2.2.0 with Ruby >= 2.6
+ - Faraday ~> 1.10 with Ruby >= 2.4
+ - Faraday ~> 0.17.3 with Ruby >= 1.9
+- Add Windows and MacOS to test matrix
+
+## [1.4.8] - 2022-02-18
+- MFA is now required to push new gem versions (@pboling)
+- README overhaul w/ new Ruby Version and Engine compatibility policies (@pboling)
+- [#569](https://gitlab.com/oauth-xx/oauth2/-/merge_requests/569) Backport fixes ([#561](https://gitlab.com/oauth-xx/oauth2/-/merge_requests/561) by @ryogift), and add more fixes, to allow faraday 1.x and 2.x (@jrochkind)
+- Improve Code Coverage tracking (Coveralls, CodeCov, CodeClimate), and enable branch coverage (@pboling)
+- Add CodeQL, Security Policy, Funding info (@pboling)
+- Added Ruby 3.1, jruby, jruby-head, truffleruby, truffleruby-head to build matrix (@pboling)
+- [#543](https://gitlab.com/oauth-xx/oauth2/-/merge_requests/543) - Support for more modern Open SSL libraries (@pboling)
+
+## [1.4.7] - 2021-03-19
+- [#541](https://gitlab.com/oauth-xx/oauth2/-/merge_requests/541) - Backport fix to expires_at handling [#533](https://gitlab.com/oauth-xx/oauth2/-/merge_requests/533) to 1-4-stable branch. (@dobon)
+
+## [1.4.6] - 2021-03-19
+- [#540](https://gitlab.com/oauth-xx/oauth2/-/merge_requests/540) - Add VERSION constant (@pboling)
+- [#537](https://gitlab.com/oauth-xx/oauth2/-/merge_requests/537) - Fix crash in OAuth2::Client#get_token (@anderscarling)
+- [#538](https://gitlab.com/oauth-xx/oauth2/-/merge_requests/538) - Remove reliance on globally included OAuth2 in tests, analogous to [#539](https://gitlab.com/oauth-xx/oauth2/-/merge_requests/539) on main branch (@anderscarling)
+
+## [1.4.5] - 2021-03-18
+- [#535](https://gitlab.com/oauth-xx/oauth2/-/merge_requests/535) - Compatibility with range of supported Ruby OpenSSL versions, Rubocop updates, Github Actions, analogous to [#536](https://gitlab.com/oauth-xx/oauth2/-/merge_requests/536) on main branch (@pboling)
+- [#518](https://gitlab.com/oauth-xx/oauth2/-/merge_requests/518) - Add extract_access_token option to OAuth2::Client (@jonspalmer)
+- [#507](https://gitlab.com/oauth-xx/oauth2/-/merge_requests/507) - Fix camel case content type, response keys (@anvox)
+- [#500](https://gitlab.com/oauth-xx/oauth2/-/merge_requests/500) - Fix YARD documentation formatting (@olleolleolle)
+
+## [1.4.4] - 2020-02-12
+- [#408](https://gitlab.com/oauth-xx/oauth2/-/merge_requests/408) - Fixed expires_at for formatted time (@Lomey)
+
+## [1.4.3] - 2020-01-29
+- [#483](https://gitlab.com/oauth-xx/oauth2/-/merge_requests/483) - add project metadata to gemspec (@orien)
+- [#495](https://gitlab.com/oauth-xx/oauth2/-/merge_requests/495) - support additional types of access token requests (@SteveyblamFreeagent, @thomcorley, @dgholz)
+ - Adds support for private_key_jwt and tls_client_auth
+- [#433](https://gitlab.com/oauth-xx/oauth2/-/merge_requests/433) - allow field names with square brackets and numbers in params (@asm256)
+
+## [1.4.2] - 2019-10-01
+- [#478](https://gitlab.com/oauth-xx/oauth2/-/merge_requests/478) - support latest version of faraday & fix build (@pboling)
+ - Officially support Ruby 2.6 and truffleruby
## [1.4.1] - 2018-10-13
-
-- [#417](https://github.com/oauth-xx/oauth2/pull/417) - update jwt dependency (@thewoolleyman)
-- [#419](https://github.com/oauth-xx/oauth2/pull/419) - remove rubocop dependency (temporary, added back in [#423](https://github.com/oauth-xx/oauth2/pull/423)) (@pboling)
-- [#418](https://github.com/oauth-xx/oauth2/pull/418) - update faraday dependency (@pboling)
-- [#420](https://github.com/oauth-xx/oauth2/pull/420) - update [oauth2.gemspec](https://github.com/oauth-xx/oauth2/blob/1-4-stable/oauth2.gemspec) (@pboling)
-- [#421](https://github.com/oauth-xx/oauth2/pull/421) - fix [CHANGELOG.md](https://github.com/oauth-xx/oauth2/blob/1-4-stable/CHANGELOG.md) for previous releases (@pboling)
-- [#422](https://github.com/oauth-xx/oauth2/pull/422) - update [LICENSE](https://github.com/oauth-xx/oauth2/blob/1-4-stable/LICENSE) and [README.md](https://github.com/oauth-xx/oauth2/blob/1-4-stable/README.md) (@pboling)
-- [#423](https://github.com/oauth-xx/oauth2/pull/423) - update [builds](https://travis-ci.org/oauth-xx/oauth2/builds), [Rakefile](https://github.com/oauth-xx/oauth2/blob/1-4-stable/Rakefile) (@pboling)
+- [#417](https://gitlab.com/oauth-xx/oauth2/-/merge_requests/417) - update jwt dependency (@thewoolleyman)
+- [#419](https://gitlab.com/oauth-xx/oauth2/-/merge_requests/419) - remove rubocop dependency (temporary, added back in [#423](https://gitlab.com/oauth-xx/oauth2/-/merge_requests/423)) (@pboling)
+- [#418](https://gitlab.com/oauth-xx/oauth2/-/merge_requests/418) - update faraday dependency (@pboling)
+- [#420](https://gitlab.com/oauth-xx/oauth2/-/merge_requests/420) - update [oauth2.gemspec](https://gitlab.com/oauth-xx/oauth2/-/blob/1-4-stable/oauth2.gemspec) (@pboling)
+- [#421](https://gitlab.com/oauth-xx/oauth2/-/merge_requests/421) - fix [CHANGELOG.md](https://gitlab.com/oauth-xx/oauth2/-/blob/1-4-stable/CHANGELOG.md) for previous releases (@pboling)
+- [#422](https://gitlab.com/oauth-xx/oauth2/-/merge_requests/422) - update [LICENSE](https://gitlab.com/oauth-xx/oauth2/-/blob/1-4-stable/LICENSE) and [README.md](https://gitlab.com/oauth-xx/oauth2/-/blob/1-4-stable/README.md) (@pboling)
+- [#423](https://gitlab.com/oauth-xx/oauth2/-/merge_requests/423) - update [builds](https://travis-ci.org/oauth-xx/oauth2/builds), [Rakefile](https://gitlab.com/oauth-xx/oauth2/-/blob/1-4-stable/Rakefile) (@pboling)
- officially document supported Rubies
* Ruby 1.9.3
* Ruby 2.0.0
@@ -33,19 +81,16 @@ All notable changes to this project will be documented in this file.
[jruby-9.2]: https://www.jruby.org/2018/05/24/jruby-9-2-0-0.html
## [1.4.0] - 2017-06-09
-
- Drop Ruby 1.8.7 support (@sferik)
- Fix some RuboCop offenses (@sferik)
- _Dependency_: Remove Yardstick (@sferik)
- _Dependency_: Upgrade Faraday to 0.12 (@sferik)
## [1.3.1] - 2017-03-03
-
- Add support for Ruby 2.4.0 (@pschambacher)
- _Dependency_: Upgrade Faraday to Faraday 0.11 (@mcfiredrill, @rhymes, @pschambacher)
## [1.3.0] - 2016-12-28
-
- Add support for header-based authentication to the `Client` so it can be used across the library (@bjeanes)
- Default to header-based authentication when getting a token from an authorisation code (@maletor)
- **Breaking**: Allow an `auth_scheme` (`:basic_auth` or `:request_body`) to be set on the client, defaulting to `:request_body` to maintain backwards compatibility (@maletor, @bjeanes)
@@ -55,32 +100,27 @@ All notable changes to this project will be documented in this file.
- Add support for Faraday 0.10 (@rhymes)
## [1.2.0] - 2016-07-01
-
- Properly handle encoding of error responses (so we don't blow up, for example, when Google's response includes a ∞) (@Motoshi-Nishihira)
- Make a copy of the options hash in `AccessToken#from_hash` to avoid accidental mutations (@Linuus)
- Use `raise` rather than `fail` to throw exceptions (@sferik)
## [1.1.0] - 2016-01-30
-
- Various refactors (eliminating `Hash#merge!` usage in `AccessToken#refresh!`, use `yield` instead of `#call`, freezing mutable objects in constants, replacing constants with class variables) (@sferik)
- Add support for Rack 2, and bump various other dependencies (@sferik)
## [1.0.0] - 2014-07-09
-
### Added
- Add an implementation of the MAC token spec.
-
### Fixed
- Fix Base64.strict_encode64 incompatibility with Ruby 1.8.7.
## [0.5.0] - 2011-07-29
-
### Changed
-- [breaking] `oauth_token` renamed to `oauth_bearer`.
-- [breaking] `authorize_path` Client option renamed to `authorize_url`.
-- [breaking] `access_token_path` Client option renamed to `token_url`.
-- [breaking] `access_token_method` Client option renamed to `token_method`.
-- [breaking] `web_server` renamed to `auth_code`.
+- *breaking* `oauth_token` renamed to `oauth_bearer`.
+- *breaking* `authorize_path` Client option renamed to `authorize_url`.
+- *breaking* `access_token_path` Client option renamed to `token_url`.
+- *breaking* `access_token_method` Client option renamed to `token_method`.
+- *breaking* `web_server` renamed to `auth_code`.
## [0.4.1] - 2011-04-20
@@ -108,32 +148,41 @@ All notable changes to this project will be documented in this file.
## [0.0.4] + [0.0.3] + [0.0.2] + [0.0.1] - 2010-04-22
-
-[0.0.1]: https://github.com/oauth-xx/oauth2/compare/311d9f4...v0.0.1
-[0.0.2]: https://github.com/oauth-xx/oauth2/compare/v0.0.1...v0.0.2
-[0.0.3]: https://github.com/oauth-xx/oauth2/compare/v0.0.2...v0.0.3
-[0.0.4]: https://github.com/oauth-xx/oauth2/compare/v0.0.3...v0.0.4
-[0.0.5]: https://github.com/oauth-xx/oauth2/compare/v0.0.4...v0.0.5
-[0.0.6]: https://github.com/oauth-xx/oauth2/compare/v0.0.5...v0.0.6
-[0.0.7]: https://github.com/oauth-xx/oauth2/compare/v0.0.6...v0.0.7
-[0.0.8]: https://github.com/oauth-xx/oauth2/compare/v0.0.7...v0.0.8
-[0.0.9]: https://github.com/oauth-xx/oauth2/compare/v0.0.8...v0.0.9
-[0.0.10]: https://github.com/oauth-xx/oauth2/compare/v0.0.9...v0.0.10
-[0.0.11]: https://github.com/oauth-xx/oauth2/compare/v0.0.10...v0.0.11
-[0.0.12]: https://github.com/oauth-xx/oauth2/compare/v0.0.11...v0.0.12
-[0.0.13]: https://github.com/oauth-xx/oauth2/compare/v0.0.12...v0.0.13
-[0.1.0]: https://github.com/oauth-xx/oauth2/compare/v0.0.13...v0.1.0
-[0.1.1]: https://github.com/oauth-xx/oauth2/compare/v0.1.0...v0.1.1
-[0.2.0]: https://github.com/oauth-xx/oauth2/compare/v0.1.1...v0.2.0
-[0.3.0]: https://github.com/oauth-xx/oauth2/compare/v0.2.0...v0.3.0
-[0.4.0]: https://github.com/oauth-xx/oauth2/compare/v0.3.0...v0.4.0
-[0.4.1]: https://github.com/oauth-xx/oauth2/compare/v0.4.0...v0.4.1
-[0.5.0]: https://github.com/oauth-xx/oauth2/compare/v0.4.1...v0.5.0
-[1.0.0]: https://github.com/oauth-xx/oauth2/compare/v0.9.4...v1.0.0
-[1.1.0]: https://github.com/oauth-xx/oauth2/compare/v1.0.0...v1.1.0
-[1.2.0]: https://github.com/oauth-xx/oauth2/compare/v1.1.0...v1.2.0
-[1.3.0]: https://github.com/oauth-xx/oauth2/compare/v1.2.0...v1.3.0
-[1.3.1]: https://github.com/oauth-xx/oauth2/compare/v1.3.0...v1.3.1
-[1.4.0]: https://github.com/oauth-xx/oauth2/compare/v1.3.1...v1.4.0
-[1.4.1]: https://github.com/oauth-xx/oauth2/compare/v1.4.0...v1.4.1
-[unreleased]: https://github.com/oauth-xx/oauth2/compare/v1.4.1...HEAD
+[0.0.1]: https://gitlab.com/oauth-xx/oauth2/-/compare/311d9f4...v0.0.1
+[0.0.2]: https://gitlab.com/oauth-xx/oauth2/-/compare/v0.0.1...v0.0.2
+[0.0.3]: https://gitlab.com/oauth-xx/oauth2/-/compare/v0.0.2...v0.0.3
+[0.0.4]: https://gitlab.com/oauth-xx/oauth2/-/compare/v0.0.3...v0.0.4
+[0.0.5]: https://gitlab.com/oauth-xx/oauth2/-/compare/v0.0.4...v0.0.5
+[0.0.6]: https://gitlab.com/oauth-xx/oauth2/-/compare/v0.0.5...v0.0.6
+[0.0.7]: https://gitlab.com/oauth-xx/oauth2/-/compare/v0.0.6...v0.0.7
+[0.0.8]: https://gitlab.com/oauth-xx/oauth2/-/compare/v0.0.7...v0.0.8
+[0.0.9]: https://gitlab.com/oauth-xx/oauth2/-/compare/v0.0.8...v0.0.9
+[0.0.10]: https://gitlab.com/oauth-xx/oauth2/-/compare/v0.0.9...v0.0.10
+[0.0.11]: https://gitlab.com/oauth-xx/oauth2/-/compare/v0.0.10...v0.0.11
+[0.0.12]: https://gitlab.com/oauth-xx/oauth2/-/compare/v0.0.11...v0.0.12
+[0.0.13]: https://gitlab.com/oauth-xx/oauth2/-/compare/v0.0.12...v0.0.13
+[0.1.0]: https://gitlab.com/oauth-xx/oauth2/-/compare/v0.0.13...v0.1.0
+[0.1.1]: https://gitlab.com/oauth-xx/oauth2/-/compare/v0.1.0...v0.1.1
+[0.2.0]: https://gitlab.com/oauth-xx/oauth2/-/compare/v0.1.1...v0.2.0
+[0.3.0]: https://gitlab.com/oauth-xx/oauth2/-/compare/v0.2.0...v0.3.0
+[0.4.0]: https://gitlab.com/oauth-xx/oauth2/-/compare/v0.3.0...v0.4.0
+[0.4.1]: https://gitlab.com/oauth-xx/oauth2/-/compare/v0.4.0...v0.4.1
+[0.5.0]: https://gitlab.com/oauth-xx/oauth2/-/compare/v0.4.1...v0.5.0
+[1.0.0]: https://gitlab.com/oauth-xx/oauth2/-/compare/v0.9.4...v1.0.0
+[1.1.0]: https://gitlab.com/oauth-xx/oauth2/-/compare/v1.0.0...v1.1.0
+[1.2.0]: https://gitlab.com/oauth-xx/oauth2/-/compare/v1.1.0...v1.2.0
+[1.3.0]: https://gitlab.com/oauth-xx/oauth2/-/compare/v1.2.0...v1.3.0
+[1.3.1]: https://gitlab.com/oauth-xx/oauth2/-/compare/v1.3.0...v1.3.1
+[1.4.0]: https://gitlab.com/oauth-xx/oauth2/-/compare/v1.3.1...v1.4.0
+[1.4.1]: https://gitlab.com/oauth-xx/oauth2/-/compare/v1.4.0...v1.4.1
+[1.4.2]: https://gitlab.com/oauth-xx/oauth2/-/compare/v1.4.1...v1.4.2
+[1.4.3]: https://gitlab.com/oauth-xx/oauth2/-/compare/v1.4.2...v1.4.3
+[1.4.4]: https://gitlab.com/oauth-xx/oauth2/-/compare/v1.4.3...v1.4.4
+[1.4.5]: https://gitlab.com/oauth-xx/oauth2/-/compare/v1.4.4...v1.4.5
+[1.4.6]: https://gitlab.com/oauth-xx/oauth2/-/compare/v1.4.5...v1.4.6
+[1.4.7]: https://gitlab.com/oauth-xx/oauth2/-/compare/v1.4.6...v1.4.7
+[1.4.8]: https://gitlab.com/oauth-xx/oauth2/-/compare/v1.4.7...v1.4.8
+[1.4.9]: https://gitlab.com/oauth-xx/oauth2/-/compare/v1.4.8...v1.4.9
+[1.4.10]: https://gitlab.com/oauth-xx/oauth2/-/compare/v1.4.9...v1.4.10
+[1.4.11]: https://gitlab.com/oauth-xx/oauth2/-/compare/v1.4.10...v1.4.11
+[unreleased]: https://gitlab.com/oauth-xx/oauth2/-/compare/v1.4.11...HEAD
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
index 395b407d..99ab478b 100644
--- a/CODE_OF_CONDUCT.md
+++ b/CODE_OF_CONDUCT.md
@@ -1,74 +1,133 @@
+
# Contributor Covenant Code of Conduct
## Our Pledge
-In the interest of fostering an open and welcoming environment, we as
-contributors and maintainers pledge to making participation in our project and
-our community a harassment-free experience for everyone, regardless of age, body
-size, disability, ethnicity, gender identity and expression, level of experience,
-nationality, personal appearance, race, religion, or sexual identity and
-orientation.
+We as members, contributors, and leaders pledge to make participation in our
+community a harassment-free experience for everyone, regardless of age, body
+size, visible or invisible disability, ethnicity, sex characteristics, gender
+identity and expression, level of experience, education, socio-economic status,
+nationality, personal appearance, race, religion, or sexual identity
+and orientation.
+
+We pledge to act and interact in ways that contribute to an open, welcoming,
+diverse, inclusive, and healthy community.
## Our Standards
-Examples of behavior that contributes to creating a positive environment
-include:
+Examples of behavior that contributes to a positive environment for our
+community include:
-* Using welcoming and inclusive language
-* Being respectful of differing viewpoints and experiences
-* Gracefully accepting constructive criticism
-* Focusing on what is best for the community
-* Showing empathy towards other community members
+* Demonstrating empathy and kindness toward other people
+* Being respectful of differing opinions, viewpoints, and experiences
+* Giving and gracefully accepting constructive feedback
+* Accepting responsibility and apologizing to those affected by our mistakes,
+ and learning from the experience
+* Focusing on what is best not just for us as individuals, but for the
+ overall community
-Examples of unacceptable behavior by participants include:
+Examples of unacceptable behavior include:
-* The use of sexualized language or imagery and unwelcome sexual attention or
-advances
-* Trolling, insulting/derogatory comments, and personal or political attacks
+* The use of sexualized language or imagery, and sexual attention or
+ advances of any kind
+* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
-* Publishing others' private information, such as a physical or electronic
- address, without explicit permission
+* Publishing others' private information, such as a physical or email
+ address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
-## Our Responsibilities
+## Enforcement Responsibilities
-Project maintainers are responsible for clarifying the standards of acceptable
-behavior and are expected to take appropriate and fair corrective action in
-response to any instances of unacceptable behavior.
+Community leaders are responsible for clarifying and enforcing our standards of
+acceptable behavior and will take appropriate and fair corrective action in
+response to any behavior that they deem inappropriate, threatening, offensive,
+or harmful.
-Project maintainers have the right and responsibility to remove, edit, or
-reject comments, commits, code, wiki edits, issues, and other contributions
-that are not aligned to this Code of Conduct, or to ban temporarily or
-permanently any contributor for other behaviors that they deem inappropriate,
-threatening, offensive, or harmful.
+Community leaders have the right and responsibility to remove, edit, or reject
+comments, commits, code, wiki edits, issues, and other contributions that are
+not aligned to this Code of Conduct, and will communicate reasons for moderation
+decisions when appropriate.
## Scope
-This Code of Conduct applies both within project spaces and in public spaces
-when an individual is representing the project or its community. Examples of
-representing a project or community include using an official project e-mail
-address, posting via an official social media account, or acting as an appointed
-representative at an online or offline event. Representation of a project may be
-further defined and clarified by project maintainers.
+This Code of Conduct applies within all community spaces, and also applies when
+an individual is officially representing the community in public spaces.
+Examples of representing our community include using an official e-mail address,
+posting via an official social media account, or acting as an appointed
+representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
-reported by contacting the project team at peter.boling@gmail.com. All
-complaints will be reviewed and investigated and will result in a response that
-is deemed necessary and appropriate to the circumstances. The project team is
-obligated to maintain confidentiality with regard to the reporter of an incident.
-Further details of specific enforcement policies may be posted separately.
+reported to the community leaders responsible for enforcement at
+[INSERT CONTACT METHOD].
+All complaints will be reviewed and investigated promptly and fairly.
+
+All community leaders are obligated to respect the privacy and security of the
+reporter of any incident.
+
+## Enforcement Guidelines
+
+Community leaders will follow these Community Impact Guidelines in determining
+the consequences for any action they deem in violation of this Code of Conduct:
+
+### 1. Correction
+
+**Community Impact**: Use of inappropriate language or other behavior deemed
+unprofessional or unwelcome in the community.
+
+**Consequence**: A private, written warning from community leaders, providing
+clarity around the nature of the violation and an explanation of why the
+behavior was inappropriate. A public apology may be requested.
+
+### 2. Warning
-Project maintainers who do not follow or enforce the Code of Conduct in good
-faith may face temporary or permanent repercussions as determined by other
-members of the project's leadership.
+**Community Impact**: A violation through a single incident or series
+of actions.
+
+**Consequence**: A warning with consequences for continued behavior. No
+interaction with the people involved, including unsolicited interaction with
+those enforcing the Code of Conduct, for a specified period of time. This
+includes avoiding interactions in community spaces as well as external channels
+like social media. Violating these terms may lead to a temporary or
+permanent ban.
+
+### 3. Temporary Ban
+
+**Community Impact**: A serious violation of community standards, including
+sustained inappropriate behavior.
+
+**Consequence**: A temporary ban from any sort of interaction or public
+communication with the community for a specified period of time. No public or
+private interaction with the people involved, including unsolicited interaction
+with those enforcing the Code of Conduct, is allowed during this period.
+Violating these terms may lead to a permanent ban.
+
+### 4. Permanent Ban
+
+**Community Impact**: Demonstrating a pattern of violation of community
+standards, including sustained inappropriate behavior, harassment of an
+individual, or aggression toward or disparagement of classes of individuals.
+
+**Consequence**: A permanent ban from any sort of public interaction within
+the community.
## Attribution
-This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
-available at [http://contributor-covenant.org/version/1/4][version]
+This Code of Conduct is adapted from the [Contributor Covenant][homepage],
+version 2.0, available at
+[https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0].
+
+Community Impact Guidelines were inspired by
+[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
+
+For answers to common questions about this code of conduct, see the FAQ at
+[https://www.contributor-covenant.org/faq][FAQ]. Translations are available
+at [https://www.contributor-covenant.org/translations][translations].
-[homepage]: http://contributor-covenant.org
-[version]: http://contributor-covenant.org/version/1/4/
+[homepage]: https://www.contributor-covenant.org
+[v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html
+[Mozilla CoC]: https://github.com/mozilla/diversity
+[FAQ]: https://www.contributor-covenant.org/faq
+[translations]: https://www.contributor-covenant.org/translations
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 61aa667f..a0a0933b 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,4 +1,12 @@
-## Submitting a Pull Request
+## Contributing
+
+Bug reports and pull requests are welcome on GitHub at [https://gitlab.com/oauth-xx/oauth2][source]
+. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to
+the [code of conduct][conduct].
+
+To submit a patch, please fork the project and create a patch with tests. Once you're happy with it send a pull request!
+
+## Detailed instructions on Submitting a Pull Request
1. [Fork the repository.][fork]
2. [Create a topic branch.][branch]
3. Add specs for your unimplemented feature or bug fix.
@@ -16,3 +24,21 @@
[fork]: http://help.github.com/fork-a-repo/
[branch]: http://learn.github.com/p/branching.html
[pr]: http://help.github.com/send-pull-requests/
+
+## Contributors
+
+[][contributors]
+
+Made with [contributors-img][contrib-rocks].
+
+[comment]: <> (Following links are used by README, CONTRIBUTING)
+
+[conduct]: https://gitlab.com/oauth-xx/oauth2/-/blob/main/CODE_OF_CONDUCT.md
+
+[contrib-rocks]: https://contrib.rocks
+
+[contributors]: https://gitlab.com/oauth-xx/oauth2/-/graphs/main
+
+[comment]: <> (Following links are used by README, CONTRIBUTING, Homepage)
+
+[source]: https://gitlab.com/oauth-xx/oauth2
diff --git a/Dangerfile b/Dangerfile
new file mode 100644
index 00000000..2f8600bb
--- /dev/null
+++ b/Dangerfile
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+# Ideas...
+# 1. Check for hashtags in PR title, and disallow changes to changelog?
+# e.g. github.pr_title.include? "#trivial"
+
+# Make it more obvious that a PR is a work in progress and shouldn't be merged yet
+warn('PR is classed as Work in Progress') if github.pr_title.include? '[WIP]'
+
+# Warn when there is a big PR
+warn('Big PR') if git.lines_of_code > 500
+
+# Don't let testing shortcuts get into main by accident
+raise('fdescribe left in tests') if `grep -r fdescribe specs/ `.length > 1
+raise('fit left in tests') if `grep -r fit specs/ `.length > 1
diff --git a/Gemfile b/Gemfile
index 0dbce159..dfade746 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,40 +1,44 @@
+# frozen_string_literal: true
+
source 'https://rubygems.org'
+gemspec
+
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
-gem 'faraday', ['>= 0.8', '< 2.0'], :platforms => [:jruby_18, :ruby_18]
-gem 'jwt', '< 1.5.2', :platforms => [:jruby_18, :ruby_18]
-gem 'rake', '< 11.0'
-gem 'rdoc', '~> 4.2.2'
+gem 'overcommit'
group :test do
- ruby_version = Gem::Version.new(RUBY_VERSION)
- if ruby_version >= Gem::Version.new('2.1')
- # TODO: Upgrade to >= 0.59 when we drop Rubies below 2.2
- # Error: Unsupported Ruby version 2.1 found in `TargetRubyVersion` parameter (in .rubocop.yml). 2.1-compatible analysis was dropped after version 0.58.
- # Supported versions: 2.2, 2.3, 2.4, 2.5
- gem 'rubocop', '~> 0.57.0'
- gem 'rubocop-rspec', '~> 1.27.0' # last version that can use rubocop < 0.58
- end
- gem 'pry', '~> 0.11' if ruby_version >= Gem::Version.new('2.0')
-
- gem 'addressable', '~> 2.3.8'
- gem 'backports'
- gem 'coveralls'
- gem 'rack', '~> 1.2', :platforms => [:jruby_18, :jruby_19, :ruby_18, :ruby_19, :ruby_20, :ruby_21]
+ gem 'addressable', '>= 2.3'
gem 'rspec', '>= 3'
- gem 'simplecov', '>= 0.9'
-
- platforms :jruby_18, :ruby_18 do
- gem 'mime-types', '~> 1.25'
- gem 'rest-client', '~> 1.6.0'
- end
-
- platforms :ruby_18, :ruby_19 do
- gem 'json', '< 2.0'
- gem 'term-ansicolor', '< 1.4.0'
- gem 'tins', '< 1.7'
+ platforms :mri do
+ ruby_version = Gem::Version.new(RUBY_VERSION)
+ minimum_version = ->(version) { ruby_version >= Gem::Version.new(version) && RUBY_ENGINE == 'ruby' }
+ linting = minimum_version.call('2.7')
+ coverage = minimum_version.call('2.7')
+ debug = minimum_version.call('2.5')
+ if linting
+ gem 'rubocop-rspec', '1.5.0', :require => false
+ gem 'rubocop-thread_safety', '0.3.1', :require => false
+ end
+ if coverage
+ gem 'codecov', :require => false, :group => :test
+ gem 'simplecov', '~> 0.21', :require => false
+ gem 'simplecov-cobertura' # XML for Jenkins
+ gem 'simplecov-lcov', '~> 0.8', :require => false
+ end
+ if debug
+ # No need to run byebug / pry on earlier versions
+ gem 'byebug'
+ gem 'pry'
+ gem 'pry-byebug'
+ end
end
end
-gemspec
+### deps for documentation and rdoc.info
+group :documentation do
+ gem 'github-markup', :platform => :mri
+ gem 'redcarpet', :platform => :mri
+ gem 'yard', :require => false
+end
diff --git a/LICENSE b/LICENSE
index 6dda5ca1..5fd4bd3c 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,7 +1,7 @@
MIT License
Copyright (c) 2011 - 2013 Michael Bleigh and Intridea, Inc.
-Copyright (c) 2017 - 2018 oauth-xx organization, https://github.com/oauth-xx
+Copyright (c) 2017 - 2022 oauth-xx organization, https://gitlab.com/oauth-xx
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/README.md b/README.md
index 77054ded..6b78b998 100644
--- a/README.md
+++ b/README.md
@@ -1,55 +1,295 @@
-# OAuth2
-
-[][gem]
-[][gem]
-[][gem]
-[][travis]
-[][coveralls]
-[][codeclimate-maintainability]
-[][depfu]
-[][code-triage]
-[](https://gitter.im/oauth-xx/oauth2)
-[][source-license]
-[][inch-ci]
-
-[gem]: https://rubygems.org/gems/oauth2
-[travis]: http://travis-ci.org/oauth-xx/oauth2
-[coveralls]: https://coveralls.io/r/oauth-xx/oauth2
-[codeclimate-maintainability]: https://codeclimate.com/github/oauth-xx/oauth2/maintainability
-[depfu]: https://depfu.com/github/oauth-xx/oauth2
-[source-license]: https://opensource.org/licenses/MIT
-[inch-ci]: http://inch-ci.org/github/oauth-xx/oauth2
-[code-triage]: https://www.codetriage.com/oauth-xx/oauth2
-
-A Ruby wrapper for the [OAuth 2.0 specification][oauth2-spec].
+