Class: Pod::Generator::CopyResourcesScript
- Inherits:
-
Object
- Object
- Pod::Generator::CopyResourcesScript
- Defined in:
- lib/cocoapods/generator/copy_resources_script.rb
Instance Attribute Summary collapse
-
#platform ⇒ Platform
readonly
The platform of the library for which the copy resources script is needed.
-
#resources ⇒ Array<#to_s>
readonly
A list of files relative to the project pods root.
Instance Method Summary collapse
-
#initialize(resources, platform) ⇒ CopyResourcesScript
constructor
A new instance of CopyResourcesScript.
-
#save_as(pathname) ⇒ void
Saves the resource script to the given pathname.
Constructor Details
#initialize(resources, platform) ⇒ CopyResourcesScript
Returns a new instance of CopyResourcesScript.
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
#platform ⇒ Platform (readonly)
Returns 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 |
#resources ⇒ Array<#to_s> (readonly)
Returns 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.
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 |