classy_assets 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e9ec6db00dd5b915529cd34cdd6e6bb446b349bc
4
- data.tar.gz: bfe108e29e8043150a6eafac96f62d90b739b69c
3
+ metadata.gz: a6ab8dec64bd1600f71a775e544dbcb7566fb8a4
4
+ data.tar.gz: c1f33a3be3048b092bfef8c2efa3f14728eae328
5
5
  SHA512:
6
- metadata.gz: b744c30940d2b046e742e0a3c1ff0b44a428dc67a71df34edbe581ab5c9354bf36820c79ec4bf1e1182392db9deedb7d3841066bc0a4dfe32673bcc4035e5ff8
7
- data.tar.gz: 6cf13ce5ed8a463696de6533e90229eead7633228e5887bc5fbbe9ed276c46a75c8d9b91135f51875ed5ea71566de3a438b00c755d165f8c46c7ac530da0bae0
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,3 +1,3 @@
1
1
  module ClassyAssets
2
- VERSION = "0.6.0"
2
+ VERSION = "0.6.1"
3
3
  end
@@ -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
 
@@ -5,9 +5,12 @@ require 'classy_assets'
5
5
 
6
6
  describe ClassyAssets do
7
7
  before do
8
- @root_path = File.expand_path('../support', __FILE__)
9
- ClassyAssets::Configuration.configure do |config|
10
- config.root_path = @root_path
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::Configuration.debug_mode = true
26
+ ClassyAssets.config.asset_debug = true
24
27
  end
25
28
 
26
29
  after do
27
- ClassyAssets::Configuration.debug_mode = false
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::Configuration.asset_digest = true
39
- @digest = ClassyAssets::Configuration.sprockets.digest
41
+ ClassyAssets.config.asset_digest = true
42
+ @digest = ClassyAssets.sprockets.digest
40
43
  end
41
44
 
42
45
  after do
43
- ClassyAssets::Configuration.asset_digest = false
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::Configuration.sprockets['application.js'].digest_path}"
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::Configuration.asset_host = 'http://example.com'
57
+ ClassyAssets.config.asset_host = 'http://example.com'
55
58
  end
56
59
 
57
60
  after do
58
- ClassyAssets::Configuration.asset_host = nil
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
@@ -12,5 +12,4 @@ require 'minitest/autorun'
12
12
  require "minitest-spec-context"
13
13
  require 'minitest/reporters'
14
14
  MiniTest::Reporters.use! MiniTest::Reporters::SpecReporter.new
15
-
16
15
  include Rack::Test::Methods
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.0
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
@@ -1,5 +0,0 @@
1
- # encoding: utf-8
2
-
3
- ClassyAssets.config do |config|
4
- config.asset_root = File.expand_path('../support', __FILE__)
5
- end