middleman 0.3.10 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitmodules +0 -12
- data/VERSION +1 -1
- data/bin/mm-build +2 -1
- data/lib/middleman.rb +6 -14
- data/lib/middleman/markaby.rb +4 -0
- data/lib/middleman/maruku.rb +4 -0
- data/middleman.gemspec +6 -2
- data/spec/fixtures/sample/init.rb +2 -0
- data/vendor/sinatra-markaby/lib/sinatra/markaby.rb +1 -1
- metadata +6 -2
data/.gitmodules
CHANGED
@@ -1,12 +0,0 @@
|
|
1
|
-
[submodule "vendor/sinatra-markaby"]
|
2
|
-
path = vendor/sinatra-markaby
|
3
|
-
url = git://github.com/sbfaulkner/sinatra-markaby.git
|
4
|
-
[submodule "vendor/sinatra-maruku"]
|
5
|
-
path = vendor/sinatra-maruku
|
6
|
-
url = git://github.com/wbzyl/sinatra-maruku.git
|
7
|
-
[submodule "vendor/rack-test"]
|
8
|
-
path = vendor/rack-test
|
9
|
-
url = git://github.com/brynary/rack-test.git
|
10
|
-
[submodule "vendor/sinatra-content-for"]
|
11
|
-
path = vendor/sinatra-content-for
|
12
|
-
url = git://github.com/foca/sinatra-content-for.git
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.4.0
|
data/bin/mm-build
CHANGED
@@ -26,6 +26,7 @@ module Generators
|
|
26
26
|
|
27
27
|
if (args[0] === args[1])
|
28
28
|
newext = case File.extname(args.first)
|
29
|
+
# Middleman.supported_formats.map { |ext| ".#{ext}" }
|
29
30
|
when '.haml', '.erb', '.mab', '.maruku'
|
30
31
|
'.html'
|
31
32
|
when '.sass'
|
@@ -51,7 +52,7 @@ module Generators
|
|
51
52
|
file(action.downcase.gsub(/[^a-z0-9]+/, '_').to_sym, action, action.gsub('public/', ''))
|
52
53
|
end
|
53
54
|
|
54
|
-
glob! "views",
|
55
|
+
glob! "views", (Middleman.supported_formats << "sass")
|
55
56
|
end
|
56
57
|
|
57
58
|
add :build, Builder
|
data/lib/middleman.rb
CHANGED
@@ -3,12 +3,6 @@ require 'haml'
|
|
3
3
|
require 'compass' #must be loaded before sinatra
|
4
4
|
require 'sinatra/base'
|
5
5
|
|
6
|
-
# Include markaby support
|
7
|
-
require File.join(File.dirname(__FILE__), '..', 'vendor', 'sinatra-markaby', 'lib', 'sinatra', 'markaby')
|
8
|
-
|
9
|
-
# Include maruku support
|
10
|
-
require File.join(File.dirname(__FILE__), '..', 'vendor', 'sinatra-maruku', 'lib', 'sinatra', 'maruku')
|
11
|
-
|
12
6
|
# Include content_for support
|
13
7
|
require File.join(File.dirname(__FILE__), '..', 'vendor', 'sinatra-content-for', 'lib', 'sinatra', 'content_for')
|
14
8
|
|
@@ -17,9 +11,9 @@ class Middleman < Sinatra::Base
|
|
17
11
|
set :static, true
|
18
12
|
set :root, Dir.pwd
|
19
13
|
set :environment, defined?(MIDDLEMAN_BUILDER) ? :build : :development
|
20
|
-
|
21
|
-
|
22
|
-
|
14
|
+
|
15
|
+
set :supported_formats, %w(haml erb builder)
|
16
|
+
|
23
17
|
helpers Sinatra::ContentFor
|
24
18
|
|
25
19
|
def self.run!(options={}, &block)
|
@@ -84,6 +78,7 @@ class Middleman < Sinatra::Base
|
|
84
78
|
end
|
85
79
|
end
|
86
80
|
|
81
|
+
# All other files
|
87
82
|
get /(.*)/ do |path|
|
88
83
|
path << "index.html" if path.match(%r{/$})
|
89
84
|
path.gsub!(%r{^/}, '')
|
@@ -91,9 +86,8 @@ class Middleman < Sinatra::Base
|
|
91
86
|
|
92
87
|
result = nil
|
93
88
|
begin
|
94
|
-
|
89
|
+
options.supported_formats.detect do |renderer|
|
95
90
|
next false if !File.exists?(File.join(options.views, "#{path}.#{renderer}"))
|
96
|
-
renderer = "markaby" if renderer == "mab"
|
97
91
|
result = send(renderer.to_sym, path.to_sym)
|
98
92
|
end
|
99
93
|
rescue Haml::Error => e
|
@@ -103,6 +97,4 @@ class Middleman < Sinatra::Base
|
|
103
97
|
|
104
98
|
result || pass
|
105
99
|
end
|
106
|
-
end
|
107
|
-
|
108
|
-
require File.join(File.dirname(__FILE__), 'middleman', 'helpers')
|
100
|
+
end
|
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.
|
8
|
+
s.version = "0.4.0"
|
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
|
+
s.date = %q{2009-08-12}
|
13
13
|
s.email = %q{tdreyno@gmail.com}
|
14
14
|
s.executables = ["mm-init", "mm-build", "mm-server"]
|
15
15
|
s.extra_rdoc_files = [
|
@@ -29,12 +29,15 @@ Gem::Specification.new do |s|
|
|
29
29
|
"bin/mm-server",
|
30
30
|
"lib/middleman.rb",
|
31
31
|
"lib/middleman/helpers.rb",
|
32
|
+
"lib/middleman/markaby.rb",
|
33
|
+
"lib/middleman/maruku.rb",
|
32
34
|
"lib/middleman/template/init.rb",
|
33
35
|
"lib/middleman/template/views/index.haml",
|
34
36
|
"lib/middleman/template/views/layout.haml",
|
35
37
|
"lib/middleman/template/views/stylesheets/site.sass",
|
36
38
|
"middleman.gemspec",
|
37
39
|
"spec/builder_spec.rb",
|
40
|
+
"spec/fixtures/sample/init.rb",
|
38
41
|
"spec/fixtures/sample/public/static.html",
|
39
42
|
"spec/fixtures/sample/public/stylesheets/static.css",
|
40
43
|
"spec/fixtures/sample/views/_partial.haml",
|
@@ -113,6 +116,7 @@ Gem::Specification.new do |s|
|
|
113
116
|
s.summary = %q{A static site generator utilizing Haml and Sass}
|
114
117
|
s.test_files = [
|
115
118
|
"spec/builder_spec.rb",
|
119
|
+
"spec/fixtures/sample/init.rb",
|
116
120
|
"spec/generator_spec.rb",
|
117
121
|
"spec/spec_helper.rb"
|
118
122
|
]
|
@@ -8,7 +8,7 @@ module Sinatra
|
|
8
8
|
#
|
9
9
|
# Options for markaby may be specified in Sinatra using set :markaby, { ... }
|
10
10
|
# TODO: the options aren't actually used yet
|
11
|
-
def
|
11
|
+
def mab(template=nil, options={}, locals = {}, &block)
|
12
12
|
options, template = template, nil if template.is_a?(Hash)
|
13
13
|
template = lambda { block } if template.nil?
|
14
14
|
render :mab, template, options, locals
|
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
|
+
version: 0.4.0
|
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
|
+
date: 2009-08-12 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -96,12 +96,15 @@ files:
|
|
96
96
|
- bin/mm-server
|
97
97
|
- lib/middleman.rb
|
98
98
|
- lib/middleman/helpers.rb
|
99
|
+
- lib/middleman/markaby.rb
|
100
|
+
- lib/middleman/maruku.rb
|
99
101
|
- lib/middleman/template/init.rb
|
100
102
|
- lib/middleman/template/views/index.haml
|
101
103
|
- lib/middleman/template/views/layout.haml
|
102
104
|
- lib/middleman/template/views/stylesheets/site.sass
|
103
105
|
- middleman.gemspec
|
104
106
|
- spec/builder_spec.rb
|
107
|
+
- spec/fixtures/sample/init.rb
|
105
108
|
- spec/fixtures/sample/public/static.html
|
106
109
|
- spec/fixtures/sample/public/stylesheets/static.css
|
107
110
|
- spec/fixtures/sample/views/_partial.haml
|
@@ -201,5 +204,6 @@ specification_version: 3
|
|
201
204
|
summary: A static site generator utilizing Haml and Sass
|
202
205
|
test_files:
|
203
206
|
- spec/builder_spec.rb
|
207
|
+
- spec/fixtures/sample/init.rb
|
204
208
|
- spec/generator_spec.rb
|
205
209
|
- spec/spec_helper.rb
|