Class: OsCtl::Image::Operations::Repository::Create
- Defined in:
- lib/osctl/image/operations/repository/create.rb
Instance Attribute Summary collapse
- #repo_dir ⇒ String readonly
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(repo_dir) ⇒ Create
constructor
A new instance of Create.
Methods inherited from Base
Constructor Details
#initialize(repo_dir) ⇒ Create
Returns a new instance of Create.
11 12 13 14 |
# File 'lib/osctl/image/operations/repository/create.rb', line 11 def initialize(repo_dir) super() @repo_dir = repo_dir end |
Instance Attribute Details
#repo_dir ⇒ String (readonly)
8 9 10 |
# File 'lib/osctl/image/operations/repository/create.rb', line 8 def repo_dir @repo_dir end |
Instance Method Details
#execute ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/osctl/image/operations/repository/create.rb', line 16 def execute repo = OsCtl::Repo::Local::Repository.new(repo_dir) unless repo.exist? FileUtils.mkpath(repo_dir) repo.create end true end |