Sha256: 2fcb3cf862db33d0b779f68a7bb24790b7c704a521a8ef124ec392d18420cc71

Contents?: true

Size: 508 Bytes

Versions: 6

Compression:

Stored size: 508 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module Cop
    module Lint
      # @example
      #   # bad
      #   HTTParty.get(..)
      #
      #   # good
      #   TimedRequest.get(...)
      class NoHTTParty < Cop
        MSG = "Prefer `TimedRequest` instead of raw `HTTParty` calls."

        def_node_matcher :is_HTTParty?, "(send (const nil? :HTTParty) ...)"

        def on_send(node)
          return unless is_HTTParty?(node)

          add_offense(node)
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rf-stylez-1.2.4 lib/rubocop/cop/lint/no_http_party.rb
rf-stylez-1.2.3 lib/rubocop/cop/lint/no_http_party.rb
rf-stylez-1.2.1 lib/rubocop/cop/lint/no_http_party.rb
rf-stylez-1.1.2 lib/rubocop/cop/lint/no_http_party.rb
rf-stylez-1.1.1 lib/rubocop/cop/lint/no_http_party.rb
rf-stylez-1.1.0 lib/rubocop/cop/lint/no_http_party.rb