Class: CodeTools::Compiler::Writer
- Defined in:
- lib/rubinius/code/compiler/stages.rb
Overview
compiled method -> compiled file
Instance Attribute Summary collapse
- 
  
    
      #name  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Returns the value of attribute name. 
- 
  
    
      #version  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Returns the value of attribute version. 
Attributes inherited from Stage
Instance Method Summary collapse
- 
  
    
      #initialize(compiler, last)  ⇒ Writer 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of Writer. 
- #run ⇒ Object
Methods inherited from Stage
#create_next_stage, #input, #insert, next_stage, next_stage_class, #processor, #run_next, stage, stage_name
Constructor Details
#initialize(compiler, last) ⇒ Writer
Returns a new instance of Writer.
| 66 67 68 69 70 71 72 73 | # File 'lib/rubinius/code/compiler/stages.rb', line 66 def initialize(compiler, last) super compiler.writer = self @version = 0 @processor = CompiledFile @signature = Rubinius::Signature end | 
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
| 64 65 66 | # File 'lib/rubinius/code/compiler/stages.rb', line 64 def name @name end | 
#version ⇒ Object
Returns the value of attribute version.
| 64 65 66 | # File 'lib/rubinius/code/compiler/stages.rb', line 64 def version @version end | 
Instance Method Details
#run ⇒ Object
| 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | # File 'lib/rubinius/code/compiler/stages.rb', line 75 def run return @input unless @name dir = File.dirname(@name) unless File.directory?(dir) parts = [] until dir == "/" or dir == "." parts << dir dir = File.dirname(dir) end parts.reverse_each do |d| Dir.mkdir d unless File.directory?(d) end end @processor.dump @input, @name, @signature, @version @input end |