Class: Pod::Extension::SourceDefinition
- Inherits:
-
Object
- Object
- Pod::Extension::SourceDefinition
- Defined in:
- lib/cocoapods-extension/development/definition.rb
Instance Attribute Summary collapse
-
#children ⇒ Object
readonly
Returns the value of attribute children.
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
-
#map ⇒ Object
readonly
Returns the value of attribute map.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
Instance Method Summary collapse
-
#initialize(domain, parent) ⇒ SourceDefinition
constructor
A new instance of SourceDefinition.
- #source_list ⇒ Object
- #store_pod(name = nil, *requirements) ⇒ Object
- #store_pod_git(name, group, git) ⇒ Object
- #store_pod_http(name, group, git) ⇒ Object
Constructor Details
#initialize(domain, parent) ⇒ SourceDefinition
Returns a new instance of SourceDefinition.
11 12 13 14 15 16 17 18 19 |
# File 'lib/cocoapods-extension/development/definition.rb', line 11 def initialize(domain, parent) @domain = domain @parent = parent @children = [] @map = Hash::new if parent.is_a?(Pod::Extension::SourceDefinition) parent.children << self end end |
Instance Attribute Details
#children ⇒ Object (readonly)
Returns the value of attribute children.
8 9 10 |
# File 'lib/cocoapods-extension/development/definition.rb', line 8 def children @children end |
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
6 7 8 |
# File 'lib/cocoapods-extension/development/definition.rb', line 6 def domain @domain end |
#map ⇒ Object (readonly)
Returns the value of attribute map.
9 10 11 |
# File 'lib/cocoapods-extension/development/definition.rb', line 9 def map @map end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
7 8 9 |
# File 'lib/cocoapods-extension/development/definition.rb', line 7 def parent @parent end |
Instance Method Details
#source_list ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/cocoapods-extension/development/definition.rb', line 21 def source_list list = Hash::new(@map) for source in children do list = list.merge(source.map) end list end |
#store_pod(name = nil, *requirements) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/cocoapods-extension/development/definition.rb', line 29 def store_pod(name = nil, *requirements) = requirements.last || Hash.new git = [:git] || "#{name}.git" group = [:group] || name if domain.start_with? "git@" store_pod_git(name, group, git) elsif domain.size > 0 store_pod_http(name, group, git) end end |
#store_pod_git(name, group, git) ⇒ Object
41 42 43 44 |
# File 'lib/cocoapods-extension/development/definition.rb', line 41 def store_pod_git(name, group, git) source = "#{domain}:#{group}/#{git}" map[name] = source end |
#store_pod_http(name, group, git) ⇒ Object
46 47 48 49 50 51 |
# File 'lib/cocoapods-extension/development/definition.rb', line 46 def store_pod_http(name, group, git) source = Pathname(domain) source += group source += git map[name] = source.to_s end |