Module: Flutter::Pub::ExternalSources
- Defined in:
- lib/cocoapods-embed-flutter/flutter/external_sources.rb
Overview
The ExternalSources modules name-spaces all the classes for accessing remote Flutter projects.
Defined Under Namespace
Classes: DownloaderSource
Constant Summary collapse
- SOURCE_KEYS =
The keys accepted by the hash of the source attribute.
{ :git => [:tag, :branch, :commit, :submodules].freeze, :svn => [:folder, :tag, :revision].freeze, :hg => [:revision].freeze, :http => [:flatten, :type, :sha256, :sha1, :headers].freeze, }.freeze
Class Method Summary collapse
-
.fetchWithNameAndOptions(name, options) ⇒ Spec
Returns the path to ‘pubspec` with the given name and location to search.
Class Method Details
.fetchWithNameAndOptions(name, options) ⇒ Spec
Note:
the source of project can either be local or all the remotes supported by ‘cocoapods-downloader`.
Returns the path to ‘pubspec` with the given name and location to search.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/cocoapods-embed-flutter/flutter/external_sources.rb', line 35 def self.fetchWithNameAndOptions(name, ) raise StandardError, 'A flutter module requires a name.' unless name = .last if .is_a?(Array) raise StandardError, "No options specified for flutter module: '#{name}'." unless .is_a?(Hash) if SOURCE_KEYS.keys.any? { |key| .key?(key) } source = DownloaderSource.new(name, , Pod::Config.instance.podfile_path) source.fetch(Pod::Config.instance.sandbox) path = source.normalized_pubspec_path elsif .key?(:path) path = [:path] else raise StandardError, "Invalid flutter module: '#{name}'." end return Spec.find(name, path) end |