middleman 0.5.5 → 0.9.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +1 -2
- data/.gitignore +3 -2
- data/LICENSE +0 -0
- data/README.rdoc +4 -0
- data/Rakefile +28 -36
- data/VERSION +1 -1
- data/bin/mm-build +7 -113
- data/bin/mm-init +11 -5
- data/bin/mm-server +56 -3
- data/features/asset_host.feature +12 -0
- data/features/automatic_image_sizes.feature +14 -0
- data/features/cache_buster.feature +22 -0
- data/features/generator.feature +8 -0
- data/features/minify_css.feature +22 -0
- data/features/minify_javascript.feature +12 -0
- data/features/page_alias_and_layouts.feature +12 -0
- data/features/relative_assets.feature +12 -0
- data/features/step_definitions/asset_host_steps.rb +7 -0
- data/features/step_definitions/env.rb +3 -0
- data/features/step_definitions/generator_steps.rb +24 -0
- data/features/step_definitions/middleman_steps.rb +28 -0
- data/features/step_definitions/page_layout_steps.rb +13 -0
- data/lib/middleman.rb +6 -132
- data/lib/middleman/assets.rb +33 -0
- data/lib/middleman/base.rb +147 -0
- data/lib/middleman/builder.rb +59 -0
- data/lib/middleman/config.ru +2 -0
- data/lib/middleman/features.rb +39 -0
- data/lib/middleman/features/asset_host.rb +21 -0
- data/lib/middleman/features/automatic_image_sizes.rb +31 -0
- data/lib/middleman/features/automatic_image_sizes/fastimage.rb +282 -0
- data/lib/middleman/features/cache_buster.rb +43 -0
- data/lib/middleman/features/default_helpers.rb +68 -0
- data/lib/middleman/features/livereload.rb +19 -0
- data/lib/middleman/features/minify_css.rb +9 -0
- data/lib/middleman/features/minify_javascript.rb +20 -0
- data/lib/middleman/features/minify_javascript/rack.rb +31 -0
- data/lib/middleman/features/relative_assets.rb +35 -0
- data/lib/middleman/features/slickmap.rb +118 -0
- data/lib/middleman/features/smush_pngs.rb +38 -0
- data/lib/middleman/features/ugly_haml.rb +7 -0
- data/lib/middleman/renderers.rb +26 -0
- data/lib/middleman/renderers/coffee.rb +28 -0
- data/lib/middleman/renderers/haml.rb +47 -0
- data/lib/middleman/renderers/sass.rb +67 -0
- data/lib/middleman/template/init.rbt +57 -0
- data/lib/middleman/template/views/index.html.haml +4 -0
- data/lib/middleman/template/views/layout.haml +11 -4
- data/lib/middleman/template/views/stylesheets/site.css.sass +27 -0
- data/lib/middleman/templater+dynamic_renderer.rb +26 -0
- data/middleman.gemspec +121 -107
- data/spec/builder_spec.rb +17 -16
- data/spec/fixtures/sample/init.rb +28 -2
- data/spec/fixtures/sample/public/images/blank.gif +0 -0
- data/spec/fixtures/sample/public/static.html +0 -0
- data/{vendor/sinatra-maruku/examples/public/javascripts/application.js → spec/fixtures/sample/public/stylesheets/auto-css.css} +0 -0
- data/spec/fixtures/sample/public/stylesheets/static.css +0 -0
- data/{vendor/sinatra-maruku/examples/public/stylesheets/print.css → spec/fixtures/sample/public/stylesheets/sub1/auto-css.css} +0 -0
- data/spec/fixtures/sample/public/stylesheets/sub1/sub2/auto-css.css +0 -0
- data/spec/fixtures/sample/views/_partial.haml +0 -0
- data/spec/fixtures/sample/views/asset_host.html.haml +1 -0
- data/spec/fixtures/sample/views/auto-css.html.haml +1 -0
- data/spec/fixtures/sample/views/auto-image-sizes.html.haml +1 -0
- data/spec/fixtures/sample/views/cache-buster.html.haml +2 -0
- data/spec/fixtures/sample/views/{index.haml → custom-layout.html.haml} +0 -0
- data/spec/fixtures/sample/views/custom.haml +5 -0
- data/spec/fixtures/sample/views/index.html.haml +1 -0
- data/spec/fixtures/sample/views/inline-css.html.haml +4 -0
- data/spec/fixtures/sample/views/{inline-js.haml → inline-js.html.haml} +0 -0
- data/spec/fixtures/sample/views/layout.haml +1 -1
- data/spec/fixtures/sample/views/{maruku.maruku → maruku.html.maruku} +0 -0
- data/spec/fixtures/sample/views/page-classes.html.haml +1 -0
- data/spec/fixtures/sample/views/services/{index.haml → index.html.haml} +0 -0
- data/spec/fixtures/sample/views/stylesheets/asset_host.css.sass +3 -0
- data/spec/fixtures/sample/views/stylesheets/relative_assets.css.sass +3 -0
- data/spec/fixtures/sample/views/stylesheets/site.css.sass +1 -0
- data/spec/fixtures/sample/views/stylesheets/site_scss.css.scss +1 -0
- data/spec/fixtures/sample/views/stylesheets/test_less.css.less +5 -0
- data/spec/helpers_spec.rb +43 -0
- data/spec/spec_helper.rb +3 -5
- metadata +298 -127
- data/lib/middleman/helpers.rb +0 -131
- data/lib/middleman/markaby.rb +0 -4
- data/lib/middleman/maruku.rb +0 -4
- data/lib/middleman/sprockets_ext.rb +0 -29
- data/lib/middleman/template/init.rb +0 -22
- data/lib/middleman/template/views/index.haml +0 -1
- data/lib/middleman/template/views/stylesheets/site.sass +0 -1
- data/spec/fixtures/sample/views/markaby.mab +0 -5
- data/spec/fixtures/sample/views/stylesheets/site.sass +0 -1
- data/spec/generator_spec.rb +0 -34
- data/vendor/rack-test/History.txt +0 -64
- data/vendor/rack-test/MIT-LICENSE.txt +0 -19
- data/vendor/rack-test/README.rdoc +0 -57
- data/vendor/rack-test/Rakefile +0 -62
- data/vendor/rack-test/lib/rack/mock_session.rb +0 -57
- data/vendor/rack-test/lib/rack/test.rb +0 -246
- data/vendor/rack-test/lib/rack/test/cookie_jar.rb +0 -169
- data/vendor/rack-test/lib/rack/test/methods.rb +0 -73
- data/vendor/rack-test/lib/rack/test/mock_digest_request.rb +0 -27
- data/vendor/rack-test/lib/rack/test/uploaded_file.rb +0 -36
- data/vendor/rack-test/lib/rack/test/utils.rb +0 -75
- data/vendor/rack-test/spec/fixtures/config.ru +0 -3
- data/vendor/rack-test/spec/fixtures/fake_app.rb +0 -109
- data/vendor/rack-test/spec/fixtures/foo.txt +0 -1
- data/vendor/rack-test/spec/rack/test/cookie_spec.rb +0 -176
- data/vendor/rack-test/spec/rack/test/digest_auth_spec.rb +0 -48
- data/vendor/rack-test/spec/rack/test/multipart_spec.rb +0 -85
- data/vendor/rack-test/spec/rack/test/utils_spec.rb +0 -44
- data/vendor/rack-test/spec/rack/test_spec.rb +0 -363
- data/vendor/rack-test/spec/rcov.opts +0 -1
- data/vendor/rack-test/spec/spec.opts +0 -1
- data/vendor/rack-test/spec/spec_helper.rb +0 -48
- data/vendor/sinatra-content-for/LICENSE +0 -22
- data/vendor/sinatra-content-for/README.rdoc +0 -49
- data/vendor/sinatra-content-for/Rakefile +0 -33
- data/vendor/sinatra-content-for/lib/sinatra/content_for.rb +0 -58
- data/vendor/sinatra-content-for/sinatra-content-for.gemspec +0 -34
- data/vendor/sinatra-content-for/test/content_for_test.rb +0 -156
- data/vendor/sinatra-markaby/CHANGES +0 -7
- data/vendor/sinatra-markaby/LICENSE +0 -20
- data/vendor/sinatra-markaby/README.rdoc +0 -33
- data/vendor/sinatra-markaby/Rakefile +0 -45
- data/vendor/sinatra-markaby/TODO +0 -3
- data/vendor/sinatra-markaby/VERSION.yml +0 -4
- data/vendor/sinatra-markaby/lib/sinatra/markaby.rb +0 -31
- data/vendor/sinatra-markaby/sinatra-markaby.gemspec +0 -49
- data/vendor/sinatra-markaby/test/sinatra_markaby_test.rb +0 -72
- data/vendor/sinatra-markaby/test/test_helper.rb +0 -19
- data/vendor/sinatra-markaby/test/views/hello.mab +0 -1
- data/vendor/sinatra-markaby/test/views/html.mab +0 -4
- data/vendor/sinatra-maruku/LICENSE +0 -22
- data/vendor/sinatra-maruku/README.markdown +0 -85
- data/vendor/sinatra-maruku/Rakefile +0 -34
- data/vendor/sinatra-maruku/VERSION.yml +0 -4
- data/vendor/sinatra-maruku/examples/app.rb +0 -8
- data/vendor/sinatra-maruku/examples/config.ru +0 -4
- data/vendor/sinatra-maruku/examples/mapp.rb +0 -15
- data/vendor/sinatra-maruku/examples/public/stylesheets/application.css +0 -23
- data/vendor/sinatra-maruku/examples/views/index.maruku +0 -32
- data/vendor/sinatra-maruku/examples/views/layout.maruku +0 -9
- data/vendor/sinatra-maruku/lib/sinatra/maruku.rb +0 -25
- data/vendor/sinatra-maruku/sinatra-maruku.gemspec +0 -70
- data/vendor/sinatra-maruku/test/sinatra_maruku_test.rb +0 -91
- data/vendor/sinatra-maruku/test/test_helper.rb +0 -21
- data/vendor/sinatra-maruku/test/views/hello.maruku +0 -1
- data/vendor/sinatra-maruku/test/views/layout2.maruku +0 -2
@@ -1,32 +0,0 @@
|
|
1
|
-
Maruku features
|
2
|
-
===============
|
3
|
-
|
4
|
-
Maruku allows you to write in an easy-to-read-and-write syntax, like this:
|
5
|
-
|
6
|
-
> [This document in Markdown][this_md]
|
7
|
-
|
8
|
-
Then it can be translated to HTML:
|
9
|
-
|
10
|
-
> [This document in HTML][this_html]
|
11
|
-
|
12
|
-
or LaTeX, which is then converted to PDF:
|
13
|
-
|
14
|
-
> [This document in PDF][this_pdf]
|
15
|
-
|
16
|
-
Maruku implements:
|
17
|
-
|
18
|
-
* the original [Markdown syntax][markdown_html]
|
19
|
-
([HTML][markdown_html] or [PDF][markdown_pdf]), translated by Maruku).
|
20
|
-
|
21
|
-
* all the improvements in PHP Markdown Extra.
|
22
|
-
|
23
|
-
* a new [meta-data syntax][meta_data_proposal]
|
24
|
-
|
25
|
-
[markdown_html]: http://maruku.rubyforge.org/markdown_syntax.html
|
26
|
-
[markdown_pdf]: http://maruku.rubyforge.org/markdown_syntax.pdf
|
27
|
-
[this_md]: http://maruku.rubyforge.org/maruku.md
|
28
|
-
[this_html]: http://maruku.rubyforge.org/maruku.html
|
29
|
-
[this_pdf]: http://maruku.rubyforge.org/maruku.pdf
|
30
|
-
[Andrea Censi]: http://www.dis.uniroma1.it/~acensi/
|
31
|
-
|
32
|
-
[meta_data_proposal]: http://maruku.rubyforge.org/proposal.html
|
@@ -1,25 +0,0 @@
|
|
1
|
-
require 'maruku'
|
2
|
-
require 'sinatra/base'
|
3
|
-
|
4
|
-
module Sinatra
|
5
|
-
module Maruku
|
6
|
-
def maruku(template, options={}, locals={})
|
7
|
-
render :maruku, template, options, locals
|
8
|
-
end
|
9
|
-
|
10
|
-
private
|
11
|
-
def render_maruku(template, data, options, locals, &block)
|
12
|
-
maruku_src = render_erb(template, data, options, locals, &block)
|
13
|
-
instance = ::Maruku.new(maruku_src, options)
|
14
|
-
if block_given?
|
15
|
-
# render layout
|
16
|
-
instance.to_html_document
|
17
|
-
else
|
18
|
-
# render template
|
19
|
-
instance.to_html
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
helpers Maruku
|
25
|
-
end
|
@@ -1,70 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
|
3
|
-
Gem::Specification.new do |s|
|
4
|
-
s.name = %q{sinatra-maruku}
|
5
|
-
s.version = "0.10.1"
|
6
|
-
|
7
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
|
-
s.authors = ["Wlodek Bzyl"]
|
9
|
-
s.date = %q{2009-07-26}
|
10
|
-
s.description = %q{}
|
11
|
-
s.email = %q{matwb@univ.gda.pl}
|
12
|
-
s.extra_rdoc_files = [
|
13
|
-
"LICENSE",
|
14
|
-
"README.markdown"
|
15
|
-
]
|
16
|
-
s.files = [
|
17
|
-
".gitignore",
|
18
|
-
"LICENSE",
|
19
|
-
"README.markdown",
|
20
|
-
"Rakefile",
|
21
|
-
"VERSION.yml",
|
22
|
-
"examples/app.rb",
|
23
|
-
"examples/config.ru",
|
24
|
-
"examples/mapp.rb",
|
25
|
-
"examples/public/javascripts/application.js",
|
26
|
-
"examples/public/stylesheets/application.css",
|
27
|
-
"examples/public/stylesheets/print.css",
|
28
|
-
"examples/views/index.maruku",
|
29
|
-
"examples/views/layout.maruku",
|
30
|
-
"lib/sinatra/maruku.rb",
|
31
|
-
"sinatra-maruku.gemspec",
|
32
|
-
"test/sinatra_maruku_test.rb",
|
33
|
-
"test/test_helper.rb",
|
34
|
-
"test/views/hello.maruku",
|
35
|
-
"test/views/layout2.maruku"
|
36
|
-
]
|
37
|
-
s.homepage = %q{http://github.com/wbzyl/sinatra-maruku}
|
38
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
39
|
-
s.require_paths = ["lib"]
|
40
|
-
s.rubygems_version = %q{1.3.5}
|
41
|
-
s.summary = %q{An extension providing Maruku templates for Sinatra applications.}
|
42
|
-
s.test_files = [
|
43
|
-
"test/test_helper.rb",
|
44
|
-
"test/sinatra_maruku_test.rb",
|
45
|
-
"examples/mapp.rb",
|
46
|
-
"examples/app.rb"
|
47
|
-
]
|
48
|
-
|
49
|
-
if s.respond_to? :specification_version then
|
50
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
51
|
-
s.specification_version = 3
|
52
|
-
|
53
|
-
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
54
|
-
s.add_runtime_dependency(%q<sinatra>, [">= 0.10.1"])
|
55
|
-
s.add_runtime_dependency(%q<maruku>, [">= 0.6.0"])
|
56
|
-
s.add_development_dependency(%q<rack>, [">= 1.0.0"])
|
57
|
-
s.add_development_dependency(%q<rack-test>, [">= 0.3.0"])
|
58
|
-
else
|
59
|
-
s.add_dependency(%q<sinatra>, [">= 0.10.1"])
|
60
|
-
s.add_dependency(%q<maruku>, [">= 0.6.0"])
|
61
|
-
s.add_dependency(%q<rack>, [">= 1.0.0"])
|
62
|
-
s.add_dependency(%q<rack-test>, [">= 0.3.0"])
|
63
|
-
end
|
64
|
-
else
|
65
|
-
s.add_dependency(%q<sinatra>, [">= 0.10.1"])
|
66
|
-
s.add_dependency(%q<maruku>, [">= 0.6.0"])
|
67
|
-
s.add_dependency(%q<rack>, [">= 1.0.0"])
|
68
|
-
s.add_dependency(%q<rack-test>, [">= 0.3.0"])
|
69
|
-
end
|
70
|
-
end
|
@@ -1,91 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/test_helper'
|
2
|
-
|
3
|
-
class SinatraMarukuTest < Test::Unit::TestCase
|
4
|
-
include Rack::Test::Methods
|
5
|
-
|
6
|
-
def maruku_app(&block)
|
7
|
-
mock_app {
|
8
|
-
set :views, File.dirname(__FILE__) + '/views'
|
9
|
-
helpers Sinatra::Maruku
|
10
|
-
set :show_exceptions, false
|
11
|
-
get '/', &block
|
12
|
-
}
|
13
|
-
get '/'
|
14
|
-
end
|
15
|
-
|
16
|
-
def test_renders_inline_strings
|
17
|
-
maruku_app { maruku 'hello world' }
|
18
|
-
assert last_response.ok?
|
19
|
-
assert_equal "<p>hello world</p>", last_response.body
|
20
|
-
end
|
21
|
-
|
22
|
-
def test_renders_inline_erb_string
|
23
|
-
maruku_app { maruku '<%= 1 + 1 %>' }
|
24
|
-
assert last_response.ok?
|
25
|
-
assert_equal "<p>2</p>", last_response.body
|
26
|
-
end
|
27
|
-
|
28
|
-
def test_renders_files_in_views_path
|
29
|
-
maruku_app { maruku :hello }
|
30
|
-
assert last_response.ok?
|
31
|
-
assert_equal "<h1 id='hello_world'>hello world</h1>", last_response.body
|
32
|
-
end
|
33
|
-
|
34
|
-
def test_takes_locals_option
|
35
|
-
maruku_app {
|
36
|
-
locals = {:foo => 'Bar'}
|
37
|
-
maruku "<%= foo %>", :locals => locals
|
38
|
-
}
|
39
|
-
assert last_response.ok?
|
40
|
-
assert_equal "<p>Bar</p>", last_response.body
|
41
|
-
end
|
42
|
-
|
43
|
-
def test_renders_with_inline_layouts
|
44
|
-
maruku_app {
|
45
|
-
maruku 'Sparta', :layout => 'THIS. IS. <%= yield.upcase %>'
|
46
|
-
}
|
47
|
-
assert last_response.ok?
|
48
|
-
assert_equal "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!DOCTYPE html PUBLIC\n \"-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN\"\n \"http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd\">\n<html xmlns:svg='http://www.w3.org/2000/svg' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>\n<head><meta content='application/xhtml+xml;charset=utf-8' http-equiv='Content-type' /><title></title></head>\n<body>\n<p>THIS. IS. <P>SPARTA</P></p>\n</body></html>", last_response.body
|
49
|
-
end
|
50
|
-
|
51
|
-
def test_renders_with_file_layouts
|
52
|
-
maruku_app {
|
53
|
-
maruku 'hello world', :layout => :layout2
|
54
|
-
}
|
55
|
-
assert last_response.ok?
|
56
|
-
assert_equal "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!DOCTYPE html PUBLIC\n \"-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN\"\n \"http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd\">\n<html xmlns:svg='http://www.w3.org/2000/svg' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>\n<head><meta content='application/xhtml+xml;charset=utf-8' http-equiv='Content-type' /><title></title></head>\n<body>\n<p>erb layout <p>hello world</p></p>\n</body></html>", last_response.body
|
57
|
-
end
|
58
|
-
|
59
|
-
def test_renders_erb_with_blocks
|
60
|
-
mock_app {
|
61
|
-
set :views, File.dirname(__FILE__) + '/views'
|
62
|
-
helpers Sinatra::Maruku
|
63
|
-
|
64
|
-
def container
|
65
|
-
yield
|
66
|
-
end
|
67
|
-
def is
|
68
|
-
"THIS. IS. SPARTA!"
|
69
|
-
end
|
70
|
-
|
71
|
-
get '/' do
|
72
|
-
maruku '<% container do %> <%= is %> <% end %>'
|
73
|
-
end
|
74
|
-
}
|
75
|
-
|
76
|
-
get '/'
|
77
|
-
assert last_response.ok?
|
78
|
-
assert_equal "<p>THIS. IS. SPARTA!</p>", last_response.body
|
79
|
-
end
|
80
|
-
|
81
|
-
def test_raises_error_if_template_not_found
|
82
|
-
mock_app {
|
83
|
-
set :views, File.dirname(__FILE__) + '/views'
|
84
|
-
helpers Sinatra::Maruku
|
85
|
-
set :show_exceptions, false
|
86
|
-
|
87
|
-
get('/') { maruku :no_such_template }
|
88
|
-
}
|
89
|
-
assert_raise(Errno::ENOENT) { get('/') }
|
90
|
-
end
|
91
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'test/unit'
|
3
|
-
require 'rack/test'
|
4
|
-
|
5
|
-
path = File.expand_path("../lib" + File.dirname(__FILE__))
|
6
|
-
$:.unshift(path) unless $:.include?(path)
|
7
|
-
|
8
|
-
require 'sinatra/maruku'
|
9
|
-
|
10
|
-
class Test::Unit::TestCase
|
11
|
-
include Rack::Test::Methods
|
12
|
-
|
13
|
-
attr_reader :app
|
14
|
-
|
15
|
-
# Sets up a Sinatra::Base subclass defined with the block
|
16
|
-
# given. Used in setup or individual spec methods to establish
|
17
|
-
# the application.
|
18
|
-
def mock_app(base=Sinatra::Base, &block)
|
19
|
-
@app = Sinatra.new(base, &block)
|
20
|
-
end
|
21
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
# hello world
|