middleman 2.0.0 → 2.0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/features/sprockets.feature +5 -0
- data/fixtures/sprockets-app/config.rb +1 -0
- data/fixtures/sprockets-app/source/library/javascripts/sprockets_base.js +5 -0
- data/fixtures/sprockets-app/source/library/javascripts/sprockets_sub.js +3 -0
- data/lib/middleman/core_extensions/sprockets.rb +7 -4
- data/lib/middleman/templates/local.rb +2 -2
- data/lib/middleman/version.rb +1 -1
- metadata +10 -3
data/features/sprockets.feature
CHANGED
@@ -3,4 +3,9 @@ Feature: Sprockets
|
|
3
3
|
Scenario: Sprockets require
|
4
4
|
Given the Server is running at "test-app"
|
5
5
|
When I go to "/javascripts/sprockets_base.js"
|
6
|
+
Then I should see "sprockets_sub_function"
|
7
|
+
|
8
|
+
Scenario: Sprockets require with custom :js_dir
|
9
|
+
Given the Server is running at "sprockets-app"
|
10
|
+
When I go to "/library/javascripts/sprockets_base.js"
|
6
11
|
Then I should see "sprockets_sub_function"
|
@@ -0,0 +1 @@
|
|
1
|
+
set :js_dir, "library/javascripts"
|
@@ -2,12 +2,15 @@ require "sprockets"
|
|
2
2
|
|
3
3
|
module Middleman::CoreExtensions::Sprockets
|
4
4
|
class << self
|
5
|
-
def registered(app)
|
5
|
+
def registered(app)
|
6
6
|
app.set :js_compressor, false
|
7
|
-
|
8
|
-
app.
|
9
|
-
|
7
|
+
|
8
|
+
app.after_configuration do
|
9
|
+
app.map "/#{app.js_dir}" do
|
10
|
+
run JavascriptEnvironment.new(app)
|
11
|
+
end
|
10
12
|
end
|
13
|
+
|
11
14
|
# app.map "/#{app.css_dir}" do
|
12
15
|
# run StylesheetEnvironment.new(app)
|
13
16
|
# end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Middleman
|
2
2
|
def self.templates_path
|
3
|
-
File.join(
|
3
|
+
File.join(File.expand_path("~/"), ".middleman")
|
4
4
|
end
|
5
5
|
end
|
6
6
|
|
@@ -17,4 +17,4 @@ end
|
|
17
17
|
Dir[File.join(Middleman.templates_path, "*")].each do |dir|
|
18
18
|
next unless File.directory?(dir)
|
19
19
|
Middleman::Templates.register(File.basename(dir).to_sym, Middleman::Templates::Local)
|
20
|
-
end
|
20
|
+
end
|
data/lib/middleman/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: middleman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 109
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 0
|
9
9
|
- 0
|
10
|
-
|
10
|
+
- 1
|
11
|
+
version: 2.0.0.1
|
11
12
|
platform: ruby
|
12
13
|
authors:
|
13
14
|
- Thomas Reynolds
|
@@ -15,7 +16,7 @@ autorequire:
|
|
15
16
|
bindir: bin
|
16
17
|
cert_chain: []
|
17
18
|
|
18
|
-
date: 2011-08-
|
19
|
+
date: 2011-08-09 00:00:00 Z
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
21
22
|
name: rack
|
@@ -458,6 +459,9 @@ files:
|
|
458
459
|
- fixtures/relative-app/config.rb
|
459
460
|
- fixtures/relative-app/source/images/blank.gif
|
460
461
|
- fixtures/relative-app/source/stylesheets/relative_assets.css.sass
|
462
|
+
- fixtures/sprockets-app/config.rb
|
463
|
+
- fixtures/sprockets-app/source/library/javascripts/sprockets_base.js
|
464
|
+
- fixtures/sprockets-app/source/library/javascripts/sprockets_sub.js
|
461
465
|
- fixtures/test-app/config.rb
|
462
466
|
- fixtures/test-app/data/test.yml
|
463
467
|
- fixtures/test-app/source/_partial.haml
|
@@ -687,6 +691,9 @@ test_files:
|
|
687
691
|
- fixtures/relative-app/config.rb
|
688
692
|
- fixtures/relative-app/source/images/blank.gif
|
689
693
|
- fixtures/relative-app/source/stylesheets/relative_assets.css.sass
|
694
|
+
- fixtures/sprockets-app/config.rb
|
695
|
+
- fixtures/sprockets-app/source/library/javascripts/sprockets_base.js
|
696
|
+
- fixtures/sprockets-app/source/library/javascripts/sprockets_sub.js
|
690
697
|
- fixtures/test-app/config.rb
|
691
698
|
- fixtures/test-app/data/test.yml
|
692
699
|
- fixtures/test-app/source/_partial.haml
|