classy_assets 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/classy_assets/version.rb +1 -1
- data/lib/classy_assets.rb +1 -1
- data/spec/classy_assets_spec.rb +11 -11
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55b4167e9611dfaacd69733306f940c682bd653e
|
4
|
+
data.tar.gz: 15f98735560bd291bfa45f0ed1bbe233b2f61899
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3c94124064d2c8dae0bd58c9845bbd95639b792b852e5c15d0cce0a8471a71ed3208ed9311b2b894a094c6bac991c84dfe62459b9badb6bb747ad57eeed2b2a
|
7
|
+
data.tar.gz: 3a4595dbdf2f740f4d6a14172c8a9f0c33c62e56a50e35e16b7fbb54aacf9ef720599342b8434b14f24eb48901e2636c49edf3e29c09dd3171d17f7c7e7523d1
|
data/lib/classy_assets.rb
CHANGED
@@ -88,7 +88,7 @@ module ClassyAssets
|
|
88
88
|
|
89
89
|
def self.sprockets
|
90
90
|
@sprockets ||= Sprockets::Environment.new(root_path)
|
91
|
-
asset_paths.each { |asset_path| @sprockets.append_path asset_path }
|
91
|
+
asset_paths.each { |asset_path| @sprockets.append_path asset_path unless @sprockets.paths.include? asset_path }
|
92
92
|
@sprockets
|
93
93
|
end
|
94
94
|
end
|
data/spec/classy_assets_spec.rb
CHANGED
@@ -5,8 +5,11 @@ require 'classy_assets'
|
|
5
5
|
|
6
6
|
describe ClassyAssets::Configuration do
|
7
7
|
subject { ClassyAssets::Configuration }
|
8
|
+
|
8
9
|
it "returns an array of asset directories" do
|
9
|
-
|
10
|
+
paths = %w(fonts images javascripts stylesheets)
|
11
|
+
paths.map! { |dir_name| File.join(ClassyAssets::Configuration.root_path, ClassyAssets::Configuration.asset_prefix, dir_name) }
|
12
|
+
subject.asset_paths.must_equal paths
|
10
13
|
end
|
11
14
|
|
12
15
|
it "returns the asset digest setting" do
|
@@ -34,11 +37,11 @@ describe ClassyAssets::Configuration do
|
|
34
37
|
end
|
35
38
|
|
36
39
|
it "returns the path to the public folder" do
|
37
|
-
subject.public_path.must_equal '
|
40
|
+
subject.public_path.must_equal File.expand_path('../support/public', __FILE__)
|
38
41
|
end
|
39
42
|
|
40
43
|
it "returns the path to the root folder" do
|
41
|
-
subject.root_path.must_equal
|
44
|
+
subject.root_path.must_equal File.expand_path('../support', __FILE__)
|
42
45
|
end
|
43
46
|
|
44
47
|
it "returns the sprockets environment" do
|
@@ -46,10 +49,7 @@ describe ClassyAssets::Configuration do
|
|
46
49
|
end
|
47
50
|
|
48
51
|
it "returns the correct asset paths" do
|
49
|
-
paths
|
50
|
-
File.join(subject.root_path, subject.asset_prefix, dir)
|
51
|
-
end
|
52
|
-
subject.sprockets.paths.must_equal paths
|
52
|
+
subject.sprockets.paths.must_equal subject.asset_paths
|
53
53
|
end
|
54
54
|
|
55
55
|
describe "configure" do
|
@@ -72,8 +72,8 @@ describe ClassyAssets::Configuration do
|
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
75
|
-
after do
|
76
|
-
ClassyAssets::Configuration.root_path = nil
|
77
|
-
ClassyAssets::Configuration.public_path = nil
|
78
|
-
end
|
75
|
+
#after do
|
76
|
+
#ClassyAssets::Configuration.root_path = nil
|
77
|
+
#ClassyAssets::Configuration.public_path = nil
|
78
|
+
#end
|
79
79
|
end
|