Changeset 398

Show
Ignore:
Timestamp:
08/07/07 19:15:19 (1 year ago)
Author:
e.@brainspl.at
Message:

removed DIST_ROOT entirely. MERB_ROOT is all there is now. I feel better already. I've alos decided to bump the version number to 0.4.0 because I am going to breaik things a bit in order to make them better. Use the 0.3.7 branch or gem if you have a merb 0.3.x app.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/README

    r279 r398  
    299299== Merb app layout 
    300300 
    301 A Merb app contains everything it needs to run in production in the  
    302 MERB_ROOT/dist directory. So for deployment you only need to deploy the dist dir. This 
    303 keeps your test code and development plugins separate from your main app and lets you 
    304 not deploy them to the live server. You deal with two things with this setup, MERB_ROOT 
    305 and DIST_ROOT. MERB_ROOT is the root of the whole tree. And DISTROOT is MERB_ROOT+/dist 
    306 You will cd into MERB_ROOT to run the merb command line. ANd when you deploy live you 
    307 will put the dist dir into another empty MERB_ROOT on the production server. 
    308  
    309301        merb_app: 
     302 
     303          app 
     304            controllers 
     305            models 
     306            views 
     307            parts 
     308            mailers 
     309          conf 
     310          lib 
     311          public 
     312          schema 
    310313          Rakefile 
    311           README 
    312314          scripts 
    313315          test 
     
    315317            unit 
    316318          plugins 
    317           dist 
    318             app 
    319               controllers 
    320               models 
    321               views 
    322             conf 
    323             lib 
    324             public 
    325             plugins 
    326             schema 
  • trunk/Rakefile

    r395 r398  
    1616 
    1717NAME = "merb" 
    18 VERS = "0.3.8
     18VERS = "0.4.0
    1919CLEAN.include ['**/.*.sw?', '*.gem', '.config'] 
    2020 
  • trunk/examples/skeleton/conf/merb_init.rb

    r354 r398  
    44ActiveRecord::Base.logger = MERB_LOGGER 
    55 
    6 require DIST_ROOT+"/app/controllers/application.rb" 
    7 Dir[DIST_ROOT+"/app/controllers/*.rb"].each{ |m| require m }  
    8 Dir[DIST_ROOT+"/app/helpers/*.rb"].each    { |m| require m }  
    9 Dir[DIST_ROOT+"/app/models/*.rb"].each     { |m| require m }  
    10 Dir[DIST_ROOT+"/app/mailers/*.rb"].each    { |m| require m } 
    11 Dir[DIST_ROOT+"/lib/*/lib/*.rb"].each      { |m| require m } 
    12 Dir[DIST_ROOT+"/lib/*/bin/*.rb"].each      { |m| require m } 
    13 Dir[DIST_ROOT+"/plugins/*/init.rb"].each   { |m| require m } 
     6require MERB_ROOT+"/app/controllers/application.rb" 
     7Dir[MERB_ROOT+"/app/controllers/*.rb"].each{ |m| require m }  
     8Dir[MERB_ROOT+"/app/helpers/*.rb"].each    { |m| require m }  
     9Dir[MERB_ROOT+"/app/models/*.rb"].each     { |m| require m }  
     10Dir[MERB_ROOT+"/app/mailers/*.rb"].each    { |m| require m } 
     11Dir[MERB_ROOT+"/lib/*/lib/*.rb"].each      { |m| require m } 
     12Dir[MERB_ROOT+"/lib/*/bin/*.rb"].each      { |m| require m } 
     13Dir[MERB_ROOT+"/plugins/*/init.rb"].each   { |m| require m } 
    1414 
    1515#Get Database Config 
    1616puts "Connecting to database..." 
    17 conn_options = YAML::load(Erubis::Eruby.new(IO.read("#{DIST_ROOT}/conf/database.yml")).result) 
     17conn_options = YAML::load(Erubis::Eruby.new(IO.read("#{MERB_ROOT}/conf/database.yml")).result) 
    1818ActiveRecord::Base.establish_connection conn_options["#{MERB_ENV}"]  
    1919 
    2020#Get Environment File 
    21 require "#{DIST_ROOT}/conf/environments/#{MERB_ENV}" 
     21require "#{MERB_ROOT}/conf/environments/#{MERB_ENV}" 
    2222 
    2323# add your own ruby code here for app specific stuff. This file gets loaded 
  • trunk/lib/merb.rb

    r395 r398  
    1616 
    1717module Merb 
    18   VERSION='0.3.8' unless defined?VERSION 
     18  VERSION='0.4.0' unless defined?VERSION 
    1919  class Server 
    2020    class << self 
     
    5050 
    5151MERB_ROOT = Merb::Server.merb_root || Dir.pwd 
    52 DIST_ROOT = Merb::Server.dist_root || Dir.pwd+'/dist' 
    5352MERB_ENV  = Merb::Server.config[:environment].nil? ? 'development' : Merb::Server.config[:environment] 
    54 MERB_VIEW_ROOT = MERB_ROOT / "dist/app/views" 
     53MERB_VIEW_ROOT = MERB_ROOT / "app/views" 
    5554 
    5655logpath = $TESTING ? "/tmp/merb_test.log" : "#{MERB_ROOT}/log/merb.#{Merb::Server.port}.log" 
  • trunk/lib/merb/generators/merb_app/merb_app.rb

    r293 r398  
    2121        FileUtils.rm_rf(f) if /\.svn$/ =~ f 
    2222      end 
    23       public_path = File.expand_path(File.join(@path, "dist", "public")) 
    24       mailer_path = File.expand_path(File.join(@path, "dist", "app", "mailers")) 
    25       app_path    = File.expand_path(File.join(@path, "dist", "app")) 
     23      public_path = File.expand_path(File.join(@path, "public")) 
     24      mailer_path = File.expand_path(File.join(@path, "app", "mailers")) 
     25      app_path    = File.expand_path(File.join(@path, "app")) 
    2626      FileUtils.mkdir_p(["#{mailer_path}/helpers",  
    2727                         "#{mailer_path}/views",  
  • trunk/lib/merb/merb_dispatcher.rb

    r394 r398  
    7373      def resolve_controller(controller_name) 
    7474        segments = controller_name.split('/').map{|s| s.snake_case} 
    75         path = "#{DIST_ROOT}/app/controllers/#{controller_name}.rb" 
     75        path = "#{MERB_ROOT}/app/controllers/#{controller_name}.rb" 
    7676        cnt = segments.map{|s| s.camel_case }.join('::') 
    7777         
  • trunk/lib/merb/merb_exceptions.rb

    r394 r398  
    149149      ErrorResponse.new(e).out  
    150150    else 
    151       IO.read(DIST_ROOT / 'public/500.html') rescue "500 Internal Server Error!" 
     151      IO.read(MERB_ROOT / 'public/500.html') rescue "500 Internal Server Error!" 
    152152    end 
    153153  end   
  • trunk/lib/merb/merb_mail_controller.rb

    r366 r398  
    44  class MailController < AbstractController 
    55    
    6     self._template_root = File.expand_path(DIST_ROOT / "app/mailers/views") 
     6    self._template_root = File.expand_path(MERB_ROOT / "app/mailers/views") 
    77    class_inheritable_accessor :_mailer_klass 
    88    self._mailer_klass  = Merb::Mailer 
  • trunk/lib/merb/merb_part_controller.rb

    r348 r398  
    11module Merb 
    22  class PartController < AbstractController 
    3     self._template_root = File.expand_path(DIST_ROOT / "app/parts/views") 
     3    self._template_root = File.expand_path(MERB_ROOT / "app/parts/views") 
    44     
    55    def initialize(web_controller) 
  • trunk/lib/merb/merb_server.rb

    r385 r398  
    2121      } 
    2222      begin 
    23         options = defaults.merge(YAML.load(Erubis::Eruby.new(IO.read("#{defaults[:merb_root]}/dist/conf/merb.yml")).result)) 
     23        options = defaults.merge(YAML.load(Erubis::Eruby.new(IO.read("#{defaults[:merb_root]}/conf/merb.yml")).result)) 
    2424      rescue 
    2525        options = defaults 
     
    165165      def initialize_merb 
    166166        require 'merb' 
    167         require @@merb_opts[:merb_root] / 'dist/conf/router.rb' 
    168         require @@merb_opts[:merb_root] / 'dist/conf/merb_init.rb' 
    169  
     167        require @@merb_opts[:merb_root] / 'conf/router.rb' 
     168        require @@merb_opts[:merb_root] / 'conf/merb_init.rb' 
    170169      end   
    171170       
     
    206205        end   
    207206         
    208         @@merb_opts[:dist_root] = @@merb_opts[:merb_root]+'/dist'  
    209         $LOAD_PATH.unshift( File.join(@@merb_opts[:dist_root] , '/app/models') ) 
    210         $LOAD_PATH.unshift( File.join(@@merb_opts[:dist_root] , '/app/controllers') ) 
    211         $LOAD_PATH.unshift( File.join(@@merb_opts[:dist_root] , '/lib') ) 
    212         if File.exist? File.join(@@merb_opts[:dist_root] , '/framework') 
    213           $LOAD_PATH.unshift( File.join(@@merb_opts[:dist_root] , '/framework') ) 
     207        $LOAD_PATH.unshift( File.join(@@merb_opts[:merb_root] , '/app/models') ) 
     208        $LOAD_PATH.unshift( File.join(@@merb_opts[:merb_root] , '/app/controllers') ) 
     209        $LOAD_PATH.unshift( File.join(@@merb_opts[:merb_root] , '/lib') ) 
     210        if File.exist? File.join(@@merb_opts[:merb_root] , '/framework') 
     211          $LOAD_PATH.unshift( File.join(@@merb_opts[:merb_root] , '/framework') ) 
    214212        end 
    215213            
     
    350348          listener do 
    351349            uri( "/", :handler => MerbUploadHandler.new(yconfig), :in_front => true) if @@merb_opts[:config] 
    352             uri "/", :handler => MerbHandler.new(@@merb_opts[:dist_root]+'/public') 
     350            uri "/", :handler => MerbHandler.new(@@merb_opts[:merb_root]+'/public') 
    353351            uri "/favicon.ico", :handler => Mongrel::Error404Handler.new("")  
    354352          end 
  • trunk/lib/merb/merb_yaml_store.rb

    r107 r398  
    66    attr_accessor :db 
    77   
    8     def initialize(filename = "#{DIST_ROOT}/schema/db.yaml") 
     8    def initialize(filename = "#{MERB_ROOT}/schema/db.yaml") 
    99      FileUtils.touch(filename) 
    1010      @db = YAML::Store.new(filename)