classy_assets 0.6.0 → 0.6.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.
- checksums.yaml +4 -4
- data/lib/classy_assets.rb +0 -1
- data/lib/classy_assets/version.rb +1 -1
- data/spec/classy_assets/sprockets_spec.rb +8 -1
- data/spec/classy_assets_spec.rb +14 -11
- data/spec/rack/classy_assets_spec.rb +10 -1
- data/spec/sinatra/classy_assets_spec.rb +10 -1
- data/spec/spec_helper.rb +0 -1
- metadata +1 -3
- data/spec/spec_config_helper.rb +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6ab8dec64bd1600f71a775e544dbcb7566fb8a4
|
4
|
+
data.tar.gz: c1f33a3be3048b092bfef8c2efa3f14728eae328
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9f56a65c810c45861965c058e55723baec7dc5fb019cca81722cd700d659af5ea4f1b541bfedec804a4353d4d26b9f829ba2f77d404790861bd2c6ea75fd577
|
7
|
+
data.tar.gz: 879b8a53b058ecb4ac2d76341a248e31b10e17e30fe5158a4efa51e202ba7ec04c5e46109cc281387306548edfbda523c48b01574d908b465b4668d2126fe225
|
data/lib/classy_assets.rb
CHANGED
@@ -13,7 +13,6 @@ require 'sprockets'
|
|
13
13
|
|
14
14
|
# classy assets components
|
15
15
|
require 'classy_assets/config'
|
16
|
-
require 'classy_assets/configuration'
|
17
16
|
require 'classy_assets/errors/nil_asset_root'
|
18
17
|
require 'classy_assets/sass/script/functions'
|
19
18
|
require 'classy_assets/sprockets'
|
@@ -1,10 +1,17 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
|
-
require 'spec_config_helper'
|
5
4
|
|
6
5
|
describe ClassyAssets::Sprockets do
|
7
6
|
before do
|
7
|
+
ClassyAssets.config do |config|
|
8
|
+
config.asset_root = File.expand_path('../support', __FILE__)
|
9
|
+
config.asset_debug = false
|
10
|
+
config.asset_digest = false
|
11
|
+
config.asset_host = nil
|
12
|
+
config.asset_paths = Dir.glob(File.join(config.asset_root, config.asset_prefix, '*'))
|
13
|
+
end
|
14
|
+
|
8
15
|
asset_root = ClassyAssets.config.asset_root
|
9
16
|
asset_prefix = ClassyAssets.config.asset_prefix
|
10
17
|
|
data/spec/classy_assets_spec.rb
CHANGED
@@ -5,9 +5,12 @@ require 'classy_assets'
|
|
5
5
|
|
6
6
|
describe ClassyAssets do
|
7
7
|
before do
|
8
|
-
|
9
|
-
|
10
|
-
config.
|
8
|
+
ClassyAssets.config do |config|
|
9
|
+
config.asset_root = File.expand_path('../support', __FILE__)
|
10
|
+
config.asset_debug = false
|
11
|
+
config.asset_digest = false
|
12
|
+
config.asset_host = nil
|
13
|
+
config.asset_paths = Dir.glob(File.join(config.asset_root, config.asset_prefix, '*'))
|
11
14
|
end
|
12
15
|
end
|
13
16
|
|
@@ -20,11 +23,11 @@ describe ClassyAssets do
|
|
20
23
|
|
21
24
|
context "debug mode" do
|
22
25
|
before do
|
23
|
-
ClassyAssets
|
26
|
+
ClassyAssets.config.asset_debug = true
|
24
27
|
end
|
25
28
|
|
26
29
|
after do
|
27
|
-
ClassyAssets
|
30
|
+
ClassyAssets.config.asset_debug = false
|
28
31
|
end
|
29
32
|
|
30
33
|
it "returns the debug url to the asset" do
|
@@ -35,27 +38,27 @@ describe ClassyAssets do
|
|
35
38
|
|
36
39
|
context "digest" do
|
37
40
|
before do
|
38
|
-
ClassyAssets
|
39
|
-
@digest = ClassyAssets
|
41
|
+
ClassyAssets.config.asset_digest = true
|
42
|
+
@digest = ClassyAssets.sprockets.digest
|
40
43
|
end
|
41
44
|
|
42
45
|
after do
|
43
|
-
ClassyAssets
|
46
|
+
ClassyAssets.config.asset_digest = false
|
44
47
|
end
|
45
48
|
|
46
49
|
it "returns the digest url to the asset" do
|
47
50
|
asset_url = ClassyAssets.asset_url_for 'application.js'
|
48
|
-
asset_url.must_equal "/assets/#{ClassyAssets
|
51
|
+
asset_url.must_equal "/assets/#{ClassyAssets.sprockets['application.js'].digest_path}"
|
49
52
|
end
|
50
53
|
end
|
51
54
|
|
52
55
|
context "asset host" do
|
53
56
|
before do
|
54
|
-
ClassyAssets
|
57
|
+
ClassyAssets.config.asset_host = 'http://example.com'
|
55
58
|
end
|
56
59
|
|
57
60
|
after do
|
58
|
-
ClassyAssets
|
61
|
+
ClassyAssets.config.asset_host = nil
|
59
62
|
end
|
60
63
|
|
61
64
|
it "returns the digest url to the asset" do
|
@@ -1,7 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
|
-
require 'spec_config_helper'
|
5
4
|
require 'rack/classy_assets'
|
6
5
|
|
7
6
|
class ClassyApp < Sinatra::Base
|
@@ -13,6 +12,16 @@ def app
|
|
13
12
|
end
|
14
13
|
|
15
14
|
describe Rack::ClassyAssets do
|
15
|
+
before do
|
16
|
+
ClassyAssets.config do |config|
|
17
|
+
config.asset_root = File.expand_path('../../support', __FILE__)
|
18
|
+
config.asset_debug = false
|
19
|
+
config.asset_digest = false
|
20
|
+
config.asset_host = nil
|
21
|
+
config.asset_paths = Dir.glob(File.join(config.asset_root, config.asset_prefix, '*'))
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
16
25
|
context "stylesheets" do
|
17
26
|
context "css" do
|
18
27
|
it "will respond sucessfully" do
|
@@ -1,7 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
|
-
require 'spec_config_helper'
|
5
4
|
require 'sinatra/classy_assets'
|
6
5
|
|
7
6
|
class ClassySinatraApp < Sinatra::Base
|
@@ -45,6 +44,16 @@ def app
|
|
45
44
|
end
|
46
45
|
|
47
46
|
describe Sinatra::ClassyAssets do
|
47
|
+
before do
|
48
|
+
ClassyAssets.config do |config|
|
49
|
+
config.asset_root = File.expand_path('../../support', __FILE__)
|
50
|
+
config.asset_debug = false
|
51
|
+
config.asset_digest = false
|
52
|
+
config.asset_host = nil
|
53
|
+
config.asset_paths = Dir.glob(File.join(config.asset_root, config.asset_prefix, '*'))
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
48
57
|
context "sprockets.context_class" do
|
49
58
|
it "resolves the url to the asset" do
|
50
59
|
get "/assets/application.css"
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: classy_assets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- StyleSeek Engineering
|
@@ -198,7 +198,6 @@ files:
|
|
198
198
|
- spec/classy_assets_spec.rb
|
199
199
|
- spec/rack/classy_assets_spec.rb
|
200
200
|
- spec/sinatra/classy_assets_spec.rb
|
201
|
-
- spec/spec_config_helper.rb
|
202
201
|
- spec/spec_helper.rb
|
203
202
|
- spec/support/assets/fonts/font.eot
|
204
203
|
- spec/support/assets/fonts/font.otf
|
@@ -243,7 +242,6 @@ test_files:
|
|
243
242
|
- spec/classy_assets_spec.rb
|
244
243
|
- spec/rack/classy_assets_spec.rb
|
245
244
|
- spec/sinatra/classy_assets_spec.rb
|
246
|
-
- spec/spec_config_helper.rb
|
247
245
|
- spec/spec_helper.rb
|
248
246
|
- spec/support/assets/fonts/font.eot
|
249
247
|
- spec/support/assets/fonts/font.otf
|