-
Notifications
You must be signed in to change notification settings - Fork 198
Getting Monocle running
There are four ways to explore the Monocle examples and tests.
The very simplest way is to go here:
http://test.monoclejs.com/test
Of course, this way you can only test the particular version of Monocle that is live on the site. And you can't easily experiment by changing a line of code or two. Experimentation is the key to exploring Monocle!
You can always grab the latest master
of Monocle here:
http://test.monoclejs.com/dist/scripts/monocore.js
http://test.monoclejs.com/dist/styles/monocore.css
And the optional 'controls' extension is here:
http://test.monoclejs.com/dist/scripts/monoctrl.js
http://test.monoclejs.com/dist/styles/monoctrl.css
Please don't link to these files directly. That will just make your site slow and my site expensive. Instead, grab them and drop them in your own project.
So, the other ways require running Monocle locally, which means you need Git.* Clone the repository by running:
git clone git://github.com/joseph/Monocle.git monocle
cd monocle
Create the distributable files. For this, you need Ruby, Rubygems and the Sprockets gem. If you have these, just run:
rake
And it will create the files for you.
You can now run the tests in your browser — just open the index.html in the test
directory.
Be aware that this opens the files with the file:// protocol, which may cause security warnings in some browsers. The best way to run the Monocle is the fourth way, via Rack.
If you have Ruby, Rubygems, Sprockets and Rack, run the following command from the Monocle directory:
rackup
Then access http://localhost:9292.
If you're handy with Apache or Nginx or Pow or similar, you could even set up a proxy to this Rack, so that you could access the tests on, say, http://monocle.dev .**
If you access the tests via Rack, you can make changes to Monocle src files — they will automatically update in the tests. This makes it the preferred approach for contributing to Monocle.
* Technically you don't need Git. You can also download a zip of the current source from https://github.com/joseph/Monocle/zipball/master.
** Here's what my Apache VirtualHost looks like:
<VirtualHost *:80>
ServerName monocle.dev
DocumentRoot /Users/joseph/www/monocle
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://127.0.0.1:9292/
ProxyPassReverse / http://127.0.0.1:9292/
</VirtualHost>