Class: ReVIEW::Preprocessor
- Includes:
- Loggable
- Defined in:
- lib/review/preprocessor.rb,
lib/review/preprocessor/line.rb,
lib/review/preprocessor/directive.rb,
lib/review/preprocessor/repository.rb
Defined Under Namespace
Classes: Directive, Line, Repository
Constant Summary collapse
- TYPES =
%w[file range].freeze
- KNOWN_DIRECTIVES =
%w[require provide warn ok].freeze
- INF_INDENT =
9999
Instance Attribute Summary
Attributes included from Loggable
Instance Method Summary collapse
-
#initialize(param) ⇒ Preprocessor
constructor
A new instance of Preprocessor.
- #process(path) ⇒ Object
Methods included from Loggable
#app_error, #debug, #error, #error!, #warn
Constructor Details
#initialize(param) ⇒ Preprocessor
Returns a new instance of Preprocessor.
28 29 30 31 32 33 |
# File 'lib/review/preprocessor.rb', line 28 def initialize(param) @repository = ReVIEW::Preprocessor::Repository.new(param) @config = param ## do not use params in this class; only used in Repository @logger = ReVIEW.logger @leave_content = nil end |
Instance Method Details
#process(path) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/review/preprocessor.rb', line 35 def process(path) File.open(path) do |inf| @inf = inf @f = StringIO.new begin preproc(@inf) rescue Errno::ENOENT => e error! e. end @f.string end end |