public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Search Repo:
Add 'add_new_scripts' rake task for adding new rails scripts to script/*


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2926 
5ecf4fe2-1ee6-0310-87b1-e25e094e27de
jamis (author)
Mon Nov 07 10:09:31 -0800 2005
commit  c2eb22e5c69caba0f9eeb5b95558837d0d572f44
tree    9887f9092d8ead7369bca04ef5518b261408142f
parent  63e30a5cae7140742059804998371f4e0596f549
...
1
2
 
 
3
4
5
...
1
2
3
4
5
6
7
0
@@ -1,5 +1,7 @@
0
 *SVN*
0
 
0
+* Add 'add_new_scripts' rake task for adding new rails scripts to script/* [Jamis Buck]
0
+
0
 * Remove bogus hyphen from script/process/reaper calls to 'ps'. #2767 [anonymous]
0
 
0
 * Copy lighttpd.conf when it is first needed, instead of on app creation [Jamis Buck]
...
1
2
3
...
 
 
 
0
@@ -1,4 +1 @@
0
-#!/usr/local/bin/ruby
0
-require File.dirname(__FILE__) + '/../config/boot'
0
-require 'commands/lighttpd'
...
50
51
52
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
0
@@ -50,4 +50,23 @@
0
 task :unfreeze_rails do
0
   rm_rf "vendor/rails"
0
 end
0
+
0
+desc "Add new scripts to the application script/ directory"
0
+task :add_new_scripts do
0
+ local_base = "script"
0
+ edge_base = "#{File.dirname(__FILE__)}/../../bin"
0
+
0
+ local = Dir["#{local_base}/**/*"].reject { |path| File.directory?(path) }
0
+ edge = Dir["#{edge_base}/**/*"].reject { |path| File.directory?(path) }
0
+
0
+ edge.each do |script|
0
+ base_name = script[(edge_base.length+1)..-1]
0
+ next if base_name == "rails"
0
+ next if local.detect { |path| base_name == path[(local_base.length+1)..-1] }
0
+ if !File.directory?("#{local_base}/#{File.dirname(base_name)}")
0
+ mkdir_p "#{local_base}/#{File.dirname(base_name)}"
0
+ end
0
+ install script, "#{local_base}/#{base_name}", :mode => 0655
0
+ end
0
+end

Comments

    No one has commented yet.