asset_hat 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/HISTORY +11 -0
- data/README.markdown +4 -3
- data/VERSION.yml +2 -2
- data/asset_hat.gemspec +2 -2
- data/lib/asset_hat/css.rb +7 -1
- data/lib/asset_hat/tasks.rb +4 -5
- metadata +2 -2
data/HISTORY
CHANGED
@@ -1,6 +1,17 @@
|
|
1
1
|
HISTORY
|
2
2
|
=======
|
3
3
|
|
4
|
+
Version 0.1.5 (2010-03-11)
|
5
|
+
--------------------------
|
6
|
+
* Fixed fetching asset commit IDs in some environments. The bug was possibly
|
7
|
+
caused by older versions of Git, which fail to read logs properly when given
|
8
|
+
absolute paths, rather than relative paths.
|
9
|
+
* Stopped app tests from running twice in some environments.
|
10
|
+
|
11
|
+
Version 0.1.4 (2010-03-03)
|
12
|
+
--------------------------
|
13
|
+
* Fixed config filepaths in `asset_hat:config` task.
|
14
|
+
|
4
15
|
Version 0.1.3 (2010-03-03)
|
5
16
|
--------------------------
|
6
17
|
* Allowed adding commit IDs and asset hosts to `url(/htc/...)` URLs (e.g.,
|
data/README.markdown
CHANGED
@@ -54,7 +54,7 @@ Installation
|
|
54
54
|
begin
|
55
55
|
require 'asset_hat/tasks'
|
56
56
|
rescue LoadError
|
57
|
-
puts
|
57
|
+
puts "Could not load AssetHat tasks: 'asset_hat' not found."
|
58
58
|
end
|
59
59
|
|
60
60
|
|
@@ -130,14 +130,15 @@ These turn into:
|
|
130
130
|
|
131
131
|
If your environment has `config.action_controller.perform_caching` set to
|
132
132
|
`true` (e.g., in production), the layout/view will include minified bundle
|
133
|
-
files. Otherwise, the separate, unminified files will be included
|
133
|
+
files. Otherwise, the separate, unminified files will be included, based on
|
134
|
+
the bundle contents you define in `config/assets.yml`.
|
134
135
|
|
135
136
|
### Advanced usage ###
|
136
137
|
|
137
138
|
You can also include single files as expected:
|
138
139
|
|
139
140
|
<%= include_css 'reset', 'application' %>
|
140
|
-
<%= include_js
|
141
|
+
<%= include_js 'plugin.min', 'application' %>
|
141
142
|
|
142
143
|
Or include multiple bundles at once:
|
143
144
|
|
data/VERSION.yml
CHANGED
data/asset_hat.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{asset_hat}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.5"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Ron DeVera", "Mint Digital"]
|
12
|
-
s.date = %q{2010-03-
|
12
|
+
s.date = %q{2010-03-11}
|
13
13
|
s.description = %q{Minify, bundle, and optimize CSS/JS assets.}
|
14
14
|
s.email = %q{ronald.devera@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/asset_hat/css.rb
CHANGED
@@ -35,7 +35,13 @@ module AssetHat
|
|
35
35
|
def self.add_asset_commit_ids(css)
|
36
36
|
css.gsub(/url[\s]*\((\/(images|htc)\/[^)]+)\)/) do |match|
|
37
37
|
src = $1
|
38
|
-
|
38
|
+
|
39
|
+
# Get absolute path
|
40
|
+
filepath = File.join(ASSETS_DIR, src)
|
41
|
+
|
42
|
+
# Convert to relative path
|
43
|
+
filepath.sub!(/^#{FileUtils.pwd}#{File::SEPARATOR}/, '')
|
44
|
+
|
39
45
|
commit_id = AssetHat.last_commit_id(filepath)
|
40
46
|
commit_id.present? ? "url(#{src}?#{commit_id})" : "url(#{src})"
|
41
47
|
end
|
data/lib/asset_hat/tasks.rb
CHANGED
@@ -4,19 +4,18 @@ require 'action_controller'
|
|
4
4
|
require 'action_view'
|
5
5
|
require File.join(File.dirname(__FILE__), %w[.. asset_hat])
|
6
6
|
|
7
|
-
|
8
|
-
|
9
7
|
unless defined?(RAILS_ROOT)
|
10
8
|
RAILS_ROOT = File.join(File.dirname(__FILE__), '..', '..')
|
11
9
|
end
|
12
10
|
|
11
|
+
|
12
|
+
|
13
13
|
task :default => :test
|
14
14
|
|
15
|
-
desc 'Run tests'
|
16
15
|
Rake::TestTask.new(:test) do |t|
|
17
16
|
t.libs << 'lib' << 'test'
|
18
|
-
t.pattern = 'test
|
19
|
-
t.verbose =
|
17
|
+
t.pattern = 'test/*_test.rb'
|
18
|
+
t.verbose = true
|
20
19
|
end
|
21
20
|
|
22
21
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asset_hat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ron DeVera
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2010-03-
|
13
|
+
date: 2010-03-11 00:00:00 -05:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|