1
0
Fork 0
mirror of synced 2024-06-26 18:20:43 +12:00

Updated Ruby and PHP SDKs

This commit is contained in:
eldadfux 2019-10-19 03:04:16 +03:00
parent 310211e692
commit b675eb69fe
6 changed files with 25 additions and 10 deletions

View file

@ -1,4 +1,4 @@
# Generated by pub on 2019-10-18 21:11:54.500301.
# Generated by pub on 2019-10-19 03:03:25.181202.
charcode:file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/charcode-1.1.2/lib/
collection:file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/collection-1.14.12/lib/
cookie_jar:file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/cookie_jar-1.0.1/lib/

View file

@ -37,7 +37,7 @@ class Client
*/
protected $headers = [
'content-type' => '',
'x-sdk-version' => 'appwrite:php:1.0.10',
'x-sdk-version' => 'appwrite:php:1.0.11',
];
/**

View file

@ -1,7 +1,7 @@
Gem::Specification.new do |s|
s.name = 'appwrite'
s.version = '1.0.3'
s.version = '1.0.4'
s.summary = "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)"
s.author = 'Appwrite Team'
s.homepage = 'https://appwrite.io/support'

View file

@ -1,6 +1,7 @@
require 'net/http'
require 'uri'
require 'json'
require 'cgi'
module Appwrite
class Client
@ -19,7 +20,7 @@ module Appwrite
@headers = {
'content-type' => '',
'user-agent' => RUBY_PLATFORM + ':ruby-' + RUBY_VERSION,
'x-sdk-version' => 'appwrite:ruby:1.0.3'
'x-sdk-version' => 'appwrite:ruby:1.0.4'
}
@endpoint = 'https://appwrite.io/v1';
end
@ -61,7 +62,7 @@ module Appwrite
end
def call(method, path = '', headers = {}, params = {})
uri = URI.parse(@endpoint + path + ((method == METHOD_GET) ? '?' + URI.encode_www_form(params) : ''))
uri = URI.parse(@endpoint + path + ((method == METHOD_GET) ? '?' + encode(params) : ''))
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = (uri.scheme == 'https')
payload = ''
@ -73,7 +74,7 @@ module Appwrite
when 'application/json'
payload = params.to_json
else
payload = URI.encode_www_form(params)
payload = encode(params)
end
end
@ -89,5 +90,19 @@ module Appwrite
protected
private
def encode(value, key = nil)
case value
when Hash then value.map { |k,v| encode(v, append_key(key,k)) }.join('&')
when Array then value.map { |v| encode(v, "#{key}[]") }.join('&')
when nil then ''
else
"#{key}=#{CGI.escape(value.to_s)}"
end
end
def append_key(root_key, key)
root_key.nil? ? key : "#{root_key}[#{key.to_s}]"
end
end
end

View file

@ -39,7 +39,7 @@ $cli
$clients = [
'php' => [
'version' => '1.0.10',
'version' => '1.0.11',
'result' => __DIR__.'/../sdks/php/',
'gitURL' => 'https://github.com/appwrite/sdk-for-php.git',
'gitRepo' => 'git@github.com:appwrite/sdk-for-php.git',
@ -83,7 +83,7 @@ $cli
'platform' => 'server',
],
'ruby' => [
'version' => '1.0.3',
'version' => '1.0.4',
'result' => __DIR__.'/../sdks/ruby/',
'gitURL' => 'https://github.com/appwrite/sdk-for-ruby.git',
'gitRepo' => 'git@github.com:appwrite/sdk-for-ruby.git',

4
composer.lock generated
View file

@ -92,7 +92,7 @@
"source": {
"type": "git",
"url": "https://github.com/appwrite/sdk-generator",
"reference": "a130fb6e8fcd88f9dd5da1331dcd24a7d426ec22"
"reference": "4ab0600fb6e4b59824d4804fbd347050f5dc3864"
},
"require": {
"ext-curl": "*",
@ -122,7 +122,7 @@
}
],
"description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms",
"time": "2019-10-18 18:08:52"
"time": "2019-10-18 21:12:43"
},
{
"name": "bacon/bacon-qr-code",