middleman 0.4.1 → 0.4.2
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 +1 -1
- data/bin/mm-server +1 -0
- data/lib/middleman.rb +0 -1
- data/lib/middleman/helpers.rb +35 -0
- data/middleman.gemspec +2 -2
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.2
|
data/bin/mm-server
CHANGED
data/lib/middleman.rb
CHANGED
@@ -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)
|
data/lib/middleman/helpers.rb
CHANGED
@@ -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(' ')
|
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.4.
|
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-
|
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.
|
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-
|
12
|
+
date: 2009-09-04 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|