Sha256: e677a5f4242086d063460b08d70c41b47836401f7b16ace3c1ad1daf3adee479

Contents?: true

Size: 561 Bytes

Versions: 16

Compression:

Stored size: 561 Bytes

Contents

module CC
  module Analyzer
    class PathEntries
      def initialize(initial_path)
        @initial_path = initial_path.gsub(%r{/$}, "")
      end

      def entries
        if File.directory?(initial_path)
          all_entries.reject do |path|
            path.end_with?("/.") || path.start_with?(".git/")
          end
        else
          initial_path
        end
      end

      private

      attr_reader :initial_path

      def all_entries
        Dir.glob("#{initial_path}/**/*", File::FNM_DOTMATCH).push(initial_path)
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
codeclimate-0.17.0 lib/cc/analyzer/path_entries.rb
codeclimate-0.16.6 lib/cc/analyzer/path_entries.rb
codeclimate-0.16.5 lib/cc/analyzer/path_entries.rb
codeclimate-0.16.4 lib/cc/analyzer/path_entries.rb
codeclimate-0.16.3 lib/cc/analyzer/path_entries.rb
codeclimate-0.16.2 lib/cc/analyzer/path_entries.rb
codeclimate-0.16.1 lib/cc/analyzer/path_entries.rb
codeclimate-0.16.0 lib/cc/analyzer/path_entries.rb
codeclimate-0.15.2 lib/cc/analyzer/path_entries.rb
codeclimate-0.15.1 lib/cc/analyzer/path_entries.rb
codeclimate-0.15.0 lib/cc/analyzer/path_entries.rb
codeclimate-0.14.7 lib/cc/analyzer/path_entries.rb
codeclimate-0.14.6 lib/cc/analyzer/path_entries.rb
codeclimate-0.14.5 lib/cc/analyzer/path_entries.rb
codeclimate-0.14.4 lib/cc/analyzer/path_entries.rb
codeclimate-0.14.3 lib/cc/analyzer/path_entries.rb