README.md in prependers-0.2.0 vs README.md in prependers-0.3.0
- old
+ new
@@ -47,11 +47,11 @@
If you want to extend a module's class methods, you can define a `ClassMethods` module in your
prepender:
```ruby
-module Animals::Dog::AddBarking
+module Animals::Dog::AddFamily
include Prependers::Prepender.new
module ClassMethods
def family
puts 'Canids'
@@ -132,24 +132,14 @@
To use prependers in your Rails app, simply create them under `app/prependers/models`,
`app/prependers/controllers` etc. and add the following to your `config/application.rb`:
```ruby
-config.to_prepare do
- Dir.glob(Rails.root.join('app', 'prependers', '**', '*.rb')) do |c|
- Rails.configuration.cache_classes ? require(c) : load(c)
- end
-
- prepender_paths = Dir.glob(Rails.root.join('app', 'prependers', '*')).map do |p|
- File.expand_path(p, __FILE__)
- end
-
- Prependers.load_paths(*prepender_paths)
-end
+Prependers.setup_for_rails
```
-If you want to use a namespace, just pass the `:namespace` option to `#load_paths` and name your
-files and modules accordingly.
+If you want to use a namespace, just pass the `:namespace` option to `#setup_for_rails` and name
+your files and modules accordingly.
## Development
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run
the tests. You can also run `bin/console` for an interactive prompt that will allow you to