#!/usr/bin/env ruby require 'optparse' require 'methadone' require_relative '../motion-prime/version' class App include Methadone::Main include Methadone::CLILogging include Methadone::SH main do |command, opt| case command.to_sym when :new then create(opt) else help end 0 end def self.help info "Command line tools for MotionPrime" info "Commands:" info " new " info " Creates a new MotionPrime app from a template." end def self.create(name) return puts "Usage: prime new " unless name.to_s.length > 0 info "Creating new MotionPrime iOS app: #{name}" sh "motion create #{name} --template=motion-prime" info "Command: bundle instal" sh "cd ./#{name} & bundle install" info "Command: pod setup" sh "cd ./#{name} & pod setup" info "Command: rake pod:install" sh "cd ./#{name} & rake pod:install" end description "Command line tools for MotionPrime" arg :command arg :opt, :optional version MotionPrime::VERSION go! end