aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2009-11-06 23:28:58 -0200
committerYehuda Katz <wycats@mobile-166-129-219-135.mycingular.net>2009-11-08 18:41:44 -0800
commit216e8c6bfad6800f5f2a772d40cab29442efdaf5 (patch)
tree2611d10fa2d2b8303a5df4cd3e8533dcf76c6ce8
parent103b29831e6d6a6c4363fd0e59ffcc6c343a14aa (diff)
downloadrails-216e8c6bfad6800f5f2a772d40cab29442efdaf5.tar.gz
rails-216e8c6bfad6800f5f2a772d40cab29442efdaf5.tar.bz2
rails-216e8c6bfad6800f5f2a772d40cab29442efdaf5.zip
Update Rails Generators to use Thor 0.12.0.
Signed-off-by: Yehuda Katz <wycats@mobile-166-129-219-135.mycingular.net>
-rw-r--r--railties/lib/rails/generators.rb2
-rw-r--r--railties/lib/rails/generators/base.rb4
-rw-r--r--railties/lib/rails/vendor/thor-0.12.0/CHANGELOG.rdoc (renamed from railties/lib/rails/vendor/thor-0.11.8/CHANGELOG.rdoc)7
-rw-r--r--railties/lib/rails/vendor/thor-0.12.0/LICENSE (renamed from railties/lib/rails/vendor/thor-0.11.8/LICENSE)0
-rw-r--r--railties/lib/rails/vendor/thor-0.12.0/README.rdoc (renamed from railties/lib/rails/vendor/thor-0.11.8/README.rdoc)0
-rw-r--r--railties/lib/rails/vendor/thor-0.12.0/Thorfile (renamed from railties/lib/rails/vendor/thor-0.11.8/Thorfile)0
-rw-r--r--railties/lib/rails/vendor/thor-0.12.0/lib/thor.rb (renamed from railties/lib/rails/vendor/thor-0.11.8/lib/thor.rb)0
-rw-r--r--railties/lib/rails/vendor/thor-0.12.0/lib/thor/actions.rb (renamed from railties/lib/rails/vendor/thor-0.11.8/lib/thor/actions.rb)0
-rw-r--r--railties/lib/rails/vendor/thor-0.12.0/lib/thor/actions/create_file.rb (renamed from railties/lib/rails/vendor/thor-0.11.8/lib/thor/actions/create_file.rb)1
-rw-r--r--railties/lib/rails/vendor/thor-0.12.0/lib/thor/actions/directory.rb (renamed from railties/lib/rails/vendor/thor-0.11.8/lib/thor/actions/directory.rb)14
-rw-r--r--railties/lib/rails/vendor/thor-0.12.0/lib/thor/actions/empty_directory.rb (renamed from railties/lib/rails/vendor/thor-0.11.8/lib/thor/actions/empty_directory.rb)1
-rw-r--r--railties/lib/rails/vendor/thor-0.12.0/lib/thor/actions/file_manipulation.rb (renamed from railties/lib/rails/vendor/thor-0.11.8/lib/thor/actions/file_manipulation.rb)0
-rw-r--r--railties/lib/rails/vendor/thor-0.12.0/lib/thor/actions/inject_into_file.rb (renamed from railties/lib/rails/vendor/thor-0.11.8/lib/thor/actions/inject_into_file.rb)0
-rw-r--r--railties/lib/rails/vendor/thor-0.12.0/lib/thor/base.rb (renamed from railties/lib/rails/vendor/thor-0.11.8/lib/thor/base.rb)0
-rw-r--r--railties/lib/rails/vendor/thor-0.12.0/lib/thor/core_ext/hash_with_indifferent_access.rb (renamed from railties/lib/rails/vendor/thor-0.11.8/lib/thor/core_ext/hash_with_indifferent_access.rb)0
-rw-r--r--railties/lib/rails/vendor/thor-0.12.0/lib/thor/core_ext/ordered_hash.rb (renamed from railties/lib/rails/vendor/thor-0.11.8/lib/thor/core_ext/ordered_hash.rb)0
-rw-r--r--railties/lib/rails/vendor/thor-0.12.0/lib/thor/error.rb (renamed from railties/lib/rails/vendor/thor-0.11.8/lib/thor/error.rb)0
-rw-r--r--railties/lib/rails/vendor/thor-0.12.0/lib/thor/group.rb (renamed from railties/lib/rails/vendor/thor-0.11.8/lib/thor/group.rb)2
-rw-r--r--railties/lib/rails/vendor/thor-0.12.0/lib/thor/invocation.rb (renamed from railties/lib/rails/vendor/thor-0.11.8/lib/thor/invocation.rb)0
-rw-r--r--railties/lib/rails/vendor/thor-0.12.0/lib/thor/parser.rb (renamed from railties/lib/rails/vendor/thor-0.11.8/lib/thor/parser.rb)0
-rw-r--r--railties/lib/rails/vendor/thor-0.12.0/lib/thor/parser/argument.rb (renamed from railties/lib/rails/vendor/thor-0.11.8/lib/thor/parser/argument.rb)0
-rw-r--r--railties/lib/rails/vendor/thor-0.12.0/lib/thor/parser/arguments.rb (renamed from railties/lib/rails/vendor/thor-0.11.8/lib/thor/parser/arguments.rb)0
-rw-r--r--railties/lib/rails/vendor/thor-0.12.0/lib/thor/parser/option.rb (renamed from railties/lib/rails/vendor/thor-0.11.8/lib/thor/parser/option.rb)0
-rw-r--r--railties/lib/rails/vendor/thor-0.12.0/lib/thor/parser/options.rb (renamed from railties/lib/rails/vendor/thor-0.11.8/lib/thor/parser/options.rb)0
-rw-r--r--railties/lib/rails/vendor/thor-0.12.0/lib/thor/rake_compat.rb (renamed from railties/lib/rails/vendor/thor-0.11.8/lib/thor/rake_compat.rb)0
-rw-r--r--railties/lib/rails/vendor/thor-0.12.0/lib/thor/runner.rb (renamed from railties/lib/rails/vendor/thor-0.11.8/lib/thor/runner.rb)0
-rw-r--r--railties/lib/rails/vendor/thor-0.12.0/lib/thor/shell.rb (renamed from railties/lib/rails/vendor/thor-0.11.8/lib/thor/shell.rb)0
-rw-r--r--railties/lib/rails/vendor/thor-0.12.0/lib/thor/shell/basic.rb (renamed from railties/lib/rails/vendor/thor-0.11.8/lib/thor/shell/basic.rb)0
-rw-r--r--railties/lib/rails/vendor/thor-0.12.0/lib/thor/shell/color.rb (renamed from railties/lib/rails/vendor/thor-0.11.8/lib/thor/shell/color.rb)0
-rw-r--r--railties/lib/rails/vendor/thor-0.12.0/lib/thor/task.rb (renamed from railties/lib/rails/vendor/thor-0.11.8/lib/thor/task.rb)0
-rw-r--r--railties/lib/rails/vendor/thor-0.12.0/lib/thor/util.rb (renamed from railties/lib/rails/vendor/thor-0.11.8/lib/thor/util.rb)0
-rw-r--r--railties/lib/rails/vendor/thor-0.12.0/lib/thor/version.rb (renamed from railties/lib/rails/vendor/thor-0.11.8/lib/thor/version.rb)0
32 files changed, 23 insertions, 8 deletions
diff --git a/railties/lib/rails/generators.rb b/railties/lib/rails/generators.rb
index fa2c11795b..19412c259e 100644
--- a/railties/lib/rails/generators.rb
+++ b/railties/lib/rails/generators.rb
@@ -9,7 +9,7 @@ require 'active_support/core_ext/module/attribute_accessors'
require 'active_support/core_ext/string/inflections'
# TODO: Do not always push on vendored thor
-$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/vendor/thor-0.11.8/lib")
+$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/vendor/thor-0.12.0/lib")
require 'rails/generators/base'
require 'rails/generators/named_base'
diff --git a/railties/lib/rails/generators/base.rb b/railties/lib/rails/generators/base.rb
index af1bf26f4a..a64005497b 100644
--- a/railties/lib/rails/generators/base.rb
+++ b/railties/lib/rails/generators/base.rb
@@ -212,6 +212,10 @@ module Rails
def self.inherited(base) #:nodoc:
super
+ # Cache source root, we need to do this, since __FILE__ is a relative value
+ # and can point to wrong directions when inside an specified directory.
+ base.source_root
+
if base.name && base.name !~ /Base$/ && defined?(Rails.root) && Rails.root
path = File.expand_path(File.join(Rails.root, 'lib', 'templates'))
if base.name.include?('::')
diff --git a/railties/lib/rails/vendor/thor-0.11.8/CHANGELOG.rdoc b/railties/lib/rails/vendor/thor-0.12.0/CHANGELOG.rdoc
index dba25b7205..adedfeca9d 100644
--- a/railties/lib/rails/vendor/thor-0.11.8/CHANGELOG.rdoc
+++ b/railties/lib/rails/vendor/thor-0.12.0/CHANGELOG.rdoc
@@ -2,7 +2,12 @@
* Improve spec coverage for Thor::Runner
-== 0.11.x, released 2009-07-01
+== 0.12, released 2009-11-06
+
+* [#7] Do not force white color on status
+* [#8] Yield a block with the filename on directory
+
+== 0.11, released 2009-07-01
* Added a rake compatibility layer. It allows you to use spec and rdoc tasks on
Thor classes.
diff --git a/railties/lib/rails/vendor/thor-0.11.8/LICENSE b/railties/lib/rails/vendor/thor-0.12.0/LICENSE
index 98722da459..98722da459 100644
--- a/railties/lib/rails/vendor/thor-0.11.8/LICENSE
+++ b/railties/lib/rails/vendor/thor-0.12.0/LICENSE
diff --git a/railties/lib/rails/vendor/thor-0.11.8/README.rdoc b/railties/lib/rails/vendor/thor-0.12.0/README.rdoc
index f1106f02b6..f1106f02b6 100644
--- a/railties/lib/rails/vendor/thor-0.11.8/README.rdoc
+++ b/railties/lib/rails/vendor/thor-0.12.0/README.rdoc
diff --git a/railties/lib/rails/vendor/thor-0.11.8/Thorfile b/railties/lib/rails/vendor/thor-0.12.0/Thorfile
index f71a1e57e2..f71a1e57e2 100644
--- a/railties/lib/rails/vendor/thor-0.11.8/Thorfile
+++ b/railties/lib/rails/vendor/thor-0.12.0/Thorfile
diff --git a/railties/lib/rails/vendor/thor-0.11.8/lib/thor.rb b/railties/lib/rails/vendor/thor-0.12.0/lib/thor.rb
index 68944f140d..68944f140d 100644
--- a/railties/lib/rails/vendor/thor-0.11.8/lib/thor.rb
+++ b/railties/lib/rails/vendor/thor-0.12.0/lib/thor.rb
diff --git a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/actions.rb b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/actions.rb
index d561ccb2aa..d561ccb2aa 100644
--- a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/actions.rb
+++ b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/actions.rb
diff --git a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/actions/create_file.rb b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/actions/create_file.rb
index 8f6badee27..a3d9296823 100644
--- a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/actions/create_file.rb
+++ b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/actions/create_file.rb
@@ -60,6 +60,7 @@ class Thor
FileUtils.mkdir_p(File.dirname(destination))
File.open(destination, 'w'){ |f| f.write render }
end
+ given_destination
end
protected
diff --git a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/actions/directory.rb b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/actions/directory.rb
index 063ac57406..467e63732a 100644
--- a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/actions/directory.rb
+++ b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/actions/directory.rb
@@ -40,15 +40,16 @@ class Thor
# directory "doc"
# directory "doc", "docs", :recursive => false
#
- def directory(source, destination=nil, config={})
- action Directory.new(self, source, destination || source, config)
+ def directory(source, destination=nil, config={}, &block)
+ action Directory.new(self, source, destination || source, config, &block)
end
class Directory < EmptyDirectory #:nodoc:
attr_reader :source
- def initialize(base, source, destination=nil, config={})
+ def initialize(base, source, destination=nil, config={}, &block)
@source = File.expand_path(base.find_in_source_paths(source.to_s))
+ @block = block
super(base, destination, { :recursive => true }.merge(config))
end
@@ -70,6 +71,7 @@ class Thor
Dir[lookup].each do |file_source|
next if File.directory?(file_source)
file_destination = File.join(given_destination, file_source.gsub(source, '.'))
+ file_destination.gsub!('/./', '/')
case file_source
when /\.empty_directory$/
@@ -77,9 +79,11 @@ class Thor
next if dirname == given_destination
base.empty_directory(dirname, config)
when /\.tt$/
- base.template(file_source, file_destination[0..-4], config)
+ destination = base.template(file_source, file_destination[0..-4], config)
+ @block.call(destination) if @block
else
- base.copy_file(file_source, file_destination, config)
+ destination = base.copy_file(file_source, file_destination, config)
+ @block.call(destination) if @block
end
end
end
diff --git a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/actions/empty_directory.rb b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/actions/empty_directory.rb
index 03c1fe4af1..484cb820f8 100644
--- a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/actions/empty_directory.rb
+++ b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/actions/empty_directory.rb
@@ -55,6 +55,7 @@ class Thor
def revoke!
say_status :remove, :red
::FileUtils.rm_rf(destination) if !pretend? && exists?
+ given_destination
end
protected
diff --git a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/actions/file_manipulation.rb b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/actions/file_manipulation.rb
index d77d90d448..d77d90d448 100644
--- a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/actions/file_manipulation.rb
+++ b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/actions/file_manipulation.rb
diff --git a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/actions/inject_into_file.rb b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/actions/inject_into_file.rb
index 0636ec6591..0636ec6591 100644
--- a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/actions/inject_into_file.rb
+++ b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/actions/inject_into_file.rb
diff --git a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/base.rb b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/base.rb
index 700d794123..700d794123 100644
--- a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/base.rb
+++ b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/base.rb
diff --git a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/core_ext/hash_with_indifferent_access.rb b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/core_ext/hash_with_indifferent_access.rb
index 78bc5cf4bf..78bc5cf4bf 100644
--- a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/core_ext/hash_with_indifferent_access.rb
+++ b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/core_ext/hash_with_indifferent_access.rb
diff --git a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/core_ext/ordered_hash.rb b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/core_ext/ordered_hash.rb
index 27fea5bb35..27fea5bb35 100644
--- a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/core_ext/ordered_hash.rb
+++ b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/core_ext/ordered_hash.rb
diff --git a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/error.rb b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/error.rb
index f9b31a35d1..f9b31a35d1 100644
--- a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/error.rb
+++ b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/error.rb
diff --git a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/group.rb b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/group.rb
index 1e59df2313..0964a9667a 100644
--- a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/group.rb
+++ b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/group.rb
@@ -74,7 +74,7 @@ class Thor::Group
#
def invoke(*names, &block)
options = names.last.is_a?(Hash) ? names.pop : {}
- verbose = options.fetch(:verbose, :white)
+ verbose = options.fetch(:verbose, true)
names.each do |name|
invocations[name] = false
diff --git a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/invocation.rb b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/invocation.rb
index 32e6a72454..32e6a72454 100644
--- a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/invocation.rb
+++ b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/invocation.rb
diff --git a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/parser.rb b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/parser.rb
index 57a3f6e1a5..57a3f6e1a5 100644
--- a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/parser.rb
+++ b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/parser.rb
diff --git a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/parser/argument.rb b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/parser/argument.rb
index aa8ace4719..aa8ace4719 100644
--- a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/parser/argument.rb
+++ b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/parser/argument.rb
diff --git a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/parser/arguments.rb b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/parser/arguments.rb
index fb5d965e06..fb5d965e06 100644
--- a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/parser/arguments.rb
+++ b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/parser/arguments.rb
diff --git a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/parser/option.rb b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/parser/option.rb
index 9e40ec73fa..9e40ec73fa 100644
--- a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/parser/option.rb
+++ b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/parser/option.rb
diff --git a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/parser/options.rb b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/parser/options.rb
index 75092308b5..75092308b5 100644
--- a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/parser/options.rb
+++ b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/parser/options.rb
diff --git a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/rake_compat.rb b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/rake_compat.rb
index 0d0757fdda..0d0757fdda 100644
--- a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/rake_compat.rb
+++ b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/rake_compat.rb
diff --git a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/runner.rb b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/runner.rb
index 9dc70ea069..9dc70ea069 100644
--- a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/runner.rb
+++ b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/runner.rb
diff --git a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/shell.rb b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/shell.rb
index 1dc8f0e5b4..1dc8f0e5b4 100644
--- a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/shell.rb
+++ b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/shell.rb
diff --git a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/shell/basic.rb b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/shell/basic.rb
index ea9665380b..ea9665380b 100644
--- a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/shell/basic.rb
+++ b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/shell/basic.rb
diff --git a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/shell/color.rb b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/shell/color.rb
index 24704f7885..24704f7885 100644
--- a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/shell/color.rb
+++ b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/shell/color.rb
diff --git a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/task.rb b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/task.rb
index 91c7564d3f..91c7564d3f 100644
--- a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/task.rb
+++ b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/task.rb
diff --git a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/util.rb b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/util.rb
index ebae0a3193..ebae0a3193 100644
--- a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/util.rb
+++ b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/util.rb
diff --git a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/version.rb b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/version.rb
index 885230fac4..885230fac4 100644
--- a/railties/lib/rails/vendor/thor-0.11.8/lib/thor/version.rb
+++ b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/version.rb