module Thor::Actions
def get(source, *args, &block)
end
content.split("\n").first
get "http://gist.github.com/103208" do |content|
get "http://gist.github.com/103208", "doc/README"
==== Examples
config
destination
source
==== Parameters
the url is yielded and used as location.
destination. If a block is given instead of destination, the content of
Gets the content at the given address and places it at the given relative
def get(source, *args, &block) config = args.last.is_a?(Hash) ? args.pop : {} destination = args.first source = File.expand_path(find_in_source_paths(source.to_s)) unless source =~ /^https?\:\/\// render = open(source) {|input| input.binmode.read } destination ||= if block_given? block.arity == 1 ? block.call(render) : block.call else File.basename(source) end create_file destination, render, config end