Getting started with closure by creating a Sinatra application
JavaScript Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Geting Started with Closure and Sinatra

This is a sample application to be used in conjunction with the tutorial.

All the application does is instantiate a Javascript object that writes messages to the user by appending content to the document body.

Setup the repository and start the server

  1. git clone godzilla
  2. cd godzilla
  3. gem install bundler
  4. bundle install
  5. ruby server.rb

Now that your server is started, you can navigate to: http://localhost:4567/test.html

Using the Uncompiled Code

Perform these steps if you want to play around with the code and not have to recompile every time you make a change.

Get the Closure Library

  1. cd godzilla
  2. svn checkout closure-library
  3. cp -R closure-library/closure/* public/

Change test.html to point to uncompiled Javascripts

  1. comment out: <script type="text/javascript" src="/javascripts/test.compiled.js"></script>
  2. and uncomment: <!--<script type="text/javascript" src="/goog/base.js"></script>--> <!--<script type="text/javascript" src="/javascripts/test.js"></script>-->