Class: Nanoc3::Extra::VCS
- Nanoc3::Plugin
- Nanoc3::Extra::VCS
Nanoc3::Extra::VCS is a very simple representation of a version control system that abstracts the add, remove and move operations. It does not commit. This class is primarily used by data sources that store data as flat files on the disk.
This is the abstract superclass for all VCSes. Subclasses should implement the indicated methods.
Constants Inherited from Nanoc3::Plugin
Public Visibility
Public Class Method Summary
| identifier(identifier) |
Sets the identifier for this VCS. |
|---|---|
| identifiers(*identifiers) |
Sets the identifiers for this VCS. |
| register(class_or_name, *identifiers) |
Registers the given class as a VCS with the given identifier. |
Public Class Methods Inherited from Nanoc3::Plugin
Public Instance Method Summary
| #add(filename) |
Adds the file with the given filename to the working copy. |
|---|---|
| #move(src, dst) |
Moves the file with the given filename to a new location. |
| #remove(filename) |
Removes the file with the given filename from the working copy. |
Public Class Method Details
identifier
Sets the identifier for this VCS.
20 21 22 |
# File 'lib/nanoc3/extra/vcs.rb', line 20 def self.identifier(identifier) Nanoc3::Extra::VCS.register(self, identifier) end |
identifiers
Sets the identifiers for this VCS.
15 16 17 |
# File 'lib/nanoc3/extra/vcs.rb', line 15 def self.identifiers(*identifiers) Nanoc3::Extra::VCS.register(self, *identifiers) end |
register
Registers the given class as a VCS with the given identifier.
25 26 27 |
# File 'lib/nanoc3/extra/vcs.rb', line 25 def self.register(class_or_name, *identifiers) Nanoc3::Plugin.register(Nanoc3::Extra::VCS, class_or_name, *identifiers) end |
Public Instance Method Details
add
Adds the file with the given filename to the working copy.
Subclasses must implement this method.
32 33 34 |
# File 'lib/nanoc3/extra/vcs.rb', line 32 def add(filename) not_implemented('add') end |
move
Moves the file with the given filename to a new location. When this method is executed, the original file should no longer be present on the disk.
Subclasses must implement this method.
50 51 52 |
# File 'lib/nanoc3/extra/vcs.rb', line 50 def move(src, dst) not_implemented('move') end |
remove
Removes the file with the given filename from the working copy. When this method is executed, the file should no longer be present on the disk.
Subclasses must implement this method.
41 42 43 |
# File 'lib/nanoc3/extra/vcs.rb', line 41 def remove(filename) not_implemented('remove') end |