aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/vendor
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2009-11-17 22:47:23 +0000
committerPratik Naik <pratiknaik@gmail.com>2009-11-17 22:47:23 +0000
commit5446d5cb05b50a9a3f317ded774be438e0eff909 (patch)
tree6b0b87efe3e95783763208215a3159fb63217a6d /railties/lib/rails/vendor
parent9754debb9a72f9385950e5282f3642b995ab76d8 (diff)
parentf8877d4b2a2a6f68770b376f0b1391a6295f62f2 (diff)
downloadrails-5446d5cb05b50a9a3f317ded774be438e0eff909.tar.gz
rails-5446d5cb05b50a9a3f317ded774be438e0eff909.tar.bz2
rails-5446d5cb05b50a9a3f317ded774be438e0eff909.zip
Merge remote branch 'mainstream/master'
Conflicts: activesupport/lib/active_support/core_ext/hash/conversions.rb
Diffstat (limited to 'railties/lib/rails/vendor')
-rwxr-xr-xrailties/lib/rails/vendor/thor-0.11.6/bin/rake2thor87
-rwxr-xr-xrailties/lib/rails/vendor/thor-0.11.6/bin/thor7
-rw-r--r--railties/lib/rails/vendor/thor-0.12.0/CHANGELOG.rdoc (renamed from railties/lib/rails/vendor/thor-0.11.6/CHANGELOG.rdoc)7
-rw-r--r--railties/lib/rails/vendor/thor-0.12.0/LICENSE (renamed from railties/lib/rails/vendor/thor-0.11.6/LICENSE)0
-rw-r--r--railties/lib/rails/vendor/thor-0.12.0/README.rdoc (renamed from railties/lib/rails/vendor/thor-0.11.6/README.rdoc)0
-rw-r--r--railties/lib/rails/vendor/thor-0.12.0/Thorfile63
-rw-r--r--railties/lib/rails/vendor/thor-0.12.0/lib/thor.rb (renamed from railties/lib/rails/vendor/thor-0.11.6/lib/thor.rb)1
-rw-r--r--railties/lib/rails/vendor/thor-0.12.0/lib/thor/actions.rb (renamed from railties/lib/rails/vendor/thor-0.11.6/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.6/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.6/lib/thor/actions/directory.rb)18
-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.6/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.6/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.6/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.6/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.6/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.6/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.6/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.6/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.6/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.6/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.6/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.6/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.6/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.6/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.6/lib/thor/rake_compat.rb)11
-rw-r--r--railties/lib/rails/vendor/thor-0.12.0/lib/thor/runner.rb (renamed from railties/lib/rails/vendor/thor-0.11.6/lib/thor/runner.rb)2
-rw-r--r--railties/lib/rails/vendor/thor-0.12.0/lib/thor/shell.rb (renamed from railties/lib/rails/vendor/thor-0.11.6/lib/thor/shell.rb)10
-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.6/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.6/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.6/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.6/lib/thor/util.rb)4
-rw-r--r--railties/lib/rails/vendor/thor-0.12.0/lib/thor/version.rb3
32 files changed, 103 insertions, 114 deletions
diff --git a/railties/lib/rails/vendor/thor-0.11.6/bin/rake2thor b/railties/lib/rails/vendor/thor-0.11.6/bin/rake2thor
deleted file mode 100755
index 50c7410d80..0000000000
--- a/railties/lib/rails/vendor/thor-0.11.6/bin/rake2thor
+++ /dev/null
@@ -1,87 +0,0 @@
-#!/usr/bin/env ruby
-
-require 'rubygems'
-require 'ruby2ruby'
-require 'parse_tree'
-if Ruby2Ruby::VERSION >= "1.2.0"
- require 'parse_tree_extensions'
-end
-require 'rake'
-
-input = ARGV[0] || 'Rakefile'
-output = ARGV[1] || 'Thorfile'
-
-$requires = []
-
-module Kernel
- def require_with_record(file)
- $requires << file if caller[1] =~ /rake2thor:/
- require_without_record file
- end
- alias_method :require_without_record, :require
- alias_method :require, :require_with_record
-end
-
-load input
-
-@private_methods = []
-
-def file_task_name(name)
- "compile_" + name.gsub('/', '_slash_').gsub('.', '_dot_').gsub(/\W/, '_')
-end
-
-def method_for_task(task)
- file_task = task.is_a?(Rake::FileTask)
- comment = task.instance_variable_get('@comment')
- prereqs = task.instance_variable_get('@prerequisites').select(&Rake::Task.method(:task_defined?))
- actions = task.instance_variable_get('@actions')
- name = task.name.gsub(/^([^:]+:)+/, '')
- name = file_task_name(name) if file_task
- meth = ''
-
- meth << "desc #{name.inspect}, #{comment.inspect}\n" if comment
- meth << "def #{name}\n"
-
- meth << prereqs.map do |pre|
- pre = pre.to_s
- pre = file_task_name(pre) if Rake::Task[pre].is_a?(Rake::FileTask)
- ' ' + pre
- end.join("\n")
-
- meth << "\n\n" unless prereqs.empty? || actions.empty?
-
- meth << actions.map do |act|
- act = act.to_ruby
- unless act.gsub!(/^proc \{ \|(\w+)\|\n/,
- " \\1 = Struct.new(:name).new(#{name.inspect}) # A crude mock Rake::Task object\n")
- act.gsub!(/^proc \{\n/, '')
- end
- act.gsub(/\n\}$/, '')
- end.join("\n")
-
- meth << "\nend"
-
- if file_task
- @private_methods << meth
- return
- end
-
- meth
-end
-
-body = Rake::Task.tasks.map(&method(:method_for_task)).compact.map { |meth| meth.gsub(/^/, ' ') }.join("\n\n")
-
-unless @private_methods.empty?
- body << "\n\n private\n\n"
- body << @private_methods.map { |meth| meth.gsub(/^/, ' ') }.join("\n\n")
-end
-
-requires = $requires.map { |r| "require #{r.inspect}" }.join("\n")
-
-File.open(output, 'w') { |f| f.write(<<END.lstrip) }
-#{requires}
-
-class Default < Thor
-#{body}
-end
-END
diff --git a/railties/lib/rails/vendor/thor-0.11.6/bin/thor b/railties/lib/rails/vendor/thor-0.11.6/bin/thor
deleted file mode 100755
index eaf849fb4a..0000000000
--- a/railties/lib/rails/vendor/thor-0.11.6/bin/thor
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/env ruby
-# -*- mode: ruby -*-
-
-require File.join(File.dirname(__FILE__), '..', 'lib', 'thor')
-require 'thor/runner'
-
-Thor::Runner.start
diff --git a/railties/lib/rails/vendor/thor-0.11.6/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.6/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.6/LICENSE b/railties/lib/rails/vendor/thor-0.12.0/LICENSE
index 98722da459..98722da459 100644
--- a/railties/lib/rails/vendor/thor-0.11.6/LICENSE
+++ b/railties/lib/rails/vendor/thor-0.12.0/LICENSE
diff --git a/railties/lib/rails/vendor/thor-0.11.6/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.6/README.rdoc
+++ b/railties/lib/rails/vendor/thor-0.12.0/README.rdoc
diff --git a/railties/lib/rails/vendor/thor-0.12.0/Thorfile b/railties/lib/rails/vendor/thor-0.12.0/Thorfile
new file mode 100644
index 0000000000..f71a1e57e2
--- /dev/null
+++ b/railties/lib/rails/vendor/thor-0.12.0/Thorfile
@@ -0,0 +1,63 @@
+# enconding: utf-8
+
+require File.join(File.dirname(__FILE__), "lib", "thor", "version")
+require 'thor/rake_compat'
+require 'spec/rake/spectask'
+require 'rdoc/task'
+
+GEM_NAME = 'thor'
+EXTRA_RDOC_FILES = ["README.rdoc", "LICENSE", "CHANGELOG.rdoc", "VERSION", "Thorfile"]
+
+class Default < Thor
+ include Thor::RakeCompat
+
+ Spec::Rake::SpecTask.new(:spec) do |t|
+ t.libs << 'lib'
+ t.spec_opts = ['--options', "spec/spec.opts"]
+ t.spec_files = FileList['spec/**/*_spec.rb']
+ end
+
+ Spec::Rake::SpecTask.new(:rcov) do |t|
+ t.libs << 'lib'
+ t.spec_opts = ['--options', "spec/spec.opts"]
+ t.spec_files = FileList['spec/**/*_spec.rb']
+ t.rcov = true
+ t.rcov_dir = "rcov"
+ end
+
+ RDoc::Task.new do |rdoc|
+ rdoc.main = "README.rdoc"
+ rdoc.rdoc_dir = "rdoc"
+ rdoc.title = GEM_NAME
+ rdoc.rdoc_files.include(*EXTRA_RDOC_FILES)
+ rdoc.rdoc_files.include('lib/**/*.rb')
+ rdoc.options << '--line-numbers' << '--inline-source'
+ end
+
+ begin
+ require 'jeweler'
+ Jeweler::Tasks.new do |s|
+ s.name = GEM_NAME
+ s.version = Thor::VERSION
+ s.rubyforge_project = "textmate"
+ s.platform = Gem::Platform::RUBY
+ s.summary = "A scripting framework that replaces rake, sake and rubigen"
+ s.email = "ruby-thor@googlegroups.com"
+ s.homepage = "http://yehudakatz.com"
+ s.description = "A scripting framework that replaces rake, sake and rubigen"
+ s.authors = ['Yehuda Katz', 'José Valim']
+ s.has_rdoc = true
+ s.extra_rdoc_files = EXTRA_RDOC_FILES
+ s.require_path = 'lib'
+ s.bindir = "bin"
+ s.executables = %w( thor rake2thor )
+ s.files = s.extra_rdoc_files + Dir.glob("{bin,lib}/**/*")
+ s.files.exclude 'spec/sandbox/**/*'
+ s.test_files.exclude 'spec/sandbox/**/*'
+ end
+
+ Jeweler::RubyforgeTasks.new
+ rescue LoadError
+ puts "Jeweler, or one of its dependencies, is not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
+ end
+end
diff --git a/railties/lib/rails/vendor/thor-0.11.6/lib/thor.rb b/railties/lib/rails/vendor/thor-0.12.0/lib/thor.rb
index 3b45c4e9b7..68944f140d 100644
--- a/railties/lib/rails/vendor/thor-0.11.6/lib/thor.rb
+++ b/railties/lib/rails/vendor/thor-0.12.0/lib/thor.rb
@@ -1,4 +1,3 @@
-$:.unshift File.expand_path(File.dirname(__FILE__))
require 'thor/base'
require 'thor/group'
require 'thor/actions'
diff --git a/railties/lib/rails/vendor/thor-0.11.6/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.6/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.6/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.6/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.6/lib/thor/actions/directory.rb b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/actions/directory.rb
index be5eb822ac..467e63732a 100644
--- a/railties/lib/rails/vendor/thor-0.11.6/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,14 +71,19 @@ 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$/
- base.empty_directory(File.dirname(file_destination), config)
+ dirname = File.dirname(file_destination).gsub(/\/\.$/, '')
+ 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.6/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.6/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.6/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.6/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.6/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.6/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.6/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.6/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.6/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.6/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.6/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.6/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.6/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.6/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.6/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.6/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.6/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.6/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.6/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.6/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.6/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.6/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.6/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.6/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.6/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.6/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.6/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.6/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.6/lib/thor/rake_compat.rb b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/rake_compat.rb
index 3ab6bb21f5..0d0757fdda 100644
--- a/railties/lib/rails/vendor/thor-0.11.6/lib/thor/rake_compat.rb
+++ b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/rake_compat.rb
@@ -22,7 +22,8 @@ class Thor
def self.included(base)
# Hack. Make rakefile point to invoker, so rdoc task is generated properly.
- Rake.application.instance_variable_set(:@rakefile, caller[0].match(/(.*):\d+/)[1])
+ rakefile = File.basename(caller[0].match(/(.*):\d+/)[1])
+ Rake.application.instance_variable_set(:@rakefile, rakefile)
self.rake_classes << base
end
end
@@ -43,11 +44,9 @@ class Object #:nodoc:
description.strip!
klass.desc description, task.comment || non_namespaced_name
- klass.class_eval <<-METHOD
- def #{non_namespaced_name}(#{task.arg_names.join(', ')})
- Rake::Task[#{task.name.to_sym.inspect}].invoke(#{task.arg_names.join(', ')})
- end
- METHOD
+ klass.send :define_method, non_namespaced_name do |*args|
+ Rake::Task[task.name.to_sym].invoke(*args)
+ end
end
task
diff --git a/railties/lib/rails/vendor/thor-0.11.6/lib/thor/runner.rb b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/runner.rb
index 43da09b336..9dc70ea069 100644
--- a/railties/lib/rails/vendor/thor-0.11.6/lib/thor/runner.rb
+++ b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/runner.rb
@@ -215,7 +215,7 @@ class Thor::Runner < Thor #:nodoc:
# 5. c:\ <-- no Thorfiles found!
#
def thorfiles(relevant_to=nil, skip_lookup=false)
- # Deal with deprecated thor when :namespaces: is available as constants
+ # TODO Remove this dealing with deprecated thor when :namespaces: is available as constants
save_yaml(thor_yaml) if Thor::Util.convert_constants_to_namespaces(thor_yaml)
thorfiles = []
diff --git a/railties/lib/rails/vendor/thor-0.11.6/lib/thor/shell.rb b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/shell.rb
index 0d3f4d5951..1dc8f0e5b4 100644
--- a/railties/lib/rails/vendor/thor-0.11.6/lib/thor/shell.rb
+++ b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/shell.rb
@@ -1,11 +1,17 @@
+require 'rbconfig'
require 'thor/shell/color'
class Thor
module Base
- # Returns the shell used in all Thor classes. Default to color one.
+ # Returns the shell used in all Thor classes. If you are in a Unix platform
+ # it will use a colored log, otherwise it will use a basic one without color.
#
def self.shell
- @shell ||= Thor::Shell::Color
+ @shell ||= if Config::CONFIG['host_os'] =~ /mswin|mingw/
+ Thor::Shell::Basic
+ else
+ Thor::Shell::Color
+ end
end
# Sets the shell used in all Thor classes.
diff --git a/railties/lib/rails/vendor/thor-0.11.6/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.6/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.6/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.6/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.6/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.6/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.6/lib/thor/util.rb b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/util.rb
index fd820d7462..ebae0a3193 100644
--- a/railties/lib/rails/vendor/thor-0.11.6/lib/thor/util.rb
+++ b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/util.rb
@@ -209,7 +209,7 @@ class Thor
# Returns the root where thor files are located, dependending on the OS.
#
def self.thor_root
- File.join(user_home, ".thor")
+ File.join(user_home, ".thor").gsub(/\\/, '/')
end
# Returns the files in the thor root. On Windows thor_root will be something
@@ -220,7 +220,7 @@ class Thor
# If we don't #gsub the \ character, Dir.glob will fail.
#
def self.thor_root_glob
- files = Dir["#{thor_root.gsub(/\\/, '/')}/*"]
+ files = Dir["#{thor_root}/*"]
files.map! do |file|
File.directory?(file) ? File.join(file, "main.thor") : file
diff --git a/railties/lib/rails/vendor/thor-0.12.0/lib/thor/version.rb b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/version.rb
new file mode 100644
index 0000000000..885230fac4
--- /dev/null
+++ b/railties/lib/rails/vendor/thor-0.12.0/lib/thor/version.rb
@@ -0,0 +1,3 @@
+class Thor
+ VERSION = "0.11.8".freeze
+end