sinatra_asset_packager 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
@@ -15,6 +15,7 @@ module SinatraAssetPackager
|
|
15
15
|
env.append_path("app/assets/images")
|
16
16
|
env.append_path("app/assets/javascripts")
|
17
17
|
env.append_path("app/assets/stylesheets")
|
18
|
+
env.append_path("app/assets/templates")
|
18
19
|
|
19
20
|
if !!compress || ["production", "staging"].include?(ENV["RACK_ENV"])
|
20
21
|
env.js_compressor = Uglifier.new(mangle: true)
|
@@ -6,12 +6,18 @@ module SinatraAssetPackager
|
|
6
6
|
SinatraAssetPackager.environment["#{filepath}.js"]
|
7
7
|
end
|
8
8
|
|
9
|
-
get "/assets/*.css" do
|
9
|
+
get "/assets/*.css" do
|
10
10
|
content_type "text/css", charset: "utf-8"
|
11
11
|
filepath = params[:splat][0]
|
12
12
|
SinatraAssetPackager.environment["#{filepath}.css"]
|
13
13
|
end
|
14
14
|
|
15
|
+
get "/assets/*.html" do
|
16
|
+
content_type "text/html"
|
17
|
+
filepath = params[:splat][0]
|
18
|
+
SinatraAssetPackager.environment["#{filepath}.html"]
|
19
|
+
end
|
20
|
+
|
15
21
|
%w{jpg png gif}.each do |format|
|
16
22
|
get "/assets/*.#{format}" do
|
17
23
|
content_type("image/#{format}")
|
@@ -7,13 +7,13 @@ describe SinatraAssetPackager do
|
|
7
7
|
let(:environment) { subject.environment }
|
8
8
|
|
9
9
|
it { environment.should_not be_nil }
|
10
|
-
it { environment.paths.length.should eq
|
10
|
+
it { environment.paths.length.should eq 4 }
|
11
11
|
|
12
12
|
context "compile is true" do
|
13
13
|
let(:environment) { subject.environment(true) }
|
14
14
|
|
15
15
|
it { environment.should_not be_nil }
|
16
|
-
it { environment.paths.length.should eq
|
16
|
+
it { environment.paths.length.should eq 4 }
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra_asset_packager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-05-
|
12
|
+
date: 2013-05-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -159,7 +159,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
159
159
|
version: '0'
|
160
160
|
segments:
|
161
161
|
- 0
|
162
|
-
hash:
|
162
|
+
hash: -762569424978415034
|
163
163
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
164
164
|
none: false
|
165
165
|
requirements:
|
@@ -168,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
168
168
|
version: '0'
|
169
169
|
segments:
|
170
170
|
- 0
|
171
|
-
hash:
|
171
|
+
hash: -762569424978415034
|
172
172
|
requirements: []
|
173
173
|
rubyforge_project:
|
174
174
|
rubygems_version: 1.8.23
|