Changeset 196

Show
Ignore:
Timestamp:
03/09/07 14:21:02 (2 years ago)
Author:
e.@brainspl.at
Message:

add allison rdoc template for docs, yummy. Applied patch from Rogelio for -u username and -G groupname flags to merb so merb will run as that user/group, closes #20

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/README

    r169 r196  
    4242 
    4343Merb::RouteMatcher.prepare do |r| 
    44   r.resource :posts 
     44  r.resources :posts 
    4545  r.add '/:controller/:action/:id' 
    4646  r.add '/', :controller => 'files', :action => 'index' 
  • trunk/Rakefile

    r195 r196  
    1818VERS = "0.2.0" 
    1919CLEAN.include ['**/.*.sw?', '*.gem', '.config'] 
    20 RDOC_OPTS = ['--quiet', '--title', "Merb Documentation", 
    21   "--opname", "index.html", 
    22   "--line-numbers", 'TODO', 
    23   "--main", "README", 
    24   "--inline-source"] 
    2520 
    2621setup_clean [ "pkg", "lib/*.bundle", "*.gem",  
     
    3530 
    3631 
     32#Rake::RDocTask.new do |rdoc| 
     33#  rdoc.rdoc_dir = 'doc/rdoc' 
     34#  rdoc.options += RDOC_OPTS 
     35#  rdoc.main = "README" 
     36#  rdoc.title = "Merb Documentation" 
     37#  rdoc.rdoc_files.add ['README', 'LICENSE', 'TODO', 'lib/**/*.rb'] 
     38#end 
    3739Rake::RDocTask.new do |rdoc| 
    38   rdoc.rdoc_dir = 'doc/rdoc' 
    39   rdoc.options += RDOC_OPTS 
    40   rdoc.main = "README" 
    41   rdoc.title = "Merb Documentation" 
    42   rdoc.rdoc_files.add ['README', 'LICENSE', 'TODO', 'lib/**/*.rb'] 
     40     files =['README', 'LICENSE', 'TODO', 'lib/**/*.rb'] 
     41     rdoc.rdoc_files.add(files) 
     42     rdoc.main = "README" # page to start on 
     43     rdoc.title = "Merb Docs" 
     44     rdoc.template = __DIR__+"/tools/allison/allison.rb" 
     45     rdoc.rdoc_dir = 'doc' # rdoc output folder 
     46     rdoc.options << '--line-numbers' << '--inline-source' 
    4347end 
     48 
     49 
    4450 
    4551spec = Gem::Specification.new do |s| 
     
    4955  s.has_rdoc = true 
    5056  s.extra_rdoc_files = ["README", "LICENSE", 'TODO'] 
    51   s.rdoc_options += RDOC_OPTS +  
    52     ['--exclude', '^(app|uploads)'] 
     57  #s.rdoc_options += RDOC_OPTS +  
     58  #  ['--exclude', '^(app|uploads)'] 
    5359  s.summary = "Merb == Mongrel + Erb. Pocket rocket web framework." 
    5460  s.description = s.summary 
  • trunk/lib/merb/merb_router.rb

    r194 r196  
    108108     
    109109    class Resource 
    110  
     110      # TODO : come up with naming convention and generate helper  
     111      # methods for route generation. Route generation  
     112      # framework needed but needs to be simple and light 
     113       
    111114      def initialize(resource, procs=[], opts={}) 
    112115        @resource, @procs, @opts = resource, procs, opts 
     
    143146        procs = [] 
    144147        yield Resource.new(res, procs, opts) 
    145         procs.reverse.each {|p| p.call
     148        procs.reverse.each {|p| p.call
    146149      else 
    147150        generate_resources_routes(res,opts) 
     
    155158        procs = [] 
    156159        yield Resource.new(res, procs, opts) 
    157         procs.reverse.each {|p| p.call
     160        procs.reverse.each {|p| p.call
    158161      else 
    159162        generate_singleton_routes(res,opts) 
  • trunk/lib/merb/merb_server.rb

    r193 r196  
    4040          opts.separator 'If no flags are given, Merb starts in the foreground on port 4000' 
    4141          opts.separator '*'*80 
    42            
     42 
     43          opts.on("-u", "--user USER", "This flag is for having merb run as a user other than the one currently logged in. Note: if you set this you must also provide a --group option for it to take effect.") do |config| 
     44            options[:user] = config 
     45          end 
     46 
     47          opts.on("-G", "--group GROUP", "This flag is for having merb run as a group other than the one currently logged in. Note: if you set this you must also provide a --user option for it to take effect.") do |config| 
     48            options[:group] = config 
     49          end 
     50                     
    4351          opts.on("-f", "--config-file FILENAME", "This flag is for adding extra config files for things like the upload progress module") do |config| 
    4452            options[:config] = config 
     
    257265        initialize_merb 
    258266       
    259         mconfig = Mongrel::Configurator.new :host => (@@merb_opts[:host]||"0.0.0.0"), :port => (port ||4000) do 
     267        mconf_hash = {:host => (@@merb_opts[:host]||"0.0.0.0"), :port => (port ||4000)} 
     268        if @@merb_opts[:user] and @@merb_opts[:group] 
     269          mconf_hash[:user]   = @@merb_opts[:user] 
     270          mconf_hash[:group]  = @@merb_opts[:group] 
     271        end 
     272        mconfig = Mongrel::Configurator.new(mconf_hash) do 
    260273          yconfig = YAML.load(Erubis::Eruby.new(IO.read(File.expand_path(@@merb_opts[:config]))).result) if @@merb_opts[:config] 
    261274          listener do 
  • trunk/lib/merb/template/haml.rb

    r195 r196  
    3939        end 
    4040         
    41         # OPTIMIZE :  add haml template caching 
    4241        def transform(options = {}) 
    4342          opts, file, view_context = options.values_at(:opts, :file, :view_context)