Class: Pod::Installer::CopyResourcesScript

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods/installer.rb

Constant Summary collapse

CONTENT =
<<EOS
#!/bin/sh

install_resource()
{
  echo "cp -R ${SRCROOT}/Pods/$1 ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
  cp -R ${SRCROOT}/Pods/$1 ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}
}
EOS

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resources) ⇒ CopyResourcesScript

A list of files relative to the project pods root.



33
34
35
# File 'lib/cocoapods/installer.rb', line 33

def initialize(resources)
  @resources = resources
end

Instance Attribute Details

#resourcesObject (readonly)

Returns the value of attribute resources.



30
31
32
# File 'lib/cocoapods/installer.rb', line 30

def resources
  @resources
end

Instance Method Details

#save_as(pathname) ⇒ Object



37
38
39
40
41
42
43
44
45
46
# File 'lib/cocoapods/installer.rb', line 37

def save_as(pathname)
  pathname.open('w') do |script|
    script.puts CONTENT
    @resources.each do |resource|
      script.puts "install_resource '#{resource}'"
    end
  end
  # TODO use File api
  system("chmod +x '#{pathname}'")
end