Class: LgPodPlugin::LockfileModel
- Inherits:
-
Object
- Object
- LgPodPlugin::LockfileModel
- Defined in:
- lib/lg_pod_plugin/config/lockfile_model.rb
Instance Attribute Summary collapse
-
#checkout_options_data ⇒ Object
Returns the value of attribute checkout_options_data.
-
#external_sources_data ⇒ Object
Returns the value of attribute external_sources_data.
-
#lockfile ⇒ Object
Returns the value of attribute lockfile.
-
#release_pods ⇒ Object
Returns the value of attribute release_pods.
Class Method Summary collapse
Instance Method Summary collapse
- #checkout_options_for_pod_named(name) ⇒ Object
-
#initialize ⇒ LockfileModel
constructor
A new instance of LockfileModel.
Constructor Details
#initialize ⇒ LockfileModel
Returns a new instance of LockfileModel.
11 12 |
# File 'lib/lg_pod_plugin/config/lockfile_model.rb', line 11 def initialize end |
Instance Attribute Details
#checkout_options_data ⇒ Object
Returns the value of attribute checkout_options_data.
9 10 11 |
# File 'lib/lg_pod_plugin/config/lockfile_model.rb', line 9 def @checkout_options_data end |
#external_sources_data ⇒ Object
Returns the value of attribute external_sources_data.
8 9 10 |
# File 'lib/lg_pod_plugin/config/lockfile_model.rb', line 8 def external_sources_data @external_sources_data end |
#lockfile ⇒ Object
Returns the value of attribute lockfile.
6 7 8 |
# File 'lib/lg_pod_plugin/config/lockfile_model.rb', line 6 def lockfile @lockfile end |
#release_pods ⇒ Object
Returns the value of attribute release_pods.
7 8 9 |
# File 'lib/lg_pod_plugin/config/lockfile_model.rb', line 7 def release_pods @release_pods end |
Class Method Details
.from_file ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 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/config/lockfile_model.rb', line 14 def self.from_file lockfile = LProject.shared.lockfile unless lockfile lockfile_model = LockfileModel.new lockfile_model.lockfile = nil lockfile_model.release_pods = {} lockfile_model. = {} lockfile_model.external_sources_data = {} return lockfile_model end release_pods = Hash.new pods = lockfile.send(:generate_pod_names_and_versions) pods.each do |element| if LUtils.is_a_string?(element) || element.is_a?(Hash) key = element.is_a?(Hash) ? element.keys.first : element next unless key if key.include?(" ") pod_name = LUtils.pod_real_name(key.split(" ").first) else pod_name = key end tag = key[/(?<=\().*?(?=\))/] release_pods[pod_name] = tag else next end end lockfile_model = LockfileModel.new lockfile_model.lockfile = lockfile lockfile_model.release_pods = release_pods lockfile_model. = lockfile.send(:checkout_options_data) lockfile_model. = {} unless lockfile_model. lockfile_model.external_sources_data = lockfile.send(:external_sources_data) lockfile_model.external_sources_data = {} unless lockfile_model.external_sources_data lockfile_model end |
Instance Method Details
#checkout_options_for_pod_named(name) ⇒ Object
51 52 53 54 55 |
# File 'lib/lg_pod_plugin/config/lockfile_model.rb', line 51 def (name) return {} unless @lockfile hash = @lockfile.(name) hash ? hash : {} end |