Class: Pod::DemoTailor

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-vemars/services/tailor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(components_details) ⇒ DemoTailor

Returns a new instance of DemoTailor.



7
8
9
# File 'lib/cocoapods-vemars/services/tailor.rb', line 7

def initialize(components_details)
  @components_details = components_details
end

Instance Attribute Details

#components_detailsObject (readonly)

Returns the value of attribute components_details.



3
4
5
# File 'lib/cocoapods-vemars/services/tailor.rb', line 3

def components_details
  @components_details
end

#processedPaths=(value) ⇒ Object (writeonly)

Sets the attribute processedPaths

Parameters:

  • value

    the value to set the attribute processedPaths to.



5
6
7
# File 'lib/cocoapods-vemars/services/tailor.rb', line 5

def processedPaths=(value)
  @processedPaths = value
end

Instance Method Details

#executeObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/cocoapods-vemars/services/tailor.rb', line 11

def execute
  system("mkdir .vemars") unless Dir.exists? ".vemars"
  system("mkdir .vemars/RedDemos")
  system("mkdir .vemars/RedDemos/Base")
  system("mkdir .vemars/RedDemos/Debug")
  Dir.glob(Dir.pwd + "/DevPods/App/Base/Tasks/**").each do |name|
    next unless Dir.exists? name
    pod_name = name.split('/').last
    next if pod_name == "OneKit"
    next if @components_details.find {|com|
      com.name == pod_name
    }
    system("mv #{name} #{Dir.pwd + "/.vemars/RedDemos/Base/#{pod_name}"}")
  end
  Dir.glob(Dir.pwd + "/DevPods/App/Debug/**").each do |name|
    next unless Dir.exists? name
    pod_name = name.split('/').last
    next if pod_name == 'Cell' || pod_name == 'Public'

    next if @components_details.find {|com|
      com.name == pod_name
    }
    system("mv #{name} #{Dir.pwd + "/.vemars/RedDemos/Debug/#{pod_name}"}")
  end
  system("rm -rf .vemars/RedDemos")
end