Class: SVN::Command::Export

Inherits:
OptionParser
  • Object
show all
Defined in:
lib/svn/command/export.rb

Constant Summary collapse

OPTIONS =
{
  :revision => ["-r", "--revision arg",
                "A revision argument can be one of:",
                "  NUMBER   revision number",
                "  HEAD     latest in repository"]
}

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeExport

Returns a new instance of Export.



21
22
23
24
25
26
27
28
29
# File 'lib/svn/command/export.rb', line 21

def initialize
  super
  @options = OpenStruct.new
  @options.revision = "HEAD"

  self.banner = "Usage: svn export [options] [URL] [path]"
  self.separator ""
  on(*OPTIONS[:revision]) { |revision| @options.revision = revision.upcase }
end

Class Method Details

.execute(args) ⇒ Object



8
9
10
11
12
# File 'lib/svn/command/export.rb', line 8

def self.execute(args)
  command = new
  command.parse!(args)
  command.execute(args)
end

Instance Method Details

#execute(args) ⇒ Object



31
32
33
34
# File 'lib/svn/command/export.rb', line 31

def execute(args)
  repo = MockVersion::Repository.load_from_path(args[0])
  repo.export_revision_to_path(@options.revision, args[1])        
end