seancribbs/ripple — comment on commit 7acc4692fe031e5696c371989053f17ba94a34fe
File: ripple/lib/ripple/test_server.rb line 32
By myronmarston:

> Specifying the :root key in your configuration should suffice. That said I think something that is not coupled to Rails would be good.

I have to use ruby to figure out the root (by finding a directory relative to `__FILE__`), so to do this in the YAML config file I'd need to use ERB, which feels like a total hack. Instead, I've got this that solved the issue:

``` ruby
root = File.expand_path('../../..', __FILE__)
Ripple.load_configuration File.join(root, 'config', 'ripple.yml'), ['test']
Ripple.config = Ripple.config.merge(:root => root, :js_source_dir => File.join(root, 'tmp'))
```

I'm also forced to set the `:js_source_dir` to prevent the reference to `Rails.root` on line 26. I'm not using any JS in this app anymore so this again feels like a hack :(. It works for now, though.