Skip to content

Commit

Permalink
fixed some rdoc problems
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Su committed Sep 7, 2010
1 parent 2487f2a commit bf44870
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## Version 0.1.3
## Version 0.1.4
* Minor fix in doc directory

## Version 0.1.3
* Fixed "js2 rdoc" command
* Added jamis.rb to the Manifest
* Added javascript to rewrite rdoc to look more like javascript
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ require 'rubygems'
require 'rake'
require 'echoe'

JS2_VERSION = '0.1.3'
JS2_VERSION = '0.1.4'
Echoe.new('js2', JS2_VERSION) do |p|
p.description = ""
p.url = "http://github.com/jeffsu/js2"
Expand Down
11 changes: 8 additions & 3 deletions bin/js2
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ require 'js2'
options = OpenStruct.new
options.rails = false
options.sleep_time = 1
options.rdoc_bin = 'rdoc'


op = OptionParser.new do |opts|
Expand Down Expand Up @@ -44,9 +45,14 @@ op = OptionParser.new do |opts|
options.out_dir = d
end

opts.on('-h', '--haml-dir DIR', "Direcotry where js2.haml files reside. Defaults to current directory.") do |d|
opts.on('-h', '--haml-dir DIR', "Directory where js2.haml files reside. Defaults to current directory.") do |d|
options.haml_dir = d
end

opts.on('-d', '--rdoc EXECUTABLE', "Rdoc executable to use. Defaults to 'rdoc'") do |d|
options.rdoc_bin = d
end

end

main_action = ARGV.first
Expand Down Expand Up @@ -120,6 +126,5 @@ elsif main_action == 'compile'
puts "Compiling #{Time.now}..." if res[:changed].any?
elsif main_action == 'rdoc'
res = processor.process!
config.file_handler.doc_dir = config.file_handler.js2_dir
JS2::Util::Rdoc.build(res[:pages], config.file_handler)
JS2::Util::Rdoc.build(res[:pages], config.file_handler, options.rdoc_bin)
end
2 changes: 1 addition & 1 deletion js2.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Gem::Specification.new do |s|
s.name = %q{js2}
s.version = "0.1.3"
s.version = "0.1.4"

s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
s.authors = ["Jeff Su"]
Expand Down
6 changes: 4 additions & 2 deletions lib/js2/util/rdoc.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
class JS2::Util::Rdoc

def self.build (pages, file_handler)
def self.build (pages, file_handler, rdoc_bin = 'rdoc')
file_handler.doc_dir = "./.#{Time.now.to_i.to_s}-doc-code"

pages.each do |p|
str = ''
Expand Down Expand Up @@ -28,7 +29,8 @@ def self.build (pages, file_handler)

# TODO make this portable
jamis = File.dirname(__FILE__) + '/jamis.rb'
puts `rdoc --template #{jamis} --extension js=rb #{file_handler.doc_dir}`
puts `#{rdoc_bin} --template #{jamis} --extension js=rb #{file_handler.doc_dir}`
puts `rm -rf #{file_handler.doc_dir}`
end


Expand Down

0 comments on commit bf44870

Please sign in to comment.