-
Notifications
You must be signed in to change notification settings - Fork 1
Getting Set Up For Development
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:
- Open a terminal
- Enter this command to install RVM:
$ curl -L get.rvm.io | bash -s stable
- Reload your shell environment:
$ source ~/.bash_profile
- Install any requirements you are missing (follow the instructions):
$ rvm requirements
- Right now we recommend using ruby 1.9.2, install it:
$ rvm install 1.9.2
- Go and grab a coffee, it will take a few minutes to compile
- Tell your system to use the ruby interpreter you just installed by default:
$ rvm use 1.9.2 --default
- Create a gemset for the readium project:
$ rvm gemset create readium
-
cd
(out of and then back) into the root directory of the Readium project and trust the.rvmrc
when prompted
simply type this command: $ gem install bundler
###On Windows:
To set up the project dependencies, follow these steps:
- Download the Development Kit from this site, double-click, choose an installation directory ;
- In a terminal navigate, enter these commands:
-
$ cd <DEVKIT_DIR>
(from step 1 above), $ ruby dk.rb init
$ ruby dk.rb install
- Unfortunately, eventmachine (0.12.10) is not compatible with Windows7 and Ruby >= 1.9.2. You need a pre-release version:
$ gem install eventmachine --pre
(eventmachine 1.0.0.beta.4.1) - In the project directory, remove Gemfile.lock and edite Gemfile:
# for running the server
gem "eventmachine", "1.0.0.beta.4.1"
gem 'thin'
...
- Now, to the project root, type:
$ bundle install
- WARNING : because you have modified it, don't forget to reload Gemfile and Gemfile.lock with git like:
$ git fetch upstream
$ git merge upstream/master
###On Mac / Linux:
thanks to Bundler you can do this in one shot. In a terminal navigate to the project root and type:
$ bundle install
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.
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.
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