Permalink
Browse files

Fix 'rake doc' task to work with Sprockets 2

  • Loading branch information...
1 parent cfbf2f5 commit 086d814615eb35cb6d5150f676880bc1cf62a356 @nhowell committed Sep 12, 2011
Showing with 4 additions and 9 deletions.
  1. +4 −9 Rakefile
View
@@ -1,6 +1,5 @@
require 'rake'
require 'rake/clean'
-require 'rake/rdoctask'
require 'rake/testtask'
CLEAN.include 'test/unit/tmp'
@@ -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

0 comments on commit 086d814

Please sign in to comment.