Class: Svn::Log::Application::InfoCommand
- Inherits:
-
Object
- Object
- Svn::Log::Application::InfoCommand
- Defined in:
- lib/svnlog.rb
Overview
A command for displaying information about an index
Instance Method Summary collapse
-
#initialize(argv) ⇒ InfoCommand
constructor
A new instance of InfoCommand.
- #parse_options(argv) ⇒ Object
- #run ⇒ Object
Constructor Details
#initialize(argv) ⇒ InfoCommand
Returns a new instance of InfoCommand.
100 101 102 |
# File 'lib/svnlog.rb', line 100 def initialize(argv) (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 (argv) OptionParser.new do |opt| opt. = "Displays information about an index.\n\nExample:\n svnlog info -p C:\\\\MyIndex\n\nUsage: svnlog info [options]\n" opt.on("-p", "--path <val>", "The path to the index") { |@path| } opt.parse!(argv) end end |
#run ⇒ Object
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 |