Method not available on this version
This method is only available on newer versions. The first available version (v2_6_3) is shown here.
copy_file(source, *args, &block)public
# File lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb, line 21
def copy_file(source, *args, &block)
config = args.last.is_a?(Hash) ? args.pop : {}
destination = args.first || source
source = File.expand_path(find_in_source_paths(source.to_s))
create_file destination, nil, config do
content = File.binread(source)
content = yield(content) if block
content
end
if config[:mode] == :preserve
mode = File.stat(source).mode
chmod(destination, mode, config)
end
end Related methods
- Instance methods
- action
- add_file
- add_link
- append_file
- append_to_file
- apply
- chmod
- comment_lines
- copy_file
- create_file
- create_link
- destination_root
- destination_root=
- directory
- empty_directory
- find_in_source_paths
- get
- gsub_file
- in_root
- inject_into_class
- inject_into_file
- inject_into_module
- insert_into_file
- inside
- link_file
- prepend_file
- prepend_to_file
- relative_to_original_destination_root
- remove_dir
- remove_file
- run
- run_ruby_script
- source_paths
- template
- thor
- uncomment_lines
- Class methods
- included
- new
- Protected methods
-
_cleanup_options_and_set -
_shared_configuration - Private methods
-
capture -
concat -
with_output_buffer