aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/vendor/thor/lib/thor/actions/copy_file.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/vendor/thor/lib/thor/actions/copy_file.rb')
m---------railties/lib/vendor/thor0
-rw-r--r--railties/lib/vendor/thor/lib/thor/actions/copy_file.rb32
2 files changed, 32 insertions, 0 deletions
diff --git a/railties/lib/vendor/thor b/railties/lib/vendor/thor
deleted file mode 160000
-Subproject fccc2fddfb3e696d4715bfddc1c25211fc7480d
diff --git a/railties/lib/vendor/thor/lib/thor/actions/copy_file.rb b/railties/lib/vendor/thor/lib/thor/actions/copy_file.rb
new file mode 100644
index 0000000000..b9d2e9e0a7
--- /dev/null
+++ b/railties/lib/vendor/thor/lib/thor/actions/copy_file.rb
@@ -0,0 +1,32 @@
+require 'thor/actions/templater'
+
+class Thor
+ module Actions
+
+ # Copies the file from the relative source to the relative destination. If
+ # the destination is not given it's assumed to be equal to the source.
+ #
+ # ==== Parameters
+ # source<String>:: the relative path to the source root
+ # destination<String>:: the relative path to the destination root
+ # log_status<Boolean>:: if false, does not log the status. True by default.
+ #
+ # ==== Examples
+ #
+ # copy_file "README", "doc/README"
+ #
+ # copy_file "doc/README"
+ #
+ def copy_file(source, destination=nil, log_status=true)
+ action CopyFile.new(self, source, destination || source, log_status)
+ end
+
+ class CopyFile < Templater #:nodoc:
+
+ def render
+ @render ||= ::File.read(source)
+ end
+
+ end
+ end
+end