middleman-sprockets 4.0.0.beta.1 → 4.0.0.rc.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -3
- data/Gemfile +15 -16
- data/README.md +0 -58
- data/Rakefile +1 -16
- data/features/asset_hash.feature +5 -6
- data/features/bower.feature +6 -6
- data/features/sprockets.feature +13 -65
- data/features/sprockets_gems.feature +7 -26
- data/features/step_definitions/server_steps.rb +0 -4
- data/fixtures/asset-paths-app/config.rb +1 -4
- data/fixtures/bower-app/config.rb +0 -2
- data/fixtures/bower-app/source/javascripts/application.js +1 -1
- data/fixtures/bower-app/source/javascripts/import.js +1 -0
- data/fixtures/bower-individual-outputdir-app/config.rb +0 -4
- data/fixtures/bower-individual-outputdir-app/source/javascripts/application.js +3 -0
- data/fixtures/bower-multiple-assets-app/config.rb +1 -7
- data/fixtures/{sprockets-app-debug-assets/source/stylesheets/dependency1.css → bower-multiple-assets-app/source/index.html} +0 -0
- data/fixtures/bower-multiple-assets-app/source/javascripts/core.js +2 -0
- data/fixtures/jquery-mobile-app/source/javascripts/app.js +1 -0
- data/fixtures/sprockets-app/config.rb +0 -5
- data/fixtures/sprockets-app/source/library/css/bootstrap_include.css.scss +1 -1
- data/fixtures/sprockets-app/source/library/css/plain.css +2 -0
- data/fixtures/sprockets-app/source/library/css/sprockets_base2.css.scss +1 -1
- data/fixtures/sprockets-app/source/library/js/jquery_include.js +1 -1
- data/fixtures/sprockets-app/source/library/js/plain.js +3 -0
- data/fixtures/sprockets-app2/source/stylesheets/sprockets_base2.css.scss +1 -1
- data/fixtures/sprockets-imported-asset-path-conflicts-app/config.rb +1 -1
- data/fixtures/sprockets-imported-assets-match-multiple-paths-app/config.rb +1 -1
- data/fixtures/sprockets-multiple-extensions-app/config.rb +0 -3
- data/fixtures/sprockets-multiple-extensions-app/source/stylesheets/app.css.scss +3 -0
- data/fixtures/sprockets-svg-font-app/config.rb +0 -4
- data/fixtures/sprockets-svg-font-app/source/stylesheets/app.css.scss +4 -0
- data/lib/middleman-sprockets.rb +1 -6
- data/lib/middleman-sprockets/extension.rb +197 -113
- data/lib/middleman-sprockets/version.rb +1 -1
- data/middleman-sprockets.gemspec +2 -4
- metadata +29 -74
- data/Gemfile-Sprockets3 +0 -36
- data/Gemfile-v3 +0 -36
- data/features/asset_hash-3.0.feature +0 -105
- data/fixtures/sprockets-app-debug-assets/config.rb +0 -1
- data/fixtures/sprockets-app-debug-assets/source/index.html.erb +0 -8
- data/fixtures/sprockets-app-debug-assets/source/javascripts/dependency1.js +0 -3
- data/fixtures/sprockets-app-debug-assets/source/javascripts/dependency2.js +0 -1
- data/fixtures/sprockets-app-debug-assets/source/javascripts/main.js +0 -4
- data/fixtures/sprockets-app-debug-assets/source/stylesheets/app.css.scss +0 -4
- data/fixtures/sprockets-app-debug-assets/source/stylesheets/dependency2.css.scss +0 -0
- data/lib/middleman-sprockets/asset.rb +0 -142
- data/lib/middleman-sprockets/asset_tag_helpers.rb +0 -54
- data/lib/middleman-sprockets/config_only_environment.rb +0 -50
- data/lib/middleman-sprockets/environment.rb +0 -293
- data/lib/middleman-sprockets/imported_asset.rb +0 -30
- data/lib/middleman-sprockets/sass_function_hack.rb +0 -9
- data/lib/middleman-sprockets/sass_utils.rb +0 -14
- data/spec/asset_spec.rb +0 -118
- data/spec/imported_asset_spec.rb +0 -42
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 29e65d83fd264d3f669643e448e574c58bdb9094
|
4
|
+
data.tar.gz: b4e9eb5247e49d154ffb882a4e35a09a6f06062f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ffc84a66db9426edab185bc9d2058545e9c76214ce2b6f4ff9cdd5bd47ba86a7f2130d36e09ee0b1ae859f020081bc7f7c3e9ec274811db0a19790c4985c5ba
|
7
|
+
data.tar.gz: bcc58588ae01b813edf13e9290949a16c50b664ce8689b2f91b5a4170bafc1f0f56c1461f6cd6d54a9e07030833a8cb9ce7e43e74242b1f78c5a6e544bfe046c
|
data/.travis.yml
CHANGED
@@ -2,22 +2,21 @@ rvm:
|
|
2
2
|
- ruby-head
|
3
3
|
- jruby-head
|
4
4
|
- jruby-19mode
|
5
|
-
- 2.2
|
5
|
+
- 2.2.2
|
6
6
|
- 2.1
|
7
7
|
- 2.0
|
8
8
|
os:
|
9
9
|
- linux
|
10
10
|
- osx
|
11
|
+
sudo: false
|
11
12
|
matrix:
|
12
13
|
fast_finish: true
|
13
14
|
allow_failures:
|
14
15
|
- rvm: ruby-head
|
15
16
|
- rvm: jruby-19mode
|
16
17
|
- rvm: jruby-head
|
17
|
-
|
18
18
|
gemfile:
|
19
19
|
- Gemfile
|
20
|
-
- Gemfile-v3
|
21
20
|
|
22
21
|
script: "bundle exec rake test"
|
23
22
|
|
data/Gemfile
CHANGED
@@ -1,30 +1,26 @@
|
|
1
1
|
source "https://rubygems.org"
|
2
2
|
|
3
|
-
gem "middleman-core", :github => "middleman/middleman", :branch => "master"
|
4
|
-
gem "middleman-cli", :github => "middleman/middleman", :branch => "master"
|
5
|
-
|
6
3
|
# Specify your gem's dependencies in middleman-sprockets.gemspec
|
7
4
|
gemspec
|
8
5
|
|
9
|
-
gem "
|
10
|
-
gem "
|
6
|
+
gem "middleman-cli", github: "middleman/middleman", branch: "master"
|
7
|
+
gem "middleman-core", github: "middleman/middleman", branch: "master"
|
11
8
|
|
12
|
-
#
|
13
|
-
|
14
|
-
|
9
|
+
# Build and doc tools
|
10
|
+
gem 'rake', '~> 10.3', require: false
|
11
|
+
gem 'yard', '~> 0.8', require: false
|
15
12
|
|
16
13
|
# Test tools
|
17
|
-
gem
|
18
|
-
gem
|
19
|
-
gem
|
20
|
-
gem
|
21
|
-
gem
|
22
|
-
gem "simplecov"
|
14
|
+
gem 'pry', '~> 0.10', group: :development, require: false
|
15
|
+
gem 'pry-byebug'
|
16
|
+
gem 'aruba', '~> 0.7.4', require: false
|
17
|
+
gem 'rspec', '~> 3.0', require: false
|
18
|
+
gem 'cucumber', '~> 2.0', require: false
|
23
19
|
|
24
20
|
# For actual tests
|
25
21
|
# Make sure to lock down the versions of the asset gems
|
26
22
|
# so they don't cause asset hashes to change.
|
27
|
-
gem "railties", "~> 4.
|
23
|
+
gem "railties", "~> 4.2.0"
|
28
24
|
gem "jquery-rails", "3.1.0", :require => false
|
29
25
|
gem "bootstrap-sass", "3.1.1.0", :require => false
|
30
26
|
gem "jquery_mobile_rails", "1.4.1", :require => false
|
@@ -34,4 +30,7 @@ gem "eco", "~> 1.0.0"
|
|
34
30
|
gem "erubis", "~> 2.7.0"
|
35
31
|
|
36
32
|
# Code Quality
|
37
|
-
gem
|
33
|
+
gem 'rubocop', '~> 0.24', require: false
|
34
|
+
gem 'simplecov', '~> 0.9', require: false
|
35
|
+
gem 'coveralls', '~> 0.8', require: false
|
36
|
+
gem 'codeclimate-test-reporter', '~> 0.3', require: false, group: :test
|
data/README.md
CHANGED
@@ -13,64 +13,6 @@ middleman init MY_PROJECT
|
|
13
13
|
|
14
14
|
If you already have a Middleman project: Add `gem "middleman-sprockets"` to your `Gemfile` and run `bundle install`
|
15
15
|
|
16
|
-
## Configuration
|
17
|
-
<a name="configuration"></a>
|
18
|
-
|
19
|
-
```
|
20
|
-
activate :sprockets
|
21
|
-
```
|
22
|
-
|
23
|
-
## Usage
|
24
|
-
|
25
|
-
If you want to use, `middleman-sprockets` you need to configure it first - See
|
26
|
-
[Configuration](#configuration). If you want to use `middleman-sprockets` with
|
27
|
-
bower, you need to import assets first. The path is relative to your
|
28
|
-
`bower`-directory.
|
29
|
-
|
30
|
-
```
|
31
|
-
sprockets.import_asset <path>
|
32
|
-
```
|
33
|
-
|
34
|
-
Given `vendor/assets/components` as `bower`-directory and `jquery` as
|
35
|
-
component-name, you would import the `jquery` production version with:
|
36
|
-
|
37
|
-
```
|
38
|
-
sprockets.append_path 'vendor/assets/components'
|
39
|
-
sprockets.import_asset 'jquery/dist/jquery'
|
40
|
-
```
|
41
|
-
|
42
|
-
If you tell `sprockets` just about the name of the component, it will make thos
|
43
|
-
files available which are given in the `main`-section of the `bower.json`-file.
|
44
|
-
|
45
|
-
```
|
46
|
-
sprockets.append_path 'vendor/assets/components'
|
47
|
-
sprockets.import_asset 'jquery'
|
48
|
-
```
|
49
|
-
|
50
|
-
If you need to tell `sprockets` to use an individual output path for your
|
51
|
-
asset, you can pass `#import_asset` a block. This block gets the logical path
|
52
|
-
as
|
53
|
-
[`Pathname`](http://rdoc.info/stdlib/pathname/frames)
|
54
|
-
and needs to return the relative output path for the asset as `String` or
|
55
|
-
`Pathname`.
|
56
|
-
|
57
|
-
```
|
58
|
-
sprockets.append_path 'vendor/assets/components'
|
59
|
-
|
60
|
-
# return logical path
|
61
|
-
sprockets.import_asset 'jquery/dist/jquery' do |logical_path|
|
62
|
-
# => prefix/jquery/dist/jquery
|
63
|
-
Pathname.new('prefix') + logical_path
|
64
|
-
end
|
65
|
-
```
|
66
|
-
|
67
|
-
Be careful if you are using `bower`-components which place their assets in
|
68
|
-
*non-standard*-directories. Fonts should be placed in `fonts`, Stylesheets in
|
69
|
-
`stylesheets` or `css`, JavaScript-files in `javascripts` or `js` and images in
|
70
|
-
`images`. If you have got a `svg`-font in a *non*-standard-directory you might
|
71
|
-
need to use the `#import_asset`-call with the block to place it in the correct
|
72
|
-
directory.
|
73
|
-
|
74
16
|
## Build & Dependency Status
|
75
17
|
|
76
18
|
[![Gem Version](https://badge.fury.io/rb/middleman-sprockets.png)][gem]
|
data/Rakefile
CHANGED
@@ -8,9 +8,7 @@ require 'middleman-core/version'
|
|
8
8
|
|
9
9
|
Cucumber::Rake::Task.new(:cucumber, 'Run features that should pass') do |t|
|
10
10
|
exempt_tags = ["--tags ~@wip"]
|
11
|
-
|
12
|
-
exempt_tags << "--tags ~@old " unless Middleman::VERSION.start_with?("3.0")
|
13
|
-
t.cucumber_opts = "--color #{exempt_tags.join(" ")} --strict --format #{ENV['CUCUMBER_FORMAT'] || 'Fivemat'}"
|
11
|
+
t.cucumber_opts = "--color #{exempt_tags.join(" ")} --strict"
|
14
12
|
end
|
15
13
|
|
16
14
|
RSpec::Core::RakeTask.new(:spec) do |t|
|
@@ -28,19 +26,6 @@ task :doc do
|
|
28
26
|
sh 'bundle exec yard'
|
29
27
|
end
|
30
28
|
|
31
|
-
begin
|
32
|
-
require 'cane/rake_task'
|
33
|
-
|
34
|
-
desc "Run cane to check quality metrics"
|
35
|
-
Cane::RakeTask.new(:quality) do |cane|
|
36
|
-
cane.no_style = true
|
37
|
-
cane.no_doc = true
|
38
|
-
cane.abc_glob = "lib/middleman-sprockets/**/*.rb"
|
39
|
-
end
|
40
|
-
rescue LoadError
|
41
|
-
# warn "cane not available, quality task not provided."
|
42
|
-
end
|
43
|
-
|
44
29
|
desc "Destroy the sass cache from fixtures in case it messes with results"
|
45
30
|
task :destroy_sass_cache do
|
46
31
|
Dir["fixtures/*/.sass-cache"].each do |dir|
|
data/features/asset_hash.feature
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
@new
|
2
1
|
Feature: Assets get a file hash appended to their URL and references to them are updated
|
3
2
|
Scenario: Hashed-asset files are produced, and HTML, CSS, and JavaScript gets rewritten to reference the new files
|
4
3
|
Given a successfully built app at "asset-hash-app"
|
@@ -9,7 +8,7 @@ Feature: Assets get a file hash appended to their URL and references to them are
|
|
9
8
|
| images/100px-5fd6fb90.jpg |
|
10
9
|
| images/100px-5fd6fb90.gif |
|
11
10
|
| javascripts/application-df677242.js |
|
12
|
-
| stylesheets/site-
|
11
|
+
| stylesheets/site-2f4798cc.css |
|
13
12
|
| index.html |
|
14
13
|
| subdir/index.html |
|
15
14
|
| other/index.html |
|
@@ -21,14 +20,14 @@ Feature: Assets get a file hash appended to their URL and references to them are
|
|
21
20
|
| stylesheets/site.css |
|
22
21
|
|
23
22
|
And the file "javascripts/application-df677242.js" should contain "img.src = '/images/100px-5fd6fb90.jpg'"
|
24
|
-
And the file "stylesheets/site-
|
25
|
-
And the file "index.html" should contain 'href="stylesheets/site-
|
23
|
+
And the file "stylesheets/site-2f4798cc.css" should contain 'background-image: url(../images/100px-5fd6fb90.jpg)'
|
24
|
+
And the file "index.html" should contain 'href="stylesheets/site-2f4798cc.css"'
|
26
25
|
And the file "index.html" should contain 'src="javascripts/application-df677242.js"'
|
27
26
|
And the file "index.html" should contain 'src="images/100px-5fd6fb90.jpg"'
|
28
|
-
And the file "subdir/index.html" should contain 'href="../stylesheets/site-
|
27
|
+
And the file "subdir/index.html" should contain 'href="../stylesheets/site-2f4798cc.css"'
|
29
28
|
And the file "subdir/index.html" should contain 'src="../javascripts/application-df677242.js"'
|
30
29
|
And the file "subdir/index.html" should contain 'src="../images/100px-5fd6fb90.jpg"'
|
31
|
-
And the file "other/index.html" should contain 'href="../stylesheets/site-
|
30
|
+
And the file "other/index.html" should contain 'href="../stylesheets/site-2f4798cc.css"'
|
32
31
|
And the file "other/index.html" should contain 'src="../javascripts/application-df677242.js"'
|
33
32
|
And the file "other/index.html" should contain 'src="../images/100px-5fd6fb90.jpg"'
|
34
33
|
|
data/features/bower.feature
CHANGED
@@ -21,13 +21,13 @@ Feature: Bower
|
|
21
21
|
Scenario: Assets can be added to the build with import_asset from bower dir
|
22
22
|
Given a successfully built app at "bower-app"
|
23
23
|
When I cd to "build"
|
24
|
-
Then a file named "
|
24
|
+
Then a file named "assets/underscore/underscore.js" should exist
|
25
25
|
|
26
26
|
Scenario: Multiple assets can be added to the build with import_asset from bower dir and are placed in the correct directory
|
27
27
|
Given a successfully built app at "bower-multiple-assets-app"
|
28
28
|
When I cd to "build"
|
29
|
-
Then a file named "
|
30
|
-
Then a file named "
|
29
|
+
Then a file named "assets/lightbox2/img/close.png" should exist
|
30
|
+
Then a file named "assets/lightbox2/js/lightbox.js" should exist
|
31
31
|
|
32
32
|
Scenario: Assets which haven't been imported don't appear in output directory
|
33
33
|
Given a successfully built app at "bower-multiple-assets-app"
|
@@ -37,6 +37,6 @@ Feature: Bower
|
|
37
37
|
Scenario: Assets can have an individual output directory
|
38
38
|
Given a successfully built app at "bower-individual-outputdir-app"
|
39
39
|
When I cd to "build"
|
40
|
-
Then a file named "underscore.js" should exist
|
41
|
-
And a file named "
|
42
|
-
And a file named "
|
40
|
+
Then a file named "assets/underscore/underscore.js" should exist
|
41
|
+
And a file named "assets/lightbox2/img/close.png" should exist
|
42
|
+
And a file named "assets/lightbox2/js/lightbox.js" should exist
|
data/features/sprockets.feature
CHANGED
@@ -30,46 +30,6 @@ Feature: Sprockets
|
|
30
30
|
When I go to "/javascripts/multiple_engines.js"
|
31
31
|
Then I should see "Hello One"
|
32
32
|
|
33
|
-
Scenario: Sprockets JS should only contain body when requested
|
34
|
-
Given the Server is running at "sprockets-app2"
|
35
|
-
When I go to "/javascripts/sprockets_base.js?body=1"
|
36
|
-
Then I should see "base"
|
37
|
-
And I should not see "sprockets_sub_function"
|
38
|
-
|
39
|
-
Scenario: Script tags should be provided individually while debugging assets
|
40
|
-
Given the Server is running at "sprockets-app-debug-assets"
|
41
|
-
When I go to "/index.html"
|
42
|
-
Then I should see "data-name"
|
43
|
-
Then I should see 'src="/javascripts/dependency2.js?body=1"'
|
44
|
-
Then I should see 'src="/javascripts/dependency1.js?body=1"'
|
45
|
-
Then I should see 'src="/javascripts/main.js?body=1"'
|
46
|
-
|
47
|
-
Scenario: External script tags should not be changed
|
48
|
-
Given the Server is running at "sprockets-app-debug-assets"
|
49
|
-
When I go to "/index.html"
|
50
|
-
Then I should see 'src="//domain.com/script.js"'
|
51
|
-
Then I should see 'src="http://domain.com/script.js"'
|
52
|
-
Then I should see 'src="https://domain.com/script.js"'
|
53
|
-
|
54
|
-
Scenario: Sprockets CSS should only contain body when requested
|
55
|
-
Given the Server is running at "sprockets-app-debug-assets"
|
56
|
-
When I go to "/stylesheets/app.css?body=1"
|
57
|
-
Then I should see "body"
|
58
|
-
|
59
|
-
Scenario: Stylesheets tags should be provided individually while debugging assets
|
60
|
-
Given the Server is running at "sprockets-app-debug-assets"
|
61
|
-
When I go to "/index.html"
|
62
|
-
Then I should see 'href="/stylesheets/app.css?body=1"'
|
63
|
-
Then I should see 'href="/stylesheets/dependency1.css?body=1"'
|
64
|
-
Then I should see 'href="/stylesheets/dependency2.css?body=1"'
|
65
|
-
|
66
|
-
Scenario: External stylesheet tags should not be changed
|
67
|
-
Given the Server is running at "sprockets-app-debug-assets"
|
68
|
-
When I go to "/index.html"
|
69
|
-
Then I should see 'href="//domain.com/styles.css"'
|
70
|
-
Then I should see 'href="http://domain.com/styles.css"'
|
71
|
-
Then I should see 'href="https://domain.com/styles.css"'
|
72
|
-
|
73
33
|
Scenario: Multiple engine files should build correctly
|
74
34
|
Given a successfully built app at "sprockets-app2"
|
75
35
|
When I cd to "build"
|
@@ -107,54 +67,42 @@ Feature: Sprockets
|
|
107
67
|
Then I should see 'src="/library/images/cat.jpg"'
|
108
68
|
And I should see 'src="/library/images/cat-2.jpg"'
|
109
69
|
When I go to "/library/images/cat.jpg"
|
110
|
-
Then
|
70
|
+
Then the status code should be "200"
|
111
71
|
When I go to "/library/images/cat-2.jpg"
|
112
|
-
Then
|
72
|
+
Then the status code should be "200"
|
113
73
|
|
114
74
|
Scenario: Assets built through import_asset are built with the right extension
|
115
75
|
Given a successfully built app at "sprockets-app"
|
116
76
|
When I cd to "build"
|
117
77
|
# source file is /library/css/vendored.css.scss
|
118
|
-
Then a file named "
|
78
|
+
Then a file named "assets/vendored.css" should exist
|
119
79
|
# source file is /library/css/coffee.js.coffee
|
120
|
-
Then a file named "
|
80
|
+
Then a file named "assets/coffee.js" should exist
|
121
81
|
|
122
82
|
Scenario: Vendor assets get right extension
|
123
83
|
Given the Server is running at "sprockets-app"
|
124
84
|
# source file is /library/css/vendored.css.scss
|
125
|
-
When I go to "/
|
85
|
+
When I go to "/assets/vendored.css"
|
126
86
|
And I should see 'background: brown;'
|
127
87
|
# source file is /library/js/coffee.js.coffee
|
128
|
-
When I go to "/
|
88
|
+
When I go to "/assets/coffee.js"
|
129
89
|
And I should see 'return console.log("bar");'
|
130
90
|
|
131
91
|
Scenario: Assets built through import_asset are built with the right extension
|
132
92
|
Given a successfully built app at "sprockets-svg-font-app"
|
133
93
|
When I cd to "build"
|
134
|
-
Then a file named "
|
135
|
-
Then a file named "
|
136
|
-
Then a file named "
|
94
|
+
Then a file named "assets/font-awesome/fonts/fontawesome-webfont-bower.svg" should exist
|
95
|
+
Then a file named "assets/font-awesome/fonts/fontawesome-webfont-bower.svg.gz" should exist
|
96
|
+
Then a file named "assets/font-awesome/fonts/fontawesome-webfont-bower.ttf.gz" should exist
|
137
97
|
Then a file named "fonts/fontawesome-webfont-source.svg" should exist
|
138
98
|
Then a file named "fonts/fontawesome-webfont-source.svg.gz" should exist
|
139
99
|
Then a file named "images/fontawesome-webfont-source.svg" should not exist
|
140
100
|
Then a file named "images/drawing-source.svg" should exist
|
141
|
-
Then a file named "
|
101
|
+
Then a file named "assets/blub/images/drawing-bower.svg" should exist
|
142
102
|
|
143
103
|
Scenario: Assets with multiple extensions
|
144
104
|
Given a successfully built app at "sprockets-multiple-extensions-app"
|
145
105
|
When I cd to "build"
|
146
|
-
Then a file named "
|
147
|
-
Then a file named "
|
148
|
-
Then a file named "
|
149
|
-
|
150
|
-
Scenario: Imported Asset matches multiple sprockets paths
|
151
|
-
Given a successfully built app at "sprockets-imported-assets-match-multiple-paths-app"
|
152
|
-
When I cd to "build"
|
153
|
-
Then a file named "assets/css/test.css" should exist
|
154
|
-
And a file named "assets/css/css/test.css" should not exist
|
155
|
-
|
156
|
-
Scenario: Imported Asset has a different 'asset type' directory than in config
|
157
|
-
Given a successfully built app at "sprockets-imported-asset-path-conflicts-app"
|
158
|
-
When I cd to "build"
|
159
|
-
Then a file named "assets/css/test.css" should exist
|
160
|
-
And a file named "assets/css/stylesheets/test.css" should not exist
|
106
|
+
Then a file named "assets/font-awesome/fonts/fontawesome-webfont-bower.svg.gz" should exist
|
107
|
+
Then a file named "assets/jquery/jquery.min.js" should exist
|
108
|
+
Then a file named "assets/jquery/jquery.asdf.asdf.js.min.asdf" should exist
|
@@ -22,15 +22,15 @@ Feature: Sprockets Gems
|
|
22
22
|
Scenario: Proper reference to images from a gem, in preview
|
23
23
|
Given the Server is running at "jquery-mobile-app"
|
24
24
|
When I go to "/stylesheets/base.css"
|
25
|
-
Then I should see 'url("/
|
25
|
+
Then I should see 'url("/assets/jquery-mobile/ajax-loader.gif")'
|
26
26
|
|
27
27
|
Scenario: Proper reference to images from a gem, in build
|
28
28
|
Given a successfully built app at "jquery-mobile-app"
|
29
29
|
When I cd to "build"
|
30
30
|
Then the following files should exist:
|
31
31
|
| stylesheets/base.css |
|
32
|
-
|
|
33
|
-
And the file "stylesheets/base.css" should contain 'url(
|
32
|
+
| assets/jquery-mobile/ajax-loader.gif |
|
33
|
+
And the file "stylesheets/base.css" should contain 'url(/assets/jquery-mobile/ajax-loader.gif)'
|
34
34
|
|
35
35
|
Scenario: Same thing, but with :relative_assets on
|
36
36
|
Given a fixture app "jquery-mobile-app"
|
@@ -40,28 +40,9 @@ Feature: Sprockets Gems
|
|
40
40
|
"""
|
41
41
|
Given the Server is running at "jquery-mobile-app"
|
42
42
|
When I go to "/stylesheets/base.css"
|
43
|
-
Then I should see 'url("../
|
44
|
-
|
45
|
-
Scenario: JS/CSS from gems aren't aumatically in the site
|
46
|
-
Given the Server is running at "jquery-mobile-app"
|
47
|
-
When I go to "/javascripts/jquery.mobile.js"
|
48
|
-
Then I should get a response with status "404"
|
43
|
+
Then I should see 'url("../assets/jquery-mobile/ajax-loader.gif")'
|
49
44
|
|
50
45
|
Scenario: JS/CSS from gems can be declared to be accessible
|
51
|
-
Given
|
52
|
-
|
53
|
-
|
54
|
-
after_configuration do
|
55
|
-
sprockets.import_asset 'jquery.mobile'
|
56
|
-
end
|
57
|
-
"""
|
58
|
-
And the Server is running at "jquery-mobile-app"
|
59
|
-
When I go to "/javascripts/jquery.mobile.js"
|
60
|
-
Then I should get a response with status "200"
|
61
|
-
|
62
|
-
Scenario: JS/CSS from gems are accessible when debugging assets and they are required
|
63
|
-
Given the Server is running at "sprockets-app-debug-assets"
|
64
|
-
And the Server is running at "sprockets-app-debug-assets"
|
65
|
-
When I go to "/index.html"
|
66
|
-
When I go to "/javascripts/bootstrap/alert.js?body=1"
|
67
|
-
Then I should get a response with status "200"
|
46
|
+
Given the Server is running at "jquery-mobile-app"
|
47
|
+
When I go to "/assets/jquery.mobile.js"
|
48
|
+
Then the status code should be "200"
|
@@ -1 +1 @@
|
|
1
|
-
//= require underscore/underscore
|
1
|
+
//= require underscore/underscore
|
@@ -0,0 +1 @@
|
|
1
|
+
//= link underscore/underscore
|
@@ -1,6 +1,2 @@
|
|
1
1
|
sprockets.append_path File.join(root, 'bower_components')
|
2
|
-
|
3
2
|
sprockets.append_path File.join(root, 'vendor/assets/components')
|
4
|
-
sprockets.import_asset('underscore/underscore.js') { 'underscore.js' }
|
5
|
-
sprockets.import_asset('lightbox2/img/close.png') { |logical_path| Pathname.new('hello_world') + logical_path }
|
6
|
-
sprockets.import_asset('lightbox2/js/lightbox.js')
|