Skip to content
Browse files

Added a small message at the end of the list method to show the numbe…

…r of repositories listed.
  • Loading branch information...
1 parent f327b46 commit 354328bac2d79d873a83f674fde2c389a2869203 Ryan Bigg committed with lachlanhardy Jun 22, 2008
Showing with 4 additions and 1 deletion.
  1. +3 −0 lib/gitjour/application.rb
  2. +1 −1 lib/gitjour/version.rb
View
3 lib/gitjour/application.rb
@@ -42,6 +42,7 @@ def run(*args)
private
def service_list_display(service_list, *rest)
+ @total_services = 0
lines = []
service_list.inject({}) do |service_by_repository, service|
service_by_repository[service.repository] ||= []
@@ -52,6 +53,7 @@ def service_list_display(service_list, *rest)
end.each do |(repository, services)|
local_services = services.select { |s| s.host == Socket.gethostname + "." }
services -= local_services unless rest.include?("--local")
+ @total_services += services.size
lines << "=== #{repository} #{services.length > 1 ? "(#{services.length} copies)" : ""}" if services.size >= 1
services.sort_by {|s| s.host}.each do |service|
lines << "\t#{service.name} #{service.url}"
@@ -62,6 +64,7 @@ def service_list_display(service_list, *rest)
def list(*rest)
puts service_list_display(service_list, *rest)
+ puts "#{@total_services} repositories shown."
end
def serve(path=Dir.pwd, *rest)
View
2 lib/gitjour/version.rb
@@ -2,7 +2,7 @@ module Gitjour #:nodoc:
module VERSION #:nodoc:
MAJOR = 8
MINOR = 0
- TINY = 1
+ TINY = 2
STRING = [MAJOR, MINOR, TINY].join('.')
end
end

0 comments on commit 354328b

Please sign in to comment.
Something went wrong with that request. Please try again.