Sha256: e765de59de7a838ec764b91771ada6cac9cd9804fbef52e31f754a74091d811c

Contents?: true

Size: 609 Bytes

Versions: 4

Compression:

Stored size: 609 Bytes

Contents

module Retest
  class VersionControl
    def self.files
      [Git, NoVersionControl].select(&:installed?).first.new.files
    end

    def name; end
    alias :to_s :name

    class NoVersionControl
      def self.installed?
        true
      end

      def name
        'default'
      end

      def files
        Dir.glob('**/*') - Dir.glob('{tmp,node_modules}/**/*')
      end
    end

    class Git
      def self.installed?
        system "git -C . rev-parse 2>/dev/null"
      end

      def name
        'git'
      end

      def files
        `git ls-files`.split("\n")
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
retest-0.8.0 lib/retest/version_control.rb
retest-0.8.0.pre3 lib/retest/version_control.rb
retest-0.8.0.pre2 lib/retest/version_control.rb
retest-0.8.0.pre lib/retest/version_control.rb