diff --git a/spec/tasks/build_github_pages_spec.rb b/spec/tasks/build_github_pages_spec.rb index 8e0cedcb..443fc5de 100644 --- a/spec/tasks/build_github_pages_spec.rb +++ b/spec/tasks/build_github_pages_spec.rb @@ -40,7 +40,7 @@ describe "Build Github Pages task" do @output.should match(/Congratulations, project dumped to/) end - it "should copy the pages output to the requested diretory" do + 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('**', '*')) @@ -52,5 +52,18 @@ describe "Build Github Pages task" do pages.should include(File.join('css', 'screen.css')) end end + + it "should copy the generated page files to the destination directory" do + Dir.chdir pages_dir 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 \ No newline at end of file diff --git a/tasks/jasmine_dev/build_github_pages.rb b/tasks/jasmine_dev/build_github_pages.rb index 63300605..610a9b2e 100644 --- a/tasks/jasmine_dev/build_github_pages.rb +++ b/tasks/jasmine_dev/build_github_pages.rb @@ -14,5 +14,18 @@ class JasmineDev < Thor inside File.join('pages', 'pages_source') do run_with_output "frank export #{pages_output}", :capture => true end + + pages_files = Dir.chdir(pages_output) { Dir.glob('*') } + + 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 + end end end \ No newline at end of file