Sha256: 7d7c7a61a5da6def50dcdb6f999a0073d7c28296e9560aaa73e8fc03a4d33020

Contents?: true

Size: 531 Bytes

Versions: 1

Compression:

Stored size: 531 Bytes

Contents

require 'straight_line/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.1.0 lib/straight_line/common/feature.rb