Class: Ppr::LoadRequire
Overview
Descibes an abstract class for loading or requiring files.
Constant Summary
Constants inherited from Macro
Macro::E_NUMBER, Macro::E_TYPE
Instance Attribute Summary
Attributes inherited from Macro
Instance Method Summary collapse
-
#initialize(num, ppr, expand: ":<") ⇒ LoadRequire
constructor
Creates a new load or require macro starting at line number
num
generated from preprocessorppr
. -
#loadm(name) ⇒ Object
Loads and preprocess file
name
.
Methods inherited from Macro
#add, #apply, e_message, #e_message, #e_number, #e_shift_number, #e_type?, #empty?, #final?, #generate, #to_quoted
Constructor Details
#initialize(num, ppr, expand: ":<") ⇒ LoadRequire
Creates a new load or require macro starting at line number num
generated from preprocessor ppr
.
The expand
strings be redefined through keyword arguments.
301 302 303 |
# File 'lib/ppr/ppr_core.rb', line 301 def initialize(num, ppr, expand: ":<") super("",num,ppr,expand: ) end |
Instance Method Details
#loadm(name) ⇒ Object
Loads and preprocess file name
.
306 307 308 309 310 311 312 313 |
# File 'lib/ppr/ppr_core.rb', line 306 def loadm(name) output = StringIO.new("") # print "name=#{name}\n" File.open(name,"r") do |input| @ppr.preprocess(input,output) end return output.string end |