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_by_config, platform) ⇒ CopyResourcesScript

Initialize a new instance

Parameters:

  • resources_by_config (Hash<String, Array<String>>)

    @see resources_by_config

  • platform (Platform)

    @see platform



24
25
26
27
# File 'lib/cocoapods/generator/copy_resources_script.rb', line 24

def initialize(resources_by_config, platform)
  @resources_by_config = resources_by_config
  @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.



14
15
16
# File 'lib/cocoapods/generator/copy_resources_script.rb', line 14

def platform
  @platform
end

#resources_by_configHash{String, Array{String}] A list of files relative to the project pods root, keyed by build configuration. (readonly)

Returns HashArray{String] A list of files relative to the project pods root, keyed by build configuration.

Returns:

  • (Hash{String, Array{String}] A list of files relative to the project pods root, keyed by build configuration.)

    HashArray{String] A list of files relative to the project pods root, keyed by build configuration.



9
10
11
# File 'lib/cocoapods/generator/copy_resources_script.rb', line 9

def resources_by_config
  @resources_by_config
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.



36
37
38
39
40
41
# File 'lib/cocoapods/generator/copy_resources_script.rb', line 36

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