JazzLibs
A small gem for rolling out JS libraries (includes repository, demo page and version release rake task)
Introduction
As I am a passionate Ruby and Javascript programmer, I have created and published several Javascript libraries (and Ruby gems) on Github:
- TopUp – A 100% unobtrusive Apple-styled Lightbox
- RaccoonTip – A lightweight, unobtrusive balloon tip
- SeatHolder – A modest placeholder library
- csonv.js – A tiny library to fetch relational CSV data at client-side just like JSON
- oned.js – Trigger callback functions when native HTML or jQuery elements get added to the DOM tree
During this process, I have developed a routine repository structure. So to make my life a little bit easier, I have created JazzLibs
which generates a repository containing the routine files:
- .gitignore file
- changelog
- demo page (an online example)
- readme
- MIT license
- version file
- jQuery core library
- the Javascript library
- rakefile containg a rake task for releasing library versions
I hope this will help you getting started developing new Javascript libraries as it does for me. Suggestions, questions and remarks are very welcome! ^^
Installation
Run the following command in your console:
gem install jazz_libs
Usage
Run the following command to create a Javascript library repository:
jazz new your_library_name
Note: You will be asked a couple questions concerning the library (e.g. a small description, your Twitter name).
Releasing a new version
The generated library repository contains a rake task with which you can release new versions with ease. Just run the following command in the console:
rake release[VERSION]
Note: Replace VERSION
with the actual version number (e.g. rake release[0.1.8]
)
A directory will be created containing the new version within /releases/VERSION
, it includes the following:
- CHANGELOG.rdoc
- README.textile
- jquery/core.js (only when applicable of course)
- the uncompressed library source (e.g.
mix_table.js
) - the minified library source (e.g.
mix_table.min.js
) - the demo page
Contact me
For support, remarks and requests please mail me at paul.engel@holder.nl.
Credit
The generated Javascript library structure is based on Eric Miraglia’s (@miraglia) JavaScript Module Pattern:
http://www.yuiblog.com / the-blog-post
The minification of the Javascript library is made possible by Yahoo’s YUI compressor.
ToDo’s
- Add SASS facilities like in RaccoonTip
- Add Jzip facilities like in Rich-CMS
License
Copyright © 2011 Paul Engel, released under the MIT license
http://holder.nl – http://github.com/archan937 – http://codehero.es – http://gettopup.com – http://twitter.com/archan937 – paul.engel@holder.nl
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.