README.rdoc in jqueryplugingen-0.1.4 vs README.rdoc in jqueryplugingen-0.2.0

- old
+ new

@@ -7,45 +7,106 @@ Generate the structure of jquery plugins easily. Manage library dependencies such as other jquery libraries or packing code on either mac or windows. Get jsspec testing baked in. Use the familiar rake tasks to manage your jquery code base. == FEATURES/PROBLEMS: +* CAN't have a '-' or '.' in the project name [need to split plugin name and filename :-)] +* refactor jquery.rake task like compiletask as it is pretty ugly and has some spaghetti going on * be able to use the produced code on linux and windows (need jqp.bat) -* bundle up jsspec * include qunit -* add acceptance test * add hoe-type features for updating plugins to jquery plugin page (as rake tasks) * be able to bundle/package library dependencies * be able to switch between local and remote libraries in actual html pages (perhaps this is the release bundle) * be able to generate new modules and update html pages (as rake task or generator) * nice to remove option -p for project "jpq myplugin" == SYNOPSIS: jqp -p myplugin -This will generate: +jQuery plugin generator to help you kick start your plugin development with the following structure: + + plugin + /src + /css + /images + query.plugin.js + /test + spec_plugin.js + acceptance_plugin.js + specs.html + acceptance.html + /lib + /jsspec + jquery.min.js + jquery-ui.js + /themes + /base + example.html + Rakefile + History.txt + README.txt - /src - jquery.myplugin.js - /test - spec_myplugin.js - specs.html - example.html - /lib - Rakefile - Makefile +It will generate a base plugin of the structure: -Once you have written your code: +;(function($) { + + $.jquery.test = { + VERSION: "0.0.1", + defaults: { + key: 'value' + } + }; -(a) test with jsspec at test/specs.html -(b) package with make and see the results in /dist + $.fn.extend({ + jquery.test: function(settings) { + settings = $.extend({}, $.jquery.test.defaults, settings); + return this.each( function(){ + self = this; + + // NOTE: semicolons are needed more if you are planning on packing your code + console.log(this); + console.log($(this)); + console.log($.jquery.test.VERSION); + console.log($.jquery.test.defaults.key); + // your plugin + + }) + } + + }) +})(jQuery); +And a base set of jsspec tests all hooked into an html page ready to go: + +describe('The tests can load', { + + 'before': function() { + }, + + 'after': function(){ + }, + + 'should load': function(){ + + }, + +}) + +Once you have written your code. You have three views of the plugin: + + 1. Acceptance: rake acceptance (compiles and loads tests in browser) + 2. Specs: rake specs (loads tests in browser) + 3. Example: rake show (compiles and loads the sample page in a browser) + +Finally, package your plugin ready for uploading the plugins.jquery.com + + rake package + + == REQUIREMENTS: -* jquery -* jspec -* a packer (currently linux or cygwin) +* jquery (installed with rake:jquery:add) == INSTALL: * sudo gem install jquery_plugin_gen \ No newline at end of file