public
Description: Plugin to "hijack" Ruby host(s) resolver aka(resolv-replace.rb), allowing programmatic host file entries.
Homepage: http://dewey.ws
Clone URL: git://github.com/retr0h/railsolver.git
railsolver / README.rdoc
100644 34 lines (23 sloc) 0.838 kb

Railsolver

This plugin will "hijack" Ruby host(s) resolver aka(resolv-replace.rb), allowing programmatic host file resolution (including wildcard host resolution).™

Example

Create the hosts file at:

  RAILS_ROOT/config/hosts.yml

Hosts can be added globally or overridden per environment. ERB is also supported inside the configuration.


  app.dewey.ws: <%= #!SOME_RUBY_CODE %>

development:

  app.dewey.ws: 192.168.0.1

Experimental

One can specify "wildcard" hosts (more or less). The host ‘baz.foo.com’ will match the most specific (‘baz.foo.com’) when present in hosts.yml. Otherwise, it will match ’.foo.com’ then ’.com’.


  .com: 1.1.1.1
  .foo.com: 6.6.6.6
  bar.com: 10.10.10.2
  baz.com: 10.10.10.3
  baz.foo.com: 10.10.10.4

Copyright © 2008 John Dewey <john@dewey.ws>, released under the MIT license