lib/mirage/client/client.rb in mirage-3.0.14 vs lib/mirage/client/client.rb in mirage-4.0.0.alpha1
- old
+ new
@@ -15,11 +15,11 @@
elsif options.kind_of?(Hash) && options[:port]
@url = "http://localhost:#{options[:port]}"
elsif options.kind_of?(Hash) && options[:url]
@url = options[:url]
else
- raise "specify a valid URL or port"
+ raise ArgumentError, "specify a valid URL or port"
end
@templates = Templates.new(@url)
@templates.default_config &block if block
end
@@ -36,11 +36,11 @@
return Template.get("#{@url}/templates/#{id}") if id
@templates
end
def requests id=nil
- return Request.get "#{@url}/requests/#{id}" if id
- Requests.new(@url)
+ return Requests.get "#{@url}/requests/#{id}" if id
+ Requests.new("#{@url}/requests")
end
def prime
self.class.send(:put, "#{@url}/defaults", :body => "")
end
\ No newline at end of file