Class: Flutter::Pub::ExternalSources::DownloaderSource
- Inherits:
-
Object
- Object
- Flutter::Pub::ExternalSources::DownloaderSource
- Defined in:
- lib/cocoapods-embed-flutter/flutter/external_sources.rb
Overview
The pubspec must be in the root of the repository or in directory with the name provided
Provides support for fetching a specification file from a source handled by the downloader. Supports all the options of the downloader
Instance Attribute Summary collapse
-
#can_cache ⇒ Boolean
(also: #can_cache?)
readonly
Whether the source is allowed to touch the cache.
-
#name ⇒ String
readonly
The name of the Package described by this external source.
-
#params ⇒ Hash{Symbol => String}
readonly
The hash representation of the external source.
-
#podfile_path ⇒ String
readonly
The path where the podfile is defined to resolve relative paths.
Instance Method Summary collapse
- #==(other) ⇒ Boolean
-
#description ⇒ String
A string representation of the source suitable for UI.
-
#fetch(sandbox) ⇒ void
Fetches the external source from the remote according to the params.
-
#initialize(name, params, podfile_path, can_cache = true) ⇒ DownloaderSource
constructor
Initialize a new instance.
-
#normalized_pubspec_path ⇒ String
Return the normalized path for a pubspec assuming sandbox pod folder as location.
Constructor Details
#initialize(name, params, podfile_path, can_cache = true) ⇒ DownloaderSource
Initialize a new instance
87 88 89 90 91 92 |
# File 'lib/cocoapods-embed-flutter/flutter/external_sources.rb', line 87 def initialize(name, params, podfile_path, can_cache = true) @name = name @params = params @podfile_path = podfile_path @can_cache = can_cache end |
Instance Attribute Details
#can_cache ⇒ Boolean (readonly) Also known as: can_cache?
Returns Whether the source is allowed to touch the cache.
77 78 79 |
# File 'lib/cocoapods-embed-flutter/flutter/external_sources.rb', line 77 def can_cache @can_cache end |
#name ⇒ String (readonly)
Returns the name of the Package described by this external source.
63 64 65 |
# File 'lib/cocoapods-embed-flutter/flutter/external_sources.rb', line 63 def name @name end |
#params ⇒ Hash{Symbol => String} (readonly)
Returns the hash representation of the external source.
68 69 70 |
# File 'lib/cocoapods-embed-flutter/flutter/external_sources.rb', line 68 def params @params end |
#podfile_path ⇒ String (readonly)
Returns the path where the podfile is defined to resolve relative paths.
73 74 75 |
# File 'lib/cocoapods-embed-flutter/flutter/external_sources.rb', line 73 def podfile_path @podfile_path end |
Instance Method Details
#==(other) ⇒ Boolean
97 98 99 100 |
# File 'lib/cocoapods-embed-flutter/flutter/external_sources.rb', line 97 def ==(other) return false if other.nil? name == other.name && params == other.params end |
#description ⇒ String
Returns a string representation of the source suitable for UI.
118 119 120 121 122 123 124 125 126 127 |
# File 'lib/cocoapods-embed-flutter/flutter/external_sources.rb', line 118 def description strategy = Pod::Downloader.(download_params) = download_params.dup url = .delete(strategy) result = "from `#{url}`" .each do |key, value| result << ", #{key} `#{value}`" end result end |
#fetch(sandbox) ⇒ void
This method returns an undefined value.
Fetches the external source from the remote according to the params.
112 113 114 |
# File 'lib/cocoapods-embed-flutter/flutter/external_sources.rb', line 112 def fetch(sandbox) pre_download(sandbox) end |