Skip to content

Commit

Permalink
should ask database config first
Browse files Browse the repository at this point in the history
  • Loading branch information
xdite committed Oct 9, 2012
1 parent 501f862 commit 1541681
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
@@ -1,2 +1,4 @@
0.0.6 (Oct 10, 2012)
* will ask your database config password first
0.0.5 (Oct 8, 2012) 0.0.5 (Oct 8, 2012)
* announce project * announce project
2 changes: 1 addition & 1 deletion LICENSE.txt
Expand Up @@ -20,4 +20,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
6 changes: 4 additions & 2 deletions README.md
Expand Up @@ -35,9 +35,9 @@ It includes application gems like:
* [Turbo Sprockets for Rails 3.2.x](https://github.com/ndbroadbent/turbo-sprockets-rails3) Speeds up your Rails 3 rake assets:precompile by only recompiling changed assets * [Turbo Sprockets for Rails 3.2.x](https://github.com/ndbroadbent/turbo-sprockets-rails3) Speeds up your Rails 3 rake assets:precompile by only recompiling changed assets




## USAGE ## Remind


MySQL setting: config/database.yml default setting:


``` ```
development: &default development: &default
Expand All @@ -49,6 +49,8 @@ development: &default
password: "" password: ""
``` ```


but we still ask for your preferences



## Contributing ## Contributing


Expand Down
17 changes: 12 additions & 5 deletions lib/bootstrappers/app_builder.rb
Expand Up @@ -67,11 +67,18 @@ def add_devise_gem
end end


def use_mysql_config_template def use_mysql_config_template


template 'mysql_database.yml.erb', 'config/database.yml', template 'mysql_database.yml.erb', 'config/database.yml',:force => true
:force => true template 'mysql_database.yml.erb', 'config/database.yml.example', :force => true
template 'mysql_database.yml.erb', 'config/database.yml.example',
:force => true db_user_name = ask("What is your local database user name? [root]")
db_user_name = "root" if db_user_name.blank?
db_password = ask("What is your local database password? ['']")
db_password = "''" if db_password.blank?
replace_in_file 'config/database.yml', 'username: root', "username: #{db_user_name}"
replace_in_file 'config/database.yml', 'password: ""', "pasword: '#{db_password}'"


end end


def create_database def create_database
Expand Down
2 changes: 1 addition & 1 deletion lib/bootstrappers/version.rb
@@ -1,3 +1,3 @@
module Bootstrappers module Bootstrappers
VERSION = "0.0.5" VERSION = "0.0.6"
end end

0 comments on commit 1541681

Please sign in to comment.