Skip to content

Commit

Permalink
Updated instructions in WebTools README
Browse files Browse the repository at this point in the history
  • Loading branch information
Monty Williams committed Apr 15, 2011
1 parent 2e7cd9e commit 6c4c9c6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
27 changes: 19 additions & 8 deletions README.rdoc
Expand Up @@ -32,26 +32,37 @@ Run the WebTools Sinatra application
This will start WEBrick in your current window. Hit Ctl-C to stop.

Browse to http://localhost:9292/, click on a class or module, then
click on a constant or method. Results appear in the bottom pane.
File locations with line numbers appear at the bottom. Time spent on
the server/network/client appear at the top,
click on a constant or method. Results appear in the bottom pane, file
locations with line numbers in the bottom status line, and time spent
on the server/network/client in the top status line.

=== Add classes and modules from ActiveModel

<b>WARNING: If you already have an application loaded into MagLev, do not
run <code>rake meta</code> since it persists RubyGems and ActiveModel.
Use WebTools to explore <i>your application</i> instead. If you run
<code>rake meta</code>, run <code>maglev force-reload</code> afterwards
to load an empty database.</b>

$ rake meta

Click on "Refresh View" in WebTools. Note that AValidPerson now appears in the
class list, as do a number of classes/modules from ActiveModel and ActiveSupport.

Click on the class AValidPerson and compare it with the source
(meta_demo.rb). Some things to note:
(meta_demo.rb). Some things to note:

1. You get to see all of the methods written by metaprogramming.
1. You can see all the methods generated by metaprogramming.
2. You can see the file and line number of the code that generated each
method. This makes it simpler to track down which part of ActiveWhatever
is messing with your code.
3. The <code>initialize</code> method is unchanged from the code
in <code>meta_demo.rb</code>
4. The instance method <code>_callback_before_1</code> generated from
<code>$MAGLEV_HOME/lib/maglev/gems/1.8/gems/activesupport-3.0.5/lib/active_support/callbacks.rb</code>
shows the actual method name <code>_callback_before_1</code> instead of <code>#{method_name}</code>.

=== Modify meta_demo.rb and view updates
=== Modify meta_demo.rb and view new generated methods

Edit the file meta_demo.rb. Add :age to both validates_presence_of and attr_accessor.
The changed lines should look like
Expand All @@ -77,11 +88,11 @@ class list. Click on the class AAADemo and compare it with the source
== Viewing GemStone/S code, processes and statistics

The code for this example was inspired by the Smalltalk example found in
$MAGLEV_HOME/gemstone/examples/www. The smalltalk example code can be
$MAGLEV_HOME/gemstone/examples/www. The Smalltalk example code can be
invoked from ruby (a demonstration of how to invoke Smalltalk from Ruby),
via:

$ rake smalltalk:run
$ rake smalltalk:run

Then browse to http://localhost:8080/ and explore

Expand Down
2 changes: 1 addition & 1 deletion demo_data.rb
Expand Up @@ -2,7 +2,7 @@
#
# Name: demo_data.rb
#
# Purpose: Define a persistent class with public, private and protected
# Purpose: Define a persistent class with public, private and protected
# instance methods, a class method, and some data we can explore
# using WebTools. Name it AAADemo so it will appear at the top
# of the Class list.
Expand Down

0 comments on commit 6c4c9c6

Please sign in to comment.