class RSwift::CLI

Attributes

project_configurator[RW]
template_manager[RW]

Public Class Methods

new(args = [], local_options = {}, config = {}) click to toggle source
Calls superclass method
# File lib/rswift/cli.rb, line 8
def initialize(args = [], local_options = {}, config = {})
  super
  @template_manager = RSwift::TemplateManager.new
  @project_configurator = RSwift::ProjectConfigurator.new
end

Public Instance Methods

app(name) click to toggle source
# File lib/rswift/cli.rb, line 17
def app(name)
  template = options[:template]
  template ||= 'ios'
  template = template.to_sym
  abort 'Available templates: ios (default), osx, tvos, watchos' unless RSwift::Constants::TEMPLATE_PROPERTIES.keys.include? template
  abort 'Not implemented yet' if template == :watchos

  @template_manager.create_files_for_template(name, template)

  project_path = "#{name}/#{name}.xcodeproj"
  project = Xcodeproj::Project.new project_path
  @project_configurator.configure_project(project, template)
  project.save
  say_status :generate, project_path
end