forked from couchrest/couchrest_model
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Lucas Renan
committed
May 15, 2011
1 parent
3f7b1d3
commit c3b7cc3
Showing
3 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
lib/rails/generators/couchrest_model/config/config_generator.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
require 'rails/generators/couchrest_model' | ||
|
||
module CouchrestModel | ||
module Generators | ||
class ConfigGenerator < Rails::Generators::Base | ||
source_root File.expand_path('../templates', __FILE__) | ||
|
||
def app_name | ||
Rails::Application.subclasses.first.parent.to_s.underscore | ||
end | ||
|
||
def copy_configuration_file | ||
template 'couchdb.yml', File.join('config', "couchdb.yml") | ||
end | ||
|
||
end | ||
end | ||
end |
21 changes: 21 additions & 0 deletions
21
lib/rails/generators/couchrest_model/config/templates/couchdb.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
development: &development | ||
protocol: 'http' | ||
host: localhost | ||
port: 5984 | ||
prefix: <%= app_name %> | ||
suffix: development | ||
username: | ||
password: | ||
|
||
test: | ||
<<: *development | ||
suffix: test | ||
|
||
production: | ||
protocol: 'https' | ||
host: localhost | ||
port: 5984 | ||
prefix: <%= app_name %> | ||
suffix: production | ||
username: root | ||
password: 123 |