ruby-lokalise-api 4.5.0 → 4.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/ruby-lokalise-api/error.rb +2 -2
- data/lib/ruby-lokalise-api/version.rb +1 -1
- data/lib/ruby-lokalise-api.rb +2 -2
- data/spec/lib/ruby-lokalise-api/rest/contributors_spec.rb +2 -2
- data/spec/lib/ruby-lokalise-api/rest/keys_spec.rb +1 -1
- data/spec/lib/ruby-lokalise-api/rest/languages_spec.rb +2 -2
- data/spec/lib/ruby-lokalise-api/rest/projects_spec.rb +1 -1
- data/spec/lib/ruby-lokalise-api/rest/screenshots_spec.rb +2 -2
- data/spec/lib/ruby-lokalise-api/rest/snapshots_spec.rb +1 -1
- data/spec/lib/ruby-lokalise-api/rest/tasks_spec.rb +2 -2
- data/spec/lib/ruby-lokalise-api/rest/team_users_spec.rb +1 -1
- data/spec/lib/ruby-lokalise-api/rest/translations_spec.rb +1 -1
- data/spec/lib/ruby-lokalise-api_spec.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e3db69f1caef4a81c8cb7da9cafb25e68dc4d98abcf7c5806fb748370cd5a335
|
4
|
+
data.tar.gz: 22e61446ba7bb1b9e0a446c2a0411e1f0fa27ef7615d78fc1eb50f4da9b63411
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03b8381002e892638238ecd2fcd50f3052f7f18e454dab05e3962fbfe61d36b17be3488ce9af3eaaf64733684e25c7f888a24a350601672f3bfc493ac6670c22
|
7
|
+
data.tar.gz: 0dc3679409dd32bf1eeac182a17b21114b2233bc7b9dc33d0e74bae48f9361557d067c576cba49f90b773dd74b304157b54d58e8e2e67550511fd275c22944e6
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Lokalise API v2 official Ruby interface
|
2
2
|
|
3
3
|
![Gem](https://img.shields.io/gem/v/ruby-lokalise-api)
|
4
|
-
|
4
|
+
![CI](https://github.com/lokalise/ruby-lokalise-api/actions/workflows/ci.yml/badge.svg)
|
5
5
|
[![Test Coverage](https://codecov.io/gh/lokalise/ruby-lokalise-api/graph/badge.svg)](https://codecov.io/gh/lokalise/ruby-lokalise-api)
|
6
6
|
![Downloads total](https://img.shields.io/gem/dt/ruby-lokalise-api)
|
7
7
|
|
@@ -13,7 +13,7 @@ module Lokalise
|
|
13
13
|
TooManyRequests = Class.new(ClientError)
|
14
14
|
Forbidden = Class.new(ClientError)
|
15
15
|
Locked = Class.new(ClientError)
|
16
|
-
|
16
|
+
MethodNotAllowed = Class.new(ClientError)
|
17
17
|
|
18
18
|
NotImplemented = Class.new(ServerError)
|
19
19
|
BadGateway = Class.new(ServerError)
|
@@ -25,7 +25,7 @@ module Lokalise
|
|
25
25
|
401 => Lokalise::Error::Unauthorized,
|
26
26
|
403 => Lokalise::Error::Forbidden,
|
27
27
|
404 => Lokalise::Error::NotFound,
|
28
|
-
405 => Lokalise::Error::
|
28
|
+
405 => Lokalise::Error::MethodNotAllowed,
|
29
29
|
406 => Lokalise::Error::NotAcceptable,
|
30
30
|
409 => Lokalise::Error::Conflict,
|
31
31
|
423 => Lokalise::Error::Locked,
|
data/lib/ruby-lokalise-api.rb
CHANGED
@@ -76,7 +76,7 @@ module Lokalise
|
|
76
76
|
# @param token [String]
|
77
77
|
# @param params [Hash]
|
78
78
|
def client(token, params = {})
|
79
|
-
@client
|
79
|
+
@client = Lokalise::Client.new token, params
|
80
80
|
end
|
81
81
|
|
82
82
|
# Reset the currently set client
|
@@ -90,7 +90,7 @@ module Lokalise
|
|
90
90
|
# @param token [String]
|
91
91
|
# @param params [Hash]
|
92
92
|
def oauth_client(token, params = {})
|
93
|
-
@oauth_client
|
93
|
+
@oauth_client = Lokalise::OAuthClient.new token, params
|
94
94
|
end
|
95
95
|
|
96
96
|
# Reset the currently set OAuth client
|
@@ -106,7 +106,7 @@ RSpec.describe Lokalise::Client do
|
|
106
106
|
languages: [{lang_iso: 'en'}]
|
107
107
|
end.collection.first
|
108
108
|
|
109
|
-
expect(contributor.client).to eq(test_client)
|
109
|
+
expect(contributor.client.token).to eq(test_client.token)
|
110
110
|
expect(contributor.fullname).to eq('chained')
|
111
111
|
|
112
112
|
id = contributor.user_id
|
@@ -116,7 +116,7 @@ RSpec.describe Lokalise::Client do
|
|
116
116
|
contributor.update fullname: 'updated!'
|
117
117
|
end
|
118
118
|
|
119
|
-
expect(updated_contributor.client).to eq(test_client)
|
119
|
+
expect(updated_contributor.client.token).to eq(test_client.token)
|
120
120
|
expect(updated_contributor.fullname).to eq('updated!')
|
121
121
|
expect(updated_contributor.user_id).to eq(id)
|
122
122
|
expect(updated_contributor.path).to eq(path)
|
@@ -160,7 +160,7 @@ RSpec.describe Lokalise::Client do
|
|
160
160
|
key.update key_name: 'updated!'
|
161
161
|
end
|
162
162
|
|
163
|
-
expect(updated_key.client).to eq(test_client)
|
163
|
+
expect(updated_key.client.token).to eq(test_client.token)
|
164
164
|
expect(updated_key.key_name['ios']).to eq('updated!')
|
165
165
|
expect(updated_key.path).to eq(path)
|
166
166
|
|
@@ -109,7 +109,7 @@ RSpec.describe Lokalise::Client do
|
|
109
109
|
test_client.create_languages project_id, lang_iso: 'ab', custom_name: 'chained lang'
|
110
110
|
end.collection.first
|
111
111
|
|
112
|
-
expect(language.client).to eq(test_client)
|
112
|
+
expect(language.client.token).to eq(test_client.token)
|
113
113
|
expect(language.lang_name).to eq('chained lang')
|
114
114
|
|
115
115
|
path = language.path
|
@@ -118,7 +118,7 @@ RSpec.describe Lokalise::Client do
|
|
118
118
|
language.update lang_name: 'updated!'
|
119
119
|
end
|
120
120
|
|
121
|
-
expect(updated_language.client).to eq(test_client)
|
121
|
+
expect(updated_language.client.token).to eq(test_client.token)
|
122
122
|
expect(updated_language.lang_name).to eq('updated!')
|
123
123
|
expect(updated_language.lang_id).to eq(language.lang_id)
|
124
124
|
expect(updated_language.path).to eq(path)
|
@@ -115,7 +115,7 @@ RSpec.describe Lokalise::Client do
|
|
115
115
|
project.update name: 'updated!'
|
116
116
|
end
|
117
117
|
|
118
|
-
expect(updated_project.client).to eq(test_client)
|
118
|
+
expect(updated_project.client.token).to eq(test_client.token)
|
119
119
|
expect(updated_project.name).to eq('updated!')
|
120
120
|
expect(updated_project.path).to eq(path)
|
121
121
|
|
@@ -91,7 +91,7 @@ RSpec.describe Lokalise::Client do
|
|
91
91
|
end.collection.first
|
92
92
|
end
|
93
93
|
|
94
|
-
expect(screenshot.client).to eq(test_client)
|
94
|
+
expect(screenshot.client.token).to eq(test_client.token)
|
95
95
|
expect(screenshot.title).to eq('chained screen')
|
96
96
|
|
97
97
|
path = screenshot.path
|
@@ -100,7 +100,7 @@ RSpec.describe Lokalise::Client do
|
|
100
100
|
screenshot.update title: 'updated!'
|
101
101
|
end
|
102
102
|
|
103
|
-
expect(updated_screenshot.client).to eq(test_client)
|
103
|
+
expect(updated_screenshot.client.token).to eq(test_client.token)
|
104
104
|
expect(updated_screenshot.title).to eq('updated!')
|
105
105
|
expect(updated_screenshot.screenshot_id).to eq(screenshot.screenshot_id)
|
106
106
|
expect(updated_screenshot.path).to eq(path)
|
@@ -81,7 +81,7 @@ RSpec.describe Lokalise::Client do
|
|
81
81
|
new_project.update name: 'Restored and updated'
|
82
82
|
end
|
83
83
|
|
84
|
-
expect(updated_project.client).to eq(test_client)
|
84
|
+
expect(updated_project.client.token).to eq(test_client.token)
|
85
85
|
expect(updated_project.name).to eq('Restored and updated')
|
86
86
|
expect(updated_project.project_id).to eq(new_project.project_id)
|
87
87
|
|
@@ -120,7 +120,7 @@ RSpec.describe Lokalise::Client do
|
|
120
120
|
]
|
121
121
|
end
|
122
122
|
|
123
|
-
expect(task.client).to eq(test_client)
|
123
|
+
expect(task.client.token).to eq(test_client.token)
|
124
124
|
expect(task.title).to eq('chained')
|
125
125
|
|
126
126
|
path = task.path
|
@@ -129,7 +129,7 @@ RSpec.describe Lokalise::Client do
|
|
129
129
|
task.update title: 'updated!'
|
130
130
|
end
|
131
131
|
|
132
|
-
expect(updated_task.client).to eq(test_client)
|
132
|
+
expect(updated_task.client.token).to eq(test_client.token)
|
133
133
|
expect(updated_task.title).to eq('updated!')
|
134
134
|
expect(updated_task.task_id).to eq(task.task_id)
|
135
135
|
expect(updated_task.path).to eq(path)
|
@@ -81,7 +81,7 @@ RSpec.describe Lokalise::Client do
|
|
81
81
|
team_user.update role: 'admin'
|
82
82
|
end
|
83
83
|
|
84
|
-
expect(updated_team_user.client).to eq(test_client)
|
84
|
+
expect(updated_team_user.client.token).to eq(test_client.token)
|
85
85
|
expect(updated_team_user.role).to eq('admin')
|
86
86
|
|
87
87
|
delete_response = VCR.use_cassette('delete_team_user_chained') do
|
@@ -110,7 +110,7 @@ RSpec.describe Lokalise::Client do
|
|
110
110
|
translation.update translation: 'chained updated'
|
111
111
|
end
|
112
112
|
|
113
|
-
expect(updated_translation.client).to eq(test_client)
|
113
|
+
expect(updated_translation.client.token).to eq(test_client.token)
|
114
114
|
expect(updated_translation.translation).to eq('chained updated')
|
115
115
|
expect(updated_translation.translation_id).to eq(translation.translation_id)
|
116
116
|
end
|
@@ -12,7 +12,7 @@ RSpec.describe Lokalise do
|
|
12
12
|
specify '.reset_client!' do
|
13
13
|
expect(test_client).to be_an_instance_of(Lokalise::Client)
|
14
14
|
described_class.reset_client!
|
15
|
-
current_client = described_class.instance_variable_get
|
15
|
+
current_client = described_class.instance_variable_get :@client
|
16
16
|
expect(current_client).to be_nil
|
17
17
|
end
|
18
18
|
|
@@ -27,7 +27,7 @@ RSpec.describe Lokalise do
|
|
27
27
|
specify '.reset_oauth_client!' do
|
28
28
|
expect(test_oauth_client).to be_an_instance_of(Lokalise::OAuthClient)
|
29
29
|
described_class.reset_oauth_client!
|
30
|
-
current_oauth_client = described_class.instance_variable_get
|
30
|
+
current_oauth_client = described_class.instance_variable_get :@oauth_client
|
31
31
|
expect(current_oauth_client).to be_nil
|
32
32
|
end
|
33
33
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-lokalise-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.5.
|
4
|
+
version: 4.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ilya Bodrov-Krukowski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -356,7 +356,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
356
356
|
- !ruby/object:Gem::Version
|
357
357
|
version: '0'
|
358
358
|
requirements: []
|
359
|
-
rubygems_version: 3.
|
359
|
+
rubygems_version: 3.3.5
|
360
360
|
signing_key:
|
361
361
|
specification_version: 4
|
362
362
|
summary: Ruby interface to the Lokalise API
|