tdreyno-middleman 0.2.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/.document +5 -0
- data/.gitignore +6 -0
- data/.gitmodules +9 -0
- data/LICENSE +20 -0
- data/README.rdoc +7 -0
- data/Rakefile +56 -0
- data/VERSION +1 -0
- data/bin/mm-build +69 -0
- data/bin/mm-init +32 -0
- data/bin/mm-server +7 -0
- data/lib/middleman.rb +71 -0
- data/lib/middleman/template/views/index.haml +1 -0
- data/lib/middleman/template/views/layout.haml +6 -0
- data/lib/middleman/template/views/stylesheets/site.sass +1 -0
- data/middleman.gemspec +84 -0
- data/spec/builder_spec.rb +57 -0
- data/spec/fixtures/sample/public/static.html +1 -0
- data/spec/fixtures/sample/public/stylesheets/static.css +2 -0
- data/spec/fixtures/sample/views/_partial.haml +1 -0
- data/spec/fixtures/sample/views/index.haml +1 -0
- data/spec/fixtures/sample/views/layout.haml +6 -0
- data/spec/fixtures/sample/views/markaby.mab +5 -0
- data/spec/fixtures/sample/views/maruku.maruku +1 -0
- data/spec/fixtures/sample/views/services/index.haml +1 -0
- data/spec/fixtures/sample/views/stylesheets/site.sass +1 -0
- data/spec/generator_spec.rb +34 -0
- data/spec/spec_helper.rb +9 -0
- metadata +144 -0
data/.document
ADDED
data/.gitignore
ADDED
data/.gitmodules
ADDED
@@ -0,0 +1,9 @@
|
|
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
|
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2009 Thomas Reynolds
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'jeweler'
|
6
|
+
Jeweler::Tasks.new do |gem|
|
7
|
+
gem.name = "middleman"
|
8
|
+
gem.summary = %Q{A static site generator utilizing Haml and Sass}
|
9
|
+
gem.email = "tdreyno@gmail.com"
|
10
|
+
gem.homepage = "http://github.com/tdreyno/middleman"
|
11
|
+
gem.authors = ["Thomas Reynolds"]
|
12
|
+
gem.rubyforge_project = "middleman"
|
13
|
+
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
14
|
+
gem.executables = %w(mm-init mm-build mm-server)
|
15
|
+
gem.add_dependency("templater")
|
16
|
+
gem.add_dependency("sinatra")
|
17
|
+
gem.add_dependency("markaby")
|
18
|
+
gem.add_dependency("maruku")
|
19
|
+
gem.add_dependency("haml", ">=2.1.0")
|
20
|
+
gem.add_dependency("chriseppstein-compass")
|
21
|
+
end
|
22
|
+
|
23
|
+
Jeweler::RubyforgeTasks.new
|
24
|
+
rescue LoadError
|
25
|
+
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
|
26
|
+
end
|
27
|
+
|
28
|
+
require 'spec/rake/spectask'
|
29
|
+
Spec::Rake::SpecTask.new(:spec) do |spec|
|
30
|
+
spec.libs << 'lib' << 'spec'
|
31
|
+
spec.spec_files = FileList['spec/**/*_spec.rb']
|
32
|
+
end
|
33
|
+
|
34
|
+
Spec::Rake::SpecTask.new(:rcov) do |spec|
|
35
|
+
spec.libs << 'lib' << 'spec'
|
36
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
37
|
+
spec.rcov = true
|
38
|
+
end
|
39
|
+
|
40
|
+
|
41
|
+
task :default => :spec
|
42
|
+
|
43
|
+
require 'rake/rdoctask'
|
44
|
+
Rake::RDocTask.new do |rdoc|
|
45
|
+
if File.exist?('VERSION.yml')
|
46
|
+
config = YAML.load(File.read('VERSION.yml'))
|
47
|
+
version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
|
48
|
+
else
|
49
|
+
version = ""
|
50
|
+
end
|
51
|
+
|
52
|
+
rdoc.rdoc_dir = 'rdoc'
|
53
|
+
rdoc.title = "middleman #{version}"
|
54
|
+
rdoc.rdoc_files.include('README*')
|
55
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
56
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.2.1
|
data/bin/mm-build
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# Require app
|
4
|
+
require 'rubygems'
|
5
|
+
require 'templater'
|
6
|
+
require File.join(File.dirname(__FILE__), '..', 'lib', 'middleman')
|
7
|
+
require File.join(File.dirname(__FILE__), '..', 'vendor', 'rack-test', 'lib', 'rack', 'test')
|
8
|
+
|
9
|
+
module Generators
|
10
|
+
extend Templater::Manifold
|
11
|
+
desc "Build a staticmatic site"
|
12
|
+
|
13
|
+
class Builder < Templater::Generator
|
14
|
+
# Define source and desintation
|
15
|
+
def self.source_root; Dir.pwd; end
|
16
|
+
def destination_root; File.join(Dir.pwd, 'build'); end
|
17
|
+
|
18
|
+
# Override template to ask staticmatic for the correct extension to output
|
19
|
+
def self.template(name, *args, &block)
|
20
|
+
return if args.first.include?('layout')
|
21
|
+
return if File.basename(args.first)[0,1] == '_'
|
22
|
+
|
23
|
+
if (args[0] === args[1])
|
24
|
+
newext = case File.extname(args.first)
|
25
|
+
when '.haml', '.mab', '.maruku'
|
26
|
+
'.html'
|
27
|
+
when '.sass'
|
28
|
+
'.css'
|
29
|
+
else
|
30
|
+
File.extname(args.first)
|
31
|
+
end
|
32
|
+
args[1] = args[0].gsub(File.extname(args.first), newext).gsub('views/', '')
|
33
|
+
end
|
34
|
+
|
35
|
+
super(name, *args, &block)
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.file(name, *args, &block)
|
39
|
+
puts args.inspect
|
40
|
+
args[1] = args[0].gsub('views/', '') if (args[0] === args[1])
|
41
|
+
super(name, *args, &block)
|
42
|
+
end
|
43
|
+
|
44
|
+
public_files_glob = File.join(source_root, "public", '**/*')
|
45
|
+
Dir[public_files_glob].each do |action|
|
46
|
+
next if File.directory?(action)
|
47
|
+
action = action.sub("#{source_root}/", '')
|
48
|
+
file(action.downcase.gsub(/[^a-z0-9]+/, '_').to_sym, action, action.gsub('public/', ''))
|
49
|
+
end
|
50
|
+
|
51
|
+
glob! "views", %w(haml sass mab maruku)
|
52
|
+
end
|
53
|
+
|
54
|
+
add :build, Builder
|
55
|
+
end
|
56
|
+
|
57
|
+
Middleman.set :root, Dir.pwd
|
58
|
+
|
59
|
+
# Monkey-patch to use a dynamic renderer
|
60
|
+
class Templater::Actions::Template
|
61
|
+
def render
|
62
|
+
request_path = destination.gsub(File.join(Dir.pwd, 'build'), "")
|
63
|
+
browser = Rack::Test::Session.new(Rack::MockSession.new(Middleman))
|
64
|
+
browser.get(request_path)
|
65
|
+
browser.last_response.body
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
Generators.run_cli(Dir.pwd, 'mm-build', 1, %w(build --force).concat(ARGV))
|
data/bin/mm-init
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'templater'
|
5
|
+
|
6
|
+
module Generators
|
7
|
+
extend Templater::Manifold
|
8
|
+
desc "Generator for streamlining staticmatic"
|
9
|
+
|
10
|
+
class NewSite < Templater::Generator
|
11
|
+
desc "Creates a new staticmatic scaffold."
|
12
|
+
first_argument :location, :required => true, :desc => "Project location"
|
13
|
+
|
14
|
+
def destination_root
|
15
|
+
File.expand_path(location)
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.source_root
|
19
|
+
File.join(File.dirname(__FILE__), '..', 'lib', 'middleman', 'template')
|
20
|
+
end
|
21
|
+
|
22
|
+
glob! :views
|
23
|
+
glob! :public
|
24
|
+
empty_directory :stylesheets, "public/stylesheets"
|
25
|
+
empty_directory :javascripts, "public/javascripts"
|
26
|
+
empty_directory :images, "public/images"
|
27
|
+
end
|
28
|
+
|
29
|
+
add :setup, NewSite
|
30
|
+
end
|
31
|
+
|
32
|
+
Generators.run_cli(Dir.pwd, 'mm-init', 1, %w(setup).concat(ARGV))
|
data/bin/mm-server
ADDED
data/lib/middleman.rb
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'haml'
|
3
|
+
require 'compass' #must be loaded before sinatra
|
4
|
+
require 'sinatra/base'
|
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
|
+
class Middleman < Sinatra::Base
|
13
|
+
set :app_file, __FILE__
|
14
|
+
helpers Sinatra::Markaby
|
15
|
+
helpers Sinatra::Maruku
|
16
|
+
|
17
|
+
def self.run!(options={}, &block)
|
18
|
+
set options
|
19
|
+
handler = detect_rack_handler
|
20
|
+
handler_name = handler.name.gsub(/.*::/, '')
|
21
|
+
puts "== The Middleman is standing watch on port #{port}"
|
22
|
+
handler.run self, :Host => host, :Port => port do |server|
|
23
|
+
trap(:INT) do
|
24
|
+
## Use thins' hard #stop! if available, otherwise just #stop
|
25
|
+
server.respond_to?(:stop!) ? server.stop! : server.stop
|
26
|
+
puts "\n== The Middleman has ended his patrol"
|
27
|
+
end
|
28
|
+
|
29
|
+
if block_given?
|
30
|
+
block.call
|
31
|
+
## Use thins' hard #stop! if available, otherwise just #stop
|
32
|
+
server.respond_to?(:stop!) ? server.stop! : server.stop
|
33
|
+
end
|
34
|
+
end
|
35
|
+
rescue Errno::EADDRINUSE => e
|
36
|
+
puts "== The Middleman is already standing watch on port #{port}!"
|
37
|
+
end
|
38
|
+
|
39
|
+
configure do
|
40
|
+
Compass.configuration do |config|
|
41
|
+
config.project_path = Dir.pwd
|
42
|
+
config.sass_dir = File.join(File.expand_path(self.views), "stylesheets")
|
43
|
+
config.output_style = :nested
|
44
|
+
config.images_dir = File.join(File.expand_path(self.public), "images")
|
45
|
+
config.http_images_path = "/images/"
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
get /(.*)/ do |path|
|
50
|
+
path << "index.html" if path.match(%r{/$})
|
51
|
+
path.gsub!(%r{^/}, '')
|
52
|
+
|
53
|
+
template = path.gsub(File.extname(path), '').to_sym
|
54
|
+
if path.match /.html$/
|
55
|
+
if File.exists? File.join(options.views, "#{template}.haml")
|
56
|
+
haml(template)
|
57
|
+
elsif File.exists? File.join(options.views, "#{template}.maruku")
|
58
|
+
maruku(template)
|
59
|
+
elsif File.exists? File.join(options.views, "#{template}.mab")
|
60
|
+
markaby(template)
|
61
|
+
else
|
62
|
+
pass
|
63
|
+
end
|
64
|
+
elsif path.match /.css$/
|
65
|
+
content_type 'text/css', :charset => 'utf-8'
|
66
|
+
sass(template, Compass.sass_engine_options)
|
67
|
+
else
|
68
|
+
pass
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
%h1 The Middleman is watching.
|
@@ -0,0 +1 @@
|
|
1
|
+
@import compass/reset.sass
|
data/middleman.gemspec
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = %q{middleman}
|
5
|
+
s.version = "0.2.1"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["Thomas Reynolds"]
|
9
|
+
s.date = %q{2009-07-28}
|
10
|
+
s.email = %q{tdreyno@gmail.com}
|
11
|
+
s.executables = ["mm-init", "mm-build", "mm-server"]
|
12
|
+
s.extra_rdoc_files = [
|
13
|
+
"LICENSE",
|
14
|
+
"README.rdoc"
|
15
|
+
]
|
16
|
+
s.files = [
|
17
|
+
".document",
|
18
|
+
".gitignore",
|
19
|
+
".gitmodules",
|
20
|
+
"LICENSE",
|
21
|
+
"README.rdoc",
|
22
|
+
"Rakefile",
|
23
|
+
"VERSION",
|
24
|
+
"bin/mm-build",
|
25
|
+
"bin/mm-init",
|
26
|
+
"bin/mm-server",
|
27
|
+
"lib/middleman.rb",
|
28
|
+
"lib/middleman/template/views/index.haml",
|
29
|
+
"lib/middleman/template/views/layout.haml",
|
30
|
+
"lib/middleman/template/views/stylesheets/site.sass",
|
31
|
+
"middleman.gemspec",
|
32
|
+
"spec/builder_spec.rb",
|
33
|
+
"spec/fixtures/sample/public/static.html",
|
34
|
+
"spec/fixtures/sample/public/stylesheets/static.css",
|
35
|
+
"spec/fixtures/sample/views/_partial.haml",
|
36
|
+
"spec/fixtures/sample/views/index.haml",
|
37
|
+
"spec/fixtures/sample/views/layout.haml",
|
38
|
+
"spec/fixtures/sample/views/markaby.mab",
|
39
|
+
"spec/fixtures/sample/views/maruku.maruku",
|
40
|
+
"spec/fixtures/sample/views/services/index.haml",
|
41
|
+
"spec/fixtures/sample/views/stylesheets/site.sass",
|
42
|
+
"spec/generator_spec.rb",
|
43
|
+
"spec/spec_helper.rb"
|
44
|
+
]
|
45
|
+
s.homepage = %q{http://github.com/tdreyno/middleman}
|
46
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
47
|
+
s.require_paths = ["lib"]
|
48
|
+
s.rubyforge_project = %q{middleman}
|
49
|
+
s.rubygems_version = %q{1.3.5}
|
50
|
+
s.summary = %q{A static site generator utilizing Haml and Sass}
|
51
|
+
s.test_files = [
|
52
|
+
"spec/builder_spec.rb",
|
53
|
+
"spec/generator_spec.rb",
|
54
|
+
"spec/spec_helper.rb"
|
55
|
+
]
|
56
|
+
|
57
|
+
if s.respond_to? :specification_version then
|
58
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
59
|
+
s.specification_version = 3
|
60
|
+
|
61
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
62
|
+
s.add_runtime_dependency(%q<templater>, [">= 0"])
|
63
|
+
s.add_runtime_dependency(%q<sinatra>, [">= 0"])
|
64
|
+
s.add_runtime_dependency(%q<markaby>, [">= 0"])
|
65
|
+
s.add_runtime_dependency(%q<maruku>, [">= 0"])
|
66
|
+
s.add_runtime_dependency(%q<haml>, [">= 2.1.0"])
|
67
|
+
s.add_runtime_dependency(%q<chriseppstein-compass>, [">= 0"])
|
68
|
+
else
|
69
|
+
s.add_dependency(%q<templater>, [">= 0"])
|
70
|
+
s.add_dependency(%q<sinatra>, [">= 0"])
|
71
|
+
s.add_dependency(%q<markaby>, [">= 0"])
|
72
|
+
s.add_dependency(%q<maruku>, [">= 0"])
|
73
|
+
s.add_dependency(%q<haml>, [">= 2.1.0"])
|
74
|
+
s.add_dependency(%q<chriseppstein-compass>, [">= 0"])
|
75
|
+
end
|
76
|
+
else
|
77
|
+
s.add_dependency(%q<templater>, [">= 0"])
|
78
|
+
s.add_dependency(%q<sinatra>, [">= 0"])
|
79
|
+
s.add_dependency(%q<markaby>, [">= 0"])
|
80
|
+
s.add_dependency(%q<maruku>, [">= 0"])
|
81
|
+
s.add_dependency(%q<haml>, [">= 2.1.0"])
|
82
|
+
s.add_dependency(%q<chriseppstein-compass>, [">= 0"])
|
83
|
+
end
|
84
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
3
|
+
describe "Builder" do
|
4
|
+
def project_file(*parts)
|
5
|
+
File.expand_path(File.join(File.dirname(__FILE__), "..", *parts))
|
6
|
+
end
|
7
|
+
|
8
|
+
before :all do
|
9
|
+
@root_dir = project_file("spec", "fixtures", "sample")
|
10
|
+
end
|
11
|
+
|
12
|
+
before :each do
|
13
|
+
build_cmd = project_file("bin", "mm-build")
|
14
|
+
`cd #{@root_dir} && #{build_cmd}`
|
15
|
+
end
|
16
|
+
|
17
|
+
after :each do
|
18
|
+
FileUtils.rm_rf(File.join(@root_dir, "build"))
|
19
|
+
end
|
20
|
+
|
21
|
+
it "should build markaby files" do
|
22
|
+
File.exists?("#{@root_dir}/build/markaby.html").should be_true
|
23
|
+
File.read("#{@root_dir}/build/markaby.html").should include("<title>Hi Markaby</title>")
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should build haml files" do
|
27
|
+
File.exists?("#{@root_dir}/build/index.html").should be_true
|
28
|
+
File.read("#{@root_dir}/build/index.html").should include("<h1>Welcome</h1>")
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should build maruku files" do
|
32
|
+
File.exists?("#{@root_dir}/build/maruku.html").should be_true
|
33
|
+
File.read("#{@root_dir}/build/maruku.html").should include("<h1 class='header' id='hello_maruku'>Hello Maruku</h1>")
|
34
|
+
end
|
35
|
+
|
36
|
+
it "should build static files" do
|
37
|
+
File.exists?("#{@root_dir}/build/static.html").should be_true
|
38
|
+
File.read("#{@root_dir}/build/static.html").should include("Static, no code!")
|
39
|
+
end
|
40
|
+
|
41
|
+
it "should build subdirectory files" do
|
42
|
+
File.exists?("#{@root_dir}/build/services/index.html").should be_true
|
43
|
+
end
|
44
|
+
|
45
|
+
it "should build sass files" do
|
46
|
+
File.exists?("#{@root_dir}/build/stylesheets/site.css").should be_true
|
47
|
+
File.read("#{@root_dir}/build/stylesheets/site.css").should include("html, body, div, span, applet, object, iframe")
|
48
|
+
end
|
49
|
+
|
50
|
+
it "should build static css files" do
|
51
|
+
File.exists?("#{@root_dir}/build/stylesheets/static.css").should be_true
|
52
|
+
end
|
53
|
+
|
54
|
+
it "should not build partial files" do
|
55
|
+
File.exists?("#{@root_dir}/build/_partial.html").should be_false
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
Static, no code!
|
@@ -0,0 +1 @@
|
|
1
|
+
%p Test
|
@@ -0,0 +1 @@
|
|
1
|
+
%h1 Welcome
|
@@ -0,0 +1 @@
|
|
1
|
+
# Hello Maruku {.header}
|
@@ -0,0 +1 @@
|
|
1
|
+
%h2 Services
|
@@ -0,0 +1 @@
|
|
1
|
+
@import compass/reset.sass
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
3
|
+
describe "Generator" do
|
4
|
+
def project_file(*parts)
|
5
|
+
File.expand_path(File.join(File.dirname(__FILE__), "..", *parts))
|
6
|
+
end
|
7
|
+
|
8
|
+
before :all do
|
9
|
+
@root_dir = project_file("spec", "fixtures", "generator-test")
|
10
|
+
end
|
11
|
+
|
12
|
+
before :each do
|
13
|
+
init_cmd = project_file("bin", "mm-init")
|
14
|
+
`cd #{File.dirname(@root_dir)} && #{init_cmd} #{File.basename(@root_dir)}`
|
15
|
+
end
|
16
|
+
|
17
|
+
after :each do
|
18
|
+
FileUtils.rm_rf(@root_dir)
|
19
|
+
end
|
20
|
+
|
21
|
+
it "should copy template files" do
|
22
|
+
template_dir = project_file("lib", "template", "**/*")
|
23
|
+
Dir[template_dir].each do |f|
|
24
|
+
next if File.directory?(f)
|
25
|
+
File.exists?("#{@root_dir}/#{f.split('template/')[1]}").should be_true
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
it "should create empty directories" do
|
30
|
+
%w(views/stylesheets public/stylesheets public/javascripts public/images).each do |d|
|
31
|
+
File.exists?("#{@root_dir}/#{d}").should be_true
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,144 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: tdreyno-middleman
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Thomas Reynolds
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-07-28 00:00:00 -07:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: templater
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: "0"
|
24
|
+
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: sinatra
|
27
|
+
type: :runtime
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: "0"
|
34
|
+
version:
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: markaby
|
37
|
+
type: :runtime
|
38
|
+
version_requirement:
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: "0"
|
44
|
+
version:
|
45
|
+
- !ruby/object:Gem::Dependency
|
46
|
+
name: maruku
|
47
|
+
type: :runtime
|
48
|
+
version_requirement:
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: "0"
|
54
|
+
version:
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: haml
|
57
|
+
type: :runtime
|
58
|
+
version_requirement:
|
59
|
+
version_requirements: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: 2.1.0
|
64
|
+
version:
|
65
|
+
- !ruby/object:Gem::Dependency
|
66
|
+
name: chriseppstein-compass
|
67
|
+
type: :runtime
|
68
|
+
version_requirement:
|
69
|
+
version_requirements: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - ">="
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: "0"
|
74
|
+
version:
|
75
|
+
description:
|
76
|
+
email: tdreyno@gmail.com
|
77
|
+
executables:
|
78
|
+
- mm-init
|
79
|
+
- mm-build
|
80
|
+
- mm-server
|
81
|
+
extensions: []
|
82
|
+
|
83
|
+
extra_rdoc_files:
|
84
|
+
- LICENSE
|
85
|
+
- README.rdoc
|
86
|
+
files:
|
87
|
+
- .document
|
88
|
+
- .gitignore
|
89
|
+
- .gitmodules
|
90
|
+
- LICENSE
|
91
|
+
- README.rdoc
|
92
|
+
- Rakefile
|
93
|
+
- VERSION
|
94
|
+
- bin/mm-build
|
95
|
+
- bin/mm-init
|
96
|
+
- bin/mm-server
|
97
|
+
- lib/middleman.rb
|
98
|
+
- lib/middleman/template/views/index.haml
|
99
|
+
- lib/middleman/template/views/layout.haml
|
100
|
+
- lib/middleman/template/views/stylesheets/site.sass
|
101
|
+
- middleman.gemspec
|
102
|
+
- spec/builder_spec.rb
|
103
|
+
- spec/fixtures/sample/public/static.html
|
104
|
+
- spec/fixtures/sample/public/stylesheets/static.css
|
105
|
+
- spec/fixtures/sample/views/_partial.haml
|
106
|
+
- spec/fixtures/sample/views/index.haml
|
107
|
+
- spec/fixtures/sample/views/layout.haml
|
108
|
+
- spec/fixtures/sample/views/markaby.mab
|
109
|
+
- spec/fixtures/sample/views/maruku.maruku
|
110
|
+
- spec/fixtures/sample/views/services/index.haml
|
111
|
+
- spec/fixtures/sample/views/stylesheets/site.sass
|
112
|
+
- spec/generator_spec.rb
|
113
|
+
- spec/spec_helper.rb
|
114
|
+
has_rdoc: false
|
115
|
+
homepage: http://github.com/tdreyno/middleman
|
116
|
+
licenses:
|
117
|
+
post_install_message:
|
118
|
+
rdoc_options:
|
119
|
+
- --charset=UTF-8
|
120
|
+
require_paths:
|
121
|
+
- lib
|
122
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
123
|
+
requirements:
|
124
|
+
- - ">="
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
version: "0"
|
127
|
+
version:
|
128
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - ">="
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: "0"
|
133
|
+
version:
|
134
|
+
requirements: []
|
135
|
+
|
136
|
+
rubyforge_project: middleman
|
137
|
+
rubygems_version: 1.3.5
|
138
|
+
signing_key:
|
139
|
+
specification_version: 3
|
140
|
+
summary: A static site generator utilizing Haml and Sass
|
141
|
+
test_files:
|
142
|
+
- spec/builder_spec.rb
|
143
|
+
- spec/generator_spec.rb
|
144
|
+
- spec/spec_helper.rb
|