Skip to content

Commit

Permalink
Test against unreleased version of the http gem
Browse files Browse the repository at this point in the history
Pointed temporarily to a patched version in my own repo to work around a circular require warning.
  • Loading branch information
hakanensari committed Dec 13, 2024
1 parent f251526 commit 74d99b7
Show file tree
Hide file tree
Showing 11 changed files with 476 additions and 11 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,16 @@ jobs:
strategy:
matrix:
ruby: ["3.2", "3.3"]
appraisal: [http-5, http-github]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: bundle exec rake test
- run: appraisal install
- run: appraisal ${{ matrix.appraisal }} bundle exec rake test

coverage:
if: github.event_name == 'push'
Expand Down
9 changes: 9 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

appraise "http-5" do
gem "http", "~> 5.0"
end

appraise "http-github" do
gem "http", github: "hakanensari/http", branch: "circular-require"
end
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ source "https://rubygems.org"
gemspec

group :development do
gem "appraisal"
gem "minitest"
gem "rake"
gem "rubocop"
Expand Down
25 changes: 25 additions & 0 deletions gemfiles/http_5.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "http", "~> 5.0"

group :development do
gem "appraisal"
gem "minitest"
gem "rake"
gem "rubocop"
gem "rubocop-minitest"
gem "rubocop-performance"
gem "rubocop-rake"
gem "rubocop-shopify"
gem "simplecov"
gem "vcr"
gem "webmock"
gem "yard"
gem "commonmarker", "~> 0.23.10"
gem "fiddle"
gem "rdoc"
end

gemspec path: "../"
129 changes: 129 additions & 0 deletions gemfiles/http_5.gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
PATH
remote: ..
specs:
peddler (4.0.0)
http (>= 5.0, < 7.0)

GEM
remote: https://rubygems.org/
specs:
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
appraisal (2.5.0)
bundler
rake
thor (>= 0.14.0)
ast (2.4.2)
base64 (0.2.0)
bigdecimal (3.1.8)
commonmarker (0.23.11)
crack (1.0.0)
bigdecimal
rexml
date (3.4.1)
docile (1.4.1)
domain_name (0.6.20240107)
ffi (1.17.0)
ffi (1.17.0-arm64-darwin)
ffi-compiler (1.3.2)
ffi (>= 1.15.5)
rake
fiddle (1.1.4)
hashdiff (1.1.2)
http (5.2.0)
addressable (~> 2.8)
base64 (~> 0.1)
http-cookie (~> 1.0)
http-form_data (~> 2.2)
llhttp-ffi (~> 0.5.0)
http-cookie (1.0.8)
domain_name (~> 0.5)
http-form_data (2.3.0)
json (2.9.0)
language_server-protocol (3.17.0.3)
llhttp-ffi (0.5.0)
ffi-compiler (~> 1.0)
rake (~> 13.0)
minitest (5.25.4)
parallel (1.26.3)
parser (3.3.6.0)
ast (~> 2.4.1)
racc
psych (5.2.1)
date
stringio
public_suffix (6.0.1)
racc (1.8.1)
rainbow (3.1.1)
rake (13.2.1)
rdoc (6.8.1)
psych (>= 4.0.0)
regexp_parser (2.9.3)
rexml (3.3.9)
rubocop (1.69.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.36.2, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.36.2)
parser (>= 3.3.1.0)
rubocop-minitest (0.36.0)
rubocop (>= 1.61, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-performance (1.23.0)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rake (0.6.0)
rubocop (~> 1.0)
rubocop-shopify (2.15.1)
rubocop (~> 1.51)
ruby-progressbar (1.13.0)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.13.1)
simplecov_json_formatter (0.1.4)
stringio (3.1.2)
thor (1.3.2)
unicode-display_width (3.1.2)
unicode-emoji (~> 4.0, >= 4.0.4)
unicode-emoji (4.0.4)
vcr (6.3.1)
base64
webmock (3.24.0)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
yard (0.9.37)

PLATFORMS
arm64-darwin
ruby

DEPENDENCIES
appraisal
commonmarker (~> 0.23.10)
fiddle
http (~> 5.0)
minitest
peddler!
rake
rdoc
rubocop
rubocop-minitest
rubocop-performance
rubocop-rake
rubocop-shopify
simplecov
vcr
webmock
yard

BUNDLED WITH
2.5.18
25 changes: 25 additions & 0 deletions gemfiles/http_github.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "http", github: "hakanensari/http", branch: "circular-require"

group :development do
gem "appraisal"
gem "minitest"
gem "rake"
gem "rubocop"
gem "rubocop-minitest"
gem "rubocop-performance"
gem "rubocop-rake"
gem "rubocop-shopify"
gem "simplecov"
gem "vcr"
gem "webmock"
gem "yard"
gem "commonmarker", "~> 0.23.10"
gem "fiddle"
gem "rdoc"
end

