Removed Frank for GHPages generation. Now using Rocco and a Thor task to build it
This commit is contained in:
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
|
||||
s.files = Dir.glob("./lib/**/*") + Dir.glob("./lib/jasmine-core/spec/**/*.js")
|
||||
s.require_paths = ["lib"]
|
||||
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 "compass"
|
||||
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 "thor"
|
||||
s.add_development_dependency "nokogiri"
|
||||
s.add_development_dependency "rocco"
|
||||
s.add_development_dependency "rdiscount"
|
||||
end
|
||||
|
||||
2
pages
2
pages
Submodule pages updated: b928db73fc...c852d33084
@@ -36,34 +36,25 @@ describe "Build Github Pages task" do
|
||||
@output.should match(/Building Github Pages/)
|
||||
end
|
||||
|
||||
it "should tell the user the pages are built" do
|
||||
@output.should match(/Congratulations, project dumped to/)
|
||||
end
|
||||
it "should copy the latest jasmine files to the pages dir" do
|
||||
['jasmine.js', 'jasmine.css', 'jasmine-html.js'].each do |lib_file|
|
||||
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
|
||||
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'))
|
||||
source.should == dest
|
||||
end
|
||||
end
|
||||
|
||||
it "should copy the generated page files to the destination directory" do
|
||||
Dir.chdir pages_dir do
|
||||
pages = Dir.glob(File.join('**', '*'))
|
||||
it "should build a new page" do
|
||||
@output.should match(/rocco/)
|
||||
File.exist?(File.join(pages_dir, 'introduction.html')).should be_true
|
||||
end
|
||||
|
||||
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
|
||||
it "should copy the rocco output to index.html" do
|
||||
introduction = File.read(File.join(pages_dir, 'introduction.html'))
|
||||
index = File.read(File.join(pages_dir, 'index.html'))
|
||||
|
||||
index.should == introduction
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -8,24 +8,21 @@ class JasmineDev < Thor
|
||||
|
||||
return unless pages_submodule_installed?
|
||||
|
||||
pages_output = File.join(pages_dir, 'pages_output')
|
||||
FileUtils.rm_r(pages_output) if File.exist?(pages_output)
|
||||
project_lib_dir = File.join(JasmineDev.project_root, 'lib', 'jasmine-core')
|
||||
|
||||
inside File.join('pages', 'pages_source') do
|
||||
run_with_output "frank export #{pages_output}", :capture => true
|
||||
pages_lib_dir = File.join(pages_dir, 'lib')
|
||||
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
|
||||
|
||||
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|
|
||||
source_path = File.join(pages_output, file)
|
||||
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
|
||||
inside pages_dir do
|
||||
copy_file File.join(pages_dir,'introduction.html'), File.join(pages_dir,'index.html')
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user