Skip to content

Commit

Permalink
Fix 'rake doc' task to work with Sprockets 2
Browse files Browse the repository at this point in the history
  • Loading branch information
nhowell committed Sep 12, 2011
1 parent cfbf2f5 commit 086d814
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions Rakefile
@@ -1,6 +1,5 @@
require 'rake'
require 'rake/clean'
require 'rake/rdoctask'
require 'rake/testtask'

CLEAN.include 'test/unit/tmp'
Expand Down Expand Up @@ -42,14 +41,10 @@ file 'doc' => Dir['src/**/*'] + [:sprockets, :pdoc] do
require 'tempfile'

Tempfile.open('pdoc') do |temp|
secretary = Sprockets::Secretary.new(
:root => WYSIHAT_SRC_DIR,
:load_path => [WYSIHAT_SRC_DIR],
:source_files => ["wysihat.js"],
:strip_comments => false
)

secretary.concatenation.save_to(temp.path)
env = Sprockets::Environment.new
env.prepend_path WYSIHAT_SRC_DIR
File.open(temp.path, 'w') {|f| f.write(env['wysihat.js'].to_s) }

PDoc::Runner.new(temp.path, :destination => "#{WYSIHAT_ROOT}/doc").run
end
end
Expand Down

0 comments on commit 086d814

Please sign in to comment.