make middleman not be so outright jruby hostile
This commit is contained in:
parent
1a15147f67
commit
08a9f45164
4 changed files with 52 additions and 41 deletions
58
Rakefile
58
Rakefile
|
@ -14,39 +14,41 @@ require 'rake/clean'
|
|||
|
||||
task :test => :cucumber
|
||||
|
||||
# Bring in Rocco tasks
|
||||
require 'rocco/tasks'
|
||||
Rocco::make 'docs/'
|
||||
# rocco depends on rdiscount, which makes me sad.
|
||||
unless defined?(JRUBY_VERSION)
|
||||
# Bring in Rocco tasks
|
||||
require 'rocco/tasks'
|
||||
Rocco::make 'docs/'
|
||||
|
||||
desc 'Build rocco docs'
|
||||
task :docs => :rocco
|
||||
directory 'docs/'
|
||||
desc 'Build rocco docs'
|
||||
task :docs => :rocco
|
||||
directory 'docs/'
|
||||
|
||||
# Make index.html a copy of rocco.html
|
||||
file 'docs/index.html' => 'docs/middleman.html' do |f|
|
||||
cp 'docs/middleman.html', 'docs/index.html', :preserve => true
|
||||
end
|
||||
task :docs => 'docs/index.html'
|
||||
CLEAN.include 'docs/index.html'
|
||||
|
||||
# Make index.html a copy of rocco.html
|
||||
file 'docs/index.html' => 'docs/middleman.html' do |f|
|
||||
cp 'docs/middleman.html', 'docs/index.html', :preserve => true
|
||||
end
|
||||
task :docs => 'docs/index.html'
|
||||
CLEAN.include 'docs/index.html'
|
||||
|
||||
desc 'Update gh-pages branch'
|
||||
task :pages => ['docs/.git', :docs] do
|
||||
rev = `git rev-parse --short HEAD`.strip
|
||||
Dir.chdir 'docs' do
|
||||
sh "git add *.html"
|
||||
sh "git commit -m 'rebuild pages from #{rev}'" do |ok,res|
|
||||
if ok
|
||||
verbose { puts "gh-pages updated" }
|
||||
sh "git push -q o HEAD:gh-pages"
|
||||
desc 'Update gh-pages branch'
|
||||
task :pages => ['docs/.git', :docs] do
|
||||
rev = `git rev-parse --short HEAD`.strip
|
||||
Dir.chdir 'docs' do
|
||||
sh "git add *.html"
|
||||
sh "git commit -m 'rebuild pages from #{rev}'" do |ok,res|
|
||||
if ok
|
||||
verbose { puts "gh-pages updated" }
|
||||
sh "git push -q o HEAD:gh-pages"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Update the pages/ directory clone
|
||||
file 'docs/.git' => ['docs/', '.git/refs/heads/gh-pages'] do |f|
|
||||
sh "cd docs && git init -q && git remote add o ../.git" if !File.exist?(f.name)
|
||||
sh "cd docs && git fetch -q o && git reset -q --hard o/gh-pages && touch ."
|
||||
# Update the pages/ directory clone
|
||||
file 'docs/.git' => ['docs/', '.git/refs/heads/gh-pages'] do |f|
|
||||
sh "cd docs && git init -q && git remote add o ../.git" if !File.exist?(f.name)
|
||||
sh "cd docs && git fetch -q o && git reset -q --hard o/gh-pages && touch ."
|
||||
end
|
||||
CLOBBER.include 'docs/.git'
|
||||
end
|
||||
CLOBBER.include 'docs/.git'
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
# Non-blocking site rebuilding
|
||||
trap("TSTP") do
|
||||
trap("TSTP") do
|
||||
fork do
|
||||
require "open3"
|
||||
first_run = true
|
||||
|
@ -38,7 +38,7 @@ OptionParser.new { |opts|
|
|||
opts.on("--debug", "Debug mode") {
|
||||
::Middleman::Server.set :logging, true
|
||||
}
|
||||
|
||||
|
||||
opts.parse! ARGV
|
||||
}
|
||||
|
||||
|
@ -54,9 +54,16 @@ end
|
|||
app = Middleman::Server.new
|
||||
|
||||
require 'rubygems'
|
||||
require 'thin'
|
||||
Thin::Logging.silent = true
|
||||
|
||||
Rack::Handler::Thin.run app, options do |inst|
|
||||
unless defined?(JRUBY_VERSION)
|
||||
require 'thin'
|
||||
handler = Rack::Handler::Thin
|
||||
else
|
||||
require 'kirk'
|
||||
require 'rack/handler/kirk'
|
||||
handler = Rack::Handler::Kirk
|
||||
end
|
||||
|
||||
handler.run app, options do |inst|
|
||||
puts "== The Middleman is standing watch on port #{options[:Port]}"
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
module Middleman
|
||||
VERSION = "1.1.0.beta.4"
|
||||
VERSION = "1.1.0.beta.4.1"
|
||||
end
|
||||
|
|
|
@ -10,16 +10,17 @@ Gem::Specification.new do |s|
|
|||
s.email = ["tdreyno@gmail.com"]
|
||||
s.homepage = "http://wiki.github.com/tdreyno/middleman"
|
||||
s.summary = "A static site generator utilizing Haml, Sass and providing YUI compression and cache busting"
|
||||
|
||||
|
||||
s.rubyforge_project = "middleman"
|
||||
|
||||
|
||||
s.files = `git ls-files`.split("\n")
|
||||
s.test_files = `git ls-files -- {fixtures,features}/*`.split("\n")
|
||||
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
||||
s.require_paths = ["lib"]
|
||||
|
||||
|
||||
s.add_runtime_dependency("rack", ["~> 1.0"])
|
||||
s.add_runtime_dependency("thin", ["~> 1.2.0"])
|
||||
s.add_runtime_dependency("thin", ["~> 1.2.0"]) unless defined?(JRUBY_VERSION)
|
||||
s.add_runtime_dependency("kirk", ["~> 0.1.8"]) if defined?(JRUBY_VERSION)
|
||||
s.add_runtime_dependency("shotgun", ["~> 0.8.0"])
|
||||
s.add_runtime_dependency("thor", ["~> 0.14.0"])
|
||||
s.add_runtime_dependency("tilt", ["~> 1.2.0"])
|
||||
|
@ -31,7 +32,8 @@ Gem::Specification.new do |s|
|
|||
s.add_runtime_dependency("haml", [">= 3.1.0.alpha.147"])
|
||||
s.add_runtime_dependency("sass", [">= 3.1.0.alpha.218"])
|
||||
s.add_runtime_dependency("compass", ["0.11.beta.2"])
|
||||
s.add_runtime_dependency("oily_png", ["~> 0.3.0"])
|
||||
s.add_runtime_dependency("chunky_png", ["~> 0.12.0"])
|
||||
s.add_runtime_dependency("oily_png", ["~> 0.3.0"]) unless defined?(JRUBY_VERSION)
|
||||
s.add_runtime_dependency("json_pure", ["~> 1.4.0"])
|
||||
s.add_runtime_dependency("smusher", ["~> 0.4.5"])
|
||||
s.add_runtime_dependency("compass-slickmap", ["~> 0.4.0"])
|
||||
|
@ -39,6 +41,6 @@ Gem::Specification.new do |s|
|
|||
s.add_runtime_dependency("less", ["~> 1.2.0"])
|
||||
s.add_development_dependency("cucumber", ["~> 0.10.0"])
|
||||
s.add_development_dependency("rspec", [">= 0"])
|
||||
s.add_development_dependency("rocco", [">= 0"])
|
||||
s.add_development_dependency("rocco", [">= 0"]) unless defined?(JRUBY_VERSION)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue