smurf 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +0 -3
- data/lib/smurf.rb +12 -32
- data/smurf.gemspec +1 -1
- metadata +2 -2
data/Rakefile
CHANGED
data/lib/smurf.rb
CHANGED
@@ -1,36 +1,16 @@
|
|
1
1
|
require 'smurf/javascript'
|
2
2
|
require 'smurf/stylesheet'
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
module StylesheetSources
|
14
|
-
private
|
15
|
-
def joined_contents; Smurf::Stylesheet.new(super).minified; end
|
16
|
-
end # StylesheetSources
|
17
|
-
|
18
|
-
end # ActionView::Helpers::AssetTagHelper::AssetTag
|
19
|
-
ActionView::Helpers::AssetTagHelper::JavaScriptSources.send(:include, Smurf::JavaScriptSources)
|
20
|
-
ActionView::Helpers::AssetTagHelper::StylesheetSources.send(:include, Smurf::StylesheetSources)
|
21
|
-
else
|
22
|
-
# Support for everything else
|
23
|
-
module ActionView::Helpers::AssetTagHelper
|
24
|
-
private
|
25
|
-
def join_asset_file_contents_with_minification(files)
|
26
|
-
content = join_asset_file_contents_without_minification(files)
|
27
|
-
if !files.grep(%r[/javascripts]).empty?
|
28
|
-
content = Smurf::Javascript.new(content).minified
|
29
|
-
elsif !files.grep(%r[/stylesheets]).empty?
|
30
|
-
content = Smurf::Stylesheet.new(content).minified
|
31
|
-
end
|
32
|
-
content
|
4
|
+
module ActionView::Helpers::AssetTagHelper
|
5
|
+
private
|
6
|
+
def join_asset_file_contents_with_minification(files)
|
7
|
+
content = join_asset_file_contents_without_minification(files)
|
8
|
+
if !files.grep(%r[/javascripts]).empty?
|
9
|
+
content = Smurf::Javascript.new(content).minified
|
10
|
+
elsif !files.grep(%r[/stylesheets]).empty?
|
11
|
+
content = Smurf::Stylesheet.new(content).minified
|
33
12
|
end
|
34
|
-
|
35
|
-
end
|
36
|
-
|
13
|
+
content
|
14
|
+
end
|
15
|
+
alias_method_chain :join_asset_file_contents, :minification
|
16
|
+
end # ActionView::Helpers::AssetTagHelper
|
data/smurf.gemspec
CHANGED
@@ -2,7 +2,7 @@ Gem::Specification.new do |s|
|
|
2
2
|
s.name = "smurf"
|
3
3
|
s.summary = "Rails plugin to automatically minify JS and CSS when their bundles get cached"
|
4
4
|
s.description = "Rails plugin to automatically minify JS and CSS when their bundles get cached. Send in those patches!"
|
5
|
-
s.version = "1.0.
|
5
|
+
s.version = "1.0.3"
|
6
6
|
s.authors = ["Justin Knowlden"]
|
7
7
|
s.email = %w[gus@thumblemonks.com]
|
8
8
|
s.homepage = "http://github.com/thumblemonks/smurf"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smurf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Knowlden
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-10-
|
12
|
+
date: 2009-10-13 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|