class MetaModel::Command::Init
Public Class Methods
new(argv)
click to toggle source
Calls superclass method
MetaModel::Command::new
# File lib/metamodel/command/init.rb, line 11 def initialize(argv) @metafile_path = Pathname.pwd + 'Metafile' @project_path = argv.shift_argument super end
Public Instance Methods
run()
click to toggle source
# File lib/metamodel/command/init.rb, line 22 def run UI.section "Initialing MetaModel project" do UI.section "Creating `Metafile` for MetaModel" do FileUtils.touch(@metafile_path) @metafile_path.open('w') do |source| source.puts "metamodel_version '#{VERSION}'\n\n" end end end end
validate!()
click to toggle source
Calls superclass method
# File lib/metamodel/command/init.rb, line 17 def validate! super raise Informative, 'Existing Metafile in directory' unless config.metafile_in_dir(Pathname.pwd).nil? end