Navigation Menu

Skip to content

Commit

Permalink
Improve input source detection
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jun 18, 2018
1 parent e556ebc commit 52b39da
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/chupa-text/input-data.rb
Expand Up @@ -23,11 +23,12 @@ class InputData < Data
def initialize(uri, options={})
super(options)
self.uri = uri
if @uri.class == URI::Generic
@content = FileContent.new(path)
else
case @uri
when URI::HTTP, URI::FTP
@content = download
self.path = @content.path
else
@content = FileContent.new(path)
end
end

Expand Down

0 comments on commit 52b39da

Please sign in to comment.