guilded 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. data/.gitignore +3 -0
  2. data/History.txt +111 -0
  3. data/README.rdoc +219 -0
  4. data/Rakefile +56 -0
  5. data/VERSION +1 -0
  6. data/guilded.gemspec +90 -0
  7. data/lib/guilded.rb +79 -0
  8. data/lib/guilded/browser_detector.rb +217 -0
  9. data/lib/guilded/component_def.rb +24 -0
  10. data/lib/guilded/exceptions.rb +29 -0
  11. data/lib/guilded/guilder.rb +357 -0
  12. data/lib/guilded/rails.rb +4 -0
  13. data/lib/guilded/rails/active_record/human_attribute_hint.rb +41 -0
  14. data/lib/guilded/rails/active_record/human_attribute_override.rb +41 -0
  15. data/lib/guilded/rails/helpers.rb +123 -0
  16. data/lib/guilded/rails/inactive_record/human_attribute_hint.rb +26 -0
  17. data/lib/guilded/rails/view_helpers.rb +147 -0
  18. data/rails_generators/guilded_assets/guilded_assets_generator.rb +23 -0
  19. data/rails_generators/guilded_assets/templates/guilded.js +12 -0
  20. data/rails_generators/guilded_assets/templates/guilded.min.js +1 -0
  21. data/rails_generators/guilded_assets/templates/jquery-1.2.6.js +3549 -0
  22. data/rails_generators/guilded_assets/templates/jquery-1.2.6.min.js +32 -0
  23. data/rails_generators/guilded_assets/templates/jquery-1.3.2.js +4376 -0
  24. data/rails_generators/guilded_assets/templates/jquery-1.3.2.min.js +19 -0
  25. data/rails_generators/guilded_assets/templates/jquery-url.js +199 -0
  26. data/rails_generators/guilded_assets/templates/jquery-url.min.js +9 -0
  27. data/rails_generators/guilded_assets/templates/mootools-1.2.3.js +4036 -0
  28. data/rails_generators/guilded_assets/templates/mootools-1.2.3.min.js +356 -0
  29. data/rails_generators/guilded_assets/templates/reset-min.css +7 -0
  30. data/rails_generators/guilded_config/guilded_config_generator.rb +11 -0
  31. data/rails_generators/guilded_config/templates/load_guilded_settings.rb +13 -0
  32. data/script/console +10 -0
  33. data/script/destroy +14 -0
  34. data/script/generate +14 -0
  35. data/tasks/rails.rake +8 -0
  36. data/tasks/rspec.rake +21 -0
  37. data/test/guilded/browser_detector_test.rb +1248 -0
  38. data/test/guilded/component_def_test.rb +26 -0
  39. data/test/guilded/guilder_test.rb +79 -0
  40. data/test/guilded/rails/helpers_test.rb +1450 -0
  41. data/test/guilded/rails/view_helpers_test.rb +97 -0
  42. data/test/guilded_test.rb +7 -0
  43. data/test/test_helper.rb +47 -0
  44. metadata +112 -0
