Permalink
Browse files

should ask database config first

  • Loading branch information...
1 parent 501f862 commit 15416817e2b091e076d212c350e4c46f3ef51c1b @xdite committed Oct 9, 2012
Showing with 20 additions and 9 deletions.
  1. +2 −0 CHANGELOG.md
  2. +1 −1 LICENSE.txt
  3. +4 −2 README.md
  4. +12 −5 lib/bootstrappers/app_builder.rb
  5. +1 −1 lib/bootstrappers/version.rb
View
@@ -1,2 +1,4 @@
+0.0.6 (Oct 10, 2012)
+ * will ask your database config password first
0.0.5 (Oct 8, 2012)
* announce project
View
@@ -20,4 +20,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
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.
View
@@ -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
-## USAGE
+## Remind
-MySQL setting:
+config/database.yml default setting:
```
development: &default
@@ -49,6 +49,8 @@ development: &default
password: ""
```
+but we still ask for your preferences
+
## Contributing
@@ -67,11 +67,18 @@ def add_devise_gem
end
def use_mysql_config_template
-
- template 'mysql_database.yml.erb', 'config/database.yml',
- :force => true
- template 'mysql_database.yml.erb', 'config/database.yml.example',
- :force => true
+
+ template 'mysql_database.yml.erb', 'config/database.yml',: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
def create_database
@@ -1,3 +1,3 @@
module Bootstrappers
- VERSION = "0.0.5"
+ VERSION = "0.0.6"
end

0 comments on commit 1541681

Please sign in to comment.