Sha256: 78079213fb54c92f9b42936f3f78d02180e22c2c65bf1ef3c224a04f182e4e9b

Contents?: true

Size: 514 Bytes

Versions: 36

Compression:

Stored size: 514 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.'.freeze

        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

36 entries across 36 versions & 1 rubygems

Version Path
rf-stylez-1.0.1 lib/rubocop/cop/lint/no_http_party.rb
rf-stylez-1.0.0 lib/rubocop/cop/lint/no_http_party.rb
rf-stylez-0.16.0 lib/rubocop/cop/lint/no_http_party.rb
rf-stylez-0.15.0 lib/rubocop/cop/lint/no_http_party.rb
rf-stylez-0.14.0 lib/rubocop/cop/lint/no_http_party.rb
rf-stylez-0.13.0 lib/rubocop/cop/lint/no_http_party.rb
rf-stylez-0.12.0 lib/rubocop/cop/lint/no_http_party.rb
rf-stylez-0.11.1 lib/rubocop/cop/lint/no_http_party.rb
rf-stylez-0.11.0 lib/rubocop/cop/lint/no_http_party.rb
rf-stylez-0.10.0 lib/rubocop/cop/lint/no_http_party.rb
rf-stylez-0.9.0 lib/rubocop/cop/lint/no_http_party.rb
rf-stylez-0.8.0 lib/rubocop/cop/lint/no_http_party.rb
rf-stylez-0.8.0.pre2 lib/rubocop/cop/lint/no_http_party.rb
rf-stylez-0.8.0.pre lib/rubocop/cop/lint/no_http_party.rb
rf-stylez-0.7.2 lib/rubocop/cop/lint/no_http_party.rb
rf-stylez-0.7.2.pre2 lib/rubocop/cop/lint/no_http_party.rb
rf-stylez-0.7.2.pre lib/rubocop/cop/lint/no_http_party.rb
rf-stylez-0.7.1 lib/rubocop/cop/lint/no_http_party.rb
rf-stylez-0.7.1.pre lib/rubocop/cop/lint/no_http_party.rb
rf-stylez-0.7.0 lib/rubocop/cop/lint/no_http_party.rb