Class: Podfile_Modle
- Inherits:
-
Object
- Object
- Podfile_Modle
- Defined in:
- lib/big_keeper/util/podfile_detector.rb
Instance Attribute Summary collapse
-
#branch ⇒ Object
Returns the value of attribute branch.
-
#comment ⇒ Object
Returns the value of attribute comment.
-
#configurations ⇒ Object
Returns the value of attribute configurations.
-
#git ⇒ Object
Returns the value of attribute git.
-
#name ⇒ Object
Returns the value of attribute name.
-
#path ⇒ Object
Returns the value of attribute path.
-
#tag ⇒ Object
Returns the value of attribute tag.
Instance Method Summary collapse
-
#initialize(sentence) ⇒ Podfile_Modle
constructor
A new instance of Podfile_Modle.
Constructor Details
#initialize(sentence) ⇒ Podfile_Modle
Returns a new instance of Podfile_Modle.
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
# File 'lib/big_keeper/util/podfile_detector.rb', line 110 def initialize(sentence) if sentence.include?('#') list = sentence.split('#') @comment = list[1] sentence = list[0] end sentence_slip_list = sentence.split(',') return if sentence_slip_list.size.zero? for piece in sentence_slip_list do if /:git =>/ =~ piece @git = $~.post_match.strip elsif /:path =>/ =~ piece @path = $~.post_match.strip elsif /:configurations =>/ =~ piece @configurations = $~.post_match.strip elsif /:branch =>/ =~ piece @branch = $~.post_match.strip elsif /:tag =>/ =~ piece @tag = $~.post_match.strip elsif /pod /=~ piece @name = $~.post_match.delete("'\n ") end # p %Q{model name:#{@name},git:#{@git},path:#{@path},config:#{@configurations},branch:#{@branch},tag:#{@tag},comment:#{@comment}} end end |
Instance Attribute Details
#branch ⇒ Object
Returns the value of attribute branch.
109 110 111 |
# File 'lib/big_keeper/util/podfile_detector.rb', line 109 def branch @branch end |
#comment ⇒ Object
Returns the value of attribute comment.
109 110 111 |
# File 'lib/big_keeper/util/podfile_detector.rb', line 109 def comment @comment end |
#configurations ⇒ Object
Returns the value of attribute configurations.
109 110 111 |
# File 'lib/big_keeper/util/podfile_detector.rb', line 109 def configurations @configurations end |
#git ⇒ Object
Returns the value of attribute git.
109 110 111 |
# File 'lib/big_keeper/util/podfile_detector.rb', line 109 def git @git end |
#name ⇒ Object
Returns the value of attribute name.
109 110 111 |
# File 'lib/big_keeper/util/podfile_detector.rb', line 109 def name @name end |
#path ⇒ Object
Returns the value of attribute path.
109 110 111 |
# File 'lib/big_keeper/util/podfile_detector.rb', line 109 def path @path end |
#tag ⇒ Object
Returns the value of attribute tag.
109 110 111 |
# File 'lib/big_keeper/util/podfile_detector.rb', line 109 def tag @tag end |