Skip to content

Commit

Permalink
defaulting nil uri scheme to file for opening xsd files. resolves mov…
Browse files Browse the repository at this point in the history
  • Loading branch information
cjavdev committed Apr 23, 2014
1 parent 454efb1 commit 992c45f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/rxsd/loader.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RXSD resource loader
# RXSD resource loader
#
# Copyright (C) 2010 Mohammed Morsi <[email protected]>
# See COPYING for the License of this software
Expand All @@ -13,10 +13,10 @@ class Loader

# loads and return text resource from specified source uri
def self.load(source_uri)
Logger.info "loading resource from uri #{source_uri}"
Logger.info "loading resource from uri #{source_uri}"
data = nil
uri = URI.parse(source_uri)
if uri.scheme == "file"
if uri.scheme == "file" || uri.scheme.nil?
data = File.read_all uri.path
elsif uri.scheme == "http"
data = Net::HTTP.get_response(uri.host, uri.path).body
Expand Down
1 change: 0 additions & 1 deletion lib/rxsd/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# See COPYING for the License of this software

module RXSD

# Provides class methods to parse xsd and xml data
class Parser
private
Expand Down

0 comments on commit 992c45f

Please sign in to comment.