Class: XCBootstrap::Bootstrap
- Inherits:
-
Object
- Object
- XCBootstrap::Bootstrap
- Defined in:
- lib/xcbootstrap/bootstrap.rb
Instance Attribute Summary collapse
-
#project_dir ⇒ Object
Returns the value of attribute project_dir.
-
#template_dir ⇒ Object
Returns the value of attribute template_dir.
Instance Method Summary collapse
- #finish ⇒ Object
-
#initialize(template_root, template_name, project_dir) ⇒ Bootstrap
constructor
A new instance of Bootstrap.
- #process ⇒ Object
Constructor Details
#initialize(template_root, template_name, project_dir) ⇒ Bootstrap
Returns a new instance of Bootstrap.
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/xcbootstrap/bootstrap.rb', line 10 def initialize template_root, template_name, project_dir @template_dir = File.join template_root, template_name raise "Invalid template: could not find template directory #{@template_dir}" unless File.directory?(@template_dir) manifest_file = File.join @template_dir, "manifest.yml" raise "Invalid template: could not find template manifest #{manifest_file}" unless File.exists?(manifest_file) @manifest = YAML.load_file manifest_file raise "Invalid template: manifest file did not contain a hash of file mappings #{manifest_file}" unless manifest_data_is_valid(@manifest) @project_dir = File.(project_dir, Dir.pwd) end |
Instance Attribute Details
#project_dir ⇒ Object
Returns the value of attribute project_dir.
8 9 10 |
# File 'lib/xcbootstrap/bootstrap.rb', line 8 def project_dir @project_dir end |
#template_dir ⇒ Object
Returns the value of attribute template_dir.
7 8 9 |
# File 'lib/xcbootstrap/bootstrap.rb', line 7 def template_dir @template_dir end |
Instance Method Details
#finish ⇒ Object
31 32 33 34 |
# File 'lib/xcbootstrap/bootstrap.rb', line 31 def finish print_output_project_files print_next_steps end |