tdreyno-middleman 0.3.10 → 0.4.1

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.10
1
+ 0.4.1
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", %w(haml sass erb builder mab maruku)
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
- helpers Sinatra::Markaby
22
- helpers Sinatra::Maruku
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
- %w(haml erb builder maruku mab).detect do |renderer|
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
@@ -0,0 +1,4 @@
1
+ # Include markaby support
2
+ require File.join(File.dirname(__FILE__), '..', '..', 'vendor', 'sinatra-markaby', 'lib', 'sinatra', 'markaby')
3
+ Middleman.helpers Sinatra::Markaby
4
+ Middleman.supported_formats << "mab"
@@ -0,0 +1,4 @@
1
+ # Include maruku support
2
+ require File.join(File.dirname(__FILE__), '..', '..', 'vendor', 'sinatra-maruku', 'lib', 'sinatra', 'maruku')
3
+ Middleman.helpers Sinatra::Maruku
4
+ Middleman.supported_formats << "maruku"
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.10"
8
+ s.version = "0.4.1"
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-11}
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 = [
@@ -19,7 +19,6 @@ Gem::Specification.new do |s|
19
19
  s.files = [
20
20
  ".document",
21
21
  ".gitignore",
22
- ".gitmodules",
23
22
  "LICENSE",
24
23
  "README.rdoc",
25
24
  "Rakefile",
@@ -29,12 +28,15 @@ Gem::Specification.new do |s|
29
28
  "bin/mm-server",
30
29
  "lib/middleman.rb",
31
30
  "lib/middleman/helpers.rb",
31
+ "lib/middleman/markaby.rb",
32
+ "lib/middleman/maruku.rb",
32
33
  "lib/middleman/template/init.rb",
33
34
  "lib/middleman/template/views/index.haml",
34
35
  "lib/middleman/template/views/layout.haml",
35
36
  "lib/middleman/template/views/stylesheets/site.sass",
36
37
  "middleman.gemspec",
37
38
  "spec/builder_spec.rb",
39
+ "spec/fixtures/sample/init.rb",
38
40
  "spec/fixtures/sample/public/static.html",
39
41
  "spec/fixtures/sample/public/stylesheets/static.css",
40
42
  "spec/fixtures/sample/views/_partial.haml",
@@ -47,62 +49,120 @@ Gem::Specification.new do |s|
47
49
  "spec/generator_spec.rb",
48
50
  "spec/spec_helper.rb",
49
51
  "vendor/rack-test/History.txt",
52
+ "vendor/rack-test/History.txt",
53
+ "vendor/rack-test/MIT-LICENSE.txt",
50
54
  "vendor/rack-test/MIT-LICENSE.txt",
51
55
  "vendor/rack-test/README.rdoc",
56
+ "vendor/rack-test/README.rdoc",
57
+ "vendor/rack-test/Rakefile",
52
58
  "vendor/rack-test/Rakefile",
53
59
  "vendor/rack-test/lib/rack/mock_session.rb",
60
+ "vendor/rack-test/lib/rack/mock_session.rb",
61
+ "vendor/rack-test/lib/rack/test.rb",
54
62
  "vendor/rack-test/lib/rack/test.rb",
55
63
  "vendor/rack-test/lib/rack/test/cookie_jar.rb",
64
+ "vendor/rack-test/lib/rack/test/cookie_jar.rb",
65
+ "vendor/rack-test/lib/rack/test/methods.rb",
56
66
  "vendor/rack-test/lib/rack/test/methods.rb",
57
67
  "vendor/rack-test/lib/rack/test/mock_digest_request.rb",
68
+ "vendor/rack-test/lib/rack/test/mock_digest_request.rb",
69
+ "vendor/rack-test/lib/rack/test/uploaded_file.rb",
58
70
  "vendor/rack-test/lib/rack/test/uploaded_file.rb",
59
71
  "vendor/rack-test/lib/rack/test/utils.rb",
72
+ "vendor/rack-test/lib/rack/test/utils.rb",
73
+ "vendor/rack-test/spec/fixtures/config.ru",
60
74
  "vendor/rack-test/spec/fixtures/config.ru",
61
75
  "vendor/rack-test/spec/fixtures/fake_app.rb",
76
+ "vendor/rack-test/spec/fixtures/fake_app.rb",
77
+ "vendor/rack-test/spec/fixtures/foo.txt",
62
78
  "vendor/rack-test/spec/fixtures/foo.txt",
63
79
  "vendor/rack-test/spec/rack/test/cookie_spec.rb",
80
+ "vendor/rack-test/spec/rack/test/cookie_spec.rb",
64
81
  "vendor/rack-test/spec/rack/test/digest_auth_spec.rb",
82
+ "vendor/rack-test/spec/rack/test/digest_auth_spec.rb",
83
+ "vendor/rack-test/spec/rack/test/multipart_spec.rb",
65
84
  "vendor/rack-test/spec/rack/test/multipart_spec.rb",
66
85
  "vendor/rack-test/spec/rack/test/utils_spec.rb",
86
+ "vendor/rack-test/spec/rack/test/utils_spec.rb",
87
+ "vendor/rack-test/spec/rack/test_spec.rb",
67
88
  "vendor/rack-test/spec/rack/test_spec.rb",
68
89
  "vendor/rack-test/spec/rcov.opts",
90
+ "vendor/rack-test/spec/rcov.opts",
91
+ "vendor/rack-test/spec/spec.opts",
69
92
  "vendor/rack-test/spec/spec.opts",
70
93
  "vendor/rack-test/spec/spec_helper.rb",
94
+ "vendor/rack-test/spec/spec_helper.rb",
71
95
  "vendor/sinatra-content-for/LICENSE",
96
+ "vendor/sinatra-content-for/LICENSE",
97
+ "vendor/sinatra-content-for/README.rdoc",
72
98
  "vendor/sinatra-content-for/README.rdoc",
73
99
  "vendor/sinatra-content-for/Rakefile",
100
+ "vendor/sinatra-content-for/Rakefile",
101
+ "vendor/sinatra-content-for/lib/sinatra/content_for.rb",
74
102
  "vendor/sinatra-content-for/lib/sinatra/content_for.rb",
75
103
  "vendor/sinatra-content-for/sinatra-content-for.gemspec",
104
+ "vendor/sinatra-content-for/sinatra-content-for.gemspec",
105
+ "vendor/sinatra-content-for/test/content_for_test.rb",
76
106
  "vendor/sinatra-content-for/test/content_for_test.rb",
77
107
  "vendor/sinatra-markaby/CHANGES",
108
+ "vendor/sinatra-markaby/CHANGES",
78
109
  "vendor/sinatra-markaby/LICENSE",
110
+ "vendor/sinatra-markaby/LICENSE",
111
+ "vendor/sinatra-markaby/README.rdoc",
79
112
  "vendor/sinatra-markaby/README.rdoc",
80
113
  "vendor/sinatra-markaby/Rakefile",
114
+ "vendor/sinatra-markaby/Rakefile",
115
+ "vendor/sinatra-markaby/TODO",
81
116
  "vendor/sinatra-markaby/TODO",
82
117
  "vendor/sinatra-markaby/VERSION.yml",
118
+ "vendor/sinatra-markaby/VERSION.yml",
119
+ "vendor/sinatra-markaby/lib/sinatra/markaby.rb",
83
120
  "vendor/sinatra-markaby/lib/sinatra/markaby.rb",
84
121
  "vendor/sinatra-markaby/sinatra-markaby.gemspec",
122
+ "vendor/sinatra-markaby/sinatra-markaby.gemspec",
85
123
  "vendor/sinatra-markaby/test/sinatra_markaby_test.rb",
124
+ "vendor/sinatra-markaby/test/sinatra_markaby_test.rb",
125
+ "vendor/sinatra-markaby/test/test_helper.rb",
86
126
  "vendor/sinatra-markaby/test/test_helper.rb",
87
127
  "vendor/sinatra-markaby/test/views/hello.mab",
128
+ "vendor/sinatra-markaby/test/views/hello.mab",
129
+ "vendor/sinatra-markaby/test/views/html.mab",
88
130
  "vendor/sinatra-markaby/test/views/html.mab",
89
131
  "vendor/sinatra-maruku/LICENSE",
132
+ "vendor/sinatra-maruku/LICENSE",
133
+ "vendor/sinatra-maruku/README.markdown",
90
134
  "vendor/sinatra-maruku/README.markdown",
91
135
  "vendor/sinatra-maruku/Rakefile",
136
+ "vendor/sinatra-maruku/Rakefile",
92
137
  "vendor/sinatra-maruku/VERSION.yml",
138
+ "vendor/sinatra-maruku/VERSION.yml",
139
+ "vendor/sinatra-maruku/examples/app.rb",
93
140
  "vendor/sinatra-maruku/examples/app.rb",
94
141
  "vendor/sinatra-maruku/examples/config.ru",
142
+ "vendor/sinatra-maruku/examples/config.ru",
143
+ "vendor/sinatra-maruku/examples/mapp.rb",
95
144
  "vendor/sinatra-maruku/examples/mapp.rb",
96
145
  "vendor/sinatra-maruku/examples/public/javascripts/application.js",
146
+ "vendor/sinatra-maruku/examples/public/javascripts/application.js",
147
+ "vendor/sinatra-maruku/examples/public/stylesheets/application.css",
97
148
  "vendor/sinatra-maruku/examples/public/stylesheets/application.css",
98
149
  "vendor/sinatra-maruku/examples/public/stylesheets/print.css",
150
+ "vendor/sinatra-maruku/examples/public/stylesheets/print.css",
99
151
  "vendor/sinatra-maruku/examples/views/index.maruku",
152
+ "vendor/sinatra-maruku/examples/views/index.maruku",
153
+ "vendor/sinatra-maruku/examples/views/layout.maruku",
100
154
  "vendor/sinatra-maruku/examples/views/layout.maruku",
101
155
  "vendor/sinatra-maruku/lib/sinatra/maruku.rb",
156
+ "vendor/sinatra-maruku/lib/sinatra/maruku.rb",
157
+ "vendor/sinatra-maruku/sinatra-maruku.gemspec",
102
158
  "vendor/sinatra-maruku/sinatra-maruku.gemspec",
103
159
  "vendor/sinatra-maruku/test/sinatra_maruku_test.rb",
160
+ "vendor/sinatra-maruku/test/sinatra_maruku_test.rb",
161
+ "vendor/sinatra-maruku/test/test_helper.rb",
104
162
  "vendor/sinatra-maruku/test/test_helper.rb",
105
163
  "vendor/sinatra-maruku/test/views/hello.maruku",
164
+ "vendor/sinatra-maruku/test/views/hello.maruku",
165
+ "vendor/sinatra-maruku/test/views/layout2.maruku",
106
166
  "vendor/sinatra-maruku/test/views/layout2.maruku"
107
167
  ]
108
168
  s.homepage = %q{http://github.com/tdreyno/middleman}
@@ -113,6 +173,7 @@ Gem::Specification.new do |s|
113
173
  s.summary = %q{A static site generator utilizing Haml and Sass}
114
174
  s.test_files = [
115
175
  "spec/builder_spec.rb",
176
+ "spec/fixtures/sample/init.rb",
116
177
  "spec/generator_spec.rb",
117
178
  "spec/spec_helper.rb"
118
179
  ]
@@ -0,0 +1,2 @@
1
+ require File.join(File.dirname(__FILE__), "..", "..", "..", "lib", "middleman", "maruku")
2
+ require File.join(File.dirname(__FILE__), "..", "..", "..", "lib", "middleman", "markaby")
@@ -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 markaby(template=nil, options={}, locals = {}, &block)
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
@@ -8,8 +8,8 @@ module Sinatra
8
8
  end
9
9
 
10
10
  private
11
- def render_maruku(data, options, locals, &block)
12
- maruku_src = render_erb(data, options, locals, &block)
11
+ def render_maruku(template, data, options, locals, &block)
12
+ maruku_src = render_erb(template, data, options, locals, &block)
13
13
  instance = ::Maruku.new(maruku_src, options)
14
14
  if block_given?
15
15
  # render layout
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.10
4
+ version: 0.4.1
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-11 00:00:00 -07:00
12
+ date: 2009-08-12 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -86,7 +86,6 @@ extra_rdoc_files:
86
86
  files:
87
87
  - .document
88
88
  - .gitignore
89
- - .gitmodules
90
89
  - LICENSE
91
90
  - README.rdoc
92
91
  - Rakefile
@@ -96,12 +95,15 @@ files:
96
95
  - bin/mm-server
97
96
  - lib/middleman.rb
98
97
  - lib/middleman/helpers.rb
98
+ - lib/middleman/markaby.rb
99
+ - lib/middleman/maruku.rb
99
100
  - lib/middleman/template/init.rb
100
101
  - lib/middleman/template/views/index.haml
101
102
  - lib/middleman/template/views/layout.haml
102
103
  - lib/middleman/template/views/stylesheets/site.sass
103
104
  - middleman.gemspec
104
105
  - spec/builder_spec.rb
106
+ - spec/fixtures/sample/init.rb
105
107
  - spec/fixtures/sample/public/static.html
106
108
  - spec/fixtures/sample/public/stylesheets/static.css
107
109
  - spec/fixtures/sample/views/_partial.haml
@@ -200,5 +202,6 @@ specification_version: 3
200
202
  summary: A static site generator utilizing Haml and Sass
201
203
  test_files:
202
204
  - spec/builder_spec.rb
205
+ - spec/fixtures/sample/init.rb
203
206
  - spec/generator_spec.rb
204
207
  - spec/spec_helper.rb
data/.gitmodules DELETED
@@ -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