diff options
author | re4k <re4k@re4k.info> | 2013-05-05 22:01:48 +0900 |
---|---|---|
committer | re4k <re4k@re4k.info> | 2013-05-05 22:01:48 +0900 |
commit | 34fb1a26d732a1ca4dd5db1a27eb03e8c5d0f1e8 (patch) | |
tree | f4dd98bd881307a1979fa94ca4c756c3f69efa7a /config | |
parent | 33fa30d3a5e116cfc6b1347605a57aed49469900 (diff) | |
download | aclog-34fb1a26d732a1ca4dd5db1a27eb03e8c5d0f1e8.tar.gz |
add startup shell script
Diffstat (limited to 'config')
-rw-r--r-- | config/database.yml | 52 | ||||
-rw-r--r-- | config/database.yml.example | 24 | ||||
-rw-r--r-- | config/initializers/secret_token.rb.example | 2 |
3 files changed, 25 insertions, 53 deletions
diff --git a/config/database.yml b/config/database.yml deleted file mode 100644 index 8578d0f..0000000 --- a/config/database.yml +++ /dev/null @@ -1,52 +0,0 @@ -<% -require 'cgi' -require 'uri' - -begin - uri = URI.parse(ENV["DATABASE_URL"]) -rescue URI::InvalidURIError - raise "Invalid DATABASE_URL" -end - -raise "No RACK_ENV or RAILS_ENV found" unless ENV["RAILS_ENV"] || ENV["RACK_ENV"] - -def attribute(name, value, force_string = false) - if value - value_string = - if force_string - '"' + value + '"' - else - value - end - "#{name}: #{value_string}" - else - "" - end -end - -adapter = uri.scheme -adapter = "postgresql" if adapter == "postgres" - -database = (uri.path || "").split("/")[1] - -username = uri.user -password = uri.password - -host = uri.host -port = uri.port - -params = CGI.parse(uri.query || "") - -%> - -<%= ENV["RAILS_ENV"] || ENV["RACK_ENV"] %>: - <%= attribute "adapter", adapter %> - <%= attribute "database", database %> - <%= attribute "username", username %> - <%= attribute "password", password, true %> - <%= attribute "host", host %> - <%= attribute "port", port %> - -<% params.each do |key, value| %> - <%= key %>: <%= value.first %> -<% end %> diff --git a/config/database.yml.example b/config/database.yml.example new file mode 100644 index 0000000..ab53f01 --- /dev/null +++ b/config/database.yml.example @@ -0,0 +1,24 @@ +development: + adapter: mysql2 + database: aclog_development + username: aclog + password: + host: localhost + encoding: utf8mb4 + +test: + adapter: mysql2 + database: aclog_test + username: aclog + password: + host: localhost + encoding: utf8mb4 + +production: + adapter: mysql2 + database: aclog_production + username: aclog + password: + host: localhost + encoding: utf8mb4 + diff --git a/config/initializers/secret_token.rb.example b/config/initializers/secret_token.rb.example index b6efdf8..89bd5ae 100644 --- a/config/initializers/secret_token.rb.example +++ b/config/initializers/secret_token.rb.example @@ -9,4 +9,4 @@ # Make sure your secret_key_base is kept private # if you're sharing your code publicly. -Aclog::Application.config.secret_key_base = '*****' +Aclog::Application.config.secret_key_base = 'replace_here' |