Class: DevSnap::SnapRepos
- Inherits:
-
Object
- Object
- DevSnap::SnapRepos
- Includes:
- TR::CondUtils
- Defined in:
- lib/dev_snap/snap_repos.rb
Instance Method Summary collapse
- #init ⇒ Object
-
#initialize(root, name) ⇒ SnapRepos
constructor
A new instance of SnapRepos.
Constructor Details
#initialize(root, name) ⇒ SnapRepos
Returns a new instance of SnapRepos.
10 11 12 13 14 15 |
# File 'lib/dev_snap/snap_repos.rb', line 10 def initialize(root, name) raise Error, "Snap repos root cannot be nil" if root.nil? @root = root FileUtils.mkdir_p(@root) if not File.exist?(@root) @name = name end |
Instance Method Details
#init ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/dev_snap/snap_repos.rb', line 17 def init target = File.join(@root, @name) if not File.exist?(target) logger.debug "Snap workspace '#{target}' does not exist. Creating new bare workspace" GitCli::Vcs.new.init(target, true) else logger.debug "Snap workspace '#{target}' already exist." end target end |