Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix the get action to support HTTP remote sources.

As of commit dd072c9 the get action fails to retrieve remote sources. This is due to the File.binread method operating on File which only works with locally mounted file systems. Prior to this commit the get action used Open-URI to access the source which allowed it to be either local to the system or a remote http file.

This commit restores the use of Open-URI and also aims to maintain the binary mode reading support of the aforementioned commit.

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
commit ab812a9cddb280296c44cb72f6fb1d8ba8c38947 1 parent 199fbeb
@geoffgarside geoffgarside authored josevalim committed
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/thor/actions/file_manipulation.rb
View
2  lib/thor/actions/file_manipulation.rb
@@ -48,7 +48,7 @@ def copy_file(source, destination=nil, config={}, &block)
#
def get(source, destination=nil, config={}, &block)
source = File.expand_path(find_in_source_paths(source.to_s)) unless source =~ /^http\:\/\//
- render = File.binread(source)
+ render = open(source).binmode.read
destination ||= if block_given?
block.arity == 1 ? block.call(render) : block.call
Please sign in to comment.
Something went wrong with that request. Please try again.