Class: BuildTool::VCS::Base
- Inherits:
-
Object
- Object
- BuildTool::VCS::Base
- Includes:
- MJ::Tools::SubProcess
- Defined in:
- lib/build-tool/vcs/base.rb
Overview
Base class for Version Control System implementations
Defined Under Namespace
Classes: VcsError
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
ATTRIBUTES.
Instance Method Summary collapse
- #apply_patches_after_rebase? ⇒ Boolean
- #configure ⇒ Object
-
#gc ⇒ Object
Collect garbage, do maintenance …
-
#initialize(config) ⇒ Base
constructor
# Create a repository.
- #local_path ⇒ Object
-
#local_path_exist? ⇒ Boolean
checks if path exists and is a directory.
-
#patches_supported? ⇒ Boolean
CAPABILITIES.
- #recipe ⇒ Object
- #remote_path ⇒ Object
- #repository ⇒ Object
Constructor Details
#initialize(config) ⇒ Base
# Create a repository
43 44 45 |
# File 'lib/build-tool/vcs/base.rb', line 43 def initialize( config ) @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
ATTRIBUTES
50 51 52 |
# File 'lib/build-tool/vcs/base.rb', line 50 def config @config end |
Instance Method Details
#apply_patches_after_rebase? ⇒ Boolean
58 59 60 |
# File 'lib/build-tool/vcs/base.rb', line 58 def apply_patches_after_rebase? false end |
#configure ⇒ Object
93 94 95 |
# File 'lib/build-tool/vcs/base.rb', line 93 def configure logger.debug "VCS #{name} did not implement configure!" end |
#gc ⇒ Object
Collect garbage, do maintenance …
63 64 |
# File 'lib/build-tool/vcs/base.rb', line 63 def gc end |
#local_path ⇒ Object
66 67 68 69 70 |
# File 'lib/build-tool/vcs/base.rb', line 66 def local_path local_path = @config.local_path raise ConfigurationError, "#{self.class}.local_path not set" if local_path.nil? local_path end |
#local_path_exist? ⇒ Boolean
checks if path exists and is a directory
89 90 91 |
# File 'lib/build-tool/vcs/base.rb', line 89 def local_path_exist? !local_path.nil? and File.exist? local_path and File.directory? local_path end |
#patches_supported? ⇒ Boolean
CAPABILITIES
54 55 56 |
# File 'lib/build-tool/vcs/base.rb', line 54 def patches_supported? false end |
#recipe ⇒ Object
97 98 99 |
# File 'lib/build-tool/vcs/base.rb', line 97 def recipe Application::instance.recipe end |
#remote_path ⇒ Object
72 73 74 75 76 |
# File 'lib/build-tool/vcs/base.rb', line 72 def remote_path remote_path = @config.remote_path raise ConfigurationError, "#{self.class}.remote_path not set" if remote_path.nil? remote_path end |
#repository ⇒ Object
78 79 80 81 82 |
# File 'lib/build-tool/vcs/base.rb', line 78 def repository repository = @config.repository raise ConfigurationError, "#{self.class}.repository not set" if repository.nil? repository end |