From d219d54930a68a9c5de3705d05d5d464e5e51b54 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Thu, 29 Sep 2005 12:33:48 +0000 Subject: Clean up the act of commands git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2412 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- railties/lib/commands/breakpointer | 3 --- railties/lib/commands/breakpointer.rb | 1 + railties/lib/commands/console.rb | 2 +- railties/lib/commands/destroy | 7 ------- railties/lib/commands/destroy.rb | 6 ++++++ railties/lib/commands/generate | 7 ------- railties/lib/commands/generate.rb | 6 ++++++ railties/lib/commands/server.rb | 4 ++-- railties/lib/commands/update | 5 ----- railties/lib/commands/update.rb | 4 ++++ 10 files changed, 20 insertions(+), 25 deletions(-) delete mode 100644 railties/lib/commands/breakpointer create mode 100644 railties/lib/commands/breakpointer.rb delete mode 100644 railties/lib/commands/destroy create mode 100644 railties/lib/commands/destroy.rb delete mode 100755 railties/lib/commands/generate create mode 100755 railties/lib/commands/generate.rb delete mode 100644 railties/lib/commands/update create mode 100644 railties/lib/commands/update.rb (limited to 'railties/lib/commands') diff --git a/railties/lib/commands/breakpointer b/railties/lib/commands/breakpointer deleted file mode 100644 index 4ac3e7c3c9..0000000000 --- a/railties/lib/commands/breakpointer +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/local/bin/ruby -$LOAD_PATH << File.dirname(__FILE__) + '/../vendor/railties/lib' -require 'breakpoint_client' diff --git a/railties/lib/commands/breakpointer.rb b/railties/lib/commands/breakpointer.rb new file mode 100644 index 0000000000..cc52010c32 --- /dev/null +++ b/railties/lib/commands/breakpointer.rb @@ -0,0 +1 @@ +require 'breakpoint_client' diff --git a/railties/lib/commands/console.rb b/railties/lib/commands/console.rb index b8756ba3a1..0aed60152c 100644 --- a/railties/lib/commands/console.rb +++ b/railties/lib/commands/console.rb @@ -9,7 +9,7 @@ OptionParser.new do |opt| end libs = " -r irb/completion" -libs << " -r #{File.dirname(__FILE__)}/../config/environment" +libs << " -r #{RAILS_ROOT}/config/environment" libs << " -r console_sandbox" if options[:sandbox] ENV['RAILS_ENV'] = ARGV.first || 'development' diff --git a/railties/lib/commands/destroy b/railties/lib/commands/destroy deleted file mode 100644 index f9d9d181a4..0000000000 --- a/railties/lib/commands/destroy +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/local/bin/ruby -require File.dirname(__FILE__) + '/../config/environment' -require 'rails_generator' -require 'rails_generator/scripts/destroy' - -ARGV.shift if ['--help', '-h'].include?(ARGV[0]) -Rails::Generator::Scripts::Destroy.new.run(ARGV) diff --git a/railties/lib/commands/destroy.rb b/railties/lib/commands/destroy.rb new file mode 100644 index 0000000000..f4b81d6511 --- /dev/null +++ b/railties/lib/commands/destroy.rb @@ -0,0 +1,6 @@ +require "#{RAILS_ROOT}/config/environment" +require 'rails_generator' +require 'rails_generator/scripts/destroy' + +ARGV.shift if ['--help', '-h'].include?(ARGV[0]) +Rails::Generator::Scripts::Destroy.new.run(ARGV) diff --git a/railties/lib/commands/generate b/railties/lib/commands/generate deleted file mode 100755 index 43bcfd0cb1..0000000000 --- a/railties/lib/commands/generate +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/local/bin/ruby -require File.dirname(__FILE__) + '/../config/environment' -require 'rails_generator' -require 'rails_generator/scripts/generate' - -ARGV.shift if ['--help', '-h'].include?(ARGV[0]) -Rails::Generator::Scripts::Generate.new.run(ARGV) diff --git a/railties/lib/commands/generate.rb b/railties/lib/commands/generate.rb new file mode 100755 index 0000000000..3d3db3d856 --- /dev/null +++ b/railties/lib/commands/generate.rb @@ -0,0 +1,6 @@ +require "#{RAILS_ROOT}/config/environment" +require 'rails_generator' +require 'rails_generator/scripts/generate' + +ARGV.shift if ['--help', '-h'].include?(ARGV[0]) +Rails::Generator::Scripts::Generate.new.run(ARGV) diff --git a/railties/lib/commands/server.rb b/railties/lib/commands/server.rb index 5330c050b9..d21e91f980 100644 --- a/railties/lib/commands/server.rb +++ b/railties/lib/commands/server.rb @@ -5,7 +5,7 @@ OPTIONS = { :port => 3000, :ip => "0.0.0.0", :environment => "development", - :server_root => File.expand_path(File.dirname(__FILE__) + "/../public/"), + :server_root => File.expand_path(RAILS_ROOT + "/public/"), :server_type => WEBrick::SimpleServer, :charset => "UTF-8", :mime_types => WEBrick::HTTPUtils::DefaultMimeTypes @@ -47,7 +47,7 @@ ARGV.options do |opts| end ENV["RAILS_ENV"] = OPTIONS[:environment] -require File.dirname(__FILE__) + "/../config/environment" +require RAILS_ROOT + "/config/environment" require 'webrick_server' OPTIONS['working_directory'] = File.expand_path(RAILS_ROOT) diff --git a/railties/lib/commands/update b/railties/lib/commands/update deleted file mode 100644 index 430d325b07..0000000000 --- a/railties/lib/commands/update +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/local/bin/ruby -require File.dirname(__FILE__) + '/../config/environment' -require 'rails_generator' -require 'rails_generator/scripts/update' -Rails::Generator::Scripts::Update.new.run(ARGV) diff --git a/railties/lib/commands/update.rb b/railties/lib/commands/update.rb new file mode 100644 index 0000000000..83ef833300 --- /dev/null +++ b/railties/lib/commands/update.rb @@ -0,0 +1,4 @@ +require "#{RAILS_ROOT}/config/environment" +require 'rails_generator' +require 'rails_generator/scripts/update' +Rails::Generator::Scripts::Update.new.run(ARGV) -- cgit v1.2.3