Removed Frank for GHPages generation. Now using Rocco and a Thor task to build it

This commit is contained in:
Davis W. Frank
2012-05-27 13:16:20 -07:00
parent b6f96bc121
commit 7bbcf51d45
4 changed files with 29 additions and 39 deletions

View File

@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
s.files = Dir.glob("./lib/**/*") + Dir.glob("./lib/jasmine-core/spec/**/*.js") s.files = Dir.glob("./lib/**/*") + Dir.glob("./lib/jasmine-core/spec/**/*.js")
s.require_paths = ["lib"] s.require_paths = ["lib"]
s.add_development_dependency "json_pure", ">= 1.4.3" s.add_development_dependency "json_pure", ">= 1.4.3"
s.add_development_dependency "frank" s.add_development_dependency "tilt"
s.add_development_dependency "sass" s.add_development_dependency "sass"
s.add_development_dependency "compass" s.add_development_dependency "compass"
s.add_development_dependency "ragaskar-jsdoc_helper" s.add_development_dependency "ragaskar-jsdoc_helper"
@@ -26,4 +26,6 @@ Gem::Specification.new do |s|
s.add_development_dependency "awesome_print" s.add_development_dependency "awesome_print"
s.add_development_dependency "thor" s.add_development_dependency "thor"
s.add_development_dependency "nokogiri" s.add_development_dependency "nokogiri"
s.add_development_dependency "rocco"
s.add_development_dependency "rdiscount"
end end

2
pages

Submodule pages updated: b928db73fc...c852d33084

View File

@@ -36,34 +36,25 @@ describe "Build Github Pages task" do
@output.should match(/Building Github Pages/) @output.should match(/Building Github Pages/)
end end
it "should tell the user the pages are built" do it "should copy the latest jasmine files to the pages dir" do
@output.should match(/Congratulations, project dumped to/) ['jasmine.js', 'jasmine.css', 'jasmine-html.js'].each do |lib_file|
end source = File.read(File.join(project_root, 'lib', 'jasmine-core', lib_file))
dest = File.read(File.join(pages_dir, 'lib', lib_file))
it "should build the pages output to the requested diretory" do source.should == dest
Dir.chdir File.join(pages_dir, 'pages_output') do
pages = Dir.glob(File.join('**', '*'))
pages.should include('download.html')
pages.should include('index.html')
pages.should include(File.join('images', 'jasmine_logo.png'))
pages.should include(File.join('images', 'pivotal_logo.gif'))
pages.should include(File.join('css', 'pygments.css'))
pages.should include(File.join('css', 'screen.css'))
end end
end end
it "should copy the generated page files to the destination directory" do it "should build a new page" do
Dir.chdir pages_dir do @output.should match(/rocco/)
pages = Dir.glob(File.join('**', '*')) File.exist?(File.join(pages_dir, 'introduction.html')).should be_true
end
pages.should include('download.html') it "should copy the rocco output to index.html" do
pages.should include('index.html') introduction = File.read(File.join(pages_dir, 'introduction.html'))
pages.should include(File.join('images', 'jasmine_logo.png')) index = File.read(File.join(pages_dir, 'index.html'))
pages.should include(File.join('images', 'pivotal_logo.gif'))
pages.should include(File.join('css', 'pygments.css')) index.should == introduction
pages.should include(File.join('css', 'screen.css'))
end
end end
end end
end end

View File

@@ -8,24 +8,21 @@ class JasmineDev < Thor
return unless pages_submodule_installed? return unless pages_submodule_installed?
pages_output = File.join(pages_dir, 'pages_output') project_lib_dir = File.join(JasmineDev.project_root, 'lib', 'jasmine-core')
FileUtils.rm_r(pages_output) if File.exist?(pages_output)
inside File.join('pages', 'pages_source') do pages_lib_dir = File.join(pages_dir, 'lib')
run_with_output "frank export #{pages_output}", :capture => true FileUtils.rm_r(pages_lib_dir) if File.exist?(pages_lib_dir)
['jasmine.js', 'jasmine-html.js', 'jasmine.css'].each do |file|
copy_file File.join(project_lib_dir, file), File.join(pages_lib_dir, file)
end end
pages_files = Dir.chdir(pages_output) { Dir.glob('*') } inside File.join(JasmineDev.project_root, 'pages', 'src') do
run_with_output "bundle exec rocco -l js introduction.js -t layout.mustache -o #{pages_dir}"
end
pages_files.each do |file| inside pages_dir do
source_path = File.join(pages_output, file) copy_file File.join(pages_dir,'introduction.html'), File.join(pages_dir,'index.html')
destination_path = File.join(pages_dir, file)
if File.directory?(source_path)
directory source_path, destination_path
else
copy_file source_path, destination_path
end
end end
end end
end end