middleman 1.1.2 → 1.1.3

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.
@@ -13,4 +13,9 @@ Feature: Builder
13
13
  Then "stylesheets/test_less.css" should exist and include "666"
14
14
  Then "stylesheets/static.css" should exist and include "body"
15
15
  Then "_partial.html" should not exist
16
+ And cleanup built test app
17
+
18
+ Scenario: Force relative assets
19
+ Given a built test app with flags "--relative"
20
+ Then "stylesheets/site.css" should exist and include "../"
16
21
  And cleanup built test app
@@ -6,6 +6,12 @@ Given /^a built test app$/ do
6
6
  `cd #{target} && MM_DIR="#{target}" #{build_cmd}`
7
7
  end
8
8
 
9
+ Given /^a built test app with flags "([^"]*)"$/ do |flags|
10
+ target = File.join(File.dirname(File.dirname(File.dirname(__FILE__))), "fixtures", "test-app")
11
+ build_cmd = File.expand_path(File.join(File.dirname(File.dirname(File.dirname(__FILE__))), "bin", "mm-build"))
12
+ `cd #{target} && MM_DIR="#{target}" #{build_cmd} #{flags}`
13
+ end
14
+
9
15
  Given /^cleanup built test app$/ do
10
16
  target = File.join(File.dirname(File.dirname(File.dirname(__FILE__))), "fixtures", "test-app", "build")
11
17
  FileUtils.rm_rf(target)
@@ -27,9 +27,15 @@ module Middleman
27
27
  include Thor::Actions
28
28
  include Middleman::ThorActions
29
29
 
30
+ class_option :relative, :type => :boolean, :aliases => "-r", :default => false, :desc => 'Override the config.rb file and force relative urls'
31
+
30
32
  def initialize(*args)
31
- Middleman::Server.new
32
33
  super
34
+
35
+ Middleman::Server.new
36
+ if options.has_key?("relative") && options["relative"]
37
+ Middleman::Server.activate :relative_assets
38
+ end
33
39
  end
34
40
 
35
41
  def source_paths
@@ -51,10 +51,12 @@ configure :build do
51
51
 
52
52
  # Enable cache buster
53
53
  # activate :cache_buster
54
+
55
+ # Use relative URLs
56
+ # activate :relative_assets
54
57
 
55
58
  # Generate ugly/obfuscated HTML from Haml
56
59
  # activate :ugly_haml
57
-
58
60
 
59
61
  # Or use a different image path
60
62
  # set :http_path, "/Content/images/"
@@ -39,6 +39,9 @@ configure :build do
39
39
 
40
40
  # Enable cache buster
41
41
  # activate :cache_buster
42
+
43
+ # Use relative URLs
44
+ # activate :relative_assets
42
45
 
43
46
  # Generate ugly/obfuscated HTML from Haml
44
47
  # activate :ugly_haml
@@ -1,3 +1,3 @@
1
1
  module Middleman
2
- VERSION = "1.1.2"
2
+ VERSION = "1.1.3"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 1
9
- - 2
10
- version: 1.1.2
9
+ - 3
10
+ version: 1.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Thomas Reynolds
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-18 00:00:00 -07:00
18
+ date: 2011-04-19 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency