Details on the initial setup for development
The readme contains the following steps for initial setup:
- Clone the git repository
- open another new terminal and run
- open http://localhost:9292
- (optional) open a new terminal and run
cp -vn script/post-commit .git/hooks/
1. Clone the git repository
Use git to create a local clone of the Lab repository.
If you aren’t familiar with git, you should read one of the tutorials on it.
If you have commit access to the repository use this form:
git clone firstname.lastname@example.org:concord-consortium/lab-interactives-site.git
Alternatively if you don’t have commit access use this form:
git clone git://github.com/concord-consortium/lab-interactives-site.git
Open a shell and change to the
lab-interactives-site/ directory. The first time you
lab-interactives-site/ directory RVM will switch to using
ruby-2.0.0-p247 based on the
.ruby-version file in the repository.
.ruby-gemset tells RVM to install the gems in a gemset named
lab. So together
these files tell RVM to store and load gems from the
If you don’t have
ruby-2.0.0-p247 already installed rvm will display the command you need to
run to install it. Run this command if required.
If you do end up having to install a new version of Ruby with RVM change out of and back into the lab directory after the RVM install of Ruby is complete:
cd ..; cd lab
This will download and install all the dependencies and build the whole project for the first time.
make everything is run on a freshly cloned repository it performs the following tasks:
Install the runtime dependencies as git submodules into the
git submodule update --init --recursive
You can see the list of dependencies to be installed in the file
package.json. In addition
vendor/science.jsare manually installed into
Install the additional RubyGems used for development: haml, sass, guard …
You should now be able to open the file:
public/index.html in a browser however most things won’t work correctly.
This is because of the limitation of the
file protocol in browsers. Continue on to see about setting up the server.
4. open another new terminal and run
Startup the Rack-based Lab server for local development. This is simple rack application that mainly just serves the files in public.
Alternatively you can use
python -m SimpleHTTPServer to run a python server. Currently it won’t handle the applets and it won’t support snapshots, but you might not need those features.
5. open http://localhost:9292
Now that the files in public are built and a server is running you can view the Lab site locally.
6. (optional) open a new terminal and run
Start watching the
test/ directories with Guard and when files are
Now any change you make in
src/examples/ will generate the corresponding content in
In addition changes in
src/lab/ generate the associated Lab modules in
lab/ and copy these modules
public/lab/. In addition any change in either the
test/directories will run the
tests and display the results in the console window where
This is optional because you can also just manually run
make after making changes.