web_resource_bundler 0.0.22 → 0.0.23

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -8,7 +8,7 @@ task :build do
8
8
  end
9
9
 
10
10
  task :install => :build do
11
- system "sudo gem install web_resource_bundler-#{WebResourceBundler::VERSION}.gem"
11
+ system "gem install web_resource_bundler-#{WebResourceBundler::VERSION}.gem"
12
12
  end
13
13
 
14
14
  task :release => :build do
data/Readme.md CHANGED
@@ -105,12 +105,13 @@ Recommendations
105
105
 
106
106
  1. Be mindful while organazing and linking your resource files
107
107
  WebResourceBundler combines all resource file in one. This resulted file could be huge.
108
- a. Don't link all resources in layouts!
108
+
109
+ * Don't link all resources in layouts!
109
110
  Be sure to link resources (css\js) only for pages that using them, in other case your users will be forced
110
111
  to download huge css\js files with unused content.
111
- b. One css for one page.
112
+ * One css for one page.
112
113
  Try to slice you css files - separate file for each particular page.
113
- c. Separate bundle block for crucial resources
114
+ * Separate bundle block for crucial resources
114
115
  To make crucial resources (basic styles\scripts for user can see basic page layout ASAP) load first - just bundle them in separate web_resource_bundler_process block and put this block at the top of your head block.
115
116
 
116
117
  2. Don't set max_image_size to big values.
@@ -124,5 +125,6 @@ on the client side. But your scripts are bundled and their relative path changed
124
125
  won't be able to compute loaded file path correctly. You should avoid bundling such tricky javascripts.
125
126
 
126
127
  4. Unexistent resources handling
127
- a. Be sure to link in html only existent resource files, otherwise bundler won't work.
128
- b. If you have unexistent images in css, bundler will work but you've got info messages in log.
128
+
129
+ * Be sure to link in html only existent resource files, otherwise bundler won't work.
130
+ * If you have unexistent images in css, bundler will work but you've got info messages in log.
@@ -1,10 +1,21 @@
1
- require 'rails'
2
-
3
1
  module WebResourceBundler
4
- class Railtie < Rails::Railtie
5
- initializer "web_resource_bundler_initializer.configure_rails_initialization" do
2
+
3
+ if defined?(Rails::Railtie)
4
+ require 'rails'
5
+ class Railtie < Rails::Railtie
6
+ initializer "web_resource_bundler_initializer.configure_rails_initialization" do
7
+ ActiveSupport.on_load :action_view do
8
+ WebResourceBundler::Railtie.insert
9
+ end
10
+ end
11
+ end
12
+ end
13
+
14
+ class Railtie
15
+ def self.insert
6
16
  WebResourceBundler::Bundler.setup(Rails.root, Rails.env)
7
17
  ActionView::Base.send(:include, WebResourceBundler::RailsAppHelpers)
8
18
  end
9
19
  end
20
+
10
21
  end
@@ -0,0 +1,2 @@
1
+ require File.join(File.dirname(__FILE__), "../lib/web_resource_bundler", "railtie.rb")
2
+ WebResourceBundler::Railtie.insert
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 22
9
- version: 0.0.22
8
+ - 23
9
+ version: 0.0.23
10
10
  platform: ruby
11
11
  authors:
12
12
  - gregolsen
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-06-29 00:00:00 +03:00
18
+ date: 2011-07-04 00:00:00 +03:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -59,6 +59,7 @@ extra_rdoc_files: []
59
59
  files:
60
60
  - Rakefile
61
61
  - Readme.md
62
+ - rails/init.rb
62
63
  - lib/web_resource_bundler.rb
63
64
  - lib/web_resource_bundler/exceptions.rb
64
65
  - lib/web_resource_bundler/railtie.rb