New Command-Line jQuery Tool

Update: I have completely refactored jcheat and added substantial new functionality, including a ton of filters that can be used in any combination. Do a gem update and run jcheat -h for full usage details.

I released a new tool, jquery-cheat, that allows you to get information about the jQuery API directly from the command-line. You can get the description of a function, a list of functions in each module, search the list of all function descriptions for a string, get a list of all functions whose name match a string, and some other cool tricks.

Some examples:

# jcheat desc clearForm
--------------------------------------------------------------------------------
Name: clearForm()
Description: Clears the form data.
Details: Clears the form data. Takes the following actions on the
form's input fields: - input text fields will have their
'value' property set to the empty string - select elements
will have their 'selectedIndex' property set to -1 - checkbox
and radio inputs will have their 'checked' property set to
false - inputs of type submit, button, reset, and hidden will
*not* be effected - button elements will *not* be effected
Returns: jQuery
--------------------------------------------------------------------------------
| EXAMPLES |
--------------------------------------------------------------------------------
---------------
| Description |
---------------
Clears all forms on the page.
--------
| Code |
--------
$('form').clearForm();
# jcheat namelike $.ajax
$.ajaxTimeout(time) in Ajax
$.ajaxSetup(settings) in Ajax
$.ajax(properties) in Ajax
# jcheat like clear field
clearForm() in Plugins/Form
clearFields() in Plugins/Form

You can grab the tool by doing:

gem install jquery-cheat -y

The -y is so that it automatically includes hpricot, a required dependency.

15 thoughts on “New Command-Line jQuery Tool”

This looks cool, Yehuda! Unfortunately, you might have to explain in a bit more detail how to “grab the tool.” I’m guessing that RubyGems is required for this to work and that there might be some more prep work involved before we can just type the one-liner on the command line and make things magically happen. Any chance you could an executive summary for those of us who aren’t Ruby/Rails gurus so that we can try this out? That would be really cool.

You can try a “gem list –remote” and see if jquery-cheat is listed. It should be between jqpeg2pdf and jruby-openssl. You might somehow be using a weird repository. You can also download the raw gem and install it manually at http://jquery-cheat.rubyforge.org/.

Got it working. It just “magically” started working this afternoon. I’m thinking my ISP is doing some heavy caching, since weird things like this happen sometimes, but it seems weird to affect rubyforge like that.