R
Rich Morin
I'm trying to get "rake doc:app" pull its input from a different
Rails app's source tree. In trying to prototype a solution, I've
fiddled with documentation.rake. However, my hack isn't working:
My trace of the value being mapped contains only a series of:
new_name='.//'
Any idea what I'm doing wrong? Here's the relevant code:
# /usr/.local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb defines
# the include method, as follows:
#
# # Add file names defined by glob patterns to the file list.
# # If an array is given, add each element of the array.
# #
# # Example:
# # file_list.include("*.java", "*.cfg")
# # file_list.include %w( math.c lib.h *.o )
# #
# def include(*filenames)
# # TODO: check for pending
# filenames.each do |fn|
# if fn.respond_to? :to_ary
# include(*fn.to_ary)
# else
# @pending_add << fn
# end
# end
# @pending = true
# self
# end
# alias :add :include
#
#####
#
# We can redefine this to add an arbitrary prefix to each path, based
# on the RDOC_SRC_DIR environment variable:
class FileList
@@rdoc_src_dir = ENV['RDOC_SRC_DIR']
if (@@rdoc_src_dir)
alias rig_include :include
def include(*filenames)
list = filenames.map do |name|
new_name = "#{@@rdoc_src_dir}/#{name}"
puts "new_name='#{new_name}'" #T
end
orig_include(list)
end
alias :add :include
end
end
...
More generally, if someone has a better way to solve the original
problem, I'd be happy to hear about it!
-r
--
http://www.cfcl.com/rdm Rich Morin
http://www.cfcl.com/rdm/resume (e-mail address removed)
http://www.cfcl.com/rdm/weblog +1 650-873-7841
Technical editing and writing, programming, and web development
Rails app's source tree. In trying to prototype a solution, I've
fiddled with documentation.rake. However, my hack isn't working:
rake aborted!
stack level too deep
/usr/local/lib/ruby/gems/1.8/gems/
rake-0.7.1/lib/rake.rb:1038:in `orig_include'
rake-0.7.1/lib/rake.rb:1036:in `orig_include'
rails-1.2.2/lib/tasks/documentation.rake:41:in `include'
My trace of the value being mapped contains only a series of:
new_name='.//'
Any idea what I'm doing wrong? Here's the relevant code:
# /usr/.local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb defines
# the include method, as follows:
#
# # Add file names defined by glob patterns to the file list.
# # If an array is given, add each element of the array.
# #
# # Example:
# # file_list.include("*.java", "*.cfg")
# # file_list.include %w( math.c lib.h *.o )
# #
# def include(*filenames)
# # TODO: check for pending
# filenames.each do |fn|
# if fn.respond_to? :to_ary
# include(*fn.to_ary)
# else
# @pending_add << fn
# end
# end
# @pending = true
# self
# end
# alias :add :include
#
#####
#
# We can redefine this to add an arbitrary prefix to each path, based
# on the RDOC_SRC_DIR environment variable:
class FileList
@@rdoc_src_dir = ENV['RDOC_SRC_DIR']
if (@@rdoc_src_dir)
alias rig_include :include
def include(*filenames)
list = filenames.map do |name|
new_name = "#{@@rdoc_src_dir}/#{name}"
puts "new_name='#{new_name}'" #T
end
orig_include(list)
end
alias :add :include
end
end
...
More generally, if someone has a better way to solve the original
problem, I'd be happy to hear about it!
-r
--
http://www.cfcl.com/rdm Rich Morin
http://www.cfcl.com/rdm/resume (e-mail address removed)
http://www.cfcl.com/rdm/weblog +1 650-873-7841
Technical editing and writing, programming, and web development