lib/client.rb in nsisam-0.2.0 vs lib/client.rb in nsisam-0.2.1
- old
+ new
@@ -7,11 +7,11 @@
class Client
def initialize(url)
user_and_pass = url.match(/(\w+):(\w+)/)
@user, @password = user_and_pass[1], user_and_pass[2]
- @url = url.match(/@(\w*)/)[1]
- @port = url.match(/[0-9]{4}/)[0]
+ @url = url.match(/@(.*):/)[1]
+ @port = url.match(/([0-9]+)(\/)$/)[1]
end
def store(data)
request_data = {:value => data}.to_json
request = prepare_request :PUT, request_data