toptranslation_api 2.5.0 → 3.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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a7a5e459dc186fd8dc7ca31ed08de8aa2f59489f13c5a7921c0b6e276feaf11
|
4
|
+
data.tar.gz: 90ef9708e838df69119982d77fdf27b5427f037cb1fc34391ec563a54d89ba73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a50b0d1ad993cff3c7b2477e694022d4042be6ed62792a679a8e0a1559a1db5670f0484cace778f37810663fffa1ec836071d24e0ec501c57f1383cda2d16a96
|
7
|
+
data.tar.gz: 5ae7cbb4208769f291386f72ad420071d54328babe299028d2f2df9208f8e46457efbc00368df5ef541a7f36c779c36c20bee49c53938fcbb989766403ff9f19
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Toptranslation
|
2
|
-
class Connection
|
2
|
+
class Connection
|
3
3
|
attr_accessor :upload_token, :verbose, :access_token
|
4
4
|
|
5
5
|
def initialize(options = {})
|
@@ -140,17 +140,10 @@ module Toptranslation
|
|
140
140
|
end
|
141
141
|
|
142
142
|
def upload_file(file, type, uri)
|
143
|
-
last_upload_size = 0
|
144
|
-
|
145
143
|
response = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == 'https') do |http|
|
146
144
|
request = Net::HTTP::Post.new(uri)
|
147
145
|
request.set_form({ 'file' => file, 'token' => upload_token, 'type' => type }, 'multipart/form-data')
|
148
146
|
|
149
|
-
Net::HTTP::UploadProgress.new(request) do |progress|
|
150
|
-
yield progress.upload_size - last_upload_size if block_given?
|
151
|
-
last_upload_size = progress.upload_size
|
152
|
-
end
|
153
|
-
|
154
147
|
http.request(request)
|
155
148
|
end
|
156
149
|
|
@@ -28,8 +28,9 @@ module Toptranslation::Resource
|
|
28
28
|
Document.new(@connection, response)
|
29
29
|
end
|
30
30
|
|
31
|
-
def documents
|
32
|
-
|
31
|
+
def documents(options = {})
|
32
|
+
options.merge!(project_identifier: @identifier)
|
33
|
+
ProjectDocumentList.new(@connection, options)
|
33
34
|
end
|
34
35
|
|
35
36
|
def strings
|
@@ -14,7 +14,10 @@ module Toptranslation::Resource
|
|
14
14
|
private
|
15
15
|
|
16
16
|
def documents
|
17
|
-
|
17
|
+
params = { per_page: 100 }
|
18
|
+
params[:type] = @options[:type] if @options[:type]
|
19
|
+
|
20
|
+
@connection.get("/projects/#{@options[:project_identifier]}/documents", params: params)
|
18
21
|
end
|
19
22
|
end
|
20
23
|
end
|
data/lib/toptranslation_api.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: toptranslation_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Toptranslation GmbH
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-12-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '2.0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: net-http-uploadprogress
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '2.0'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '2.0'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: rest-client
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -98,30 +84,30 @@ dependencies:
|
|
98
84
|
name: rubocop
|
99
85
|
requirement: !ruby/object:Gem::Requirement
|
100
86
|
requirements:
|
101
|
-
- - "
|
87
|
+
- - ">="
|
102
88
|
- !ruby/object:Gem::Version
|
103
|
-
version: 0
|
89
|
+
version: '0'
|
104
90
|
type: :development
|
105
91
|
prerelease: false
|
106
92
|
version_requirements: !ruby/object:Gem::Requirement
|
107
93
|
requirements:
|
108
|
-
- - "
|
94
|
+
- - ">="
|
109
95
|
- !ruby/object:Gem::Version
|
110
|
-
version: 0
|
96
|
+
version: '0'
|
111
97
|
- !ruby/object:Gem::Dependency
|
112
98
|
name: rubocop-rspec
|
113
99
|
requirement: !ruby/object:Gem::Requirement
|
114
100
|
requirements:
|
115
|
-
- - "
|
101
|
+
- - ">="
|
116
102
|
- !ruby/object:Gem::Version
|
117
|
-
version:
|
103
|
+
version: '0'
|
118
104
|
type: :development
|
119
105
|
prerelease: false
|
120
106
|
version_requirements: !ruby/object:Gem::Requirement
|
121
107
|
requirements:
|
122
|
-
- - "
|
108
|
+
- - ">="
|
123
109
|
- !ruby/object:Gem::Version
|
124
|
-
version:
|
110
|
+
version: '0'
|
125
111
|
- !ruby/object:Gem::Dependency
|
126
112
|
name: vcr
|
127
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -181,8 +167,9 @@ files:
|
|
181
167
|
homepage: https://github.com/toptranslation/toptranslation_ruby
|
182
168
|
licenses:
|
183
169
|
- MIT
|
184
|
-
metadata:
|
185
|
-
|
170
|
+
metadata:
|
171
|
+
rubygems_mfa_required: 'true'
|
172
|
+
post_install_message:
|
186
173
|
rdoc_options: []
|
187
174
|
require_paths:
|
188
175
|
- lib
|
@@ -190,15 +177,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
190
177
|
requirements:
|
191
178
|
- - ">="
|
192
179
|
- !ruby/object:Gem::Version
|
193
|
-
version:
|
180
|
+
version: 3.0.0
|
194
181
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
195
182
|
requirements:
|
196
183
|
- - ">="
|
197
184
|
- !ruby/object:Gem::Version
|
198
185
|
version: '0'
|
199
186
|
requirements: []
|
200
|
-
rubygems_version: 3.
|
201
|
-
signing_key:
|
187
|
+
rubygems_version: 3.3.26
|
188
|
+
signing_key:
|
202
189
|
specification_version: 4
|
203
190
|
summary: A ruby client for the Toptranslation API
|
204
191
|
test_files: []
|