middleman 0.10.7 → 0.10.8

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.10.7
1
+ 0.10.8
@@ -17,7 +17,7 @@ module Middleman
17
17
  set :css_dir, "stylesheets"
18
18
  set :images_dir, "images"
19
19
  set :build_dir, "build"
20
- set :http_prefix, "/"
20
+ set :http_prefix, nil
21
21
 
22
22
  use Rack::ConditionalGet if environment == :development
23
23
 
@@ -10,18 +10,23 @@ class << Middleman::Base
10
10
  rescue
11
11
  end
12
12
 
13
- path = pre_relative_asset_url(path, prefix, request)
14
13
  if path.include?("://")
14
+ pre_relative_asset_url(path, prefix, request)
15
+ elsif path[0,1] == "/"
15
16
  path
16
17
  else
17
- path = path[1,path.length-1] if path[0,1] == '/'
18
+ path = File.join(prefix, path) if prefix.length > 0
18
19
  request_path = request.path_info.dup
19
- request_path << self.class.index_file if path.match(%r{/$})
20
+ request_path << self.index_file if path.match(%r{/$})
20
21
  request_path.gsub!(%r{^/}, '')
21
22
  parts = request_path.split('/')
22
-
23
+
23
24
  if parts.length > 1
24
- "../" * (parts.length - 1) + path
25
+ arry = []
26
+ (parts.length - 1).times { arry << ".." }
27
+ arry << path
28
+ File.join(*arry)
29
+ #"../" * (parts.length - 1) + path
25
30
  else
26
31
  path
27
32
  end
@@ -1,8 +1,7 @@
1
1
  module Middleman
2
2
  class Base
3
3
  def self.asset_url(path, prefix="", request=nil)
4
- base_url = File.join(self.http_prefix, prefix)
5
- path.include?("://") ? path : File.join(base_url, path)
4
+ path.include?("://") ? path : File.join(self.http_prefix || "/", prefix, path)
6
5
  end
7
6
  end
8
7
 
@@ -1,4 +1,5 @@
1
1
  require "sass"
2
+ #gem "compass-edge"
2
3
  require "compass"
3
4
 
4
5
  module Middleman
@@ -75,8 +76,8 @@ class Middleman::Base
75
76
  config.output_style = :nested
76
77
  config.css_dir = File.join(File.basename(self.public), self.css_dir)
77
78
  config.images_dir = File.join(File.basename(self.public), self.images_dir)
78
- config.http_images_path = self.http_images_path rescue File.join(self.http_prefix, self.images_dir)
79
- config.http_stylesheets_path = self.http_css_path rescue File.join(self.http_prefix, self.css_dir)
79
+ config.http_images_path = self.http_images_path rescue File.join(self.http_prefix || "/", self.images_dir)
80
+ config.http_stylesheets_path = self.http_css_path rescue File.join(self.http_prefix || "/", self.css_dir)
80
81
  config.asset_cache_buster { false }
81
82
 
82
83
  config.add_import_path(config.sass_dir)
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{middleman}
8
- s.version = "0.10.7"
8
+ s.version = "0.10.8"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Thomas Reynolds"]
12
- s.date = %q{2009-11-03}
12
+ s.date = %q{2009-11-06}
13
13
  s.email = %q{tdreyno@gmail.com}
14
14
  s.executables = ["mm-init", "mm-build", "mm-server"]
15
15
  s.extra_rdoc_files = [
@@ -61,18 +61,24 @@ Gem::Specification.new do |s|
61
61
  "spec/fixtures/sample/public/images/blank.gif",
62
62
  "spec/fixtures/sample/public/javascripts/to-be-included.js",
63
63
  "spec/fixtures/sample/public/static.html",
64
+ "spec/fixtures/sample/public/stylesheets/auto-css.css",
64
65
  "spec/fixtures/sample/public/stylesheets/static.css",
66
+ "spec/fixtures/sample/public/stylesheets/sub1/auto-css.css",
67
+ "spec/fixtures/sample/public/stylesheets/sub1/sub2/auto-css.css",
65
68
  "spec/fixtures/sample/views/_partial.haml",
69
+ "spec/fixtures/sample/views/auto-css.html.haml",
66
70
  "spec/fixtures/sample/views/auto-image-sizes.html.haml",
67
71
  "spec/fixtures/sample/views/index.html.haml",
68
72
  "spec/fixtures/sample/views/inline-js.html.haml",
69
73
  "spec/fixtures/sample/views/javascripts/empty-with-include.js",
70
74
  "spec/fixtures/sample/views/layout.haml",
71
75
  "spec/fixtures/sample/views/maruku.html.maruku",
76
+ "spec/fixtures/sample/views/page-classes.html.haml",
72
77
  "spec/fixtures/sample/views/services/index.html.haml",
73
78
  "spec/fixtures/sample/views/stylesheets/relative_assets.css.sass",
74
79
  "spec/fixtures/sample/views/stylesheets/site.css.sass",
75
80
  "spec/generator_spec.rb",
81
+ "spec/helpers_spec.rb",
76
82
  "spec/minify_javascript_spec.rb",
77
83
  "spec/relative_assets_spec.rb",
78
84
  "spec/spec_helper.rb"
@@ -0,0 +1 @@
1
+ = auto_stylesheet_link_tag
@@ -0,0 +1 @@
1
+ = page_classes
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.7
4
+ version: 0.10.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Reynolds
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-03 00:00:00 -08:00
12
+ date: 2009-11-06 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -188,18 +188,24 @@ files:
188
188
  - spec/fixtures/sample/public/images/blank.gif
189
189
  - spec/fixtures/sample/public/javascripts/to-be-included.js
190
190
  - spec/fixtures/sample/public/static.html
191
+ - spec/fixtures/sample/public/stylesheets/auto-css.css
191
192
  - spec/fixtures/sample/public/stylesheets/static.css
193
+ - spec/fixtures/sample/public/stylesheets/sub1/auto-css.css
194
+ - spec/fixtures/sample/public/stylesheets/sub1/sub2/auto-css.css
192
195
  - spec/fixtures/sample/views/_partial.haml
196
+ - spec/fixtures/sample/views/auto-css.html.haml
193
197
  - spec/fixtures/sample/views/auto-image-sizes.html.haml
194
198
  - spec/fixtures/sample/views/index.html.haml
195
199
  - spec/fixtures/sample/views/inline-js.html.haml
196
200
  - spec/fixtures/sample/views/javascripts/empty-with-include.js
197
201
  - spec/fixtures/sample/views/layout.haml
198
202
  - spec/fixtures/sample/views/maruku.html.maruku
203
+ - spec/fixtures/sample/views/page-classes.html.haml
199
204
  - spec/fixtures/sample/views/services/index.html.haml
200
205
  - spec/fixtures/sample/views/stylesheets/relative_assets.css.sass
201
206
  - spec/fixtures/sample/views/stylesheets/site.css.sass
202
207
  - spec/generator_spec.rb
208
+ - spec/helpers_spec.rb
203
209
  - spec/minify_javascript_spec.rb
204
210
  - spec/relative_assets_spec.rb
205
211
  - spec/spec_helper.rb