class Duty::Git::Tasks::DeleteFeature

Public Class Methods

description() click to toggle source
# File lib/duty/git.rb, line 71
def self.description
  "Delete a feature"
end
usage() click to toggle source
# File lib/duty/git.rb, line 75
def self.usage
  "duty delete-feature <feature-name>"
end

Public Instance Methods

execute() click to toggle source
# File lib/duty/git.rb, line 83
def execute
  checkout_master
  sh("Delete `feature/#{@feature_name}` branch on `origin`") { "git push origin --delete remotes/origin/feature/#{@feature_name}" }
  sh("Delete `feature/#{@feature_name}` branch") { "git branch -d feature/#{@feature_name}" }
end
valid?() click to toggle source
# File lib/duty/git.rb, line 79
def valid?
  @feature_name = @arguments.first
end