wrata_api 0.1.2 → 1.0.1

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: 0b2099697f34d23435434ded7a938fcab544834277270eb1be734f14b910265c
4
+ data.tar.gz: 86c54e5e56fc7b254b2a7949f900ecef18954e2f6f0184ae2fff75ce48340189
5
5
  SHA512:
6
- metadata.gz: 8807f18c845bf79867495012e399dedea3c0eff35571776ace95b9bc3d606441cab089f6c512f02d3ad96725c31e5ffee649cf0fa88f79cd52dd582928869f6c
7
- data.tar.gz: 7ed42f27c95fe35b1795d2c36594f4f0d91e37e1eeb3cae63c20be2e4947606129047100172ca29b52a693065c63f747fefac45e78290dd2a7d2e6d830c26f52
6
+ metadata.gz: e3c67ce5c6102297b9c32285c11415fb1b015aea9c750289d3d163241a0bd38f3c5c0dcd918584d45788991b745df6fd5210eb285bfd39403d2fabb4489c50e3
7
+ data.tar.gz: e37cc67dffbcb95830353ad864cbe256eedb4c6c284ea59e0b6b2531394f5261eb9e702fafc38465f3cb5ba3bc12384b90f7d11aa68bdb479d362a06ea8ed38a
@@ -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
@@ -106,7 +107,7 @@ module WrataApi
106
107
  # @return [String] error for server timeout
107
108
  def server_status_timeout_error(server, status)
108
109
  "Couldn't wait until #{server} have status "\
109
- "#{status} in specified timeout"
110
+ "#{status} in specified timeout"
110
111
  end
111
112
  end
112
113
  end
@@ -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 = '1.0.1'
8
8
  end
9
9
  end
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'cgi'
3
4
  require 'net/http'
4
5
  module WrataApi
5
6
  # Module for describing base request actions
@@ -7,7 +8,7 @@ module WrataApi
7
8
  # @return [Hash] default header for requests
8
9
  def default_header
9
10
  { 'Cookie' => "remember_token=#{@cookie}; \
10
- _runner_session=#{@wrata_session}",
11
+ _runner_session=#{CGI.escape(@wrata_session)}",
11
12
  'X-CSRF-Token' => @csrf_token }
12
13
  end
13
14
 
data/lib/wrata_api.rb CHANGED
@@ -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
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: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ONLYOFFICE
@@ -9,78 +9,134 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-06-17 00:00:00.000000000 Z
12
+ date: 2022-02-22 00:00:00.000000000 Z
13
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: codecov
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - "~>"
19
+ - !ruby/object:Gem::Version
20
+ version: '0'
21
+ type: :development
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - "~>"
26
+ - !ruby/object:Gem::Version
27
+ version: '0'
28
+ - !ruby/object:Gem::Dependency
29
+ name: overcommit
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - "~>"
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
14
42
  - !ruby/object:Gem::Dependency
15
43
  name: rake
16
44
  requirement: !ruby/object:Gem::Requirement
17
45
  requirements:
18
46
  - - "~>"
19
47
  - !ruby/object:Gem::Version
20
- version: '13.0'
48
+ version: '13'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "~>"
54
+ - !ruby/object:Gem::Version
55
+ version: '13'
56
+ - !ruby/object:Gem::Dependency
57
+ name: rspec
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: '3'
21
63
  type: :development
22
64
  prerelease: false
23
65
  version_requirements: !ruby/object:Gem::Requirement
24
66
  requirements:
25
67
  - - "~>"
26
68
  - !ruby/object:Gem::Version
27
- version: '13.0'
69
+ version: '3'
28
70
  - !ruby/object:Gem::Dependency
29
71
  name: rubocop
30
72
  requirement: !ruby/object:Gem::Requirement
31
73
  requirements:
32
- - - '='
74
+ - - "~>"
33
75
  - !ruby/object:Gem::Version
34
- version: 0.85.0
76
+ version: '1'
35
77
  type: :development
36
78
  prerelease: false
37
79
  version_requirements: !ruby/object:Gem::Requirement
