class RGitFlow::Tasks::SCM::Task
Public Class Methods
new(git, name, description, namespaces=['rgitflow', 'scm'], dependencies=[])
click to toggle source
Calls superclass method
RGitFlow::Tasks::Task::new
# File lib/rgitflow/tasks/scm/task.rb, line 7 def initialize(git, name, description, namespaces=['rgitflow', 'scm'], dependencies=[]) super(git, name, description, namespaces, dependencies) end
Public Instance Methods
dirty?()
click to toggle source
# File lib/rgitflow/tasks/scm/task.rb, line 12 def dirty? @git.diff.size > 0 end
print_status()
click to toggle source
# File lib/rgitflow/tasks/scm/task.rb, line 16 def print_status added = [] modified = [] deleted = [] @git.diff.each { |f| if f.type == 'new' added << f elsif f.type == 'modified' modified << f elsif f.type == 'deleted' deleted << f end } debug 'added' added.each { |f| debug " #{ANSI::Constants::GREEN}#{ANSI::Constants::BRIGHT}"\ "#{f.path}#{ANSI::Constants::CLEAR}" } debug 'modified' modified.each { |f| debug " #{ANSI::Constants::YELLOW}#{ANSI::Constants::BRIGHT}"\ "#{f.path}#{ANSI::Constants::CLEAR}" } debug 'deleted' deleted.each { |f| debug " #{ANSI::Constants::RED}#{ANSI::Constants::BRIGHT}"\ "#{f.path}#{ANSI::Constants::CLEAR}" } end