Method: Pod::Lockfile.from_file
- Defined in:
- lib/cocoapods-core/lockfile.rb
permalink .from_file(path) ⇒ Lockfile
Note:
This method returns nil if the given path doesn’t exists.
Loads a lockfile form the given path.
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/cocoapods-core/lockfile.rb', line 38 def self.from_file(path) return nil unless path.exist? hash = YAMLHelper.load_file(path) unless hash && hash.is_a?(Hash) raise Informative, "Invalid Lockfile in `#{path}`" end lockfile = Lockfile.new(hash) lockfile.defined_in_file = path lockfile end |