From: "Jörg W Mittag" Date: 2010-09-08T10:55:25+09:00 Subject: Re: How to require Ruby 1.9 from a required file? Sarah Allen wrote: > Is there any way to require Ruby 1.9 from a required file such that I > can trigger an error message before the main file is parsed? > > Suppose I'm making a DSL that depends on the very nice Ruby 1.9 hash > syntax. [...] [...] > Sure this can be solved with documentation OR changing the syntax of my > DSL to use 1.8.7, but I was hoping for a nicer solution for end users > (who are expected to be kids). Unfortunately, no. Ruby 1.8.8 is supposed to be syntactically compatible with Ruby 1.9, specifically to solve the very problem you are having. So, in Ruby 1.8.8, just *parsing* Ruby 1.9 code should not result in an error, only actually *running* it. But obviously, Ruby 1.8.8 isn't out yet, and if you could get the kids to upgrade to Ruby 1.8.8, you could presumably get them to upgrade to Ruby 1.9.2 as well, so ... jwm