alebruck / ohloh-ui

Web Application for the Ohloh Stack. Currently Rails 4.2.7 & Ruby 2.2.5

Home Page:https://www.openhub.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OhlohUI

Dependencies:

  • OhlohUI uses the ruby version 2.2.5. Please install ruby 2.
  • OhlohUI uses the postgresql database. Please install postgresql and create a new user on it.

Getting Started:

$ git clone git@github.com:blackducksoftware/ohloh-ui.git
$ cd ohloh-ui
$ gem install bundler
$ bundle install

The OhlohUI data is split between two databases in production. The development setup needs to reflect the same. The database names are configured in a file specific to each environment. For development, create a file env.development, with the following contents.

DB_ENCODING = 'UTF-8'

DB_HOST = localhost
DB_NAME =
DB_USERNAME =
DB_PASSWORD =

FOREIGN_DB_HOST = localhost
FOREIGN_DB_NAME =
FOREIGN_DB_USERNAME =
FOREIGN_DB_PASSWORD =

The default DB encoding was set to SQL_ASCII to support data encoded by older ruby. For new data, the UTF-8 encoding should work fine. The *_USERNAME and *_PASSWORD entries need to reflect the user created in postgresql. The *DB_NAME entries should be new database names. These will be created during our setup.

$ rake db:create
$ rake db:structure:load
$ rake db:second_base:structure:load

This might throw a bunch of errors about relations and constraints already existing. Please ignore them and proceed.

Setup a default admin user. The arguments are optional. By default a user with the login admin_user, password admin_password and email admin@example.com will be created.

$ ruby script/setup_default_admin.rb <login> <passsword> <email>
$ rails s

Visit localhost:3000 to checkout the site.

Tests:

Add the following to the .env.development file. Fill in the blank values appropriately. Modify .env.test to reflect the values that were added here.

TEST_DB_HOST = localhost
TEST_DB_NAME =
TEST_DB_USERNAME =
TEST_DB_PASSWORD =

FOREIGN_TEST_DB_HOST = localhost
FOREIGN_TEST_DB_NAME =
FOREIGN_TEST_DB_USERNAME =
FOREIGN_TEST_DB_PASSWORD =

Then run the following:

$ rake db:test:prepare
$ rake test

Pull Request Builder:

The OhlohUI CI uses the following task to verify PR compatibility.

$ rake ci:all_tasks

This runs:

  • rubocop
  • haml-lint
  • brakeman
  • bundle audit
  • teaspoon
  • rake test

About

Web Application for the Ohloh Stack. Currently Rails 4.2.7 & Ruby 2.2.5

https://www.openhub.net

License:Other


Languages

Language:Ruby 53.1%Language:PLpgSQL 15.8%Language:HTML 13.5%Language:JavaScript 8.0%Language:CSS 6.5%Language:CoffeeScript 1.7%Language:PHP 0.8%Language:SQLPL 0.4%Language:Puppet 0.3%Language:Shell 0.0%Language:Assembly 0.0%