Skip to content

Commit

Permalink
get action accepts https remote sources
Browse files Browse the repository at this point in the history
  • Loading branch information
yannlugrin authored and josevalim committed Nov 4, 2010
1 parent 8b567b3 commit f6bc7ed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/thor/actions/file_manipulation.rb
Expand Up @@ -51,7 +51,7 @@ 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 =~ /^http\:\/\//
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?
Expand Down
9 changes: 9 additions & 0 deletions spec/actions/file_manipulation_spec.rb
Expand Up @@ -114,6 +114,15 @@ def file
end
FakeWeb.clean_registry
end

it "accepts https remote sources" do
body = "__start__\nHTTPSFILE\n__end__\n"
FakeWeb.register_uri(:get, 'https://example.com/file.txt', :body => body)
action :get, 'https://example.com/file.txt' do |content|
content.must == body
end
FakeWeb.clean_registry
end
end

describe "#template" do
Expand Down

0 comments on commit f6bc7ed

Please sign in to comment.