Sha256: 162a4129ee0f76f4bf71007837140b3b1945a86a663230dc5fc028e2c2e1dc7a
Contents?: true
Size: 1.05 KB
Versions: 1
Compression:
Stored size: 1.05 KB
Contents
require 'karo/common' require 'thor' require 'rugged' module Karo class Workflow < Thor include Karo::Common desc "feature", "create a feature branch for a given name" def feature(name) branch_name = "feature/#{name}" if current_branch.eql?(branch_name) say "You are already on #{branch_name} this feature branch", :red elsif branch_exists? branch_name say "Feature branch #{branch_name} already exists! so checking it out", :red checkout_branch branch_name else create_and_checkout_branch branch_name end end desc "bugfix", "create a bug fix branch for a given name" def bugfix(name) branch_name = "bugfix/#{name}" if current_branch.eql?(branch_name) say "You are already on #{branch_name} this bug fix branch", :red elsif branch_exists? branch_name say "Bug fix branch #{branch_name} already exists! so checking it out", :red checkout_branch branch_name else create_and_checkout_branch branch_name end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
karo-2.5.0 | lib/karo/workflow.rb |