guilded 1.0.9 → 1.0.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (29) hide show
  1. data/History.txt +8 -7
  2. data/README.rdoc +29 -11
  3. data/Rakefile +1 -0
  4. data/VERSION +1 -1
  5. data/guilded.gemspec +25 -4
  6. data/lib/generators/guilded_assets/guilded_assets_generator.rb +21 -0
  7. data/lib/generators/guilded_assets/templates/guilded.js +12 -0
  8. data/lib/generators/guilded_assets/templates/guilded.min.js +1 -0
  9. data/lib/generators/guilded_assets/templates/jquery-1.2.6.js +3549 -0
  10. data/lib/generators/guilded_assets/templates/jquery-1.2.6.min.js +32 -0
  11. data/lib/generators/guilded_assets/templates/jquery-1.3.2.js +4376 -0
  12. data/lib/generators/guilded_assets/templates/jquery-1.3.2.min.js +19 -0
  13. data/lib/generators/guilded_assets/templates/jquery-url.js +199 -0
  14. data/lib/generators/guilded_assets/templates/jquery-url.min.js +9 -0
  15. data/lib/generators/guilded_assets/templates/mootools-1.2.3.js +4036 -0
  16. data/lib/generators/guilded_assets/templates/mootools-1.2.3.min.js +356 -0
  17. data/lib/generators/guilded_assets/templates/reset-min.css +7 -0
  18. data/lib/generators/guilded_config/guilded_config_generator.rb +11 -0
  19. data/{rails_generators/guilded_config/templates/load_guilded_settings.rb → lib/generators/guilded_config/templates/guilded_config.rb} +3 -0
  20. data/lib/guilded.rb +1 -1
  21. data/lib/guilded/guilder.rb +36 -16
  22. data/lib/guilded/rails/view_helpers.rb +12 -1
  23. data/rails_generators/guilded_config/guilded_config_generator.rb +1 -1
  24. data/rails_generators/guilded_config/templates/guilded_config.rb +16 -0
  25. data/spec/generators/guilded_assets_generator_spec.rb +35 -0
  26. data/spec/generators/guilded_config_generator_spec.rb +24 -0
  27. data/spec/spec.opts +7 -1
  28. data/spec/spec_helper.rb +17 -4
  29. metadata +38 -6
@@ -22,8 +22,19 @@ module Guilded
22
22
  def g_apply_includes
23
23
  g = Guilded::Guilder.instance
24
24
  g.generate_asset_lists
25
+
26
+ # CSS
25
27
  self.output_buffer.sub!( /<!-- guilded.styles -->/, stylesheet_link_tag( g.combined_css_srcs, :cache => "cache/#{g.css_cache_name}" ) )
26
- javascript_include_tag( g.combined_js_srcs, :cache => "cache/#{g.js_cache_name}" )
28
+
29
+ # JavaScript
30
+ if g.production? && g.use_remote_jquery
31
+ js_groups = g.combined_js_srcs.partition { |src| src == g.jquery_js }
32
+ output = javascript_include_tag( g.jquery_remote_url )
33
+ output << javascript_include_tag( js_groups[1], :cache => "cache/#{g.js_cache_name}" ) unless js_groups[1].nil?
34
+ else
35
+ output = javascript_include_tag( g.combined_js_srcs, :cache => "cache/#{g.js_cache_name}" )
36
+ end
37
+ output
27
38
  end
28
39
 
29
40
  def g_apply_style
@@ -5,7 +5,7 @@ class GuildedConfigGenerator < Rails::Generator::Base
5
5
 
6
6
  def manifest
7
7
  record do |m|
8
- m.file 'load_guilded_settings.rb', 'config/initializers/load_guilded_settings.rb'
8
+ m.file 'guilded_config.rb', 'config/initializers/guilded_config.rb'
9
9
  end
10
10
  end
11
11
  end
