onlyoffice_documentserver_conversion_helper 0.2.0 → 0.3.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 76e4586303d9e591a56bfcfe1449d052e686bab52a003c6e96b37d52e27ab55c
|
4
|
+
data.tar.gz: 207964d6459a5f732c528407230657561d47e0035da7be6126d4017dd709d505
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b6607991e9781150ed057e0db906d1c2803f70a82c3bcaa268227ab595adb28436c4d6c11f06513b378a94ff19867c556381f5743ae22065a1737e1089a9876
|
7
|
+
data.tar.gz: c642bc87c00c0696951bd82bb4b50de6bb505ce76708904537121f3e20bd3e92eccfe4a2e37180807ac31f14f1c86d8217f63bdc648f052562604759cb6ce94d
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Class for parse Xml responce
|
4
|
+
class XmlResponceParser
|
5
|
+
def initialize(string_with_xml, file_format)
|
6
|
+
@string_with_xml = string_with_xml
|
7
|
+
@file_format = file_format
|
8
|
+
end
|
9
|
+
|
10
|
+
# Method parses server response
|
11
|
+
# returning url with unescape HTML
|
12
|
+
# @return [String] URL
|
13
|
+
def result_url
|
14
|
+
res_result = /(http|https).*\.(#{@file_format})/.match(@string_with_xml)
|
15
|
+
CGI.unescapeHTML(res_result.to_s)
|
16
|
+
end
|
17
|
+
end
|
@@ -4,6 +4,7 @@ require 'jwt'
|
|
4
4
|
require 'net/http'
|
5
5
|
require 'securerandom'
|
6
6
|
require 'timeout'
|
7
|
+
require_relative 'onlyoffice_documentserver_conversion_helper/xml_responce_parser'
|
7
8
|
require_relative 'onlyoffice_documentserver_conversion_helper/version'
|
8
9
|
|
9
10
|
# Stuff for working with conversion service
|
@@ -147,7 +148,7 @@ module OnlyofficeDocumentserverConversionHelper
|
|
147
148
|
@input_filetype = File.extname(@file_url).delete('.')
|
148
149
|
advanced_params = autocomplete_missing_params(args)
|
149
150
|
data = request(convert_url, advanced_params)
|
150
|
-
url =
|
151
|
+
url = XmlResponceParser.new(data, advanced_params[:outputtype]).result_url
|
151
152
|
{ url: url, data: data }
|
152
153
|
end
|
153
154
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: onlyoffice_documentserver_conversion_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ONLYOFFICE
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-
|
13
|
+
date: 2021-12-17 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: jwt
|
@@ -26,20 +26,6 @@ dependencies:
|
|
26
26
|
- - "~>"
|
27
27
|
- !ruby/object:Gem::Version
|
28
28
|
version: '2'
|
29
|
-
- !ruby/object:Gem::Dependency
|
30
|
-
name: codecov
|
31
|
-
requirement: !ruby/object:Gem::Requirement
|
32
|
-
requirements:
|
33
|
-
- - "~>"
|
34
|
-
- !ruby/object:Gem::Version
|
35
|
-
version: '0'
|
36
|
-
type: :development
|
37
|
-
prerelease: false
|
38
|
-
version_requirements: !ruby/object:Gem::Requirement
|
39
|
-
requirements:
|
40
|
-
- - "~>"
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
version: '0'
|
43
29
|
- !ruby/object:Gem::Dependency
|
44
30
|
name: overcommit
|
45
31
|
requirement: !ruby/object:Gem::Requirement
|
@@ -138,6 +124,20 @@ dependencies:
|
|
138
124
|
- - "~>"
|
139
125
|
- !ruby/object:Gem::Version
|
140
126
|
version: '2'
|
127
|
+
- !ruby/object:Gem::Dependency
|
128
|
+
name: simplecov-cobertura
|
129
|
+
requirement: !ruby/object:Gem::Requirement
|
130
|
+
requirements:
|
131
|
+
- - "~>"
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '2'
|
134
|
+
type: :development
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
requirements:
|
138
|
+
- - "~>"
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
version: '2'
|
141
141
|
- !ruby/object:Gem::Dependency
|
142
142
|
name: yard
|
143
143
|
requirement: !ruby/object:Gem::Requirement
|
@@ -168,6 +168,7 @@ files:
|
|
168
168
|
- lib/onlyoffice_documentserver_conversion_helper.rb
|
169
169
|
- lib/onlyoffice_documentserver_conversion_helper/name.rb
|
170
170
|
- lib/onlyoffice_documentserver_conversion_helper/version.rb
|
171
|
+
- lib/onlyoffice_documentserver_conversion_helper/xml_responce_parser.rb
|
171
172
|
homepage: https://github.com/ONLYOFFICE-QA/onlyoffice_documentserver_conversion_helper
|
172
173
|
licenses:
|
173
174
|
- AGPL-3.0
|
@@ -177,6 +178,7 @@ metadata:
|
|
177
178
|
documentation_uri: https://www.rubydoc.info/gems/onlyoffice_documentserver_conversion_helper
|
178
179
|
homepage_uri: https://github.com/ONLYOFFICE-QA/onlyoffice_documentserver_conversion_helper
|
179
180
|
source_code_uri: https://github.com/ONLYOFFICE-QA/onlyoffice_documentserver_conversion_helper
|
181
|
+
rubygems_mfa_required: 'true'
|
180
182
|
post_install_message:
|
181
183
|
rdoc_options: []
|
182
184
|
require_paths:
|
@@ -192,7 +194,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
192
194
|
- !ruby/object:Gem::Version
|
193
195
|
version: '0'
|
194
196
|
requirements: []
|
195
|
-
rubygems_version: 3.2.
|
197
|
+
rubygems_version: 3.2.32
|
196
198
|
signing_key:
|
197
199
|
specification_version: 4
|
198
200
|
summary: onlyoffice_documentserver_conversion_helper Gem
|