diff --git a/jasmine-core.gemspec b/jasmine-core.gemspec index 481956996..47e7aa22e 100644 --- a/jasmine-core.gemspec +++ b/jasmine-core.gemspec @@ -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 diff --git a/pages b/pages index b928db73f..c852d3308 160000 --- a/pages +++ b/pages @@ -1 +1 @@ -Subproject commit b928db73fcb1070bd6a1bb73318b41202a1c2339 +Subproject commit c852d33084c114bfc09174eb1fde011dd20ff299 diff --git a/spec/tasks/build_github_pages_spec.rb b/spec/tasks/build_github_pages_spec.rb index 443fc5de3..921ed140a 100644 --- a/spec/tasks/build_github_pages_spec.rb +++ b/spec/tasks/build_github_pages_spec.rb @@ -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 \ 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 610a9b2e1..373d3e394 100644 --- a/tasks/jasmine_dev/build_github_pages.rb +++ b/tasks/jasmine_dev/build_github_pages.rb @@ -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 \ No newline at end of file