Class: Pod::Generator::CopyResourcesScript

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resources, platform) ⇒ CopyResourcesScript

Returns a new instance of CopyResourcesScript.

Parameters:

  • resources (Array<#to_s>)

    @see resources

  • platform (Platform)

    @see platform



17
18
19
20
# File 'lib/cocoapods/generator/copy_resources_script.rb', line 17

def initialize(resources, platform)
  @resources = resources
  @platform = platform
end

Instance Attribute Details

#platformPlatform (readonly)

Returns The platform of the library for which the copy resources script is needed.

Returns:

  • (Platform)

    The platform of the library for which the copy resources script is needed.



12
13
14
# File 'lib/cocoapods/generator/copy_resources_script.rb', line 12

def platform
  @platform
end

#resourcesArray<#to_s> (readonly)

Returns A list of files relative to the project pods root.

Returns:

  • (Array<#to_s>)

    A list of files relative to the project pods root.



7
8
9
# File 'lib/cocoapods/generator/copy_resources_script.rb', line 7

def resources
  @resources
end

Instance Method Details

#save_as(pathname) ⇒ void

This method returns an undefined value.

Saves the resource script to the given pathname.

Parameters:

  • pathname (Pathname)

    The path where the copy resources script should be saved.



29
30
31
32
33
34
# File 'lib/cocoapods/generator/copy_resources_script.rb', line 29

def save_as(pathname)
  pathname.open('w') do |file|
    file.puts(script)
  end
  File.chmod(0755, pathname.to_s)
end