class Pod::Command::Dev::Open

Public Class Methods

new(argv) click to toggle source
Calls superclass method
# File lib/cocoapods-extension/command/development/open.rb, line 21
def initialize(argv)
    @wipe_proj = argv.flag?('proj')
    @wipe_wks = argv.flag?('wks')
    super
end
options() click to toggle source
Calls superclass method
# File lib/cocoapods-extension/command/development/open.rb, line 14
def self.options
    [
        ['--proj', 'Open development project.'],
        ['--wks', 'Open development workspace.'],
    ].concat(super)
end

Public Instance Methods

open_proj() click to toggle source
# File lib/cocoapods-extension/command/development/open.rb, line 41
def open_proj
    project_url = Pathname(Dir.pwd) 
    Pod::Extension::Sandbox::install!
    Pod::Extension::Sandbox::podfile_exists! project_url
    conf = Pod::Extension::Configurator::find_conf? project_url
    if !conf.nil? && conf.verify?
        UI.section("Opening project.") do
            open! [conf::project_debug_url]
        end
    else
        UI.puts "Please run `pod dev init`."
    end
end
open_wks() click to toggle source
# File lib/cocoapods-extension/command/development/open.rb, line 55
def open_wks
    UI.section("Opening workspace.") do
        open! [Pod::Extension::Sandbox::workspace::root]
    end
end
run() click to toggle source
# File lib/cocoapods-extension/command/development/open.rb, line 27
def run
    if @wipe_proj
        open_proj
    end

    if @wipe_wks
        open_wks
    end

    if !@wipe_proj && !@wipe_wks
        help!
    end
end