gemspec path: "../"
152 changes: 152 additions & 0 deletions gemfiles/http_github.gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
GIT
remote: https://github.com/hakanensari/http.git
revision: b670715f2cdc024da8b62d1d6eb0556dfeeafd57
branch: circular-require
specs:
http (5.2.0)
addressable (~> 2.8)
http-cookie (~> 1.0)
http-form_data (~> 2.2)
llhttp-ffi (~> 0.5.0)

PATH
remote: ..
specs:
peddler (4.0.0)
http (>= 5.0, < 7.0)

GEM
remote: https://rubygems.org/
specs:
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
appraisal (2.5.0)
bundler
rake
thor (>= 0.14.0)
ast (2.4.2)
base64 (0.2.0)
bigdecimal (3.1.8)
commonmarker (0.23.11)
crack (1.0.0)
bigdecimal
rexml
date (3.4.1)
docile (1.4.1)
domain_name (0.6.20240107)
ffi (1.17.0)
ffi (1.17.0-aarch64-linux-gnu)
ffi (1.17.0-aarch64-linux-musl)
ffi (1.17.0-arm-linux-gnu)
ffi (1.17.0-arm-linux-musl)
ffi (1.17.0-arm64-darwin)
ffi (1.17.0-x86-linux-gnu)
ffi (1.17.0-x86-linux-musl)
ffi (1.17.0-x86_64-darwin)
ffi (1.17.0-x86_64-linux-gnu)
ffi (1.17.0-x86_64-linux-musl)
ffi-compiler (1.3.2)
ffi (>= 1.15.5)
rake
fiddle (1.1.6)
hashdiff (1.1.2)
http-cookie (1.0.8)
domain_name (~> 0.5)
http-form_data (2.3.0)
json (2.9.0)
language_server-protocol (3.17.0.3)
llhttp-ffi (0.5.0)
ffi-compiler (~> 1.0)
rake (~> 13.0)
minitest (5.25.4)
parallel (1.26.3)
parser (3.3.6.0)
ast (~> 2.4.1)
racc
psych (5.2.1)
date
stringio
public_suffix (6.0.1)
racc (1.8.1)
rainbow (3.1.1)
rake (13.2.1)
rdoc (6.8.1)
psych (>= 4.0.0)
regexp_parser (2.9.3)
rexml (3.3.9)
rubocop (1.69.2)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.36.2, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.37.0)
parser (>= 3.3.1.0)
rubocop-minitest (0.36.0)
rubocop (>= 1.61, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-performance (1.23.0)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rake (0.6.0)
rubocop (~> 1.0)
rubocop-shopify (2.15.1)
rubocop (~> 1.51)
ruby-progressbar (1.13.0)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.13.1)
simplecov_json_formatter (0.1.4)
stringio (3.1.2)
thor (1.3.2)
unicode-display_width (3.1.2)
unicode-emoji (~> 4.0, >= 4.0.4)
unicode-emoji (4.0.4)
vcr (6.3.1)
base64
webmock (3.24.0)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
yard (0.9.37)

PLATFORMS
aarch64-linux-gnu
aarch64-linux-musl
arm-linux-gnu
arm-linux-musl
arm64-darwin
ruby
x86-linux-gnu
x86-linux-musl
x86_64-darwin
x86_64-linux-gnu
x86_64-linux-musl

DEPENDENCIES
appraisal
commonmarker (~> 0.23.10)
fiddle
http!
minitest
peddler!
rake
rdoc
rubocop
rubocop-minitest
rubocop-performance
rubocop-rake
rubocop-shopify
simplecov
vcr
webmock
yard

BUNDLED WITH
2.5.18
6 changes: 3 additions & 3 deletions lib/peddler/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def meter(rate_limit)
# HTTP v6.0 will implement retriable. Until then, point to their GitHub repo, or it's a no-op.
# https://github.com/httprb/http/pull/790
delay = sandbox? ? 0.2 : 1.0 / rate_limit
retriable(delay: delay, retry_statuses: [429])
retriable(delay: delay, tries: 3, retry_statuses: [429])

self
end
Expand All @@ -96,8 +96,8 @@ def meter(rate_limit)
# @param (see Performer#initialize)
# @return [self]
[:via, :use, :retriable].each do |method|
define_method(method) do |*args, &block|
@http = http.send(method, *args, &block) if http.respond_to?(method)
define_method(method) do |*args, **kwargs, &block|
@http = http.send(method, *args, **kwargs, &block) if http.respond_to?(method)
self
end
end
Expand Down
Loading

0 comments on commit 74d99b7

Please sign in to comment.