maxdemarzi/neography — pull request #74 by pboling (2013-01-18 21:09:04+00:00)
Title: Initialization Hook

Provides a named initialization hook so people depending on the gem can ensure pre-requisite configuration is complete prior to initialization of neography itself.

When I upgraded from 1.0.3 to 1.0.4 I became unable to boot my app, or run my specs due to an error.

````
cannot load such file -- neography/rest/extensions (LoadError)
/Users/pboling/.rvm/gems/ruby-1.9.3-head@simple/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'
/Users/pboling/.rvm/gems/ruby-1.9.3-head@simple/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `block in require'
/Users/pboling/.rvm/gems/ruby-1.9.3-head@simple/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:236:in `load_dependency'
/Users/pboling/.rvm/gems/ruby-1.9.3-head@simple/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'
/Users/pboling/.rvm/gems/ruby-1.9.3-head@simple/gems/neography-1.0.4/lib/neography/rest.rb:23:in `'
````

With this change I am again able to boot and test my app. Additionally I can now clean up the way I configure the Neography gem (previously my pre-config had to be in application.rb, ir in an initializer which was ordered alphabetically higher than neography, both of which just feel wrong).

## Example:

````
module Simple
class NeographyInitialization < Rails::Railtie
initializer 'simple.neography_initialization', before: 'neography.configure' do
# require a file where I read from a YAML;
# load configs for the env into a constant;
# which is referenced from my Neography configuration in config/initializers
require 'simple/neography'
end
end
end
````