Class: Oryx::Preprocessor

Inherits:
Object
  • Object
show all
Defined in:
lib/oryx/preprocessor.rb

Instance Method Summary collapse

Constructor Details

#initializePreprocessor

Returns a new instance of Preprocessor.



3
4
# File 'lib/oryx/preprocessor.rb', line 3

def initialize
end

Instance Method Details

#parse(content) ⇒ Object



6
7
8
9
# File 'lib/oryx/preprocessor.rb', line 6

def parse content
  content = remove_comment content
  remove_outer_whitespace content
end

#remove_comment(content) ⇒ Object



11
12
13
# File 'lib/oryx/preprocessor.rb', line 11

def remove_comment content
  content.gsub /\/\*.*?\*\//, ''
end

#remove_outer_whitespace(content) ⇒ Object



15
16
17
# File 'lib/oryx/preprocessor.rb', line 15

def remove_outer_whitespace content
  content.lstrip.rstrip
end