Class: Pod::Command::Dev::Init

Inherits:
Pod::Command::Dev show all
Defined in:
lib/cocoapods-extension/command/development/init.rb

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ Init

Returns a new instance of Init.



11
12
13
# File 'lib/cocoapods-extension/command/development/init.rb', line 11

def initialize(argv)
    super
end

Instance Method Details

#runObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/cocoapods-extension/command/development/init.rb', line 15

def run
    begin
        UI.puts "Initing development environment."
        project_url = Pathname(Dir.pwd) 
        Pod::Extension::Sandbox::install!
        Pod::Extension::Sandbox::podfile_exists! project_url
        conf = Pod::Extension::Configurator::find_conf? project_url
        conf ||= Pod::Extension::Configurator::create_conf! project_url
        project = Pod::Extension::Sandbox::Project::new conf
        project.install!
    rescue => exception
        puts "[!] #{exception}".red
    end
end