Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Release 0.3.0.

  • Loading branch information...
commit 4c27c606a7e9d895dba6e8a20388e87894ed4cb1 1 parent d0378b5
@midas authored
View
5 History.txt
@@ -1,6 +1,11 @@
= 0.3.0 2009-07-12
* Added support for MooTools library.
+* Added :mootools option to the Guilder.add() method. If true is passed into this option when adding a component, Guilded
+ will automatically add the mootools library to the libs collection so that the lib will be included in the assets the
+ page loads.
+* Updated the g_javascript_include_tag to resolve the :jquery and :mootools symbols to their respective libraries based
+ on the configuration of Guilded and the current running environment.
= 0.2.9 2009-06-18
View
14 README.rdoc
@@ -2,6 +2,7 @@
http://github.com/midas/guilded/tree/master
+
== DESCRIPTION
Guilded is a framework for building web based components centered around current web standards and best practices. The current
@@ -28,11 +29,16 @@ in a Gem and have a dependency on the Guilded gem.
The Guilded gem contains the framework to build Guilded components.
+Update: Due to the quality components, etc. being generated by the MooTools community and the general quality of the library, we
+have decided to include support for it in Guilded as of release 0.3.0.
+
== FEATURES
=== Centralized control of CSS and JavaScript assets needed to render a web page.
* Automatic addition of jQuery 1.3.2 library.
+* Automatic addition of MooTools 1.2.3 library if a utilized component defines it as a dependency using the :mootools => true option
+ with the Guilder.add() method when defining the component.
* 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.
@@ -53,6 +59,9 @@ The Guilded gem contains the framework to build Guilded components.
is initialized, the data structure will be instantiated for you with the name specified within the g object.
* Execute custom JavaScript code after all Guilded components are initialized (ensuring everything you wish to use is instantiated)
using the 'guildedInitialized' custom jQuery event defined on the body DOM element.
+* g_javascript_include_tag view helper that will explicitly add JavaScript libraries to the libs collection to be included in the
+ assets. This helper will also resolve any libs to their full or compressed versions dependent on the current executing environment.
+ Additionally, the symbols :jquery and :mootools will be expanded to the lib version defined in the Guilded configuration.
=== Caching of CSS and JavaScript assets needed to render a web page.
* The CSS assets are cached to form one file. In addition, the JavaScript assets are cached to form one file. These files are
@@ -95,6 +104,11 @@ The Guilded gem contains the framework to build Guilded components.
* jQuery 1.3.2 (included in Guilded)
+== OPTIONALS
+
+* MooTools 1.2.3 (included in Guilded)
+
+
== INSTALL
gem sources -a http://gems.github.com
View
8 guilded.gemspec
@@ -2,15 +2,15 @@
Gem::Specification.new do |s|
s.name = %q{guilded}
- s.version = "0.2.9"
+ s.version = "0.3.0"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["C. Jason Harrelson (midas)"]
- s.date = %q{2009-06-18}
- s.description = %q{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 intends to provide a toolset for creating and consuming reusable web components. Currently, this problem domain is filled with JavaScript frameworks. These frameworks are wonderful and work very well. However, they do not degrade gracefully and are not accessible. Guilded seeks to provide the same level of "componentization" and ease of use without sacrificing degradability and accessibility. Guilded will achieve these goals by applying each technology at our disposal to do what it was intended. XHTML will be employed for content. CSS used for layout and styling. Behavior will be added to a component with JavaScript through progressive enhancement. The user will have the best experience with a Guilded component when CSS and JavaScript are enabled in their browser, but will still be able to use the component when CSS and JavaScript are disabled. Guilded will use jQuery as it's base JavaScript framework. jQuery was chosen because it lends itself to progressive enhancement due to the way it was authored. In addition, the tight integration of jQuery's selectors with CSS selectors is also highly desirable. When authoring a Guilded component, it is encouraged to write the behavior code as a jQuery plugin. This will allow the jQuery plugin to be used outside of the Guilded project, if desired. 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 gem contains the framework to build Guilded components.}
+ s.date = %q{2009-07-13}
+ s.description = %q{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 intends to provide a toolset for creating and consuming reusable web components. Currently, this problem domain is filled with JavaScript frameworks. These frameworks are wonderful and work very well. However, they do not degrade gracefully and are not accessible. Guilded seeks to provide the same level of "componentization" and ease of use without sacrificing degradability and accessibility. Guilded will achieve these goals by applying each technology at our disposal to do what it was intended. XHTML will be employed for content. CSS used for layout and styling. Behavior will be added to a component with JavaScript through progressive enhancement. The user will have the best experience with a Guilded component when CSS and JavaScript are enabled in their browser, but will still be able to use the component when CSS and JavaScript are disabled. Guilded will use jQuery as it's base JavaScript framework. jQuery was chosen because it lends itself to progressive enhancement due to the way it was authored. In addition, the tight integration of jQuery's selectors with CSS selectors is also highly desirable. When authoring a Guilded component, it is encouraged to write the behavior code as a jQuery plugin. This will allow the jQuery plugin to be used outside of the Guilded project, if desired. 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 gem contains the framework to build Guilded components. Update: Due to the quality components, etc. being generated by the MooTools community and the general quality of the library, we have decided to include support for it in Guilded as of release 0.3.0.}
s.email = ["jason@lookforwardenterprises.com"]
s.extra_rdoc_files = ["History.txt", "Manifest.txt", "PostInstall.txt", "README.rdoc"]
- s.files = ["History.txt", "Manifest.txt", "PostInstall.txt", "README.rdoc", "Rakefile", "guilded.gemspec", "lib/guilded.rb", "lib/guilded/browser_detector.rb", "lib/guilded/component_def.rb", "lib/guilded/exceptions.rb", "lib/guilded/guilder.rb", "lib/guilded/rails.rb", "lib/guilded/rails/active_record/human_attribute_hint.rb", "lib/guilded/rails/active_record/human_attribute_override.rb", "lib/guilded/rails/helpers.rb", "lib/guilded/rails/inactive_record/human_attribute_hint.rb", "lib/guilded/rails/view_helpers.rb", "rails_generators/guilded_assets/guilded_assets_generator.rb", "rails_generators/guilded_assets/templates/guilded.js", "rails_generators/guilded_assets/templates/guilded.min.js", "rails_generators/guilded_assets/templates/jquery-1.2.6.js", "rails_generators/guilded_assets/templates/jquery-1.2.6.min.js", "rails_generators/guilded_assets/templates/jquery-1.3.2.js", "rails_generators/guilded_assets/templates/jquery-1.3.2.min.js", "rails_generators/guilded_assets/templates/jquery-url.js", "rails_generators/guilded_assets/templates/jquery-url.min.js", "rails_generators/guilded_assets/templates/reset-min.css", "rails_generators/guilded_config/guilded_config_generator.rb", "rails_generators/guilded_config/templates/load_guilded_settings.rb", "script/console", "script/destroy", "script/generate", "spec/guilded/component_def_spec.rb", "spec/guilded/guilder_spec.rb", "spec/guilded/rails/helpers_spec.rb", "spec/guilded_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "tasks/rails.rake", "tasks/rspec.rake"]
+ s.files = ["History.txt", "Manifest.txt", "PostInstall.txt", "README.rdoc", "Rakefile", "guilded.gemspec", "lib/guilded.rb", "lib/guilded/browser_detector.rb", "lib/guilded/component_def.rb", "lib/guilded/exceptions.rb", "lib/guilded/guilder.rb", "lib/guilded/rails.rb", "lib/guilded/rails/active_record/human_attribute_hint.rb", "lib/guilded/rails/active_record/human_attribute_override.rb", "lib/guilded/rails/helpers.rb", "lib/guilded/rails/inactive_record/human_attribute_hint.rb", "lib/guilded/rails/view_helpers.rb", "rails_generators/guilded_assets/guilded_assets_generator.rb", "rails_generators/guilded_assets/templates/guilded.js", "rails_generators/guilded_assets/templates/guilded.min.js", "rails_generators/guilded_assets/templates/jquery-1.2.6.js", "rails_generators/guilded_assets/templates/jquery-1.2.6.min.js", "rails_generators/guilded_assets/templates/jquery-1.3.2.js", "rails_generators/guilded_assets/templates/jquery-1.3.2.min.js", "rails_generators/guilded_assets/templates/jquery-url.js", "rails_generators/guilded_assets/templates/jquery-url.min.js", "rails_generators/guilded_assets/templates/mootools-1.2.3.js", "rails_generators/guilded_assets/templates/mootools-1.2.3.min.js", "rails_generators/guilded_assets/templates/reset-min.css", "rails_generators/guilded_config/guilded_config_generator.rb", "rails_generators/guilded_config/templates/load_guilded_settings.rb", "script/console", "script/destroy", "script/generate", "spec/guilded/component_def_spec.rb", "spec/guilded/guilder_spec.rb", "spec/guilded/rails/helpers_spec.rb", "spec/guilded_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "tasks/rails.rake", "tasks/rspec.rake"]
s.has_rdoc = true
s.homepage = %q{http://github.com/midas/guilded/tree/master}
s.post_install_message = %q{PostInstall.txt}
View
5 lib/guilded/guilder.rb
@@ -24,7 +24,7 @@ class Guilder
GUILDED_NS = "guilded."
- attr_reader :initialized_at
+ attr_reader :initialized_at, :jquery_js, :mootools_js
def initialize #:nodoc:
if defined?( GUILDED_CONFIG )
@@ -63,6 +63,9 @@ def add_data( name, data )
@g_data_elements.merge!( name.to_sym => data )
end
+ # Adds JavaScript sources to the libs collection by resolving them to the normal or min version
+ # based on the current running environment, development, production, etc.
+ #
def add_js_sources( *sources )
resolve_js_libs( *sources )
end
View
15 lib/guilded/rails/view_helpers.rb
@@ -32,7 +32,12 @@ def g_apply_style
# Creates a javascript include tag for a Guilded specific file. The only difference
# being that it adds the file to a sources array to be concatenated and included at the
- # end of the page.
+ # end of the page with the dependencies specified for the Guilded components used.
+ #
+ # To explicitly include the jQuery or MooTools libraries you can use :jquery and/or :mootools
+ # respectively. If a component that uses either jQuery or MooTools is used on a page, there is
+ # no need to explicitly include the library, as it will be resolved as a dependency and only
+ # included once.
#
def g_javascript_include_tag( *sources )
g = Guilded::Guilder.instance
@@ -47,16 +52,16 @@ def g_javascript_include_tag( *sources )
end
if sources.include?( :mootools )
unless sources.include?( g.mootools_js )
- insert at = 0
- insert at = 1 if( sources.include?( g.jquery_js ) )
+ insert_at = 0
+ insert_at = 1 if( sources.include?( g.jquery_js ) )
sources.insert( insert_at, g.mootools_js )
end
sources.delete( :mootools )
end
if defaults
- g.combined_js_srcs.push( *(sources << defaults) )
+ g.add_js_sources( *(sources << defaults) )
else
- g.combined_js_srcs.push( *sources )
+ g.add_js_sources( *sources )
end
''
end
Please sign in to comment.
Something went wrong with that request. Please try again.