Guilded is a framework for building web based components centered around current web standards and best practices. The current framework is written in ruby, but could be ported to other languages.
Guilded also seeks to provide a standardized CSS framework for creating layouts that are reusable and predictable.
Guilded will utilize the currently existing RubyGems system to package its components. A new Guilded component will be packaged in a Gem and have a dependency on the guilded gem.
The Guilded-Base gem contains the framework to build Guilded components.
Automatic addition of jQuery 1.3.2 library.
Automatic addition of Yahoo's reset-min.css.
Redefinition of jQuery's $ method to $j and running jQuery in no conflict mode to allow other libraries to retain control of the $ method.
Definition of convenience method $jc(). Equivalent to jQuery( '.' + className ).
Definition of convenience method $jid(). Equivalent to jQuery( '#' + idName ).
The assets required for each component are added by the author to a central data store. When the view helper to create the component is called, these assets are added to the asset store. This results in a single method call with some options to use a Guilded component.
For CSS assets, Guilded simply loops through the collection of CSS assets creating an HTML link tag for each asset, or one HTML link tag for the cached version of these asset(s), when running in production mode.
jQuery 1.3.2 (included in Guilded)
gem sources -a http://gems.github.com sudo gem install midas-guilded
Add to environment file:
config.gem "guilded", :version => '0.1.9'
script/generate guilded_config script/generate guilded_assets
Edit the settings file at config/initializers/load_guilded_settings.rb. Change any of these settings to reflect how you would like Guilded to be configured. If you change where any file(s) are configured to be located, then also move the respective file(s).
Next you must make a call to the view helper to apply the CSS It should be placed in your layout:
<%= g_apply_style %>
<%= g_apply_behavior %>
You also must reset the Guilded singleton that manages everything after each rendering. The best way to do this is a before filter in your application controller:
def reset_guilded Guilded::Guilder.instance.reset! end
Copyright © 2009 C. Jason Harrelson (midas)
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.