Class: Pod::Extension::Development

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-extension/development/dsl.rb,
lib/cocoapods-extension/development/development.rb,
lib/cocoapods-extension/development/development.rb

Defined Under Namespace

Modules: DSL, PodDSL, SourceDSL Classes: Pods, Source

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDevelopment

Returns a new instance of Development.



16
17
18
19
20
21
22
23
24
25
# File 'lib/cocoapods-extension/development/development.rb', line 16

def initialize
    @runing = false
    @project = nil
    @workspace = nil
    @pods_list = nil
    @source_list = nil
    @pods_definition = Pod::Extension::Development::Pods::new
    @source_definition = Pod::Extension::Development::Source::new
    run
end

Instance Attribute Details

#pods_definitionObject (readonly)

Returns the value of attribute pods_definition.



9
10
11
# File 'lib/cocoapods-extension/development/development.rb', line 9

def pods_definition
  @pods_definition
end

#source_definitionObject (readonly)

Returns the value of attribute source_definition.



9
10
11
# File 'lib/cocoapods-extension/development/development.rb', line 9

def source_definition
  @source_definition
end

Class Method Details

.developmentObject



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

def self.development 
    @@shared ||= Pod::Extension::Development::new
    @@shared
end

Instance Method Details

#pod!(name, source, share) ⇒ Object



39
40
41
42
43
44
45
46
# File 'lib/cocoapods-extension/development/development.rb', line 39

def pod! name, source, share
    unless share 
        repos = @project::repos
    else
        repos = @workspace::repos
    end
    repos.pod! name, source, share
end

#pods_list?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/cocoapods-extension/development/development.rb', line 31

def pods_list?
    @pods_list
end

#runObject



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/cocoapods-extension/development/development.rb', line 48

def run
    project_url = Dir.pwd
    conf = Pod::Extension::Configurator::find_conf? project_url
    return nil if conf.nil?

    @project = Pod::Extension::Sandbox::Project::new conf
    @project.install!
    pod_file = @project.pod_file
    return nil unless pod_file.exist?

    @workspace = Pod::Extension::Sandbox::workspace
    source_file = @workspace.source_file
    return nil unless source_file.exist?

    begin
        @pods_definition::run pod_file
        @source_definition::run source_file
        @pods_list = @pods_definition.pods_list
        @source_list = @source_definition.source_list
        if @pods_list.size > 0 && @source_list.size > 0
            @runing = true
            UI.puts 'Pod::Extension::Development working.'.green
        end
    rescue => exception
        puts "[!] #{exception}".red
    end
end

#runing?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/cocoapods-extension/development/development.rb', line 27

def runing?
    @runing
end

#source_list?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/cocoapods-extension/development/development.rb', line 35

def source_list?
    @source_list
end