Class: MetaModel::Command::Install
- Inherits:
-
MetaModel::Command
- Object
- CLAide::Command
- MetaModel::Command
- MetaModel::Command::Install
- Includes:
- MetaModel::Config::Mixin
- Defined in:
- lib/metamodel/command/install.rb
Constant Summary
Constants inherited from MetaModel::Command
METAMODEL_COMMAND_ALIAS, METAMODEL_OPTION_ALIAS
Instance Attribute Summary collapse
-
#models ⇒ Object
Returns the value of attribute models.
Instance Method Summary collapse
- #clone_project ⇒ Object
-
#initialize(argv) ⇒ Install
constructor
A new instance of Install.
- #prepare ⇒ Object
- #run ⇒ Object
- #validate! ⇒ Object
Methods included from MetaModel::Config::Mixin
Methods inherited from MetaModel::Command
#installer_for_config, options, run
Constructor Details
#initialize(argv) ⇒ Install
Returns a new instance of Install.
15 16 17 18 |
# File 'lib/metamodel/command/install.rb', line 15 def initialize(argv) validate! super end |
Instance Attribute Details
#models ⇒ Object
Returns the value of attribute models.
13 14 15 |
# File 'lib/metamodel/command/install.rb', line 13 def models @models end |
Instance Method Details
#clone_project ⇒ Object
33 34 35 36 37 38 39 40 41 42 |
# File 'lib/metamodel/command/install.rb', line 33 def clone_project if File.exist? config. UI. "Existing project `#{config.}`" else UI.section "Cloning MetaModel project into `./metamodel` folder" do Git.clone(config., 'metamodel', :depth => 1) UI. "Using `#{config.}` to build module" end end end |
#prepare ⇒ Object
29 30 31 |
# File 'lib/metamodel/command/install.rb', line 29 def prepare clone_project end |
#run ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/metamodel/command/install.rb', line 20 def run UI.section "Building MetaModel.framework in project" do prepare installer = installer_for_config installer.install! end UI.notice "Please drag MetaModel.framework into Embedded Binaries phrase.\n" end |
#validate! ⇒ Object
44 45 46 47 |
# File 'lib/metamodel/command/install.rb', line 44 def validate! # super raise Informative, 'No Metafile in current directory' unless config.(Pathname.pwd) end |