Skip to content
This repository was archived by the owner on Dec 16, 2022. It is now read-only.

Getting Set Up For Development

matthewrobertson edited this page Apr 10, 2012 · 4 revisions

We are currently using a few ruby libraries to aid in the development work flow. These are all listed in the project's Gemfile. In order to contribute to the project you may need to set up these libraries. Here is a rundown on how to do it:

##1. Install a Ruby interpreter:

###On Windows:

Download an installer for a recent version of ruby (>= 1.9.2) from this site and run it.

###On Mac / Linux:

It is best to use RVM or rbenv to manage your ruby environments on nix' systems. To set up RVM follow these step:

  1. Open a terminal
  2. Enter this command to install RVM: $ curl -L get.rvm.io | bash -s stable
  3. Reload your shell environment: $ source ~/.bash_profile
  4. Install any requirements you are missing (follow the instructions): $ rvm requirements
  5. Right now we recommend using ruby 1.9.2, install it: $ rvm install 1.9.2
  6. Go and grab a coffee, it will take a few minutes to compile
  7. Tell your system to use the ruby interpreter you just installed by default: $ rvm use 1.9.2 --default
  8. Create a gemset for the readium project: $ rvm gemset create readium
  9. cd (out of and then back) into the root directory of the Readium project and trust the .rvmrc when prompted

Install Bundler

simply type this command: $ gem install bundler

Install the project dependencies

thanks to Bundler you can do this in one shot. In a terminal navigate to the project root and type:

$ bundle install

Using the libraries

Running unit tests

We use the Jasmine Ruby Gem to run our unit tests in the browser. To start the tests use the command $ rake jasmine to start up a web server running on port 8888 then open a browser and navigate to http://localhost:8888/ to run the tests.

Working with CSS

We are using SASS and Bourbon to take a bit of the pain out of writing CSS. you you should never edit .css files directly, instead modify the .scss files Use the command $ rake styles to start up a process that will watch the project's .scss files for changes and automagically regenerate the css files.

Running the dev server

We are working on a configuration of Readium runs as a webpage and fetches EPUBs over the network. To start a simple server on localhost:3000 serving the readium source, use the command $ rake server. In chrome you should be able to load up the library view by visiting http://localhost:3000/views/library.html

Clone this wiki locally