lib/rgitflow/tasks/scm/status.rb in rgitflow-0.2.1.pre.alpha.pre.32 vs lib/rgitflow/tasks/scm/status.rb in rgitflow-0.2.2
- old
+ new
@@ -1,13 +1,13 @@
-require 'rgitflow/tasks/task'
+require 'rgitflow/tasks/scm/task'
module RGitFlow
module Tasks
class SCM
- class Status < RGitFlow::Tasks::Task
+ class Status < RGitFlow::Tasks::SCM::Task
def initialize(git)
- super(git, 'status', 'Check the status of the repository', ['rgitflow', 'scm'])
+ super(git, 'status', 'Check the status of the repository')
end
protected
def run
@@ -15,41 +15,11 @@
error 'There are uncommitted changes in the repository!'
print_status
abort
- else
- status 'There are no uncommitted changes in the repository.'
end
- end
-
- def dirty?
- @git.diff.size > 0
- end
-
- 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}" }
+ status 'There are no uncommitted changes in the repository.'
end
end
end
end
end
\ No newline at end of file