Class: LgPodPlugin::Specification
- Inherits:
-
Object
- Object
- LgPodPlugin::Specification
- Defined in:
- lib/lg_pod_plugin/specification.rb
Instance Attribute Summary collapse
-
#attributes_hash ⇒ Object
Returns the value of attribute attributes_hash.
-
#dependencies ⇒ Object
Returns the value of attribute dependencies.
-
#podfile ⇒ Object
Returns the value of attribute podfile.
-
#spec ⇒ Object
Returns the value of attribute spec.
-
#work_space ⇒ Object
Returns the value of attribute work_space.
Instance Method Summary collapse
-
#initialize(work_space, podfile, name = nil, version = nil) ⇒ Specification
constructor
A new instance of Specification.
- #install ⇒ Object
Constructor Details
#initialize(work_space, podfile, name = nil, version = nil) ⇒ Specification
Returns a new instance of Specification.
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/lg_pod_plugin/specification.rb', line 16 def initialize(work_space, podfile, name = nil, version = nil) config = Pod::Config.instance sources_manager = config.send(:sources_manager) dependency = Pod::Dependency.new(name, version) set = sources_manager.search(dependency) self.podfile = podfile self.work_space = work_space self.spec = set.send(:specification) self.attributes_hash = self.spec.send(:attributes_hash) self.dependencies = self.attributes_hash["dependencies"] end |
Instance Attribute Details
#attributes_hash ⇒ Object
Returns the value of attribute attributes_hash.
14 15 16 |
# File 'lib/lg_pod_plugin/specification.rb', line 14 def attributes_hash @attributes_hash end |
#dependencies ⇒ Object
Returns the value of attribute dependencies.
15 16 17 |
# File 'lib/lg_pod_plugin/specification.rb', line 15 def dependencies @dependencies end |
#podfile ⇒ Object
Returns the value of attribute podfile.
12 13 14 |
# File 'lib/lg_pod_plugin/specification.rb', line 12 def podfile @podfile end |
#spec ⇒ Object
Returns the value of attribute spec.
11 12 13 |
# File 'lib/lg_pod_plugin/specification.rb', line 11 def spec @spec end |
#work_space ⇒ Object
Returns the value of attribute work_space.
13 14 15 |
# File 'lib/lg_pod_plugin/specification.rb', line 13 def work_space @work_space end |
Instance Method Details
#install ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/lg_pod_plugin/specification.rb', line 28 def install pod_name = self.attributes_hash["name"] if pod_name.include?("/") real_name = pod_name.split("/").first else real_name = pod_name end return if LRequest.shared.libs[real_name] pod_version = self.attributes_hash["version"] prepare_command = self.attributes_hash['prepare_command'] return if prepare_command source = self.attributes_hash['source'] return unless source.is_a?(Hash) git = source["git"] ||= "" tag = source["tag"] ||= "" return unless git.include?("https://github.com") requirements = {:git => git, :tag => tag, :spec => spec, :release_pod => true } LRequest.shared. = requirements return unless LCache.new(self.work_space).find_pod_cache(real_name, {:git => git, :tag => tag}) LRequest.shared.libs[real_name] = requirements LgPodPlugin::Installer.new(self.podfile, real_name, requirements) end |