diff --git a/.github/workflows/rspec.yml b/.github/workflows/rspec.yml index 0bf4112..325c5d1 100755 --- a/.github/workflows/rspec.yml +++ b/.github/workflows/rspec.yml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - ruby-version: ['3.1', '3.0', '2.7'] + ruby-version: ['3.1', '3.0', '2.7', '2.6', '2.5'] steps: - uses: actions/checkout@v2 - name: Set up Ruby ${{ matrix.ruby-version }} diff --git a/lib/sniffer/adapters/ethon_adapter.rb b/lib/sniffer/adapters/ethon_adapter.rb index 2a93d88..7c1bef5 100644 --- a/lib/sniffer/adapters/ethon_adapter.rb +++ b/lib/sniffer/adapters/ethon_adapter.rb @@ -93,16 +93,14 @@ def perform if defined?(::Ethon::Easy) if defined?(Sniffer::Adapters::EthonAdapter::PREPEND) - Ethon::Easy::Http.prepend Sniffer::Adapters::EthonAdapter::Http::Prepend - Ethon::Easy::Operations.prepend Sniffer::Adapters::EthonAdapter::Operations::Prepend + Ethon::Easy.prepend Sniffer::Adapters::EthonAdapter::Http::Prepend + Ethon::Easy.prepend Sniffer::Adapters::EthonAdapter::Operations::Prepend else - Ethon::Easy::Http.class_eval do + Ethon::Easy.class_eval do include Sniffer::Adapters::EthonAdapter::Http alias_method :http_request_without_sniffer, :http_request alias_method :http_request, :http_request_with_sniffer - end - Ethon::Easy::Operations.class_eval do include Sniffer::Adapters::EthonAdapter::Operations alias_method :perform_without_sniffer, :perform alias_method :perform, :perform_with_sniffer