class Bimble::GitStrategy::Clone
Public Class Methods
new(git_url, oauth_token)
click to toggle source
# File lib/bimble/git_strategy/clone.rb, line 9 def initialize(git_url, oauth_token) @git_url = git_url @oauth_token = oauth_token end
Public Instance Methods
commit_to_new_branch()
click to toggle source
# File lib/bimble/git_strategy/clone.rb, line 28 def commit_to_new_branch @repository.branch(branch_name).create @repository.checkout(branch_name) @repository.add("Gemfile.lock") @repository.commit(commit_message) @repository.push("origin", branch_name) end
default_branch()
click to toggle source
# File lib/bimble/git_strategy/clone.rb, line 36 def default_branch @default_branch end
in_working_copy() { || ... }
click to toggle source
# File lib/bimble/git_strategy/clone.rb, line 14 def in_working_copy Dir.mktmpdir do |tmpdir| @repository = Git.clone(@git_url, tmpdir) @default_branch = @repository.branch Dir.chdir(tmpdir) do yield end end end
lockfile_changed?()
click to toggle source
# File lib/bimble/git_strategy/clone.rb, line 24 def lockfile_changed? @repository.status.changed.keys.include? "Gemfile.lock" end