tdreyno-middleman 0.3.7 → 0.3.8

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.7
1
+ 0.3.8
@@ -5,8 +5,12 @@ def link_to(title, url="#", params={})
5
5
  end
6
6
 
7
7
  def page_classes(*additional)
8
+ path = env["REQUEST_PATH"]
9
+ path << "index.html" if path.match(%r{/$})
10
+ path.gsub!(%r{^/}, '')
11
+
8
12
  classes = []
9
- parts = @full_request_path.split('.')[0].split('/')
13
+ parts = path.split('.')[0].split('/')
10
14
  parts.each_with_index { |path, i| classes << parts.first(i+1).join('_') }
11
15
 
12
16
  classes << "index" if classes.empty?
data/lib/middleman.rb CHANGED
@@ -82,16 +82,14 @@ class Middleman < Sinatra::Base
82
82
  get /(.*)/ do |path|
83
83
  path << "index.html" if path.match(%r{/$})
84
84
  path.gsub!(%r{^/}, '')
85
-
86
- @template = path.gsub(File.extname(path), '').to_sym
87
- @full_request_path = path
85
+ path.gsub!(File.extname(path), '')
88
86
 
89
87
  result = nil
90
88
  begin
91
89
  %w(haml erb builder maruku mab).detect do |renderer|
92
- next false if !File.exists?(File.join(options.views, "#{@template}.#{renderer}"))
90
+ next false if !File.exists?(File.join(options.views, "#{path}.#{renderer}"))
93
91
  renderer = "markaby" if renderer == "mab"
94
- result = send(renderer.to_sym, @template)
92
+ result = send(renderer.to_sym, path.to_sym)
95
93
  end
96
94
  rescue Haml::Error => e
97
95
  result = "Haml Error: #{e}"
data/middleman.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{middleman}
8
- s.version = "0.3.7"
8
+ s.version = "0.3.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-08-09}
12
+ s.date = %q{2009-08-11}
13
13
  s.email = %q{tdreyno@gmail.com}
14
14
  s.executables = ["mm-init", "mm-build", "mm-server"]
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tdreyno-middleman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.3.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-08-09 00:00:00 -07:00
12
+ date: 2009-08-11 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency