wrata_api 0.1.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 49b985a93eed2d3018c26f251184ed8a6114c375de393b94a9c9c782a8a99b26
4
- data.tar.gz: b1730d2ac002a66092b555773113f9cb842f15d80e25a34ae95d1c42b70883e6
3
+ metadata.gz: 378ea0509ba64606a4d3537815c8e0df79ce74e416f0cd441aeed238a527eb81
4
+ data.tar.gz: 782f058d49db5e2e4d9565136fb090b1f370ffdc3fcc6f924cc0ed5777ade345
5
5
  SHA512:
6
- metadata.gz: 8807f18c845bf79867495012e399dedea3c0eff35571776ace95b9bc3d606441cab089f6c512f02d3ad96725c31e5ffee649cf0fa88f79cd52dd582928869f6c
7
- data.tar.gz: 7ed42f27c95fe35b1795d2c36594f4f0d91e37e1eeb3cae63c20be2e4947606129047100172ca29b52a693065c63f747fefac45e78290dd2a7d2e6d830c26f52
6
+ metadata.gz: 359af1dfc8c0495fb9ab31b770aad09e77b4c0e42f3e730c04a4a49da292f01c1aaf5a79dd26c63631306ab573cd626765c1a100908c130584835f984d049fb3
7
+ data.tar.gz: ba3e630cb485694f7f471f1ec041f92f7e82bb0c070ce6dccc2719975aaeaca66853765440eda7fa6232ab2a8982a5a5bf782f6cb76b5e087f9c46b4736dbfbc
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative 'wrata_api/clients_methods'
3
4
  require_relative 'wrata_api/wrata_api_request'
4
5
  require_relative 'wrata_api/server_list'
5
6
  require_relative 'wrata_api/server_methods'
@@ -13,6 +14,7 @@ require 'yaml'
13
14
  module WrataApi
14
15
  # Class for working with wrata api
15
16
  class WrataApi
17
+ include ClientsMethods
16
18
  include WrataApiRequest
17
19
  include ServerMethods
18
20
  include FileListMethods
@@ -24,7 +26,7 @@ module WrataApi
24
26
  @cookie = config['cookie']
25
27
  @wrata_session = config['wrata_session']
26
28
  @csrf_token = config['csrf_token']
27
- @logger = Logger.new(STDOUT)
29
+ @logger = Logger.new($stdout)
28
30
  @waiting_timeout = 5 * 60
29
31
  @between_request_timeout = 10
30
32
  end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Module to work with clients api
4
+ module ClientsMethods
5
+ # Get current user info
6
+ # @return [Array<Hash>] current user info
7
+ def profile
8
+ uri = URI.parse("#{@uri}/profile.json")
9
+ perform_get(uri)
10
+ end
11
+ end
@@ -34,9 +34,10 @@ module WrataApi
34
34
  def powering_status(server_name)
35
35
  all_data = server_data(server_name)
36
36
  status = all_data['_status']
37
- if status == 'created'
37
+ case status
38
+ when 'created'
38
39
  :on
39
- elsif status == 'destroyed'
40
+ when 'destroyed'
40
41
  :off
41
42
  else
42
43
  :other
@@ -4,6 +4,6 @@ module WrataApi
4
4
  # This module holds the WrataApi version information.
5
5
  module Version
6
6
  # @return [String] current gem version
7
- STRING = '0.1.2'
7
+ STRING = '0.2.0'
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wrata_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ONLYOFFICE
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-06-17 00:00:00.000000000 Z
12
+ date: 2020-09-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -31,28 +31,28 @@ dependencies:
31
31
  requirements:
32
32
  - - '='
33
33
  - !ruby/object:Gem::Version
34
- version: 0.85.0
34
+ version: 0.90.0
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - '='
40
40
  - !ruby/object:Gem::Version
41
- version: 0.85.0
41
+ version: 0.90.0
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: rubocop-performance
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
46
  - - '='
47
47
  - !ruby/object:Gem::Version
48
- version: 1.6.0
48
+ version: 1.7.1
49
49
  type: :development
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - '='
54
54
  - !ruby/object:Gem::Version
55
- version: 1.6.0
55
+ version: 1.7.1
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: rubocop-rake
58
58
  requirement: !ruby/object:Gem::Requirement
@@ -73,14 +73,14 @@ dependencies:
73
73
  requirements:
74
74
  - - '='
75
75
  - !ruby/object:Gem::Version
76
- version: 1.39.0
76
+ version: 1.43.2
77
77
  type: :development
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
81
  - - '='
82
82
  - !ruby/object:Gem::Version
83
- version: 1.39.0
83
+ version: 1.43.2
84
84
  description: Wrapper around wrata API
85
85
  email:
86
86
  - shockwavenn@gmail.com
@@ -89,6 +89,7 @@ extensions: []
89
89
  extra_rdoc_files: []
90
90
  files:
91
91
  - lib/wrata_api.rb
92
+ - lib/wrata_api/clients_methods.rb
92
93
  - lib/wrata_api/file_tree.rb
93
94
  - lib/wrata_api/name.rb
94
95
  - lib/wrata_api/queue_methos.rb
@@ -121,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
122
  - !ruby/object:Gem::Version
122
123
  version: '0'
123
124
  requirements: []
124
- rubygems_version: 3.1.2
125
+ rubygems_version: 3.1.4
125
126
  signing_key:
126
127
  specification_version: 4
127
128
  summary: Wrata API Gem