@@ -0,0 +1,16 @@
1
+ # While Guilded is framework agnostic, this config file is Rails specific. You can create your own config file based
2
+ # on this one in order to work in different environments.
3
+ #
4
+ GUILDED_CONFIG = {
5
+ :app_root => Rails.root.to_s,
6
+ :js_path => "#{Rails.root}/public/javascripts/",
7
+ :js_folder => "", # from the js_path
8
+ :jquery_js => "jquery/jquery-1.3.2.min.js", # from the js_path
9
+ :use_remote_jquery => true,
10
+ :jquery_remote_url => "http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js",
11
+ :mootools_js => "mootools/mootools-1.2.3.min.js", # from the js_path
12
+ :css_path => "#{Rails.root}/public/stylesheets/",
13
+ :css_folder => "guilded/", # from the css_path
14
+ :reset_css => "reset-min.css", # from the css_path
15
+ :environment => Rails.env
16
+ }
@@ -0,0 +1,35 @@
1
+ require 'spec_helper'
2
+ require 'generators/guilded_assets/guilded_assets_generator'
3
+
4
+ describe GuildedAssetsGenerator do
5
+ before :each do
6
+ @destination = File.join 'tmp', 'test_app'
7
+ @source = GuildedAssetsGenerator.source_root
8
+ GuildedAssetsGenerator.start '', :destination_root => @destination
9
+ end
10
+
11
+ after :each do
12
+ FileUtils.rm_rf @destination
13
+ end
14
+
15
+ {"guilded.js" => "public/javascripts/guilded.js",
16
+ "guilded.min.js" => "public/javascripts/guilded.min.js",
17
+ "jquery-1.2.6.js" => "public/javascripts/jquery/jquery-1.2.6.js",
18
+ "jquery-1.2.6.min.js" => "public/javascripts/jquery/jquery-1.2.6.min.js",
19
+ "jquery-1.3.2.js" => "public/javascripts/jquery/jquery-1.3.2.js",
20
+ "jquery-1.3.2.min.js" => "public/javascripts/jquery/jquery-1.3.2.min.js",
21
+ "jquery-url.js" => "public/javascripts/jquery/jquery-url.js",
22
+ "jquery-url.min.js" => "public/javascripts/jquery/jquery-url.min.js",
23
+ "mootools-1.2.3.js" => "public/javascripts/mootools/mootools-1.2.3.js",
24
+ "mootools-1.2.3.min.js" => "public/javascripts/mootools/mootools-1.2.3.min.js",
25
+ "reset-min.css" => "public/stylesheets/reset-min.css"}.each do |file, path|
26
+
27
+ it "should copy '#{file}' to '#{path}'" do
28
+ File.exists?( File.join( @destination, path ) ).should be_true
29
+ end
30
+
31
+ it "should agree that the contents of '#{file}' are identical to '#{path}'" do
32
+ File.read( File.join( @source, file ) ).should eql File.read( File.join( @destination, path ) )
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,24 @@
1
+ require 'spec_helper'
2
+ require 'generators/guilded_config/guilded_config_generator'
3
+
4
+ describe GuildedConfigGenerator do
5
+ before :each do
6
+ @destination = File.join 'tmp', 'test_app'
7
+ @source = GuildedConfigGenerator.source_root
8
+ GuildedConfigGenerator.start '', :destination_root => @destination
9
+ end
10
+
11
+ after :each do
12
+ FileUtils.rm_rf @destination
13
+ end
14
+
15
+ {'guilded_config.rb' => 'config/initializers/guilded_config.rb'}.each do |file, path|
16
+ it "should copy '#{file}' to '#{path}'" do
17
+ File.exists?( File.join( @destination, path ) ).should be_true
18
+ end
19
+
20
+ it "should agree that the contents of '#{file}' are identical to '#{path}'" do
21
+ File.read( File.join( @source, file ) ).should eql File.read( File.join( @destination, path ) )
22
+ end
23
+ end
24
+ end
data/spec/spec.opts CHANGED
@@ -1 +1,7 @@
1
- --color
1
+ --colour
2
+ --format progress
3
+ --format html:specifications.html
4
+ --loadby mtime
5
+ --reverse
6
+ --backtrace
7
+ --debugger
data/spec/spec_helper.rb CHANGED
@@ -9,13 +9,26 @@ Spec::Runner.configure do |config|
9
9
 
10
10
  end
11
11
 
12
- RAILS_ROOT = ''
12
+ module Rails
13
+ def self.env
14
+ 'development'
15
+ end
16
+
17
+ def self.root
18
+ ''
19
+ end
20
+ end
21
+
13
22
  GUILDED_CONFIG = {
14
- :js_path => "#{RAILS_ROOT}/public/javascripts/",
23
+ :app_root => Rails.root.to_s,
24
+ :js_path => "#{Rails.root}/public/javascripts/",
15
25
  :js_folder => "", # from the js_path
16
26
  :jquery_js => "jquery/jquery-1.3.2.min.js", # from the js_path
17
- :css_path => "#{RAILS_ROOT}/public/stylesheets/",
27
+ :use_remote_jquery => true,
28
+ :jquery_remote_url => "http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js",
29
+ :mootools_js => "mootools/mootools-1.2.3.min.js", # from the js_path
30
+ :css_path => "#{Rails.root}/public/stylesheets/",
18
31
  :css_folder => "guilded/", # from the css_path
19
32
  :reset_css => "reset-min.css", # from the css_path
20
- :environment => 'development'
33
+ :environment => Rails.env
21
34
  }
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 0
8
- - 9
9
- version: 1.0.9
8
+ - 10
9
+ version: 1.0.10
10
10
  platform: ruby
