assette 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/assette.gemspec +5 -5
- data/lib/assette/cli.rb +27 -18
- data/lib/assette/readers/less.rb +10 -0
- metadata +8 -7
data/Rakefile
CHANGED
@@ -23,7 +23,7 @@ Jeweler::Tasks.new do |gem|
|
|
23
23
|
gem.authors = ["Tal Atlas"]
|
24
24
|
# Include your dependencies below. Runtime dependencies are required when using your gem,
|
25
25
|
# and development dependencies are only needed for development (ie running rake tasks, tests, etc)
|
26
|
-
gem.add_runtime_dependency "rack", '
|
26
|
+
gem.add_runtime_dependency "rack", '>= 1.4'
|
27
27
|
gem.add_runtime_dependency "thor", '~> 0'
|
28
28
|
gem.add_runtime_dependency "json", '>= 1.4'
|
29
29
|
gem.add_runtime_dependency "sass", '>= 3.1'
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.4
|
data/assette.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{assette}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.4"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = [%q{Tal Atlas}]
|
12
|
-
s.date = %q{2012-01-
|
12
|
+
s.date = %q{2012-01-11}
|
13
13
|
s.description = %q{Renders all asset types (coffeescript/sass/scss) as equals}
|
14
14
|
s.email = %q{me@tal.by}
|
15
15
|
s.executables = [%q{assette}]
|
@@ -122,7 +122,7 @@ Gem::Specification.new do |s|
|
|
122
122
|
s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
|
123
123
|
s.add_development_dependency(%q<rcov>, [">= 0"])
|
124
124
|
s.add_development_dependency(%q<rack-test>, [">= 0"])
|
125
|
-
s.add_runtime_dependency(%q<rack>, ["
|
125
|
+
s.add_runtime_dependency(%q<rack>, [">= 1.4"])
|
126
126
|
s.add_runtime_dependency(%q<thor>, ["~> 0"])
|
127
127
|
s.add_runtime_dependency(%q<json>, [">= 1.4"])
|
128
128
|
s.add_runtime_dependency(%q<sass>, [">= 3.1"])
|
@@ -146,7 +146,7 @@ Gem::Specification.new do |s|
|
|
146
146
|
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
|
147
147
|
s.add_dependency(%q<rcov>, [">= 0"])
|
148
148
|
s.add_dependency(%q<rack-test>, [">= 0"])
|
149
|
-
s.add_dependency(%q<rack>, ["
|
149
|
+
s.add_dependency(%q<rack>, [">= 1.4"])
|
150
150
|
s.add_dependency(%q<thor>, ["~> 0"])
|
151
151
|
s.add_dependency(%q<json>, [">= 1.4"])
|
152
152
|
s.add_dependency(%q<sass>, [">= 3.1"])
|
@@ -171,7 +171,7 @@ Gem::Specification.new do |s|
|
|
171
171
|
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
|
172
172
|
s.add_dependency(%q<rcov>, [">= 0"])
|
173
173
|
s.add_dependency(%q<rack-test>, [">= 0"])
|
174
|
-
s.add_dependency(%q<rack>, ["
|
174
|
+
s.add_dependency(%q<rack>, [">= 1.4"])
|
175
175
|
s.add_dependency(%q<thor>, ["~> 0"])
|
176
176
|
s.add_dependency(%q<json>, [">= 1.4"])
|
177
177
|
s.add_dependency(%q<sass>, [">= 3.1"])
|
data/lib/assette/cli.rb
CHANGED
@@ -117,7 +117,7 @@ module Assette
|
|
117
117
|
|
118
118
|
files.delete_if {|f| f =~ /\/_/} # remove any mixins to speed up process
|
119
119
|
|
120
|
-
files = files.collect {|f| Assette::File.open(f)}
|
120
|
+
# files = files.collect {|f| Assette::File.open(f)}
|
121
121
|
|
122
122
|
container = if Assette.config.cache_method.to_s == 'path'
|
123
123
|
File.join(Assette.config.build_target,sha)
|
@@ -131,31 +131,40 @@ module Assette
|
|
131
131
|
|
132
132
|
files_to_minify = []
|
133
133
|
|
134
|
-
files.each do |
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
134
|
+
files.each do |file_path|
|
135
|
+
Assette::File.open(file_path) do |file|
|
136
|
+
|
137
|
+
if file.minify?
|
138
|
+
files_to_minify.push(file_path)
|
139
|
+
else
|
140
|
+
unless options.minified? || options.static_min?
|
141
|
+
target_path = file.relative_target_path
|
142
|
+
|
143
|
+
Assette.config.file_paths.each do |p|
|
144
|
+
# target_path.gsub!(p,'')
|
145
|
+
end
|
146
|
+
|
147
|
+
new_path = File.join(container,target_path)
|
148
|
+
|
149
|
+
Assette.logger.debug("Compiling file") {"#{file.path} -> #{new_path}"}
|
150
|
+
create_file(new_path, file.all_code)
|
151
|
+
end
|
152
|
+
end
|
141
153
|
end
|
142
|
-
|
143
|
-
new_path = File.join(container,target_path)
|
144
|
-
|
145
|
-
Assette.logger.debug("Compiling file") {"#{file.path} -> #{new_path}"}
|
146
|
-
create_file(new_path, file.all_code)
|
147
154
|
end
|
148
155
|
|
149
156
|
Assette.config.minifying do
|
150
157
|
say "\nCreating minified versions of files" unless files_to_minify.empty?
|
151
158
|
|
152
|
-
files_to_minify.each do |
|
153
|
-
|
159
|
+
files_to_minify.each do |file_path|
|
160
|
+
Assette::File.open(file_path) do |file|
|
161
|
+
target_path = file.relative_target_path
|
154
162
|
|
155
|
-
|
163
|
+
new_path = File.join(container,target_path).sub(/(\.[A-Za-z0-9]{2,10})$/,'.min\1')
|
156
164
|
|
157
|
-
|
158
|
-
|
165
|
+
Assette.logger.debug("Compiling minified file") {"#{file.path} -> #{new_path}"}
|
166
|
+
create_file(new_path, file.all_code)
|
167
|
+
end
|
159
168
|
end
|
160
169
|
end
|
161
170
|
|
data/lib/assette/readers/less.rb
CHANGED
@@ -26,4 +26,14 @@ private
|
|
26
26
|
def options
|
27
27
|
Assette.config.less
|
28
28
|
end
|
29
|
+
|
30
|
+
class << self
|
31
|
+
def tag path
|
32
|
+
tag = <<-HTML
|
33
|
+
<link href="#{path}" rel="stylesheet/less" type="text/css" media="all" />
|
34
|
+
HTML
|
35
|
+
|
36
|
+
tag << %Q{<script src="#{Assette.config.less_js_path}?nodep" type="text/javascript"></script>} if Assette.config.less_js_path
|
37
|
+
end
|
38
|
+
end
|
29
39
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: assette
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 4
|
10
|
+
version: 0.1.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Tal Atlas
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-01-
|
18
|
+
date: 2012-01-11 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
version_requirements: &id001 !ruby/object:Gem::Requirement
|
@@ -242,12 +242,13 @@ dependencies:
|
|
242
242
|
version_requirements: &id016 !ruby/object:Gem::Requirement
|
243
243
|
none: false
|
244
244
|
requirements:
|
245
|
-
- -
|
245
|
+
- - ">="
|
246
246
|
- !ruby/object:Gem::Version
|
247
|
-
hash:
|
247
|
+
hash: 7
|
248
248
|
segments:
|
249
249
|
- 1
|
250
|
-
|
250
|
+
- 4
|
251
|
+
version: "1.4"
|
251
252
|
name: rack
|
252
253
|
prerelease: false
|
253
254
|
type: :runtime
|