In Files
Parent
Class Index
- WebRI
- WebRI::Blackfish
- WebRI::Component
- WebRI::Generator
- WebRI::GeneratorOne
- WebRI::GitHub
- WebRI::Heirarchy
- WebRI::Highlight
- WebRI::Icons
- WebRI::JSONFile
- WebRI::Longfish
- WebRI::Metadata
- WebRI::Newfish
- WebRI::Oldfish
- WebRI::Onefish
- WebRI::Prettify
- WebRI::Redfish
- WebRI::RiService
- WebRI::Search
- WebRI::Search::FilesTree
- WebRI::Server
- WebRI::Subversion
- WebRI::Template
- WebRI::TimeDelta
- WebRI::Twofish
- RDoc
- RDoc::AnyMethod
- RDoc::ClassModule
- RDoc::Options
- RDoc::Parser
- RDoc::Parser::C
- RDoc::TopLevel
- Syckle
- Syckle::Plugins
- Syckle::Plugins::WebRI
- Object
- OpEsc
Constants
- PATH
- (Not documented)
Public Class Methods
Public Instance Methods
Output progress information if rdoc debugging is enabled
# File lib/webri/components/abstract.rb, line 98 def debug_msg(msg) return unless $DEBUG_RDOC case msg[-1,1] when '.' then tab = "= " when ':' then tab = "== " else tab = "* " end $stderr.puts(tab + msg) end
This is the method that is called by the generator, allowing the component in turn to generate the files it needs. By default this copies the components static directory.
# File lib/webri/components/abstract.rb, line 37 def generate generate_static end
Copy static files to output. All the common static content is stored in the assets/ directory. WebRI’s assets/ directory more or less follows an Abbreviated Monash convention:
assets/ css/ <- stylesheets json/ <- json data table (*maybe top level is better?) img/ <- images inc/ <- server-side includes js/ <- javascripts
Components can utilize this method by providing a path.
# File lib/webri/components/abstract.rb, line 54 def generate_static from = Dir[(path_static + '**').to_s] dest = path_output.to_s show_from = path_static.to_s.sub(PATH.to_s+'/', '') debug_msg "Copying #{show_from}/** to #{path_output_relative}:" fileutils.cp_r from, dest, :preserve => true end
Subcomponents use this to setup template provisions.
def initialize_methods provide :svninfo end
See the provide method.
# File lib/webri/components/abstract.rb, line 29 def initialize_methods end
# File lib/webri/components/abstract.rb, line 64 def method_missing(s, *a, &b) generator.__send__(s,*a,&b) end
# File lib/webri/components/abstract.rb, line 76 def name self.class.name.split('::').last.downcase end
# File lib/webri/components/abstract.rb, line 70 def path_static PATH + "#{name}/static" end
Provide a method interface(s) to the generator. This extends the generator’s context with component methods. Since ERB templates are rendering in the generator scope, this is useful when a component needs to provide method access to templates.
# File lib/webri/components/abstract.rb, line 86 def provision(method, &block) if block generator.provision(method, &block) else generator.provision(method) do |*a, &b| __send__(method, *a, &b) end end end
Disabled; run with --debug to generate this.