Changeset 411
- Timestamp:
- 08/12/07 20:44:12 (1 year ago)
- Files:
-
- trunk/README (modified) (2 diffs)
- trunk/Rakefile (modified) (1 diff)
- trunk/examples/skeleton/conf/merb.yml (modified) (1 diff)
- trunk/examples/skeleton/script/new_migration (modified) (1 diff)
- trunk/lib/merb/mail_controller.rb (modified) (1 diff)
- trunk/lib/merb/server.rb (modified) (2 diffs)
- trunk/lib/tasks/db.rake (modified) (3 diffs)
- trunk/lib/tasks/merb.rake (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/README
r398 r411 247 247 === Helpers 248 248 249 dist/app/helpers/global_helper.rb will be available to all of your views.249 app/helpers/global_helper.rb will be available to all of your views. 250 250 Helpers named after your controller plus _helper.rb will be included in the views 251 251 for that controller only. … … 254 254 255 255 right now you add your routes in 256 the appdir/ dist/conf/router.rb file. So by default it runs on port 4000256 the appdir/conf/router.rb file. So by default it runs on port 4000 257 257 258 258 $ cd /path/to/your/merb/app trunk/Rakefile
r403 r411 19 19 CLEAN.include ['**/.*.sw?', '*.gem', '.config'] 20 20 21 setup_clean [ "pkg", "lib/*.bundle", "*.gem", 22 "doc", ".config", "examples/sample_app/dist/public/files/**/*", 'examples/sample_app/log/*', 'coverage'] 21 setup_clean [ "pkg", "lib/*.bundle", "*.gem", "doc", ".config", 'coverage'] 23 22 24 23 trunk/examples/skeleton/conf/merb.yml
r366 r411 29 29 30 30 # Uncomment to use the merb upload progress 31 #:config: dist/conf/upload.conf31 #:config: conf/upload.conf 32 32 33 33 # Uncomment to cache templates in dev mode. Templates are cached trunk/examples/skeleton/script/new_migration
r258 r411 14 14 15 15 class_name = ARGV[0] 16 highest_migration = Dir[Dir.pwd+'/ dist/schema/migrations/*'].map{|f| File.basename(f) =~ /^(\d+)/; $1}.max16 highest_migration = Dir[Dir.pwd+'/schema/migrations/*'].map{|f| File.basename(f) =~ /^(\d+)/; $1}.max 17 17 filename = format("%03d_%s", (highest_migration.to_i+1), class_name.snake_case) 18 18 19 File.open(Dir.pwd+"/ dist/schema/migrations/#{filename}.rb", 'w+') do |file|19 File.open(Dir.pwd+"/schema/migrations/#{filename}.rb", 'w+') do |file| 20 20 file.write Erubis::Eruby.new(TMPL).result(binding) 21 21 end trunk/lib/merb/mail_controller.rb
r401 r411 32 32 # 33 33 # First of all, you'll need to store email files in your 34 # dist/app/mailers/views directory. They should be under a directory that34 # app/mailers/views directory. They should be under a directory that 35 35 # matches the name of your mailer (e.g. TestMailer's views would be stored 36 36 # under test_mailer). trunk/lib/merb/server.rb
r399 r411 134 134 # We need to reload the options that exist in the App's merb.yml 135 135 # This is needed when one calls merb NOT from the merb_app ROOT 136 # like so: merb --merb-config /path/to/ dist/conf/merb.yml -m /path/to/merb/app136 # like so: merb --merb-config /path/to/conf/merb.yml -m /path/to/merb/app 137 137 # or if we add :merb_root: /path/to/merb/app in the merb.yml we can now only call it 138 # like so: merb --merb-config /path/to/ dist/conf/merb.yml138 # like so: merb --merb-config /path/to/conf/merb.yml 139 139 if options[:merb_config] 140 140 # Check and see if an environment has been set through the CLI … … 325 325 puts "Starting merb drb server on port: #{port}" 326 326 require 'merb/merb_drb_server' 327 drb_init = File.join(@@merb_opts[:merb_root], "/ dist/conf/merb_drb_init")327 drb_init = File.join(@@merb_opts[:merb_root], "/conf/merb_drb_init") 328 328 require drb_init if File.exist?(drb_init) 329 329 DRb.start_service("druby://#{@@merb_opts[:host]}:#{port}", Merb::DrbServiceProvider) trunk/lib/tasks/db.rake
r321 r411 7 7 Merb::Server.config[:environment] = ENV['MERB_ENV'] if ENV['MERB_ENV'] 8 8 MERB_ENV = Merb::Server.config[:environment].nil? ? 'development' : Merb::Server.config[:environment] 9 load MERB_ROOT+'/ dist/conf/merb_init.rb'9 load MERB_ROOT+'/conf/merb_init.rb' 10 10 end 11 11 12 12 namespace :db do 13 desc "Migrate the database through scripts in dist/schema/migrate. Target specific version with VERSION=x"13 desc "Migrate the database through scripts in schema/migrate. Target specific version with VERSION=x" 14 14 task :migrate => :merb_env do 15 ActiveRecord::Migrator.migrate(" dist/schema/migrations/", ENV["VERSION"] ? ENV["VERSION"].to_i : nil)15 ActiveRecord::Migrator.migrate("schema/migrations/", ENV["VERSION"] ? ENV["VERSION"].to_i : nil) 16 16 Rake::Task["db:schema:dump"].invoke 17 17 end … … 21 21 task :dump => :merb_env do 22 22 require 'active_record/schema_dumper' 23 File.open(ENV['SCHEMA'] || " dist/schema/schema.rb", "w") do |file|23 File.open(ENV['SCHEMA'] || "schema/schema.rb", "w") do |file| 24 24 ActiveRecord::SchemaDumper.dump(ActiveRecord::Base.connection, file) 25 25 end … … 28 28 desc "Load a schema.rb file into the database" 29 29 task :load => :merb_env do 30 file = ENV['SCHEMA'] || " dist/schema/schema.rb"30 file = ENV['SCHEMA'] || "schema/schema.rb" 31 31 load(file) 32 32 end trunk/lib/tasks/merb.rake
r410 r411 2 2 script_filepath = MERB_ROOT / 'script/merb' 3 3 FileUtils.rm script_filepath if File.exist? script_filepath 4 tmpl = "#!/usr/bin/env ruby\nrequire File.expand_path(File.dirname(__FILE__)+'/../ dist/framework/merb/merb_server')\nMerb::Server.run\n"4 tmpl = "#!/usr/bin/env ruby\nrequire File.expand_path(File.dirname(__FILE__)+'/../framework/merb/merb_server')\nMerb::Server.run\n" 5 5 File.open(script_filepath, 'wb') {|f| 6 6 f.write tmpl … … 10 10 11 11 namespace :merb do 12 desc "freeze the merb framework into dist/merb for portability"12 desc "freeze the merb framework into merb for portability" 13 13 task :freeze do 14 FileUtils.rm_rf MERB_ROOT / ' dist/framework'15 FileUtils.cp_r MERB_FRAMEWORK_ROOT, (MERB_ROOT / ' dist/framework')14 FileUtils.rm_rf MERB_ROOT / 'framework' 15 FileUtils.cp_r MERB_FRAMEWORK_ROOT, (MERB_ROOT / 'framework') 16 16 install_merb_script 17 17 18 puts " Freezing Merb Framework into dist/framework"18 puts " Freezing Merb Framework into framework" 19 19 puts " Use script/merb to start instead of plain merb" 20 20 end 21 21 desc "unfreeze this app from the framework and use system gem." 22 22 task :unfreeze do 23 FileUtils.rm_rf MERB_ROOT / ' dist/framework'23 FileUtils.rm_rf MERB_ROOT / 'framework' 24 24 FileUtils.rm MERB_ROOT / 'script/merb' 25 25 26 26 puts " Removed: " 27 puts " - #{MERB_ROOT / ' dist/framework'} (recursive) "27 puts " - #{MERB_ROOT / 'framework'} (recursive) " 28 28 puts " - #{MERB_ROOT / 'script/merb'}" 29 29 end … … 31 31 desc "freeze the merb framework from svn" 32 32 task :freeze_from_svn do 33 install_path = MERB_ROOT / ' dist/framework'33 install_path = MERB_ROOT / 'framework' 34 34 puts " Removing old framework" if File.exist? install_path 35 35 FileUtils.rm_rf install_path … … 40 40 41 41 puts " Use script/merb to start instead of plain merb" 42 tmpl = "#!/usr/local/bin/ruby\nrequire File.expand_path(File.dirname(__FILE__)+'/../ dist/framework/merb/merb_server')\nMerb::Server.run\n"42 tmpl = "#!/usr/local/bin/ruby\nrequire File.expand_path(File.dirname(__FILE__)+'/../framework/merb/merb_server')\nMerb::Server.run\n" 43 43 File.open(MERB_ROOT / 'script/merb', 'wb') {|f| 44 44 f.write tmpl
