Sha256: d0925adcf368e3c4366eaa3d0464f40ee5f806ddc0305753ce34e3b9ccb18f6c

Contents?: true

Size: 555 Bytes

Versions: 65

Compression:

Stored size: 555 Bytes

Contents

require 'f'
require 'grit'
include Grit

module YMDP
  class GitHelper
    def get_hash(branch)
      branch = get_current_branch || "master"
      repo = Repo.new("#{BASE_PATH}/.")
      repo.commits(branch).first.id
    end

    def get_current_branch
      result = F.execute("git status", :return => true)
      if result =~ /# On branch (.*)/
        return $1
      end
    end

    def do_commit(message)
      repo = Repo.new(".")
      repo.add(".")
      $stdout.puts F.execute("git commit -am \"#{message}\"", :return => true)
    end
  end
end

Version data entries

65 entries across 65 versions & 1 rubygems

Version Path
ymdp-1.4.7 lib/ymdp/compiler/git_helper.rb
ymdp-1.4.6 lib/ymdp/compiler/git_helper.rb
ymdp-1.4.5 lib/ymdp/compiler/git_helper.rb
ymdp-1.4.4 lib/ymdp/compiler/git_helper.rb
ymdp-1.4.3 lib/ymdp/compiler/git_helper.rb
ymdp-1.4.2 lib/ymdp/compiler/git_helper.rb
ymdp-1.4.1 lib/ymdp/compiler/git_helper.rb
ymdp-1.4.0 lib/ymdp/compiler/git_helper.rb
ymdp-1.3.4 lib/ymdp/compiler/git_helper.rb
ymdp-1.3.3 lib/ymdp/compiler/git_helper.rb
ymdp-1.3.2 lib/ymdp/compiler/git_helper.rb
ymdp-1.3.1 lib/ymdp/compiler/git_helper.rb
ymdp-1.3.0 lib/ymdp/compiler/git_helper.rb
ymdp-1.2.0 lib/ymdp/compiler/git_helper.rb
ymdp-1.1.0 lib/ymdp/compiler/git_helper.rb
ymdp-1.0.1 lib/ymdp/compiler/git_helper.rb
ymdp-1.0.0 lib/ymdp/compiler/git_helper.rb
ymdp-0.10.2 lib/ymdp/compiler/git_helper.rb
ymdp-0.10.1 lib/ymdp/compiler/git_helper.rb
ymdp-0.10.0 lib/ymdp/compiler/git_helper.rb