Changeset 1287

Show
Ignore:
Timestamp:
03/16/08 19:48:31 (8 months ago)
Author:
mikem836
Message:

change Renderer to Controller

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • ruport/trunk/lib/ruport/data/grouping.rb

    r1221 r1287  
    4545    end 
    4646           
    47     include Ruport::Renderer::Hooks 
     47    include Ruport::Controller::Hooks 
    4848    renders_as_group 
    4949 
     
    341341    alias_method :sum, :sigma 
    342342 
    343     include Ruport::Renderer::Hooks 
     343    include Ruport::Controller::Hooks 
    344344    renders_as_grouping 
    345345 
  • ruport/trunk/lib/ruport/data/record.rb

    r1283 r1287  
    234234    #######################        
    235235 
    236     include Ruport::Renderer::Hooks 
     236    include Ruport::Controller::Hooks 
    237237    renders_as_row 
    238238 
  • ruport/trunk/lib/ruport/data/table.rb

    r1257 r1287  
    235235    extend FromCSV 
    236236 
    237     include Ruport::Renderer::Hooks 
     237    include Ruport::Controller::Hooks 
    238238    renders_as_table 
    239239 
  • ruport/trunk/lib/ruport/formatter.rb

    r1281 r1287  
    1212  # 
    1313  # Typically, a Formatter will implement one or more output types, 
    14   # and be registered with one or more Renderer classes.  
     14  # and be registered with one or more Controller classes.  
    1515  # 
    1616  # This class provides all the necessary base functionality to make 
     
    2121  # work, but see the built in formatters for reference implementations.  
    2222  #  
    23   # A simple Renderer definition is included to help show the example in 
     23  # A simple Controller definition is included to help show the example in 
    2424  # context, but you can also build your own custom interface to formatter 
    2525  # if you wish. 
    2626  # 
    27   #   class ReverseRenderer < Ruport::Renderer 
     27  #   class ReverseController < Ruport::Controller 
    2828  #      stage :reversed_header, :reversed_body  
    2929  #   end 
     
    3131  #   class ReversedText < Ruport::Formatter  
    3232  #       
    33   #      # Hooks formatter up to renderer 
    34   #      renders :txt, :for => ReverseRenderer       
     33  #      # Hooks formatter up to controller 
     34  #      renders :txt, :for => ReverseController       
    3535  #       
    36   #      # Implements ReverseRenderer's :reversed_header hook 
    37   #      # but can be used by any renderer    
     36  #      # Implements ReverseController's :reversed_header hook 
     37  #      # but can be used by any controller    
    3838  #      def build_reversed_header    
    3939  #         output << "#{options.header_text}\n" 
     
    4141  #      end   
    4242  #  
    43   #      # Implements ReverseRenderer's :reversed_body hook 
    44   #      # but can be used by any renderer 
     43  #      # Implements ReverseController's :reversed_body hook 
     44  #      # but can be used by any controller 
    4545  #      def build_reversed_body 
    4646  #         output << data.reverse << "\n" 
     
    4949  #   end     
    5050  # 
    51   #   puts ReverseRenderer.render_txt(:data => "apple", 
     51  #   puts ReverseController.render_txt(:data => "apple", 
    5252  #                                   :header_text => "Hello Mike, Hello Joe!") 
    5353  #    
     
    6565    # 
    6666    module RenderingTools 
    67       # Uses Renderer::Row to render the Row object with the 
     67      # Uses Controller::Row to render the Row object with the 
    6868      # given options. 
    6969      # 
     
    7171      # formatter's <tt>output</tt> object. 
    7272      def render_row(row,options={},&block) 
    73         render_helper(Renderer::Row,row,options,&block) 
    74       end 
    75  
    76       # Uses Renderer::Table to render the Table object with the 
     73        render_helper(Controller::Row,row,options,&block) 
     74      end 
     75 
     76      # Uses Controller::Table to render the Table object with the 
    7777      # given options. 
    7878      # 
     
    8080      # output object. 
    8181      def render_table(table,options={},&block) 
    82         render_helper(Renderer::Table,table,options,&block) 
    83       end 
    84  
    85       # Uses Renderer::Group to render the Group object with the 
     82        render_helper(Controller::Table,table,options,&block) 
     83      end 
     84 
     85      # Uses Controller::Group to render the Group object with the 
    8686      # given options. 
    8787      # 
     
    8989      # output object. 
    9090      def render_group(group,options={},&block) 
    91         render_helper(Renderer::Group,group,options,&block) 
    92       end 
    93  
    94       # Uses Renderer::Grouping to render the Grouping object with the 
     91        render_helper(Controller::Group,group,options,&block) 
     92      end 
     93 
     94      # Uses Controller::Grouping to render the Grouping object with the 
    9595      # given options. 
    9696      # 
     
    9898      # output object. 
    9999      def render_grouping(grouping,options={},&block) 
    100         render_helper(Renderer::Grouping,grouping,options,&block) 
     100        render_helper(Controller::Grouping,grouping,options,&block) 
    101101      end 
    102102       
     
    128128    include RenderingTools 
    129129    
    130     # Set by the <tt>:data</tt> attribute from Renderer#render 
     130    # Set by the <tt>:data</tt> attribute from Controller#render 
    131131    attr_reader :data               
    132132     
    133     # Set automatically by Renderer#render(format) or Renderer#render_format 
     133    # Set automatically by Controller#render(format) or Controller#render_format 
    134134    attr_accessor :format                                                     
    135135     
    136     # Set automatically by Renderer#render as a Renderer::Options object built 
     136    # Set automatically by Controller#render as a Controller::Options object built 
    137137    # by the hash provided. 
    138138    attr_writer :options 
    139139 
    140     # Registers the formatter with one or more Renderers. 
    141     # 
    142     #   renders :pdf, :for => MyRenderer 
    143     #   render :text, :for => [MyRenderer,YourRenderer] 
    144     #   renders [:csv,:html], :for => YourRenderer 
     140    # Registers the formatter with one or more Controllers. 
     141    # 
     142    #   renders :pdf, :for => MyController 
     143    #   render :text, :for => [MyController,YourController] 
     144    #   renders [:csv,:html], :for => YourController 
    145145    # 
    146146    def self.renders(fmts,options={}) 
     
    157157    # 
    158158    #   class ReversedText < Ruport::Formatter  
    159     #      renders :txt, :for => ReverseRenderer 
     159    #      renders :txt, :for => ReverseController 
    160160    #       
    161161    #      build :reversed_header do 
     
    189189    end 
    190190 
    191     # Provides a Renderer::Options object for storing formatting options. 
     191    # Provides a Controller::Options object for storing formatting options. 
    192192    def options 
    193       @options ||= Renderer::Options.new 
     193      @options ||= Controller::Options.new 
    194194    end  
    195195 
  • ruport/trunk/lib/ruport/formatter/csv.rb

    r1285 r1287  
    1515 
    1616  # This formatter implements the CSV format for Ruport's Row, Table, Group 
    17   # and Grouping renderers.  It is a light wrapper around 
     17  # and Grouping controllers.  It is a light wrapper around 
    1818  # James Edward Gray II's FasterCSV. 
    1919  # 
     
    3232  class Formatter::CSV < Formatter 
    3333     
    34     renders :csv, :for => [ Renderer::Row,   Renderer::Table,  
    35                             Renderer::Group, Renderer::Grouping ] 
     34    renders :csv, :for => [ Controller::Row,   Controller::Table,  
     35                            Controller::Group, Controller::Grouping ] 
    3636     
    3737    def initialize 
     
    6161 
    6262    # Generates table header by turning column_names into a CSV row. 
    63     # Uses the row renderer to generate the actual formatted output 
     63    # Uses the row controller to generate the actual formatted output 
    6464    # 
    6565    # This method does not do anything if options.show_table_headers is false 
     
    7272    end 
    7373 
    74     # Calls the row renderer for each row in the Data::Table 
     74    # Calls the row controller for each row in the Data::Table 
    7575    def build_table_body 
    7676      fcsv = csv_writer 
     
    8989    end 
    9090     
    91     # Renders the group body - uses the table renderer to generate the output. 
     91    # Renders the group body - uses the table controller to generate the output. 
    9292    # 
    9393    def build_group_body 
  • ruport/trunk/lib/ruport/formatter/html.rb

    r1281 r1287  
    1313module Ruport 
    1414  # This class produces HTML output for Ruport's Row, Table, Group, and 
    15   # Grouping renderers.  It can be subclassed, as it has some helper methods 
     15  # Grouping controllers.  It can be subclassed, as it has some helper methods 
    1616  # that might be useful for custom output. 
    1717  # 
     
    2626  class Formatter::HTML < Formatter     
    2727     
    28     renders :html, :for => [ Renderer::Row, Renderer::Table, 
    29                              Renderer::Group, Renderer::Grouping ] 
     28    renders :html, :for => [ Controller::Row, Controller::Table, 
     29                             Controller::Group, Controller::Grouping ] 
    3030 
    3131    # Hook for setting available options using a template. See the template  
     
    4949    end 
    5050     
    51     # Uses the Row renderer to build up the table body. 
     51    # Uses the Row controller to build up the table body. 
    5252    # Replaces nil and empty strings with "&nbsp;"  
    5353    def build_table_body 
     
    7777 
    7878    # Creates the group body. Since group data is a table, just uses the 
    79     # Table renderer. 
     79    # Table controller. 
    8080    # 
    8181    def build_group_body 
     
    8484 
    8585    # Generates the body for a grouping. Iterates through the groups and 
    86     # renders them using the group renderer. 
     86    # renders them using the group controller. 
    8787    # 
    8888    def build_grouping_body 
  • ruport/trunk/lib/ruport/formatter/pdf.rb

    r1236 r1287  
    1616    
    1717  # This class provides PDF output for Ruport's Table, Group, and Grouping 
    18   # renderers.  It wraps Austin Ziegler's PDF::Writer to provide a higher 
     18  # controllers.  It wraps Austin Ziegler's PDF::Writer to provide a higher 
    1919  # level interface and provides a number of helpers designed to make 
    2020  # generating PDF reports much easier.  You will typically want to build 
     
    5050    end 
    5151     
    52     renders :pdf, :for => [ Renderer::Row, Renderer::Table, 
    53                             Renderer::Group, Renderer::Grouping ] 
     52    renders :pdf, :for => [ Controller::Row, Controller::Table, 
     53                            Controller::Group, Controller::Grouping ] 
    5454     
    5555    attr_writer :pdf_writer 
     
    105105    end 
    106106     
    107     # Generates a header with the group name for Renderer::Group. 
     107    # Generates a header with the group name for Controller::Group. 
    108108    def build_group_header 
    109109      pad(10) { add_text data.name.to_s, :justification => :center } 
    110110    end 
    111111     
    112     # Renders the group as a table for Renderer::Group. 
     112    # Renders the group as a table for Controller::Group. 
    113113    def build_group_body 
    114114      render_table data, options.to_hash.merge(:formatter => pdf_writer) 
     
    116116                      
    117117    # Determines which style to use and renders the main body for 
    118     # Renderer::Grouping. 
     118    # Controller::Grouping. 
    119119    def build_grouping_body  
    120120      case options.style 
  • ruport/trunk/lib/ruport/formatter/template.rb

    r1226 r1287  
    143143#                   FasterCSV.new 
    144144# 
    145 class Ruport::Formatter::Template < Ruport::Renderer::Options 
     145class Ruport::Formatter::Template < Ruport::Controller::Options 
    146146   
    147147  # Returns all existing templates in a hash keyed by the template names. 
  • ruport/trunk/lib/ruport/formatter/text.rb

    r1281 r1287  
    1414   
    1515  # This class provides text output for Ruport's Row, Table, Group, and 
    16   # Grouping renderers 
     16  # Grouping controllers 
    1717  # 
    1818  # It handles things like automatically truncating tables that go off the 
     
    4646  class Formatter::Text < Formatter 
    4747    
    48     renders [:txt, :text], :for => [ Renderer::Row, Renderer::Table, 
    49                                      Renderer::Group, Renderer::Grouping ] 
     48    renders [:txt, :text], :for => [ Controller::Row, Controller::Table, 
     49                                     Controller::Group, Controller::Grouping ] 
    5050 
    5151    # Hook for setting available options using a template. See the template  
     
    130130     
    131131    # Creates the group body. Since group data is a table, just uses the 
    132     # Table renderer. 
     132    # Table controller. 
    133133    # 
    134134    def build_group_body 
     
    137137 
    138138    # Generates the body for a grouping. Iterates through the groups and 
    139     # renders them using the group renderer. 
     139    # renders them using the group controller. 
    140140    # 
    141141    def build_grouping_body 
  • ruport/trunk/lib/ruport/renderer.rb

    r1283 r1287  
    1 # renderer.rb : General purpose formatted data renderer for Ruby Reports 
     1# controller.rb : General purpose control of formatted data for Ruby Reports 
    22# 
    33# Copyright December 2006, Gregory Brown.  All Rights Reserved. 
     
    66 
    77 
    8 # This class implements the core renderer for Ruport's formatting system.  It is 
    9 # designed to implement the low level tools necessary to build report renderers 
    10 # for different kinds of tasks.  See Renderer::Table for a tabular dat
    11 # renderer.   
     8# This class implements the core controller for Ruport's formatting system. 
     9# It is designed to implement the low level tools necessary to build report 
     10# controllers for different kinds of tasks.  See Controller::Table for
     11# tabular data controller.   
    1212# 
    13 class Ruport::Renderer 
     13class Ruport::Controller 
    1414   
    1515  class RequiredOptionNotSet < RuntimeError #:nodoc: 
     
    1919  class StageAlreadyDefinedError < RuntimeError #:nodoc:  
    2020  end 
    21   class RendererNotSetError < RuntimeError #:nodoc: 
     21  class ControllerNotSetError < RuntimeError #:nodoc: 
    2222  end 
    2323                                           
    2424  require "ostruct"               
    2525   
    26   # Structure for holding renderer options.   
     26  # Structure for holding controller options.   
    2727  # Simplified version of HashWithIndifferentAccess 
    2828  class Options < OpenStruct  
     
    6060  # 
    6161  # You can actually use this with any data structure, it will look for a 
    62   # renderable_data(format) method to pass to the <tt>renderer</tt> you  
     62  # renderable_data(format) method to pass to the <tt>controller</tt> you  
    6363  # specify, but if that is not defined, it will pass <tt>self</tt>. 
    6464  # 
    6565  # Examples: 
    6666  # 
    67   #   # Render Arrays with Ruport's Row Renderer 
     67  #   # Render Arrays with Ruport's Row Controller 
    6868  #   class Array 
    69   #     include Ruport::Renderer::Hooks 
     69  #     include Ruport::Controller::Hooks 
    7070  #     renders_as_row 
    7171  #   end 
     
    7474  #   # => "1,2,3\n"  
    7575  # 
    76   #   # Render Hashes with Ruport's Row Renderer 
     76  #   # Render Hashes with Ruport's Row Controller 
    7777  #   class Hash 
    78   #      include Ruport::Renderer::Hooks 
     78  #      include Ruport::Controller::Hooks 
    7979  #      renders_as_row 
    8080  #      attr_accessor :column_order 
     
    9191    module ClassMethods  
    9292       
    93       # Tells the class which renderer as() will forward to. 
     93      # Tells the class which controller as() will forward to. 
    9494      # 
    9595      # Usage: 
    9696      # 
    9797      #   class MyStructure 
    98       #     include Renderer::Hooks 
    99       #     renders_with CustomRenderer 
     98      #     include Controller::Hooks 
     99      #     renders_with CustomController 
    100100      #   end 
    101101      #    
     
    104104      # 
    105105      #   class MyStructure 
    106       #     include Renderer::Hooks 
    107       #     renders_with CustomRenderer, :font_size => 14 
     106      #     include Controller::Hooks 
     107      #     renders_with CustomController, :font_size => 14 
    108108      #   end 
    109       def renders_with(renderer,opts={}) 
    110         @renderer = renderer 
     109      def renders_with(controller,opts={}) 
     110        @controller = controller 
    111111        @rendering_options=opts 
    112112      end   
     
    117117      end 
    118118        
    119       # Shortcut for renders_with(Ruport::Renderer::Table), you 
    120       # may wish to override this if you build a custom table renderer. 
     119      # Shortcut for renders_with(Ruport::Controller::Table), you 
     120      # may wish to override this if you build a custom table controller. 
    121121      def renders_as_table(options={}) 
    122         renders_with Ruport::Renderer::Table,options 
     122        renders_with Ruport::Controller::Table,options 
    123123      end 
    124124       
    125       # Shortcut for renders_with(Ruport::Renderer::Row), you 
    126       # may wish to override this if you build a custom row renderer.  
     125      # Shortcut for renders_with(Ruport::Controller::Row), you 
     126      # may wish to override this if you build a custom row controller.  
    127127      def renders_as_row(options={}) 
    128         renders_with Ruport::Renderer::Row, options 
     128        renders_with Ruport::Controller::Row, options 
    129129      end 
    130130       
    131       # Shortcut for renders_with(Ruport::Renderer::Group), you 
    132       # may wish to override this if you build a custom group renderer.   
     131      # Shortcut for renders_with(Ruport::Controller::Group), you 
     132      # may wish to override this if you build a custom group controller.   
    133133      def renders_as_group(options={}) 
    134         renders_with Ruport::Renderer::Group,options 
     134        renders_with Ruport::Controller::Group,options 
    135135      end  
    136136       
    137       # Shortcut for renders_with(Ruport::Renderer::Grouping), you 
    138       # may wish to override this if you build a custom grouping renderer. 
     137      # Shortcut for renders_with(Ruport::Controller::Grouping), you 
     138      # may wish to override this if you build a custom grouping controller. 
    139139      def renders_as_grouping(options={}) 
    140         renders_with Ruport::Renderer::Grouping,options 
     140        renders_with Ruport::Controller::Grouping,options 
    141141      end 
    142142       
    143       # The class of the renderer object for the base class. 
     143      # The class of the controller object for the base class. 
    144144      # 
    145145      # Example: 
    146146      #  
    147       #   >> Ruport::Data::Table.renderer 
    148       #   => Ruport::Renderer::Table 
    149       def renderer 
    150         @renderer 
     147      #   >> Ruport::Data::Table.controller 
     148      #   => Ruport::Controller::Table 
     149      def controller 
     150        @controller 
    151151      end 
    152152    end 
     
    156156    end       
    157157     
    158     # Uses the Renderer specified by renders_with to generate formatted 
     158    # Uses the Controller specified by renders_with to generate formatted 
    159159    # output.  Passes the return value of the <tt>renderable_data(format)</tt> 
    160160    # method if the method is defined, otherwise passes <tt>self</tt> as :data 
    161161    # 
    162     # The remaining options are converted to a Renderer::Options object and 
    163     # are accessible in both the renderer and formatter. 
     162    # The remaining options are converted to a Controller::Options object and 
     163    # are accessible in both the controller and formatter. 
    164164    # 
    165165    #  Example: 
     
    167167    #    table.as(:csv, :show_table_headers => false) 
    168168    def as(format,options={}) 
    169       raise RendererNotSetError unless self.class.renderer 
    170       unless self.class.renderer.formats.include?(format) 
     169      raise ControllerNotSetError unless self.class.controller 
     170      unless self.class.controller.formats.include?(format) 
    171171        raise UnknownFormatError 
    172172      end 
    173       self.class.renderer.render(format, 
     173      self.class.controller.render(format, 
    174174        self.class.rendering_options.merge(options)) do |rend| 
    175175          rend.data = 
     
    196196    # Usage: 
    197197    # 
    198     #   class MyRenderer < Ruport::Renderer 
     198    #   class MyController < Ruport::Controller 
    199199    #      # other details omitted... 
    200200    #      finalize :apple 
     
    202202    # 
    203203    #   class MyFormatter < Ruport::Formatter 
    204     #      renders :example, :for => MyRenderer 
     204    #      renders :example, :for => MyController 
    205205    #  
    206206    #      # other details omitted...  
    207207    #     
    208208    #      def finalize_apple 
    209     #         # this method will be called when MyRenderer tries to render 
     209    #         # this method will be called when MyController tries to render 
    210210    #         # the :example format 
    211211    #      end 
     
    225225    # Usage: 
    226226    # 
    227     #   class MyRenderer < Ruport::Renderer 
     227    #   class MyController < Ruport::Controller 
    228228    #      # other details omitted... 
    229229    #      prepare :apple 
     
    231231    # 
    232232    #   class MyFormatter < Ruport::Formatter 
    233     #      renders :example, :for => MyRenderer 
     233    #      renders :example, :for => MyController 
    234234    # 
    235235    #      def prepare_apple 
    236     #         # this method will be called when MyRenderer tries to render 
     236    #         # this method will be called when MyController tries to render 
    237237    #         # the :example format 
    238238    #      end         
     
    254254    # Usage: 
    255255    # 
    256     #   class MyRenderer < Ruport::Renderer 
     256    #   class MyController < Ruport::Controller 
    257257    #      # other details omitted... 
    258258    #      stage :apple,:banana 
     
    260260    # 
    261261    #   class MyFormatter < Ruport::Formatter 
    262     #      renders :example, :for => MyRenderer 
     262    #      renders :example, :for => MyController 
    263263    # 
    264264    #      def build_apple 
    265     #         # this method will be called when MyRenderer tries to render 
     265    #         # this method will be called when MyController tries to render 
    266266    #         # the :example format 
    267267    #      end  
    268268    #    
    269269    #      def build_banana 
    270     #         # this method will be called when MyRenderer tries to render 
     270    #         # this method will be called when MyController tries to render 
    271271    #         # the :example format 
    272272    #      end     
     
    283283    end 
    284284      
    285     # Defines attribute writers for the Renderer::Options object shared 
    286     # between Renderer and Formatter. Will throw an error if the user does 
     285    # Defines attribute writers for the Controller::Options object shared 
     286    # between Controller and Formatter. Will throw an error if the user does 
    287287    # not provide values for these options upon rendering. 
    288288    # 
    289289    # usage: 
    290290    #    
    291     #   class MyRenderer < Ruport::Renderer 
     291    #   class MyController < Ruport::Controller 
    292292    #      required_option :employee_name, :address 
    293293    #      # other details omitted 
     
    307307    end 
    308308 
    309     # Lists the formatters that are currently registered on a renderer, 
     309    # Lists the formatters that are currently registered on a controller, 
    310310    # as a hash keyed by format name. 
    311311    # 
    312312    # Example: 
    313313    #  
    314     #   >> Ruport::Renderer::Table.formats 
     314    #   >> Ruport::Controller::Table.formats 
    315315    #   => {:html=>Ruport::Formatter::HTML,  
    316316    #   ?>  :csv=>Ruport::Formatter::CSV,  
     
    321321    end 
    322322     
    323     # Builds up a renderer object, looks up the appropriate formatter, 
     323    # Builds up a controller object, looks up the appropriate formatter, 
    324324    # sets the data and options, and then does the following process: 
    325325    # 
    326     #   * If the renderer contains a module Helpers, mix it in to the instance. 
    327     #   * If a block is given, yield the Renderer instance. 
    328     #   * If a setup() method is defined on the Renderer, call it. 
     326    #   * If the controller contains a module Helpers, mix it in to the instance. 
     327    #   * If a block is given, yield the Controller instance. 
     328    #   * If a setup() method is defined on the Controller, call it. 
    329329    #   * Call the run() method. 
    330330    #   * If the :file option is set to a file name, appends output to the file. 
    331331    #   * Return the results of formatter.output 
    332332    # 
    333     # Please see the examples/ directory for custom renderer examples, because 
     333    # Please see the examples/ directory for custom controller examples, because 
    334334    # this is not nearly as complicated as it sounds in most cases. 
    335335    def render(format, add_options=nil) 
     
    350350    # 
    351351    def options 
    352       @options ||= Ruport::Renderer::Options.new 
     352      @options ||= Ruport::Controller::Options.new 
    353353      yield(@options) if block_given? 
    354354 
     
    358358    private 
    359359     
    360     # Creates a new instance of the renderer and sets it to use the specified 
    361     # formatter (by name).  If a block is given, the renderer instance is 
     360    # Creates a new instance of the controller and sets it to use the specified 
     361    # formatter (by name).  If a block is given, the controller instance is 
    362362    # yielded.   
    363363    # 
    364     # Returns the renderer instance. 
     364    # Returns the controller instance. 
    365365    # 
    366366    def build(format, add_options=nil) 
     
    382382    end 
    383383     
    384     # Allows you to register a format with the renderer. 
     384    # Allows you to register a format with the controller. 
    385385    # 
    386386    # Example: 
     
    388388    #   class MyFormatter < Ruport::Formatter 
    389389    #     # formatter code ... 
    390     #     SomeRenderer.add_format self, :my_formatter 
     390    #     SomeController.add_format self, :my_formatter 
    391391    #   end 
    392392    # 
     
    413413  end 
    414414 
    415   # Renderer::Options object which is shared with the current formatter. 
     415  # Controller::Options object which is shared with the current formatter. 
    416416  def options 
    417417    yield(formatter.options) if block_given? 
     
    420420   
    421421  # Call the _run_ method.  You can override this method in your custom 
    422   # renderer if you need to define other actions. 
     422  # controller if you need to define other actions. 
    423423  def run 
    424424    _run_ 
     
    426426   
    427427  # If an IO object is given, Formatter#output will use it instead of  
    428   # the default String.  For Ruport's core renderers, we technically 
     428  # the default String.  For Ruport's core controllers, we technically 
    429429  # can use any object that supports the << method, but it's meant 
    430430  # for IO objects such as File or STDOUT 
  • ruport/trunk/lib/ruport/renderer/grouping.rb

    r1210 r1287  
    11# Ruport : Extensible Reporting System                                 
    22# 
    3 # renderer/grouping.rb : Group data renderer for Ruby Reports 
     3# controller/grouping.rb : Group data controller for Ruby Reports 
    44# 
    55# Written by Michael Milner, 2007. 
     
    1111module Ruport 
    1212   
    13   # This class implements the basic renderer for a single group of data. 
     13  # This class implements the basic controller for a single group of data. 
    1414  # 
    1515  # == Supported Formatters  
     
    3030  # * build_group_footer 
    3131  # 
    32   class Renderer::Group < Renderer 
     32  class Controller::Group < Controller 
    3333    options { |o| o.show_table_headers = true } 
    3434 
     
    3636  end 
    3737 
    38   # This class implements the basic renderer for data groupings in Ruport 
     38  # This class implements the basic controller for data groupings in Ruport 
    3939  # (a collection of Groups). 
    4040  # 
     
    5858  # * finalize_grouping 
    5959  # 
    60   class Renderer::Grouping < Renderer 
     60  class Controller::Grouping < Controller 
    6161    options do |o|  
    6262      o.show_group_headers = true  
  • ruport/trunk/lib/ruport/renderer/table.rb

    r1210 r1287  
    1 # renderer/table.rb : Tabular data renderer for Ruby Reports 
     1# controller/table.rb : Tabular data controller for Ruby Reports 
    22# 
    33# Written by Gregory Brown, December 2006.  Copyright 2006, All Rights Reserved 
     
    66module Ruport 
    77 
    8   # This class implements the basic renderer for table rows. 
     8  # This class implements the basic controller for table rows. 
    99  # 
    1010  # == Supported Formatters  
     
    1818  # * build_row 
    1919  # 
    20   class Renderer::Row < Renderer 
     20  class Controller::Row < Controller 
    2121    stage :row 
    2222  end 
    2323 
    24   # This class implements the basic tabular data renderer for Ruport. 
     24  # This class implements the basic tabular data controller for Ruport. 
    2525  # 
    2626  # == Supported Formatters  
     
    4343  # * finalize_table 
    4444  # 
    45   class Renderer::Table < Renderer 
     45  class Controller::Table < Controller 
    4646    options { |o| o.show_table_headers = true } 
    4747