Class: SVN::Command::Export
- Inherits:
-
OptionParser
- Object
- OptionParser
- SVN::Command::Export
- 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
- #execute(args) ⇒ Object
-
#initialize ⇒ Export
constructor
A new instance of Export.
Constructor Details
#initialize ⇒ Export
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 = OpenStruct.new .revision = "HEAD" self. = "Usage: svn export [options] [URL] [path]" self.separator "" on(*OPTIONS[:revision]) { |revision| .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(.revision, args[1]) end |