Skip to content

Commit

Permalink
Drop ruby 2.x support
Browse files Browse the repository at this point in the history
  • Loading branch information
ixti committed Oct 15, 2023
1 parent 1ba37c2 commit 9d5f82e
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

strategy:
matrix:
ruby: [ ruby-2.6, ruby-2.7, ruby-3.0, ruby-3.1, ruby-3.2 ]
ruby: [ ruby-3.0, ruby-3.1, ruby-3.2 ]
os: [ ubuntu-latest ]

steps:
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:

- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
ruby-version: ruby-3.0
bundler-cache: true

- name: bundle exec rubocop
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ AllCops:
DefaultFormatter: fuubar
DisplayCopNames: true
NewCops: enable
TargetRubyVersion: 2.6
TargetRubyVersion: 3.0
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ This library aims to support and is [tested against][build-link]
the following Ruby versions:

- JRuby 9.3
- Ruby 2.6
- Ruby 2.7
- Ruby 3.0
- Ruby 3.1
- Ruby 3.2
Expand Down
4 changes: 1 addition & 3 deletions http.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,14 @@ Gem::Specification.new do |gem|
gem.require_paths = ["lib"]
gem.version = HTTP::VERSION

gem.required_ruby_version = ">= 2.6"
gem.required_ruby_version = ">= 3.0"

gem.add_runtime_dependency "addressable", "~> 2.8"
gem.add_runtime_dependency "base64", "~> 0.1"
gem.add_runtime_dependency "http-cookie", "~> 1.0"
gem.add_runtime_dependency "http-form_data", "~> 2.2"
gem.add_runtime_dependency "llhttp-ffi", "~> 0.5.0"

gem.add_development_dependency "bundler", "~> 2.0"

gem.metadata = {
"source_code_uri" => "https://github.com/httprb/http",
"wiki_uri" => "https://github.com/httprb/http/wiki",
Expand Down
2 changes: 1 addition & 1 deletion lib/http/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Client
extend Forwardable
include Chainable

HTTP_OR_HTTPS_RE = %r{^https?://}i.freeze
HTTP_OR_HTTPS_RE = %r{^https?://}i

def initialize(default_options = {})
@default_options = HTTP::Options.new(default_options)
Expand Down
4 changes: 2 additions & 2 deletions lib/http/content_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

module HTTP
class ContentType
MIME_TYPE_RE = %r{^([^/]+/[^;]+)(?:$|;)}.freeze
CHARSET_RE = /;\s*charset=([^;]+)/i.freeze
MIME_TYPE_RE = %r{^([^/]+/[^;]+)(?:$|;)}
CHARSET_RE = /;\s*charset=([^;]+)/i

attr_accessor :mime_type, :charset

Expand Down
4 changes: 2 additions & 2 deletions lib/http/headers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ class Headers
include Enumerable

# Matches HTTP header names when in "Canonical-Http-Format"
CANONICAL_NAME_RE = /\A[A-Z][a-z]*(?:-[A-Z][a-z]*)*\z/.freeze
CANONICAL_NAME_RE = /\A[A-Z][a-z]*(?:-[A-Z][a-z]*)*\z/

# Matches valid header field name according to RFC.
# @see http://tools.ietf.org/html/rfc7230#section-3.2
COMPLIANT_NAME_RE = /\A[A-Za-z0-9!#$%&'*+\-.^_`|~]+\z/.freeze
COMPLIANT_NAME_RE = /\A[A-Za-z0-9!#$%&'*+\-.^_`|~]+\z/

# Class constructor.
def initialize
Expand Down
2 changes: 1 addition & 1 deletion lib/http/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class UnsupportedMethodError < RequestError; end
class UnsupportedSchemeError < RequestError; end

# Default User-Agent header value
USER_AGENT = "http.rb/#{HTTP::VERSION}"
USER_AGENT = "http.rb/#{HTTP::VERSION}".freeze

METHODS = [
# RFC 2616: Hypertext Transfer Protocol -- HTTP/1.1
Expand Down
2 changes: 1 addition & 1 deletion lib/http/request/writer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Writer
CHUNKED = "chunked"

# End of a chunked transfer
CHUNKED_END = "#{ZERO}#{CRLF}#{CRLF}"
CHUNKED_END = "#{ZERO}#{CRLF}#{CRLF}".freeze

def initialize(socket, body, headers, headline)
@body = body
Expand Down
2 changes: 1 addition & 1 deletion lib/http/uri.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class URI
HTTPS_SCHEME = "https"

# @private
PERCENT_ENCODE = /[^\x21-\x7E]+/.freeze
PERCENT_ENCODE = /[^\x21-\x7E]+/

# @private
NORMALIZER = lambda do |uri|
Expand Down

0 comments on commit 9d5f82e

Please sign in to comment.