From: why the lucky stiff Date: 2003-12-19T06:29:26+09:00 Subject: Re: Configuration Files On Thursday 18 December 2003 10:11 am, Ara.T.Howard wrote: > > i'm with you (and use it myself), but the above is problematic if you > actually want non-programmers to be able to _configure_ a system. for > example, how long do you think it would take a non-programmer to debug > this? > > file config.rb: > ======== > require 'yaml' > config = <<-txt > plugin: > player: > class: CommandPlayer > command: mpg123 > txt > YAML::load(config) > > > ~/eg/ruby > ruby config.rb > /data/ruby-1.8.0//lib/ruby/1.8/yaml.rb:39:in `load': parse error on line 3, > col 12: ` command: mpg123' (ArgumentError) from > /data/ruby-1.8.0//lib/ruby/1.8/yaml.rb:39:in `load' > from config.rb:8 > > -a The above throws an error for you? Man, a lot has been fixed since 1.8.0. Anyhow, I'm with ya. So, let's solve the problem. Would it help if you could hook the parse error handler to generate your own nice errors? We can also start to provide more specific parse error messages, though this can be needly on some edges. ~/eg/ruby > ruby config.rb Error in configuration file. See line 4. 2 player: 3 class: CommandPlayer Here!! -> 4 command: mpg123 Yeah, the indentation on that line needs to be trimmed a bit. Just line it up cozy with the line above it. _why