@@ -0,0 +1,3 @@
1
+ .* # Ignore all dotfiles...
2
+ !.gitignore # except for .gitignore
3
+ pkg/*
@@ -0,0 +1,111 @@
1
+ = 1.0.0 2009-10-15
2
+
3
+ * It's about time for a 1.0.0 release
4
+ * Updated the browser detector to be more robust in its detection abilities and provide more features
5
+
6
+
7
+ = 0.3.0 2009-07-12
8
+
9
+ * Added support for MooTools library.
10
+ * Added :mootools option to the Guilder.add() method. If true is passed into this option when adding a component, Guilded
11
+ will automatically add the mootools library to the libs collection so that the lib will be included in the assets the
12
+ page loads.
13
+ * Updated the g_javascript_include_tag to resolve the :jquery and :mootools symbols to their respective libraries based
14
+ on the configuration of Guilded and the current running environment.
15
+
16
+
17
+ = 0.2.9 2009-06-18
18
+
19
+ * Added rescue code if the browser name or version fails.
20
+
21
+
22
+ = 0.2.8 2009-06-12
23
+
24
+ * Removed some code from the InactiveRecord:Base extension for human attrbiute hint that returns unless
25
+ table_exists? as this does not make any sense for InactiveRecord.
26
+
27
+
28
+ = 0.2.7 2009-06-10
29
+
30
+ * Changed the BrowserDetector to need to be instantiated to use. No longer just static methods.
31
+
32
+
33
+ = 0.2.6 2009-06-10
34
+
35
+ * Added some more view helpers for the browser detector.
36
+
37
+
38
+ = 0.2.5 2009-06-10
39
+
40
+ * Added BrowserDetector to assist with determining which browser is making a request.
41
+
42
+
43
+ = 0.2.4 2009-05-29
44
+
45
+ * Added add_data method to the Guilder object allowing named data structures to be passed to the JavaScript
46
+ executing environment.
47
+ * Added a jQuery event to the body DOM element called guildedInitialized. To execute JavaScript code after all
48
+ Guilded components are intialized, simply bind to this event.
49
+
50
+
51
+ = 0.2.0 2009-04-06
52
+
53
+ * Added human attribute hint support for InactiveRecord
54
+
55
+
56
+ = 0.2.0 2009-03-27
57
+
58
+ * Added Mark Perkins jquery-url plugin and made it a default library
59
+
60
+
61
+ = 0.1.9 2009-03-26
62
+
63
+ * Added Rails helper method to resolve REST path helpers and args
64
+
65
+
66
+ = 0.1.5 2009-03-24
67
+
68
+ * Added g_apply_style helper
69
+ * Added functionality to put CSS link tags in the HTML header, where they belong
70
+
71
+
72
+ == 0.1.4 2009-03-17
73
+
74
+ * Added include_component? method for testing if a component type is already present in the Guilded elements collection
75
+ * Fixed bug with Exception raising in add method
76
+
77
+
78
+ == 0.1.2 2009-03-13
79
+
80
+ * Fixed a bug with stylesheet and JS tag helpers.
81
+
82
+
83
+ == 0.1.0 2009-03-12
84
+
85
+ * Fixed a bug with requiring files.
86
+
87
+
88
+ == 0.0.9 2009-03-12
89
+
90
+ * Added Guilded::Rails::Helpers class to hold some common helpers for Rails components
91
+
92
+
93
+ == 0.0.8 2009-03-12
94
+
95
+ * Added attr_human_override and attr_human_hint
96
+
97
+
98
+ == 0.0.7 2009-03-11
99
+
100
+ * Bug fixes
101
+
102
+
103
+ == 0.0.6 2009-03-11
104
+
105
+ * Updated config file and Guilder to accept an :env variable. This variable will allow Guilded to know what environment
106
+ it is running in so that it knows whether to cache assets, etc.
107
+
108
+
109
+ == 0.0.1 2009-02-28
110
+
111
+ * Initial release
@@ -0,0 +1,219 @@
1
+ = guilded
2
+
3
+ http://github.com/midas/guilded/tree/master
4
+
5
+
6
+ == DESCRIPTION
7
+
8
+ Guilded is a framework for building web based components centered around current web standards and best practices. The current
9
+ framework is written in ruby, but could be ported to other languages.
10
+
11
+ Guilded intends to provide a toolset for creating and consuming reusable web components. Currently, this problem domain is
12
+ filled with JavaScript frameworks. These frameworks are wonderful and work very well. However, they do not degrade gracefully and
13
+ are not accessible. Guilded seeks to provide the same level of "componentization" and ease of use without sacrificing degradability
14
+ and accessibility. Guilded will achieve these goals by applying each technology at our disposal (HTML, CSS and JavaScript) to do
15
+ as it was intended.
16
+
17
+ XHTML will be employed for content. CSS used for layout and styling. Behavior will be added to a component with JavaScript
18
+ through progressive enhancement. The user will have the best experience with a Guilded component when CSS and JavaScript are
19
+ enabled in their browser, but will still be able to use the component when CSS and JavaScript are disabled.
20
+
21
+ Guilded will use jQuery as it's base JavaScript framework. jQuery was chosen because it lends itself to progressive enhancement
22
+ due to the way it was authored. In addition, the tight integration of jQuery's selectors with CSS selectors is also highly
23
+ desirable. When authoring a Guilded component, it is encouraged to write the behavior code as a jQuery plugin. This will
24
+ allow the jQuery plugin to be used outside of the Guilded project, if desired.
25
+
26
+ Guilded also seeks to provide a standardized CSS framework for creating layouts that are reusable and predictable.
27
+
28
+ Guilded will utilize the currently existing RubyGems system to package its components. A new Guilded component will be packaged
29
+ in a Gem and have a dependency on the Guilded gem.
30
+
31
+ The Guilded gem contains the framework to build Guilded components.
32
+
33
+ Update: Due to the quality components, etc. being generated by the MooTools community and the general quality of the library, we
34
+ have decided to include support for it in Guilded as of release 0.3.0.
35
+
36
+
37
+ == FEATURES
38
+
39
+ === Centralized control of CSS and JavaScript assets needed to render a web page.
40
+ * Automatic addition of jQuery 1.3.2 library.
41
+ * Automatic addition of MooTools 1.2.3 library if a utilized component defines it as a dependency using the :mootools => true option
42
+ with the Guilder.add() method when defining the component.
43
+ * Automatic addition of Yahoo's reset-min.css.
44
+ * Redefinition of jQuery's $ method to $j and running jQuery in no conflict mode to allow other libraries to retain control
45
+ of the $ method.
46
+ * Definition of the g namespace to avoid JavaScript name collisions. Simply define your custom functions within the g object.
47
+ * Definition of convenience method $j(). Equivalent to jQuery() or $(). Guilded runs jQuery in no conflict mode, giving the $
48
+ back to any other JavaScript frameworks in use. You must use $j() or jQuery() in lieu of $().
49
+ * Definition of convenience method $jc(). Equivalent to jQuery( '.' + className ).
50
+ * Definition of convenience method $jid(). Equivalent to jQuery( '#' + idName ).
51
+ * The assets required for each component are added by the author to a central data store. When the view helper to create
52
+ the component is called, these assets are added to the asset store. This results in a single method call with some options
53
+ to use a Guilded component. No need to include JavaScript source files or CSS files. Guilded automatically does this for
54
+ you.
55
+ * For CSS assets, Guilded simply loops through the collection of CSS assets creating an HTML link tag for each asset, or one
56
+ HTML link tag for the cached version of these asset(s), when running in production mode.
57
+ * For JavaScript assets, Guilded loops through the collection of JavaScript assets creating an HTML script tag for each, or a
58
+ single script tag for the cached version of these asset(s), when running in production mode.
59
+ * Pass named data structures from the server to the client side environment for use with the Guilder.add_data() method. Once Guilded
60
+ is initialized, the data structure will be instantiated for you with the name specified within the g object.
61
+ * Execute custom JavaScript code after all Guilded components are initialized (ensuring everything you wish to use is instantiated)
62
+ using the 'guildedInitialized' custom jQuery event defined on the body DOM element.
63
+ * g_javascript_include_tag view helper that will explicitly add JavaScript libraries to the libs collection to be included in the
64
+ assets. This helper will also resolve any libs to their full or compressed versions dependent on the current executing environment.
65
+ Additionally, the symbols :jquery and :mootools will be expanded to the lib version defined in the Guilded configuration.
66
+
67
+ === Caching of CSS and JavaScript assets needed to render a web page.
68
+ * The CSS assets are cached to form one file. In addition, the JavaScript assets are cached to form one file. These files are
69
+ named by sorting and concatenating into a single string the names of each individual respective asset. This string is then hashed
70
+ to generate a reproducable unique string. This file naming technique allows Guilded to find cached asset files that
71
+ match a combination of Guilded components, not an action, URI, etc. Thus, one file for a certain combination of Guilded
72
+ components is generated and then reused on any page where the combination appears.
73
+
74
+ === Automatic choosing of packed, compressed or minified JavaScript files when in production mode.
75
+ * In production mode, Guilded automatically looks for a .pack, .compressed or .min version of the JavaScript assets. If one of
76
+ these is found, it includes it, otherwise, it includes the version specified by the author in the view helper. This is usually
77
+ an unpacked version of the file.
78
+
79
+ === Additional common utilities
80
+ * Determine the browser making a request with the BrowserDetector class and related view helpers.
81
+ * Extends ActiveRecord to have a attr_human_hint method. This method works similar to the attr_human_name method except a hint
82
+ to use on forms, etc is being set.
83
+ * Extends InactiveRecord (http://github.com/midas/inactive_record/tree/master) to include the attr_human_hint method.
84
+
85
+
86
+ == GUILDED COMPONENT PROJECTS
87
+
88
+ * http://github.com/midas/g_already_grid/tree/master
89
+ * http://github.com/midas/g_auto_completer/tree/master
90
+ * http://github.com/midas/g_flash_growler/tree/master
91
+ * http://github.com/midas/g_flot/tree/master
92
+ * http://github.com/midas/g_form_submit_protector/tree/master
93
+ * http://github.com/midas/g_named_scope_filters/tree/master
94
+ * http://github.com/midas/g_nested_select/tree/master
95
+ * http://github.com/midas/g_sectioned_shower/tree/master
96
+ * http://github.com/midas/g_toggle_block/tree/master
97
+
98
+
99
+ == PROBLEMS
100
+
101
+
102
+
103
+ == REQUIREMENTS
104
+
105
+ * jQuery 1.3.2 (included in Guilded)
106
+
107
+
108
+ == OPTIONALS
109
+
110
+ * MooTools 1.2.3 (included in Guilded)
111
+
112
+
113
+ == INSTALL
114
+
115
+ gem sources -a http://gems.github.com
116
+ sudo gem install midas-guilded
117
+
118
+
119
+ == INSTALL FOR RAILS
120
+
121
+ Add to environment file:
122
+
123
+ config.gem "guilded", :version => '1.0.0'
124
+
125
+ Run:
126
+
127
+ sudo rake:gems:install
128
+
129
+ Generate:
130
+
131
+ script/generate guilded_config
132
+ script/generate guilded_assets
133
+
134
+
135
+ Edit the settings file at config/initializers/load_guilded_settings.rb. Change any of these settings to reflect how
136
+ you would like Guilded to be configured. If you change where any file(s) are configured to be located, then also move
137
+ the respective file(s).
138
+
139
+
140
+ == USAGE
141
+
142
+ === COMPONENT FRAMEWORK
143
+
144
+ You must make a call to the view helper to apply the CSS It should be placed in your layout:
145
+
146
+ <%= g_apply_style %>
147
+
148
+ There is also a view helper to apply the JavaScript. You can place this at the bottom of your layout(s) (so you
149
+ do not have to include it in every template):
150
+
151
+ <%= g_apply_behavior %>
152
+
153
+ You also must reset the Guilded singleton that manages everything after each rendering. The best way to do this is a before
154
+ filter in your application controller:
155
+
156
+ before_filter :reset_guilded
157
+
158
+ #...
159
+
160
+ protected
161
+
162
+ def reset_guilded
163
+ Guilded::Guilder.instance.reset!
164
+ end
165
+
166
+ Then install one or more Guilded components and you are on your way!
167
+
168
+ === BROWSER DETECTOR
169
+
170
+ The browser detector uses the HTTP user agent string to determine which browser is making the current request. The detector
171
+ can determine the name, version, major version, minor version, build version and revision version of the current browser.
172
+
173
+ If using Rails, there are several view helpers available that use the BrowserDetector: g_browser_name(), g_browser_version(),
174
+ g_browser_full_name() and g_browser_is?().
175
+
176
+ The following examples will assume Firefox 3.5.3 on OS/X is being used. The user agent string for Firefox 3.5.3 on OS/X is:
177
+
178
+ Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3
179
+
180
+ g_browser_name
181
+
182
+ <% if g_browser_name == 'firefox' %>
183
+ ...
184
+
185
+ g_browser_version
186
+
187
+ <% if g_browser_version == '3.5.3' %>
188
+ ...
189
+
190
+ g_browser_full_name
191
+
192
+ <%= g_browser_full_name # Outputs: Firefox 3.5.3 %>
193
+
194
+ g_browser_is?
195
+
196
+ <% if g_browser_is?( :name => 'firefox', :version => '3.5.3' ) %>
197
+ ...
198
+
199
+ <% if g_browser_is?( :name => 'firefox', :major_version => '3' ) %>
200
+ ...
201
+
202
+ <% if g_browser_is?( :name => :firefox, :major_version => 3, :minor_version => 5, :build_version => 3 ) %>
203
+ ...
204
+
205
+ <% if g_browser_is?( :name => :firefox, :major_version => 3, :minor_version => 5, :build_version => 3, :revision_version => 0 ) %>
206
+ ...
207
+
208
+
209
+ == LICENSE
210
+
211
+ Copyright (c) 2009 C. Jason Harrelson (midas)
212
+
213
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
214
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
215
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
216
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
217
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
218
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
219
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,56 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |gem|
7
+ gem.name = "guilded"
8
+ gem.summary = %Q{A framework for building web based components centered around current web standards and best practices.}
9
+ gem.description = %Q{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 (HTML, CSS and JavaScript) to do as it was intended.}
10
+ gem.email = "jason@lookforwardenterprises.com"
11
+ gem.homepage = "http://github.com/midas/guilded"
12
+ gem.authors = ["C. Jason Harrelson (midas)"]
13
+ gem.add_dependency "activesupport", ">= 2.0.2"
14
+ end
15
+ Jeweler::GemcutterTasks.new
16
+ rescue LoadError
17
+ puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
18
+ end
19
+
20
+ require 'rake/testtask'
21
+ Rake::TestTask.new(:test) do |test|
22
+ test.libs << 'lib' << 'test'
23
+ test.pattern = 'test/**/*_test.rb'
24
+ test.verbose = true
25
+ end
26
+
27
+ begin
28
+ require 'rcov/rcovtask'
29
+ Rcov::RcovTask.new do |test|
30
+ test.libs << 'test'
31
+ test.pattern = 'test/**/*_test.rb'
32
+ test.verbose = true
33
+ end
34
+ rescue LoadError
35
+ task :rcov do
36
+ abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
37
+ end
38
+ end
39
+
40
+ task :test => :check_dependencies
41
+
42
+ task :default => :test
43
+
44
+ require 'rake/rdoctask'
45
+ Rake::RDocTask.new do |rdoc|
46
+ if File.exist?('VERSION')
47
+ version = File.read('VERSION')
48
+ else
49
+ version = ""
50
+ end
51
+
52
+ rdoc.rdoc_dir = 'rdoc'
53
+ rdoc.title = "tester #{version}"
54
+ rdoc.rdoc_files.include('README*')
55
+ rdoc.rdoc_files.include('lib/**/*.rb')
56
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 1.0.0
@@ -0,0 +1,90 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{guilded}
8
+ s.version = "1.0.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["C. Jason Harrelson (midas)"]
12
+ s.date = %q{2009-10-17}
13
+ s.description = %q{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 (HTML, CSS and JavaScript) to do as it was intended.}
14
+ s.email = %q{jason@lookforwardenterprises.com}
15
+ s.extra_rdoc_files = [
16
+ "README.rdoc"
17
+ ]
18
+ s.files = [
19
+ ".gitignore",
20
+ "History.txt",
21
+ "README.rdoc",
22
+ "Rakefile",
23
+ "VERSION",
24
+ "guilded.gemspec",
25
+ "lib/guilded.rb",
26
+ "lib/guilded/browser_detector.rb",
27
+ "lib/guilded/component_def.rb",
28
+ "lib/guilded/exceptions.rb",
29
+ "lib/guilded/guilder.rb",
30
+ "lib/guilded/rails.rb",
31
+ "lib/guilded/rails/active_record/human_attribute_hint.rb",
32
+ "lib/guilded/rails/active_record/human_attribute_override.rb",
33
+ "lib/guilded/rails/helpers.rb",
34
+ "lib/guilded/rails/inactive_record/human_attribute_hint.rb",
35
+ "lib/guilded/rails/view_helpers.rb",
36
+ "rails_generators/guilded_assets/guilded_assets_generator.rb",
37
+ "rails_generators/guilded_assets/templates/guilded.js",
38
+ "rails_generators/guilded_assets/templates/guilded.min.js",
39
+ "rails_generators/guilded_assets/templates/jquery-1.2.6.js",
40
+ "rails_generators/guilded_assets/templates/jquery-1.2.6.min.js",
41
+ "rails_generators/guilded_assets/templates/jquery-1.3.2.js",
42
+ "rails_generators/guilded_assets/templates/jquery-1.3.2.min.js",
43
+ "rails_generators/guilded_assets/templates/jquery-url.js",
44
+ "rails_generators/guilded_assets/templates/jquery-url.min.js",
45
+ "rails_generators/guilded_assets/templates/mootools-1.2.3.js",
46
+ "rails_generators/guilded_assets/templates/mootools-1.2.3.min.js",
47
+ "rails_generators/guilded_assets/templates/reset-min.css",
48
+ "rails_generators/guilded_config/guilded_config_generator.rb",
49
+ "rails_generators/guilded_config/templates/load_guilded_settings.rb",
50
+ "script/console",
51
+ "script/destroy",
52
+ "script/generate",
53
+ "tasks/rails.rake",
54
+ "tasks/rspec.rake",
55
+ "test/guilded/browser_detector_test.rb",
56
+ "test/guilded/component_def_test.rb",
57
+ "test/guilded/guilder_test.rb",
58
+ "test/guilded/rails/helpers_test.rb",
59
+ "test/guilded/rails/view_helpers_test.rb",
60
+ "test/guilded_test.rb",
61
+ "test/test_helper.rb"
62
+ ]
63
+ s.homepage = %q{http://github.com/midas/guilded}
64
+ s.rdoc_options = ["--charset=UTF-8"]
65
+ s.require_paths = ["lib"]
66
+ s.rubygems_version = %q{1.3.5}
67
+ s.summary = %q{A framework for building web based components centered around current web standards and best practices.}
68
+ s.test_files = [
69
+ "test/guilded/browser_detector_test.rb",
70
+ "test/guilded/component_def_test.rb",
71
+ "test/guilded/guilder_test.rb",
72
+ "test/guilded/rails/helpers_test.rb",
73
+ "test/guilded/rails/view_helpers_test.rb",
74
+ "test/guilded_test.rb",
75
+ "test/test_helper.rb"
76
+ ]
77
+
78
+ if s.respond_to? :specification_version then
79
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
80
+ s.specification_version = 3
81
+
82
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
83
+ s.add_runtime_dependency(%q<activesupport>, [">= 2.0.2"])
84
+ else
85
+ s.add_dependency(%q<activesupport>, [">= 2.0.2"])
86
+ end
87
+ else
88
+ s.add_dependency(%q<activesupport>, [">= 2.0.2"])
89
+ end
90
+ end