Exception: Rundoc::CodeSection::ParseError
- Inherits:
- 
      StandardError
      
        - Object
- StandardError
- Rundoc::CodeSection::ParseError
 
- Defined in:
- lib/rundoc/code_section.rb
Instance Method Summary collapse
- 
  
    
      #initialize(options = {})  ⇒ ParseError 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of ParseError. 
Constructor Details
#initialize(options = {}) ⇒ ParseError
Returns a new instance of ParseError.
| 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # File 'lib/rundoc/code_section.rb', line 5 def initialize( = {}) keyword = [:keyword] command = [:command] line_number = [:line_number] block = [:block].lines.map do |line| if line == command " > #{line}" else " #{line}" end end.join("") msg = "Error parsing (line:#{line_number}):\n" msg << "> '#{command.strip}'\n" msg << "No such registered command: '#{keyword}'\n" msg << "registered commands: #{Rundoc.known_commands.inspect}\n\n" msg << block msg << "\n" super msg end |