38
80
  requirements:
39
- - - '='
81
+ - - "~>"
40
82
  - !ruby/object:Gem::Version
41
- version: 0.85.0
83
+ version: '1'
42
84
  - !ruby/object:Gem::Dependency
43
85
  name: rubocop-performance
44
86
  requirement: !ruby/object:Gem::Requirement
45
87
  requirements:
46
- - - '='
88
+ - - "~>"
47
89
  - !ruby/object:Gem::Version
48
- version: 1.6.0
90
+ version: '1'
49
91
  type: :development
50
92
  prerelease: false
51
93
  version_requirements: !ruby/object:Gem::Requirement
52
94
  requirements:
53
- - - '='
95
+ - - "~>"
54
96
  - !ruby/object:Gem::Version
55
- version: 1.6.0
97
+ version: '1'
56
98
  - !ruby/object:Gem::Dependency
57
99
  name: rubocop-rake
58
100
  requirement: !ruby/object:Gem::Requirement
59
101
  requirements:
60
- - - '='
102
+ - - "~>"
61
103
  - !ruby/object:Gem::Version
62
- version: 0.5.1
104
+ version: '0'
63
105
  type: :development
64
106
  prerelease: false
65
107
  version_requirements: !ruby/object:Gem::Requirement
66
108
  requirements:
67
- - - '='
109
+ - - "~>"
68
110
  - !ruby/object:Gem::Version
69
- version: 0.5.1
111
+ version: '0'
70
112
  - !ruby/object:Gem::Dependency
71
113
  name: rubocop-rspec
72
114
  requirement: !ruby/object:Gem::Requirement
73
115
  requirements:
74
- - - '='
116
+ - - "~>"
117
+ - !ruby/object:Gem::Version
118
+ version: '2'
119
+ type: :development
120
+ prerelease: false
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - "~>"
124
+ - !ruby/object:Gem::Version
125
+ version: '2'
126
+ - !ruby/object:Gem::Dependency
127
+ name: yard
128
+ requirement: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - ">="
75
131
  - !ruby/object:Gem::Version
76
- version: 1.39.0
132
+ version: 0.9.20
77
133
  type: :development
78
134
  prerelease: false
79
135
  version_requirements: !ruby/object:Gem::Requirement
80
136
  requirements:
81
- - - '='
137
+ - - ">="
82
138
  - !ruby/object:Gem::Version
83
- version: 1.39.0
139
+ version: 0.9.20
84
140
  description: Wrapper around wrata API
85
141
  email:
86
142
  - shockwavenn@gmail.com
@@ -89,6 +145,7 @@ extensions: []
89
145
  extra_rdoc_files: []
90
146
  files:
91
147
  - lib/wrata_api.rb
148
+ - lib/wrata_api/clients_methods.rb
92
149
  - lib/wrata_api/file_tree.rb
93
150
  - lib/wrata_api/name.rb
94
151
  - lib/wrata_api/queue_methos.rb
@@ -106,6 +163,7 @@ metadata:
106
163
  documentation_uri: https://www.rubydoc.info/gems/wrata_api
107
164
  homepage_uri: https://github.com/ONLYOFFICE/wrata_api
108
165
  source_code_uri: https://github.com/ONLYOFFICE/wrata_api
166
+ rubygems_mfa_required: 'true'
109
167
  post_install_message:
110
168
  rdoc_options: []
111
169
  require_paths:
@@ -114,14 +172,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
114
172
  requirements:
115
173
  - - ">="
116
174
  - !ruby/object:Gem::Version
117
- version: '2.4'
175
+ version: '2.5'
118
176
  required_rubygems_version: !ruby/object:Gem::Requirement
119
177
  requirements:
120
178
  - - ">="
121
179
  - !ruby/object:Gem::Version
122
180
  version: '0'
123
181
  requirements: []
124
- rubygems_version: 3.1.2
182
+ rubygems_version: 3.3.7
125
183
  signing_key:
126
184
  specification_version: 4
127
185
  summary: Wrata API Gem