matrix_dbus 0.3.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bb05e143c23e18f1afc39f9b7e1961277a31a79d
4
- data.tar.gz: 2140f469095f03a30915960105c8ef610c1c1a81
3
+ metadata.gz: be28175a6c49d37d25cd9718c6ef74d6e79b5321
4
+ data.tar.gz: 3b89ba6a7be1f4aefbc5e630364af57b774419aa
5
5
  SHA512:
6
- metadata.gz: 8bd60ed3fa2cb625dccdb7740a98137923f1f2221988a5b751b095ba5a1ca949cf775d5693bee39db05057cfcdea7fd8f9e7f2d27e123dc21f37b106a6e230fa
7
- data.tar.gz: 437a664e7e716511956b5a373216f47b7669507739d3cbfba58fe0f01ecde687df0b382d5e7d5dbb6d8e96bbfc3cb12204fe4b4ebc5ed7168edf647ccb87997c
6
+ metadata.gz: 381d61801c7ba0e06853d3c0a338b3cf14afc5e6267080b0711010c2d3c1f094368951af8d094875a94e8839ddacbf663b66eed015278e0c6ec9117b5ba30062
7
+ data.tar.gz: e19887e518b3ecf90db293e70f3e7d8fd116bcb2cd75e0a1c8edd2d028f87deec5f283454dbc74cd06df08110d384119de735a79c16defe485445392fc92f062
@@ -10,7 +10,7 @@ module MatrixDBus
10
10
  # type: Symbol or String, 'get', 'form' or 'json;
11
11
  # host: String: API address, like 'http://localhost:5700'
12
12
  def initialize(host, error) # => Hash<Symble, Lambda>
13
- @host = host
13
+ @host = host.to_s
14
14
  @error = error
15
15
  end
16
16
 
@@ -19,7 +19,7 @@ module MatrixDBus
19
19
  # uri: String
20
20
  # params (optional): Hash, url query
21
21
  def get(uri, params = nil) # => Hash
22
- uri = URI(@host + uri)
22
+ uri = URI(@host + uri.to_s)
23
23
  uri.query = URI.encode_www_form params if params
24
24
  puts 'GET URL:', uri if $DEBUG
25
25
  error RestClient.get(uri.to_s)
@@ -34,7 +34,7 @@ module MatrixDBus
34
34
  # uri: String
35
35
  # body: Hash, post body
36
36
  def post(uri, body)
37
- uri = @host + uri
37
+ uri = @host + uri.to_s
38
38
  puts 'POST URL:', uri if $DEBUG
39
39
  error RestClient.post(uri.to_s, body.to_json, content_type: :json)
40
40
  rescue RestClient::Exceptions::OpenTimeout
@@ -48,7 +48,7 @@ module MatrixDBus
48
48
  # uri: String
49
49
  # body: Anything
50
50
  def post_raw(uri, body)
51
- uri = URI(@host) + URI(uri)
51
+ uri = @host + uri.to_s
52
52
  puts 'POST URL:', uri if $DEBUG
53
53
  error RestClient.post(uri.to_s, body)
54
54
  rescue RestClient::Exceptions::OpenTimeout
@@ -62,7 +62,7 @@ module MatrixDBus
62
62
  # uri: String
63
63
  # body: Hash, put body
64
64
  def put(uri, body)
65
- uri = @host + uri
65
+ uri = @host + uri.to_s
66
66
  puts 'PUT URL:', uri.to_s if $DEBUG
67
67
  error RestClient.put(uri.to_s, body.to_json, content_type: :json)
68
68
  rescue RestClient::Exceptions::OpenTimeout
@@ -76,7 +76,7 @@ module MatrixDBus
76
76
  # uri: String
77
77
  # params (optional): Hash, url query
78
78
  def delete(uri, params = nil) # => Hash
79
- uri = URI(@host + uri)
79
+ uri = URI(@host + uri.to_s)
80
80
  puts 'DELETE URL:', uri if $DEBUG
81
81
  uri.query = String.encode_www_form params if params
82
82
  error RestClient.delete(uri.to_s)
@@ -1,3 +1,3 @@
1
1
  module MatrixDBus
2
- VERSION = "0.3.1"
2
+ VERSION = "1.0.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: matrix_dbus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - 71e6fd52