midas-guilded 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,9 @@
1
+ == 0.1.4 2009-03-17
2
+
3
+ * Added include_component? method for testing if a component type is already present in the Guilded elements collection
4
+ * Fixed bug with Exception raising in add method
5
+
6
+
1
7
  == 0.1.2 2009-03-13
2
8
 
3
9
  * Fixed a bug with stylesheet and JS tag helpers.
data/README.rdoc CHANGED
@@ -79,7 +79,7 @@ The Guilded-Base gem contains the framework to build Guilded components.
79
79
 
80
80
  Add to environment file:
81
81
 
82
- config.gem "guilded", :version => '0.1.0'
82
+ config.gem "guilded", :version => '0.1.4'
83
83
 
84
84
  Run:
85
85
 
data/guilded.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{guilded}
5
- s.version = "0.1.3"
5
+ s.version = "0.1.4"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["C. Jason Harrelson (midas)"]
9
- s.date = %q{2009-03-13}
9
+ s.date = %q{2009-03-17}
10
10
  s.description = %q{Warning: This project just started and there are no stable releases available yet. 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 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-Base gem contains the framework to build Guilded components.}
11
11
  s.email = ["jason@lookforwardenterprises.com"]
12
12
  s.extra_rdoc_files = ["History.txt", "Manifest.txt", "PostInstall.txt", "README.rdoc"]
data/lib/guilded.rb CHANGED
@@ -71,7 +71,7 @@ require 'guilded/rails/active_record/human_attribute_override'
71
71
  # <%= g_load_alerter :skin => 'blueish', :id => 'load_alerter' %>
72
72
  #
73
73
  module Guilded
74
- VERSION = '0.1.3'
74
+ VERSION = '0.1.4'
75
75
  end
76
76
 
77
77
  ActionView::Base.send( :include, Guilded::Rails::ViewHelpers ) if defined?( ActionView )
@@ -45,9 +45,9 @@ module Guilded
45
45
  # Adds an element with its options to the @g_elements hash to be used later.
46
46
  #
47
47
  def add( element, options={}, libs=[], styles=[] )
48
- raise Guilded::Exceptions::IdMissing unless options.has_key?( :id )
49
- raise Guilded::Exceptions::DuplicateElementId( options[:id] ) if @g_elements.has_key?( options[:id] )
50
- @g_elements[ options[:id] ] = Guilded::ComponentDef.new( element, options, libs, styles )
48
+ raise Guilded::Exceptions::IdMissing.new unless options.has_key?( :id )
49
+ raise Guilded::Exceptions::DuplicateElementId.new( options[:id] ) if @g_elements.has_key?( options[:id] )
50
+ @g_elements[ options[:id].to_sym ] = Guilded::ComponentDef.new( element, options, libs, styles )
51
51
  end
52
52
 
53
53
  def count #:nodoc:
@@ -72,17 +72,23 @@ module Guilded
72
72
  @combined_js_srcs.size
73
73
  end
74
74
 
75
+ # Returns true if the component type is included, otherwise false.
76
+ #
77
+ def include_component?( type )
78
+ @g_elements.has_key?( type.to_sym )
79
+ end
80
+
75
81
  # The collection of JavaScript assets for the current Guilded component set.
76
82
  #
77
83
  def combined_js_srcs
78
- generate_asset_lists unless @assets_combined
84
+ #generate_asset_lists unless @assets_combined
79
85
  @combined_js_srcs
80
86
  end
81
87
 
82
88
  # The collection of CSS assets for the current Guilded component set.
83
89
  #
84
90
  def combined_css_srcs
85
- generate_asset_lists unless @assets_combined
91
+ #generate_asset_lists unless @assets_combined
86
92
  @combined_css_srcs
87
93
  end
88
94
 
@@ -94,8 +100,18 @@ module Guilded
94
100
  @g_elements.clear
95
101
  @assets_combined = false
96
102
  init_sources
103
+ @default_css_count = @combined_css_srcs.size
104
+ @default_js_count = @combined_js_srcs.size
97
105
  end
98
106
 
107
+ def inject_css( *sources )
108
+ @combined_css_srcs.insert( @default_css_count, *sources )
109
+ end
110
+
111
+ def inject_js( *sources )
112
+ @combined_js_srcs.insert( @default_js_count, *sources )
113
+ end
114
+
99
115
  # Generates the markup required to include all the assets necessary for the Guilded compoents in
100
116
  # @g_elements collection. Use this if you are not interested in caching asset files.
101
117
  #
@@ -61,8 +61,14 @@ module Guilded
61
61
  # resets, etc and not override any guilded components styles.
62
62
  #
63
63
  def g_stylesheet_link_tag( *sources )
64
+ options = sources.extract_options!
64
65
  g = Guilded::Guilder.instance
65
- g.combined_css_srcs.push( *sources )
66
+
67
+ if options[:ensure_primary]
68
+ g.inject_css( *sources )
69
+ else
70
+ g.combined_css_srcs.push( *sources )
71
+ end
66
72
  ''
67
73
  end
68
74
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: midas-guilded
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - C. Jason Harrelson (midas)
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-03-13 00:00:00 -07:00
12
+ date: 2009-03-17 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency