Class: Svn::Log::Application::InfoCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/svnlog.rb

Overview

A command for displaying information about an index

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ InfoCommand

Returns a new instance of InfoCommand.



100
101
102
# File 'lib/svnlog.rb', line 100

def initialize(argv)
  parse_options(argv)
end

Instance Method Details

#parse_options(argv) ⇒ Object



104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/svnlog.rb', line 104

def parse_options(argv)
  OptionParser.new do |opt|
    opt.banner = <<END
Displays information about an index.

Example:
  svnlog info -p C:\\MyIndex

Usage: svnlog info [options]
END
    opt.on("-p", "--path <val>", "The path to the index") { |@path| }
    opt.parse!(argv)
  end
end

#runObject



119
120
121
122
123
124
# File 'lib/svnlog.rb', line 119

def run
  index = Index.new(@path)
  return if index.size == 0
  puts "Repository URL: #{index.repository_url}"
  puts "Last Revision: #{index.last_revision}"
end