middleman 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.1
1
+ 0.4.2
@@ -4,4 +4,5 @@
4
4
  require File.join(File.dirname(__FILE__), '..', 'lib', 'middleman')
5
5
 
6
6
  # Start Middleman
7
+ Middleman.set :server, %w[thin webrick]
7
8
  Middleman.run!(:root => Dir.pwd)
@@ -45,7 +45,6 @@ class Middleman < Sinatra::Base
45
45
  config.output_style = :nested
46
46
  config.css_dir = File.join(File.basename(self.public), "stylesheets")
47
47
  config.images_dir = File.join(File.basename(self.public), "images")
48
- config.http_path = "/"
49
48
  config.http_images_path = "/images"
50
49
  config.http_stylesheets_path = "/stylesheets"
51
50
  config.add_import_path(config.sass_dir)
@@ -1,3 +1,38 @@
1
+ module Table
2
+ include Haml::Filters::Base
3
+
4
+ def render(text)
5
+ output = '<div class="table"><table cellspacing="0" cellpadding="0">'
6
+ line_num = 0
7
+ text.each_line do |line|
8
+ line_num += 1
9
+ next if line.strip.empty?
10
+ output << %Q{<tr class="#{(line_num % 2 == 0) ? "even" : "odd" }#{(line_num == 1) ? " first" : "" }">}
11
+
12
+ columns = line.split("|").map { |p| p.strip }
13
+ columns.each_with_index do |col, i|
14
+ output << %Q{<td class="col#{i+1}">#{col}</td>}
15
+ end
16
+
17
+ output << "</tr>"
18
+ end
19
+ output + "</table></div>"
20
+ end
21
+ end
22
+
23
+ def find_and_include_related_sass_file
24
+ path = request.path_info.dup
25
+ path << "index.html" if path.match(%r{/$})
26
+ path.gsub!(%r{^/}, '')
27
+ path.gsub!(File.extname(path), '')
28
+ path.gsub!('/', '-')
29
+
30
+ sass_file = File.join(File.basename(self.class.views), "stylesheets", "#{path}.sass")
31
+ if File.exists? sass_file
32
+ stylesheet_link_tag "stylesheets/#{path}.css"
33
+ end
34
+ end
35
+
1
36
  def link_to(title, url="#", params={})
2
37
  params.merge!(:href => url)
3
38
  params = params.map { |k,v| %Q{#{k}="#{v}"}}.join(' ')
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{middleman}
8
- s.version = "0.4.1"
8
+ s.version = "0.4.2"
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-12}
12
+ s.date = %q{2009-09-04}
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: middleman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
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-12 00:00:00 -07:00
12
+ date: 2009-09-04 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency