News for hackers. Stuff that matters.
Re:New Ruby 1.9 Features, Tips & Tricks by silentbicycle on Monday February 21, 2011 @11:33PM (#2248751)
How do all of these DSLs interact in close proximity? Ruby seems to do DSLs via a lenient lexer, rather than an explicit "quoting" mechanism, which means there isn't a way to locally specify a context for its idioms.
Re:New Ruby 1.9 Features, Tips & Tricks by philwelch on Wednesday February 23, 2011 @11:41AM (#2254708)
It doesn't turn out to be a big problem since you don't generally mix idioms in the same file. In a Rails app, it's pretty easy to figure out which files are evaluated by which DSL. If you're using HAML, anything in app/views with a .haml extension is HAML. Anything under /spec is Rspec. Capfile, Gemfile, and Rakefile are self explanatory. routes.rb uses the Rails routing DSL.
Re:New Ruby 1.9 Features, Tips & Tricks by silentbicycle on Wednesday February 23, 2011 @02:41PM (#2255456)
All right. Thanks for the polite and detailed response.