lib/vmc/client.rb in vmc-0.3.16.beta.2 vs lib/vmc/client.rb in vmc-0.3.16.beta.3
- old
+ new
@@ -37,11 +37,11 @@
# Initialize new client to the target_uri with optional auth_token
def initialize(target_url=VMC::DEFAULT_TARGET, auth_token=nil)
target_url = "http://#{target_url}" unless /^https?/ =~ target_url
target_url = target_url.gsub(/\/+$/, '')
- @target = target_url
+ @target = target_url
@auth_token = auth_token
end
######################################################
# Target info
@@ -147,11 +147,11 @@
json_get(path(VMC::APPS_PATH, name, "crashes"))
end
# List the directory or download the actual file indicated by
# the path.
- def app_files(name, path, instance=0)
+ def app_files(name, path, instance='0')
check_login_status
path = path.gsub('//', '/')
url = path(VMC::APPS_PATH, name, "instances", instance, "files", path)
_, body, headers = http_get(url)
body
@@ -316,10 +316,10 @@
######################################################
def self.path(*path)
path.flatten.collect { |x|
- URI.encode x, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]")
+ URI.encode x.to_s, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]")
}.join("/")
end
private