Class: Pod::Command::X::Edit

Inherits:
Pod::Command::X show all
Extended by:
Executable
Defined in:
lib/cocoapods-x/command/edit.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ Edit

Returns a new instance of Edit.



20
21
22
23
24
25
# File 'lib/cocoapods-x/command/edit.rb', line 20

def initialize(argv)
    @wipe_pods = argv.flag?('pods')
    @wipe_source = argv.flag?('source')
    @wipe_podfile = argv.flag?('podfile')
    super
end

Class Method Details

.optionsObject



12
13
14
15
16
17
18
# File 'lib/cocoapods-x/command/edit.rb', line 12

def self.options
    [
        ['--pods', 'Edit source.rb file.'],
        ['--source', 'Edit source.rb file.'],
        ['--podfile', 'Edit Podfile file.']
    ].concat(super)
end

Instance Method Details

#runObject



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/cocoapods-x/command/edit.rb', line 27

def run
    begin
        if @wipe_pods
            open_pods!
        end
    
        if @wipe_source
            open_source!
        end
    
        if @wipe_podfile
            open_podfile!
        end
    rescue => exception
        puts "[!] Pod::X #{exception}".red
    end

end