Sha256: 23a1e54caefd1e65856605f98e55f1fb699b37693ed969bd376afc3f5e0edf93

Contents?: true

Size: 925 Bytes

Versions: 3

Compression:

Stored size: 925 Bytes

Contents

require 'git'

module RepoManager
  module RepoApi

    def repo_exists?(folder)
      File.exists?(File.join(current_dir, folder, '.git'))
    end

    def repo_init(folder)
      create_dir(folder) unless repo_exists?(folder)
      repo_path = fullpath(folder)
      Git.init(repo_path)
    end

    def repo_add_all(folder)
      repo_path = fullpath(folder)
      repo = Git.init(repo_path)
      in_path(repo_path) do
        repo.add('.').should be_true
      end
    end

    def repo_add_file(filename, folder)
      repo_path = fullpath(folder)
      repo = Git.init(repo_path)
      repo.add(filename).should be_true
    end

    def repo_commit_all(folder)
      repo_path = fullpath(folder)
      repo = Git.init(repo_path)
      repo.commit_all("cucumber commit").should be_true
    end

    def repo_file_exists?(folder, filename)
      File.exists?(File.join(current_dir, folder, filename))
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
repo_manager-0.7.3 lib/repo_manager/test/repo_api.rb
repo_manager-0.7.2 lib/repo_manager/test/repo_api.rb
repo_manager-0.7.1 lib/repo_manager/test/repo_api.rb