Class: BigKeeper::PodfileModel

Inherits:
Object
  • Object
show all
Defined in:
lib/big_keeper/model/podfile_model.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(sentence) ⇒ PodfileModel

Returns a new instance of PodfileModel.



6
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
# File 'lib/big_keeper/model/podfile_model.rb', line 6

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

#branchObject

Returns the value of attribute branch.



5
6
7
# File 'lib/big_keeper/model/podfile_model.rb', line 5

def branch
  @branch
end

#commentObject

Returns the value of attribute comment.



5
6
7
# File 'lib/big_keeper/model/podfile_model.rb', line 5

def comment
  @comment
end

#configurationsObject

Returns the value of attribute configurations.



5
6
7
# File 'lib/big_keeper/model/podfile_model.rb', line 5

def configurations
  @configurations
end

#gitObject

Returns the value of attribute git.



5
6
7
# File 'lib/big_keeper/model/podfile_model.rb', line 5

def git
  @git
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/big_keeper/model/podfile_model.rb', line 5

def name
  @name
end

#pathObject

Returns the value of attribute path.



5
6
7
# File 'lib/big_keeper/model/podfile_model.rb', line 5

def path
  @path
end

#tagObject

Returns the value of attribute tag.



5
6
7
# File 'lib/big_keeper/model/podfile_model.rb', line 5

def tag
  @tag
end