compressible 0.0.2 → 0.0.2.1
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/README.markdown +18 -10
- data/Rakefile +3 -7
- data/lib/compressible/view_helpers.rb +13 -2
- metadata +5 -4
data/README.markdown
CHANGED
@@ -109,17 +109,25 @@ This is configurable. It relies on the [`hookify`](http://github.com/viatropos/
|
|
109
109
|
sudo gem install hookify
|
110
110
|
cd my-rails-app
|
111
111
|
hookify pre-commit
|
112
|
+
mate config/hooks/pre_commit.rb
|
112
113
|
|
113
|
-
That creates a ruby script for you were you can define what you want to run when.
|
114
|
+
That creates a ruby script for you were you can define what you want to run when. Add this to the `config/hooks/pre_commit.rg` file:
|
114
115
|
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
116
|
+
require 'rubygems'
|
117
|
+
gem "activesupport", "= 2.3.5"
|
118
|
+
require "active_support"
|
119
|
+
require 'compressible'
|
120
|
+
|
121
|
+
Compressible.configure(
|
122
|
+
:stylesheet_path => "public/stylesheets",
|
123
|
+
:javascript_path => "public/javascripts"
|
124
|
+
)
|
125
|
+
|
126
|
+
Compressible.stylesheets(
|
127
|
+
:production_cache => %w(reset background footer list)
|
128
|
+
)
|
129
|
+
Compressible.javascripts(
|
130
|
+
:production_cache => %w(interface jquery.anytime)
|
123
131
|
)
|
124
132
|
|
125
|
-
Very cool.
|
133
|
+
Now stylesheets and javascripts compress using the YUICompressor every time you commit. And it's fast. Very cool.
|
data/Rakefile
CHANGED
@@ -5,12 +5,12 @@ require 'rake/gempackagetask'
|
|
5
5
|
# http://docs.rubygems.org/read/chapter/20
|
6
6
|
spec = Gem::Specification.new do |s|
|
7
7
|
s.name = "compressible"
|
8
|
-
s.version = "0.0.2"
|
8
|
+
s.version = "0.0.2.1"
|
9
9
|
s.author = "Lance Pollard"
|
10
|
-
s.summary = "Compressible: Quick asset compression for Ruby"
|
10
|
+
s.summary = "Compressible: Quick asset compression for Ruby - Perfect for Heroku"
|
11
11
|
s.homepage = "http://github.com/viatropos/compressible"
|
12
12
|
s.email = "lancejpollard@gmail.com"
|
13
|
-
s.description = "Quick asset compression for Ruby"
|
13
|
+
s.description = "Quick asset compression for Ruby - Perfect for Heroku"
|
14
14
|
s.has_rdoc = true
|
15
15
|
s.rubyforge_project = "compressible"
|
16
16
|
s.platform = Gem::Platform::RUBY
|
@@ -68,10 +68,6 @@ task :yank do
|
|
68
68
|
`gem yank #{spec.name} -v #{spec.version}`
|
69
69
|
end
|
70
70
|
|
71
|
-
task :lance do
|
72
|
-
puts "LANCE POLARd"
|
73
|
-
end
|
74
|
-
|
75
71
|
namespace :hookify do
|
76
72
|
|
77
73
|
task :pre_commit do
|
@@ -3,15 +3,26 @@ module Compressible::ViewHelpers
|
|
3
3
|
def compressible_stylesheet_tag(*keys)
|
4
4
|
Compressible.stylesheets_for(*keys).collect do |asset|
|
5
5
|
stylesheet_link_tag(asset)
|
6
|
-
end.join("\n").
|
6
|
+
end.join("\n").send(safe_method)
|
7
7
|
end
|
8
8
|
|
9
9
|
def compressible_javascript_tag(*keys)
|
10
10
|
Compressible.javascripts_for(*keys).collect do |asset|
|
11
11
|
javascript_include_tag(asset)
|
12
|
-
end.join("\n").
|
12
|
+
end.join("\n").send(safe_method)
|
13
13
|
end
|
14
14
|
|
15
|
+
private
|
16
|
+
def safe_method
|
17
|
+
if "".respond_to?(:html_safe)
|
18
|
+
return :html_safe
|
19
|
+
elsif "".respond_to?(:html_safe!)
|
20
|
+
return :html_safe!
|
21
|
+
else
|
22
|
+
return :to_s
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
15
26
|
end
|
16
27
|
|
17
28
|
ActionView::Base.send(:include, Compressible::ViewHelpers) if defined?(ActionView)
|
metadata
CHANGED
@@ -6,7 +6,8 @@ version: !ruby/object:Gem::Version
|
|
6
6
|
- 0
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
|
9
|
+
- 1
|
10
|
+
version: 0.0.2.1
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Lance Pollard
|
@@ -14,7 +15,7 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2010-06-
|
18
|
+
date: 2010-06-04 00:00:00 -07:00
|
18
19
|
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
@@ -43,7 +44,7 @@ dependencies:
|
|
43
44
|
version: "0"
|
44
45
|
type: :runtime
|
45
46
|
version_requirements: *id002
|
46
|
-
description: Quick asset compression for Ruby
|
47
|
+
description: Quick asset compression for Ruby - Perfect for Heroku
|
47
48
|
email: lancejpollard@gmail.com
|
48
49
|
executables: []
|
49
50
|
|
@@ -101,6 +102,6 @@ rubyforge_project: compressible
|
|
101
102
|
rubygems_version: 1.3.6
|
102
103
|
signing_key:
|
103
104
|
specification_version: 3
|
104
|
-
summary: "Compressible: Quick asset compression for Ruby"
|
105
|
+
summary: "Compressible: Quick asset compression for Ruby - Perfect for Heroku"
|
105
106
|
test_files: []
|
106
107
|
|