Method: Pod::Podfile.from_yaml

Defined in:
lib/cocoapods-core/podfile.rb

.from_yaml(path) ⇒ Podfile

Configures a new Podfile from the given YAML representation.

Parameters:

  • path (Pathname)

    The path from which the Podfile is loaded.

Returns:



349
350
351
352
353
354
355
356
357
# File 'lib/cocoapods-core/podfile.rb', line 349

def self.from_yaml(path)
  string = File.open(path, 'r:utf-8', &:read)
  # Work around for Rubinius incomplete encoding in 1.9 mode
  if string.respond_to?(:encoding) && string.encoding.name != 'UTF-8'
    string.encode!('UTF-8')
  end
  hash = YAMLHelper.load_string(string)
  from_hash(hash, path)
end