Class: Flutter::Pub::ExternalSources::DownloaderSource

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-embed-flutter/flutter/external_sources.rb

Overview

Note:

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

Instance Method Summary collapse

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_cacheBoolean (readonly) Also known as: can_cache?



77
78
79
# File 'lib/cocoapods-embed-flutter/flutter/external_sources.rb', line 77

def can_cache
  @can_cache
end

#nameString (readonly)



63
64
65
# File 'lib/cocoapods-embed-flutter/flutter/external_sources.rb', line 63

def name
  @name
end

#paramsHash{Symbol => String} (readonly)



68
69
70
# File 'lib/cocoapods-embed-flutter/flutter/external_sources.rb', line 68

def params
  @params
end

#podfile_pathString (readonly)



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

#descriptionString



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.strategy_from_options(download_params)
  options = download_params.dup
  url = options.delete(strategy)
  result = "from `#{url}`"
  options.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

#normalized_pubspec_pathString

Return the normalized path for a pubspec assuming sandbox pod folder as location.



140
141
142
# File 'lib/cocoapods-embed-flutter/flutter/external_sources.rb', line 140

def normalized_pubspec_path(declared_path)
  Spec.find_file(name, declared_path)
end