class Boxen::Checkout
Attributes
config[R]
Public Class Methods
new(config)
click to toggle source
# File lib/boxen/checkout.rb, line 5 def initialize(config) @config = config end
Public Instance Methods
changes()
click to toggle source
# File lib/boxen/checkout.rb, line 21 def changes Dir.chdir(config.repodir) { `git status --porcelain`.strip } end
dirty?()
click to toggle source
# File lib/boxen/checkout.rb, line 17 def dirty? !changes.empty? end
master?()
click to toggle source
# File lib/boxen/checkout.rb, line 13 def master? Dir.chdir(config.repodir) { `git symbolic-ref HEAD`.strip == 'refs/heads/master' } end
sha()
click to toggle source
# File lib/boxen/checkout.rb, line 9 def sha Dir.chdir(config.repodir) { `git rev-parse HEAD`.strip } end