Module: Parse

Defined in:
lib/platform_helpers/parse.rb

Class Method Summary collapse

Class Method Details

.is_comment?(line) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
11
12
13
14
# File 'lib/platform_helpers/parse.rb', line 8

def self.is_comment?(line)
  if line.strip.rindex('#') == 0
    return true
  else
    return false
  end
end

.partial_comment?(line) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
18
19
20
21
# File 'lib/platform_helpers/parse.rb', line 15

def self.partial_comment?(line)
  if line =~ /#/
    return true
  else
    return false
  end
end

.strip_comment(line) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/platform_helpers/parse.rb', line 22

def self.strip_comment(line)
  if partial_comment?(line)
    loc = line.rindex('#')
    line = line[0..loc-1]
  end
  line
end