Sha256: 9e7cc105528f11dead22d57ba8c69783b2f58059c1d2a730a38d640224beba60

Contents?: true

Size: 517 Bytes

Versions: 1

Compression:

Stored size: 517 Bytes

Contents

require 'common/command'
# Base module for all features
module Feature
  def current_feature
    res = Command.new('git')
              .arg('branch')
              .run
              .match(/^\*\s+(.*)/)[1].strip
    if res.match(/no branch/)
      raise UserError, %q(A rebase is in process.
        Finish the rebase, then run the command again)
    else
      res
    end
  end

  def changes_committed?
    cmd = Command.new 'git'
    cmd.arg 'status'

    out = cmd.run
    out =~ /nothing to commit/
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
straight_line-0.1.0.0 lib/common/feature.rb