Class: PodsOrz::PodspecModel
- Inherits:
-
Object
- Object
- PodsOrz::PodspecModel
- Defined in:
- lib/podsorz/core/Specs/podspec_model.rb
Instance Attribute Summary collapse
-
#dependency_list ⇒ Object
Returns the value of attribute dependency_list.
-
#have_resources ⇒ Object
Returns the value of attribute have_resources.
-
#pod_name ⇒ Object
Returns the value of attribute pod_name.
Instance Method Summary collapse
-
#initialize(podspec_file_path) ⇒ PodspecModel
constructor
A new instance of PodspecModel.
Constructor Details
#initialize(podspec_file_path) ⇒ PodspecModel
Returns a new instance of PodspecModel.
7 8 9 10 11 12 13 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 |
# File 'lib/podsorz/core/Specs/podspec_model.rb', line 7 def initialize(podspec_file_path) @dependency_list = [] @have_resources = false totoal_sentences = [] File.open(podspec_file_path, "r") {|io| totoal_sentences = io.readlines } totoal_sentences.each do |line| if /\.(name)(.*) =/ =~ line @pod_name = $~.post_match.strip @pod_name = pod_name.gsub(/[\'\"]/, "") end if /\.(resource)(.*) =/ =~ line @have_resources = true end if /\.dependency/ =~ line dependency = $~.post_match.strip unless @pod_name.nil? unless dependency.include? @pod_name @dependency_list << dependency end end end end end |
Instance Attribute Details
#dependency_list ⇒ Object
Returns the value of attribute dependency_list.
5 6 7 |
# File 'lib/podsorz/core/Specs/podspec_model.rb', line 5 def dependency_list @dependency_list end |
#have_resources ⇒ Object
Returns the value of attribute have_resources.
5 6 7 |
# File 'lib/podsorz/core/Specs/podspec_model.rb', line 5 def have_resources @have_resources end |
#pod_name ⇒ Object
Returns the value of attribute pod_name.
5 6 7 |
# File 'lib/podsorz/core/Specs/podspec_model.rb', line 5 def pod_name @pod_name end |