Class: Svn::Log::Application::IndexCommand

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

Overview

A command for populating an index

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ IndexCommand

Returns a new instance of IndexCommand.



71
72
73
# File 'lib/svnlog.rb', line 71

def initialize(argv)
  parse_options(argv)
end

Instance Method Details

#parse_options(argv) ⇒ Object



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/svnlog.rb', line 75

def parse_options(argv)
  OptionParser.new do |opt|
    opt.banner = "Populates an index with log entries from an SVN repository.\n\nExamples:\n  svnlog index -p C:\\\\MyIndex -r svn://server/repos/path/to/something\n  svnlog index -p C:\\\\MyIndex\n\nUsage: svnlog index [options]\n"
    opt.on("-p", "--path <val>", "The path to the index") { |@path| }
    opt.on("-r", "--repository-url <val>", "The url of the SVN repository") { |@repository_url| }
    opt.parse!(argv)
  end
end

#runObject



92
93
94
# File 'lib/svnlog.rb', line 92

def run
  Index.new(@path, @repository_url).update
end