Class: Pod::Generator::FileList

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

Overview

Generates an xcfilelist file.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(paths) ⇒ FileList

Initialize a new instance

Parameters:

  • paths (Array<String>)

    @see paths


15
16
17
# File 'lib/cocoapods/generator/file_list.rb', line 15

def initialize(paths)
  @paths = paths
end

Instance Attribute Details

#pathsArray<String> (readonly)

Returns The paths of the files in the file list.

Returns:

  • (Array<String>)

    The paths of the files in the file list.


8
9
10
# File 'lib/cocoapods/generator/file_list.rb', line 8

def paths
  @paths
end

Instance Method Details

#generateString

Generates the contents of the file list.

Returns:

  • (String)

23
24
25
# File 'lib/cocoapods/generator/file_list.rb', line 23

def generate
  paths.join("\n")
end

#save_as(path) ⇒ void

This method returns an undefined value.

Generates and saves the file list to the given path.

Parameters:

  • path (Pathname)

    The path where the file list should be stored.


34
35
36
# File 'lib/cocoapods/generator/file_list.rb', line 34

def save_as(path)
  path.open('w') { |file_list| file_list.write(generate) }
end