Sha256: 337d02abecb1d19d569908152aa984b18ab479075bb27193210d3a3d83d6e11c

Contents?: true

Size: 388 Bytes

Versions: 8

Compression:

Stored size: 388 Bytes

Contents

module Overcommit::Hook::PreCommit
  # Checks for local paths in files and issues a warning
  class LocalPathsInGemfile < Base
    def run
      result = execute(%w[grep -IHnE (\s*path:\s*)|(\s*:path\s*=>)] + applicable_files)

      unless result.stdout.empty?
        return :warn, "Avoid pointing to local paths in Gemfiles:\n#{result.stdout}"
      end

      :pass
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
jawshooah-overcommit-0.22.0 lib/overcommit/hook/pre_commit/local_paths_in_gemfile.rb
overcommit-0.21.0 lib/overcommit/hook/pre_commit/local_paths_in_gemfile.rb
overcommit-0.20.0 lib/overcommit/hook/pre_commit/local_paths_in_gemfile.rb
overcommit-0.19.0 lib/overcommit/hook/pre_commit/local_paths_in_gemfile.rb
overcommit-0.18.0 lib/overcommit/hook/pre_commit/local_paths_in_gemfile.rb
overcommit-0.17.0 lib/overcommit/hook/pre_commit/local_paths_in_gemfile.rb
overcommit-0.16.0 lib/overcommit/hook/pre_commit/local_paths_in_gemfile.rb
overcommit-0.15.0 lib/overcommit/hook/pre_commit/local_paths_in_gemfile.rb