11
11
  authors:
12
12
  - C. Jason Harrelson (midas)
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-04-16 00:00:00 -05:00
17
+ date: 2010-04-22 00:00:00 -05:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -32,9 +32,23 @@ dependencies:
32
32
  type: :development
33
33
  version_requirements: *id001
34
34
  - !ruby/object:Gem::Dependency
35
- name: activesupport
35
+ name: rspec
36
36
  prerelease: false
37
37
  requirement: &id002 !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ segments:
42
+ - 1
43
+ - 2
44
+ - 9
45
+ version: 1.2.9
46
+ type: :development
47
+ version_requirements: *id002
48
+ - !ruby/object:Gem::Dependency
49
+ name: activesupport
50
+ prerelease: false
51
+ requirement: &id003 !ruby/object:Gem::Requirement
38
52
  requirements:
39
53
  - - ">="
40
54
  - !ruby/object:Gem::Version
@@ -44,7 +58,7 @@ dependencies:
44
58
  - 2
45
59
  version: 2.0.2
46
60
  type: :runtime
47
- version_requirements: *id002
61
+ version_requirements: *id003
48
62
  description: 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 (in most cases). 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.
49
63
  email: jason@lookforwardenterprises.com
50
64
  executables: []
@@ -60,6 +74,20 @@ files:
60
74
  - Rakefile
61
75
  - VERSION
62
76
  - guilded.gemspec
77
+ - lib/generators/guilded_assets/guilded_assets_generator.rb
78
+ - lib/generators/guilded_assets/templates/guilded.js
79
+ - lib/generators/guilded_assets/templates/guilded.min.js
80
+ - lib/generators/guilded_assets/templates/jquery-1.2.6.js
81
+ - lib/generators/guilded_assets/templates/jquery-1.2.6.min.js
82
+ - lib/generators/guilded_assets/templates/jquery-1.3.2.js
83
+ - lib/generators/guilded_assets/templates/jquery-1.3.2.min.js
84
+ - lib/generators/guilded_assets/templates/jquery-url.js
85
+ - lib/generators/guilded_assets/templates/jquery-url.min.js
86
+ - lib/generators/guilded_assets/templates/mootools-1.2.3.js
87
+ - lib/generators/guilded_assets/templates/mootools-1.2.3.min.js
88
+ - lib/generators/guilded_assets/templates/reset-min.css
89
+ - lib/generators/guilded_config/guilded_config_generator.rb
90
+ - lib/generators/guilded_config/templates/guilded_config.rb
63
91
  - lib/guilded.rb
64
92
  - lib/guilded/component_def.rb
65
93
  - lib/guilded/exceptions.rb
@@ -83,10 +111,12 @@ files:
83
111
  - rails_generators/guilded_assets/templates/mootools-1.2.3.min.js
84
112
  - rails_generators/guilded_assets/templates/reset-min.css
85
113
  - rails_generators/guilded_config/guilded_config_generator.rb
86
- - rails_generators/guilded_config/templates/load_guilded_settings.rb
114
+ - rails_generators/guilded_config/templates/guilded_config.rb
87
115
  - script/console
88
116
  - script/destroy
89
117
  - script/generate
118
+ - spec/generators/guilded_assets_generator_spec.rb
119
+ - spec/generators/guilded_config_generator_spec.rb
90
120
  - spec/guilded/component_def_spec.rb
91
121
  - spec/guilded/guilder_spec.rb
92
122
  - spec/guilded_spec.rb
@@ -127,6 +157,8 @@ signing_key:
127
157
  specification_version: 3
128
158
  summary: A framework for building web based components centered around current web standards and best practices.
129
159
  test_files:
160
+ - spec/generators/guilded_assets_generator_spec.rb
161
+ - spec/generators/guilded_config_generator_spec.rb
130
162
  - spec/guilded/component_def_spec.rb
131
163
  - spec/guilded/guilder_spec.rb
132
164
  - spec/guilded_spec.rb