Skip to content

Commit

Permalink
Removed Frank for GHPages generation. Now using Rocco and a Thor task…
Browse files Browse the repository at this point in the history
… to build it
  • Loading branch information
Davis W. Frank committed May 27, 2012
1 parent b6f96bc commit 7bbcf51
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 39 deletions.
4 changes: 3 additions & 1 deletion jasmine-core.gemspec
Expand Up @@ -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"
Expand All @@ -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 changes: 1 addition & 1 deletion pages
Submodule pages updated from b928db to c852d3
37 changes: 14 additions & 23 deletions spec/tasks/build_github_pages_spec.rb
Expand Up @@ -36,34 +36,25 @@
@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 build the pages output to the requested diretory" do
Dir.chdir File.join(pages_dir, 'pages_output') do
pages = Dir.glob(File.join('**', '*'))
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))

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
25 changes: 11 additions & 14 deletions tasks/jasmine_dev/build_github_pages.rb
Expand Up @@ -8,24 +8,21 @@ def build_github_pages(pages_dir = File.expand_path(File.join('.', 'pages')))

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
end
pages_lib_dir = File.join(pages_dir, 'lib')
FileUtils.rm_r(pages_lib_dir) if File.exist?(pages_lib_dir)

pages_files = Dir.chdir(pages_output) { Dir.glob('*') }
['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.each do |file|
source_path = File.join(pages_output, file)
destination_path = File.join(pages_dir, file)
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

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

0 comments on commit 7bbcf51

Please sign in to comment.