Ministère du Développement Durable (Wiki)
Ruby JavaScript CoffeeScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
config
db
doc
lib
log
public
script
spec
vendor
.gitignore
.rspec
Capfile
Gemfile
Gemfile.lock
LICENSE
README.md
Rakefile
config.ru

README.md

Ministère du Développement Durable

Setup

You'll need

  • ruby 1.9.3
  • the bundler gem
  • postgresql

Install (debian)

  • Install the necessary packages:
aptitude install postgresql postgresql-server-dev-9.1 postgresql-client
  • Once you have postgresql installed, create the mdd user:
sudo su postgres
createuser mdd
exit
  • Edit /etc/postgresql/9.1/main/pg_hba.conf to authorize non unix users to authenticate. To do so, change peer to trust :
# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     trust
  • Restart postgresql for config change:
/etc/init.d/postgresql restart
  • Install the necessary gems via bundler:
bundle install
  • Copy database.yml.sample file:
cp config/database.yml.sample config/database.yml
  • Create the database and run migrations:
bundle exec rake db:setup
bundle exec rake db:migrate

Create user

bundle exec rails c
>> u = User.find_or_initialize_by_email("admin@developpement-durable.gouv.fr")
>> u.password = 'password' # => "password"
>> u.roles = [:administrator] #=> [:administrator]
>> u.save # => true

Run

Rails:

bundle exec rails s thin

ElasticSearch:

bundle exec rake es:start

Tests

  • Prepare with :
bundle exec rake db:test:prepare
  • Start tests with :
bundle exec rspec

License

MDD is released under the MIT license: