ruby-lokalise-api 2.8.0 → 3.1.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 +4 -4
- data/.github/CODE_OF_CONDUCT.md +1 -1
- data/.github/CONTRIBUTING.md +2 -2
- data/CHANGELOG.md +46 -0
- data/Gemfile +2 -0
- data/README.md +293 -178
- data/Rakefile +6 -1
- data/lib/ruby-lokalise-api.rb +4 -0
- data/lib/ruby-lokalise-api/client.rb +18 -4
- data/lib/ruby-lokalise-api/collections/base.rb +6 -2
- data/lib/ruby-lokalise-api/collections/branch.rb +3 -1
- data/lib/ruby-lokalise-api/collections/contributor.rb +2 -0
- data/lib/ruby-lokalise-api/collections/custom_translation_status.rb +3 -1
- data/lib/ruby-lokalise-api/collections/file.rb +2 -0
- data/lib/ruby-lokalise-api/collections/key.rb +2 -0
- data/lib/ruby-lokalise-api/collections/key_comment.rb +2 -0
- data/lib/ruby-lokalise-api/collections/order.rb +2 -0
- data/lib/ruby-lokalise-api/collections/payment_card.rb +2 -0
- data/lib/ruby-lokalise-api/collections/project.rb +2 -0
- data/lib/ruby-lokalise-api/collections/project_comment.rb +2 -0
- data/lib/ruby-lokalise-api/collections/project_language.rb +2 -0
- data/lib/ruby-lokalise-api/collections/queued_process.rb +15 -0
- data/lib/ruby-lokalise-api/collections/screenshot.rb +2 -0
- data/lib/ruby-lokalise-api/collections/snapshot.rb +2 -0
- data/lib/ruby-lokalise-api/collections/system_language.rb +2 -0
- data/lib/ruby-lokalise-api/collections/task.rb +2 -0
- data/lib/ruby-lokalise-api/collections/team.rb +2 -0
- data/lib/ruby-lokalise-api/collections/team_user.rb +2 -0
- data/lib/ruby-lokalise-api/collections/team_user_group.rb +3 -1
- data/lib/ruby-lokalise-api/collections/translation.rb +2 -0
- data/lib/ruby-lokalise-api/collections/translation_provider.rb +2 -0
- data/lib/ruby-lokalise-api/collections/webhook.rb +2 -0
- data/lib/ruby-lokalise-api/connection.rb +3 -1
- data/lib/ruby-lokalise-api/data/attributes.json +28 -13
- data/lib/ruby-lokalise-api/error.rb +2 -0
- data/lib/ruby-lokalise-api/json_handler.rb +4 -0
- data/lib/ruby-lokalise-api/request.rb +10 -1
- data/lib/ruby-lokalise-api/resources/base.rb +53 -21
- data/lib/ruby-lokalise-api/resources/branch.rb +3 -1
- data/lib/ruby-lokalise-api/resources/contributor.rb +4 -2
- data/lib/ruby-lokalise-api/resources/custom_translation_status.rb +4 -2
- data/lib/ruby-lokalise-api/resources/file.rb +5 -1
- data/lib/ruby-lokalise-api/resources/key.rb +3 -1
- data/lib/ruby-lokalise-api/resources/key_comment.rb +5 -3
- data/lib/ruby-lokalise-api/resources/order.rb +4 -0
- data/lib/ruby-lokalise-api/resources/payment_card.rb +3 -1
- data/lib/ruby-lokalise-api/resources/project.rb +3 -1
- data/lib/ruby-lokalise-api/resources/project_comment.rb +3 -1
- data/lib/ruby-lokalise-api/resources/project_language.rb +5 -3
- data/lib/ruby-lokalise-api/resources/queued_process.rb +18 -0
- data/lib/ruby-lokalise-api/resources/screenshot.rb +3 -1
- data/lib/ruby-lokalise-api/resources/snapshot.rb +5 -1
- data/lib/ruby-lokalise-api/resources/system_language.rb +3 -1
- data/lib/ruby-lokalise-api/resources/task.rb +3 -1
- data/lib/ruby-lokalise-api/resources/team.rb +2 -0
- data/lib/ruby-lokalise-api/resources/team_user.rb +4 -2
- data/lib/ruby-lokalise-api/resources/team_user_group.rb +6 -3
- data/lib/ruby-lokalise-api/resources/translation.rb +3 -1
- data/lib/ruby-lokalise-api/resources/translation_provider.rb +5 -0
- data/lib/ruby-lokalise-api/resources/webhook.rb +13 -3
- data/lib/ruby-lokalise-api/rest/branches.rb +2 -0
- data/lib/ruby-lokalise-api/rest/comments.rb +7 -5
- data/lib/ruby-lokalise-api/rest/contributors.rb +7 -5
- data/lib/ruby-lokalise-api/rest/custom_translation_statuses.rb +8 -6
- data/lib/ruby-lokalise-api/rest/files.rb +5 -3
- data/lib/ruby-lokalise-api/rest/keys.rb +9 -7
- data/lib/ruby-lokalise-api/rest/languages.rb +8 -6
- data/lib/ruby-lokalise-api/rest/orders.rb +2 -0
- data/lib/ruby-lokalise-api/rest/payment_cards.rb +5 -3
- data/lib/ruby-lokalise-api/rest/projects.rb +8 -6
- data/lib/ruby-lokalise-api/rest/queued_processes.rb +26 -0
- data/lib/ruby-lokalise-api/rest/screenshots.rb +7 -5
- data/lib/ruby-lokalise-api/rest/snapshots.rb +6 -4
- data/lib/ruby-lokalise-api/rest/tasks.rb +7 -5
- data/lib/ruby-lokalise-api/rest/team_user_group.rb +6 -4
- data/lib/ruby-lokalise-api/rest/team_users.rb +6 -4
- data/lib/ruby-lokalise-api/rest/teams.rb +3 -1
- data/lib/ruby-lokalise-api/rest/translation_providers.rb +4 -2
- data/lib/ruby-lokalise-api/rest/translations.rb +5 -3
- data/lib/ruby-lokalise-api/rest/webhooks.rb +18 -5
- data/lib/ruby-lokalise-api/utils/attribute_helpers.rb +2 -0
- data/lib/ruby-lokalise-api/utils/endpoint_helpers.rb +2 -0
- data/lib/ruby-lokalise-api/utils/string_utils.rb +2 -0
- data/lib/ruby-lokalise-api/version.rb +3 -1
- data/ruby-lokalise-api.gemspec +9 -5
- data/spec/lib/ruby-lokalise-api/connection_spec.rb +10 -7
- data/spec/lib/ruby-lokalise-api/custom_json_parser_spec.rb +9 -5
- data/spec/lib/ruby-lokalise-api/error_spec.rb +15 -4
- data/spec/lib/ruby-lokalise-api/rest/branches_spec.rb +19 -5
- data/spec/lib/ruby-lokalise-api/rest/comments_spec.rb +19 -5
- data/spec/lib/ruby-lokalise-api/rest/contributors_spec.rb +18 -4
- data/spec/lib/ruby-lokalise-api/rest/custom_translation_statuses_spec.rb +18 -4
- data/spec/lib/ruby-lokalise-api/rest/files_spec.rb +21 -11
- data/spec/lib/ruby-lokalise-api/rest/keys_spec.rb +46 -26
- data/spec/lib/ruby-lokalise-api/rest/languages_spec.rb +20 -6
- data/spec/lib/ruby-lokalise-api/rest/orders_spec.rb +16 -2
- data/spec/lib/ruby-lokalise-api/rest/payment_cards_spec.rb +21 -5
- data/spec/lib/ruby-lokalise-api/rest/projects_spec.rb +18 -4
- data/spec/lib/ruby-lokalise-api/rest/queued_processes_spec.rb +57 -0
- data/spec/lib/ruby-lokalise-api/rest/screenshots_spec.rb +18 -4
- data/spec/lib/ruby-lokalise-api/rest/snapshots_spec.rb +31 -4
- data/spec/lib/ruby-lokalise-api/rest/tasks_spec.rb +18 -4
- data/spec/lib/ruby-lokalise-api/rest/team_user_groups_spec.rb +92 -6
- data/spec/lib/ruby-lokalise-api/rest/team_users_spec.rb +19 -4
- data/spec/lib/ruby-lokalise-api/rest/teams_spec.rb +2 -0
- data/spec/lib/ruby-lokalise-api/rest/translation_providers_spec.rb +9 -2
- data/spec/lib/ruby-lokalise-api/rest/translations_spec.rb +20 -6
- data/spec/lib/ruby-lokalise-api/rest/webhooks_spec.rb +54 -2
- data/spec/lib/ruby-lokalise-api/utils/snakecase_spec.rb +2 -0
- data/spec/lib/ruby-lokalise-api_spec.rb +12 -9
- data/spec/spec_helper.rb +8 -1
- data/spec/support/test_client.rb +2 -0
- data/spec/support/vcr.rb +2 -0
- metadata +59 -12
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
RSpec.describe Lokalise::Client do
|
|
2
4
|
let(:team_id) { 176_692 }
|
|
3
5
|
let(:team_user_id) { 25_953 }
|
|
4
6
|
let(:another_user_id) { 26_265 }
|
|
5
7
|
|
|
6
8
|
describe '#team_users' do
|
|
7
|
-
it '
|
|
9
|
+
it 'returns all team_users' do
|
|
8
10
|
team_users = VCR.use_cassette('team_users') do
|
|
9
11
|
test_client.team_users team_id
|
|
10
12
|
end
|
|
@@ -13,7 +15,7 @@ RSpec.describe Lokalise::Client do
|
|
|
13
15
|
expect(team_users.team_id).to eq(team_id)
|
|
14
16
|
end
|
|
15
17
|
|
|
16
|
-
it '
|
|
18
|
+
it 'supports pagination' do
|
|
17
19
|
team_users = VCR.use_cassette('all_team_users_pagination') do
|
|
18
20
|
test_client.team_users team_id, limit: 1, page: 3
|
|
19
21
|
end
|
|
@@ -31,6 +33,7 @@ RSpec.describe Lokalise::Client do
|
|
|
31
33
|
test_client.team_user team_id, '20181'
|
|
32
34
|
end
|
|
33
35
|
|
|
36
|
+
expect(team_user.team_id).to eq(team_id)
|
|
34
37
|
expect(team_user.user_id).to eq(20_181)
|
|
35
38
|
expect(team_user.email).to eq('bodrovis@protonmail.com')
|
|
36
39
|
expect(team_user.fullname).to eq('Ilya B')
|
|
@@ -39,6 +42,18 @@ RSpec.describe Lokalise::Client do
|
|
|
39
42
|
expect(team_user.role).to eq('owner')
|
|
40
43
|
end
|
|
41
44
|
|
|
45
|
+
specify '#reload_data' do
|
|
46
|
+
team_user = VCR.use_cassette('team_user') do
|
|
47
|
+
test_client.team_user team_id, '20181'
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
reloaded_team_user = VCR.use_cassette('team_user') do
|
|
51
|
+
team_user.reload_data
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
expect(reloaded_team_user.user_id).to eq(team_user.user_id)
|
|
55
|
+
end
|
|
56
|
+
|
|
42
57
|
specify '#update_team_user' do
|
|
43
58
|
team_user = VCR.use_cassette('update_team_user') do
|
|
44
59
|
test_client.update_team_user team_id, team_user_id, role: 'admin'
|
|
@@ -56,8 +71,8 @@ RSpec.describe Lokalise::Client do
|
|
|
56
71
|
expect(response['team_user_deleted']).to eq(true)
|
|
57
72
|
end
|
|
58
73
|
|
|
59
|
-
context 'team user chained
|
|
60
|
-
it '
|
|
74
|
+
context 'when team user methods are chained' do
|
|
75
|
+
it 'supports update and destroy' do
|
|
61
76
|
team_user = VCR.use_cassette('another_team_user') do
|
|
62
77
|
test_client.team_user team_id, another_user_id
|
|
63
78
|
end
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
RSpec.describe Lokalise::Client do
|
|
2
4
|
let(:team_id) { 176_692 }
|
|
3
5
|
|
|
4
6
|
describe '#translation_providers' do
|
|
5
|
-
it '
|
|
7
|
+
it 'returns all providers' do
|
|
6
8
|
providers = VCR.use_cassette('all_translation_providers') do
|
|
7
9
|
test_client.translation_providers team_id
|
|
8
10
|
end.collection
|
|
@@ -11,7 +13,7 @@ RSpec.describe Lokalise::Client do
|
|
|
11
13
|
expect(providers.first.slug).to eq('gengo')
|
|
12
14
|
end
|
|
13
15
|
|
|
14
|
-
it '
|
|
16
|
+
it 'supports pagination' do
|
|
15
17
|
providers = VCR.use_cassette('all_translation_providers_pagination') do
|
|
16
18
|
test_client.translation_providers team_id, limit: 1, page: 2
|
|
17
19
|
end
|
|
@@ -37,5 +39,10 @@ RSpec.describe Lokalise::Client do
|
|
|
37
39
|
expect(provider.description.start_with?('At')).to eq(true)
|
|
38
40
|
expect(provider.tiers.first['title']).to eq('Native speaker')
|
|
39
41
|
expect(provider.pairs.first['price_per_word']).to eq('0.05')
|
|
42
|
+
|
|
43
|
+
reloaded_provider = VCR.use_cassette('translation_provider') do
|
|
44
|
+
provider.reload_data
|
|
45
|
+
end
|
|
46
|
+
expect(reloaded_provider.provider_id).to eq(provider.provider_id)
|
|
40
47
|
end
|
|
41
48
|
end
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
RSpec.describe Lokalise::Client do
|
|
2
4
|
let(:project_id) { '803826145ba90b42d5d860.46800099' }
|
|
3
5
|
let(:translation_id) { 80_015_147 }
|
|
4
6
|
let(:another_translation_id) { 82_070_312 }
|
|
5
7
|
|
|
6
8
|
describe '#translations' do
|
|
7
|
-
it '
|
|
9
|
+
it 'returns all translations' do
|
|
8
10
|
translations = VCR.use_cassette('translations') do
|
|
9
11
|
test_client.translations project_id
|
|
10
12
|
end.collection
|
|
@@ -12,7 +14,7 @@ RSpec.describe Lokalise::Client do
|
|
|
12
14
|
expect(translations.count).to eq(9)
|
|
13
15
|
end
|
|
14
16
|
|
|
15
|
-
it '
|
|
17
|
+
it 'supports pagination' do
|
|
16
18
|
translations = VCR.use_cassette('all_translations_pagination') do
|
|
17
19
|
test_client.translations project_id, limit: 4, page: 2, disable_references: 0,
|
|
18
20
|
filter_is_reviewed: 0
|
|
@@ -32,7 +34,7 @@ RSpec.describe Lokalise::Client do
|
|
|
32
34
|
end
|
|
33
35
|
|
|
34
36
|
expect(next_page_trans).to be_an_instance_of(Lokalise::Collections::Translation)
|
|
35
|
-
expect(next_page_trans.client).to be_an_instance_of(
|
|
37
|
+
expect(next_page_trans.client).to be_an_instance_of(described_class)
|
|
36
38
|
expect(next_page_trans.request_params[:page]).to eq(3)
|
|
37
39
|
expect(next_page_trans.request_params[:disable_references]).to eq(0)
|
|
38
40
|
expect(next_page_trans.total_results).to eq(187)
|
|
@@ -45,7 +47,7 @@ RSpec.describe Lokalise::Client do
|
|
|
45
47
|
end
|
|
46
48
|
|
|
47
49
|
expect(prev_page_trans).to be_an_instance_of(Lokalise::Collections::Translation)
|
|
48
|
-
expect(prev_page_trans.client).to be_an_instance_of(
|
|
50
|
+
expect(prev_page_trans.client).to be_an_instance_of(described_class)
|
|
49
51
|
expect(prev_page_trans.request_params[:page]).to eq(1)
|
|
50
52
|
expect(next_page_trans.request_params[:disable_references]).to eq(0)
|
|
51
53
|
expect(prev_page_trans.total_results).to eq(187)
|
|
@@ -74,6 +76,18 @@ RSpec.describe Lokalise::Client do
|
|
|
74
76
|
expect(translation.custom_translation_statuses).to eq([])
|
|
75
77
|
end
|
|
76
78
|
|
|
79
|
+
specify '#reload_data' do
|
|
80
|
+
translation = VCR.use_cassette('translation') do
|
|
81
|
+
test_client.translation project_id, translation_id
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
reloaded_translation = VCR.use_cassette('translation') do
|
|
85
|
+
translation.reload_data
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
expect(reloaded_translation.translation_id).to eq(translation.translation_id)
|
|
89
|
+
end
|
|
90
|
+
|
|
77
91
|
specify '#update_translation' do
|
|
78
92
|
translation = VCR.use_cassette('update_translation') do
|
|
79
93
|
test_client.update_translation project_id, translation_id, translation: 'rspec trans',
|
|
@@ -85,8 +99,8 @@ RSpec.describe Lokalise::Client do
|
|
|
85
99
|
expect(translation.is_reviewed).to eq(true)
|
|
86
100
|
end
|
|
87
101
|
|
|
88
|
-
context 'translation chained methods' do
|
|
89
|
-
it '
|
|
102
|
+
context 'when translation chained methods are used' do
|
|
103
|
+
it 'supports update' do
|
|
90
104
|
translation = VCR.use_cassette('another_translation') do
|
|
91
105
|
test_client.translation project_id, another_translation_id
|
|
92
106
|
end
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
RSpec.describe Lokalise::Client do
|
|
2
4
|
let(:project_id) { '803826145ba90b42d5d860.46800099' }
|
|
3
5
|
let(:webhook_id) { 'c7eb7e6e3c2fb2b26d0b64d0de083a5a71675b3d' }
|
|
4
6
|
let(:new_webhook_id) { 'b345ccc6499920c490e8f4fe9487b1378dbf1dbf' }
|
|
7
|
+
let(:serious_webhook_id) { '795565582e5ab15a59bb68156c7e2e9eaa1e8d1a' }
|
|
5
8
|
|
|
6
9
|
describe '#webhooks' do
|
|
7
|
-
it '
|
|
10
|
+
it 'returns all webhooks' do
|
|
8
11
|
webhooks = VCR.use_cassette('webhooks') do
|
|
9
12
|
test_client.webhooks project_id
|
|
10
13
|
end.collection
|
|
@@ -13,7 +16,7 @@ RSpec.describe Lokalise::Client do
|
|
|
13
16
|
expect(webhooks.first.url).to eq('https://serios.webhook')
|
|
14
17
|
end
|
|
15
18
|
|
|
16
|
-
it '
|
|
19
|
+
it 'supports pagination' do
|
|
17
20
|
webhooks = VCR.use_cassette('all_webhooks_pagination') do
|
|
18
21
|
test_client.webhooks project_id, limit: 1, page: 2
|
|
19
22
|
end
|
|
@@ -38,6 +41,18 @@ RSpec.describe Lokalise::Client do
|
|
|
38
41
|
expect(webhook.event_lang_map.first['event']).to eq('project.translation.updated')
|
|
39
42
|
end
|
|
40
43
|
|
|
44
|
+
specify '#reload_data' do
|
|
45
|
+
webhook = VCR.use_cassette('webhook') do
|
|
46
|
+
test_client.webhook project_id, webhook_id
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
reloaded_webhook = VCR.use_cassette('webhook') do
|
|
50
|
+
webhook.reload_data
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
expect(reloaded_webhook.webhook_id).to eq(webhook.webhook_id)
|
|
54
|
+
end
|
|
55
|
+
|
|
41
56
|
specify '#create_webhook' do
|
|
42
57
|
webhook = VCR.use_cassette('create_webhook') do
|
|
43
58
|
test_client.create_webhook project_id,
|
|
@@ -71,4 +86,41 @@ RSpec.describe Lokalise::Client do
|
|
|
71
86
|
expect(response['project_id']).to eq(project_id)
|
|
72
87
|
expect(response['webhook_deleted']).to eq(true)
|
|
73
88
|
end
|
|
89
|
+
|
|
90
|
+
specify '#regenerate_webhook_secret' do
|
|
91
|
+
response = VCR.use_cassette('regenerate_webhook_secret') do
|
|
92
|
+
test_client.regenerate_webhook_secret project_id,
|
|
93
|
+
serious_webhook_id
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
expect(response['project_id']).to eq(project_id)
|
|
97
|
+
expect(response['secret']).not_to be_nil
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
context 'when webhook chained methods are used' do
|
|
101
|
+
it 'supports regenerate_webhook_secret' do
|
|
102
|
+
webhook = VCR.use_cassette('webhook_2') do
|
|
103
|
+
test_client.webhook project_id, serious_webhook_id
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
expect(webhook.branch).to eq('master')
|
|
107
|
+
expect(webhook.webhook_id).to eq(serious_webhook_id)
|
|
108
|
+
|
|
109
|
+
response = VCR.use_cassette('regenerate_webhook_secret_2') do
|
|
110
|
+
webhook.regenerate_secret
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
expect(response['project_id']).to eq(project_id)
|
|
114
|
+
expect(response['secret']).not_to be_nil
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
it 'supports update and destroy' do
|
|
118
|
+
webhook = VCR.use_cassette('webhook_2') do
|
|
119
|
+
test_client.webhook project_id, serious_webhook_id
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
expect(webhook).to respond_to(:update)
|
|
123
|
+
expect(webhook).to respond_to(:destroy)
|
|
124
|
+
end
|
|
125
|
+
end
|
|
74
126
|
end
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
RSpec.describe Lokalise do
|
|
2
4
|
specify '.client' do
|
|
3
5
|
expect(test_client).to be_an_instance_of(Lokalise::Client)
|
|
@@ -8,22 +10,23 @@ RSpec.describe Lokalise do
|
|
|
8
10
|
|
|
9
11
|
specify '.reset_client!' do
|
|
10
12
|
expect(test_client).to be_an_instance_of(Lokalise::Client)
|
|
11
|
-
|
|
12
|
-
current_client =
|
|
13
|
+
described_class.reset_client!
|
|
14
|
+
current_client = described_class.instance_variable_get '@client'
|
|
13
15
|
expect(current_client).to be_nil
|
|
14
16
|
end
|
|
15
17
|
|
|
16
|
-
context 'client params' do
|
|
17
|
-
before
|
|
18
|
-
|
|
18
|
+
context 'with client params' do
|
|
19
|
+
before { described_class.reset_client! }
|
|
20
|
+
|
|
21
|
+
after { described_class.reset_client! }
|
|
19
22
|
|
|
20
|
-
it '
|
|
21
|
-
custom_client =
|
|
23
|
+
it 'is possible to customize timeout' do
|
|
24
|
+
custom_client = described_class.client(ENV['LOKALISE_API_TOKEN'], timeout: 600)
|
|
22
25
|
expect(custom_client.timeout).to eq(600)
|
|
23
26
|
end
|
|
24
27
|
|
|
25
|
-
it '
|
|
26
|
-
custom_client =
|
|
28
|
+
it 'is possible to customize open timeout' do
|
|
29
|
+
custom_client = described_class.client(ENV['LOKALISE_API_TOKEN'], open_timeout: 100)
|
|
27
30
|
expect(custom_client.open_timeout).to eq(100)
|
|
28
31
|
end
|
|
29
32
|
end
|
data/spec/spec_helper.rb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'dotenv/load'
|
|
2
4
|
require 'simplecov'
|
|
3
5
|
SimpleCov.start do
|
|
@@ -5,10 +7,15 @@ SimpleCov.start do
|
|
|
5
7
|
add_filter '.github/'
|
|
6
8
|
end
|
|
7
9
|
|
|
10
|
+
if ENV['CI'] == 'true'
|
|
11
|
+
require 'codecov'
|
|
12
|
+
SimpleCov.formatter = SimpleCov::Formatter::Codecov
|
|
13
|
+
end
|
|
14
|
+
|
|
8
15
|
require 'ruby-lokalise-api'
|
|
9
16
|
|
|
10
17
|
# Support files
|
|
11
|
-
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
|
18
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].sort.each { |f| require f }
|
|
12
19
|
|
|
13
20
|
RSpec.configure do |config|
|
|
14
21
|
config.include TestClient
|
data/spec/support/test_client.rb
CHANGED
data/spec/support/vcr.rb
CHANGED
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
|
+
version: 3.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ilya Bodrov
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2020-07-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: addressable
|
|
@@ -30,14 +30,42 @@ dependencies:
|
|
|
30
30
|
requirements:
|
|
31
31
|
- - "~>"
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: '0
|
|
33
|
+
version: '1.0'
|
|
34
|
+
type: :runtime
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '1.0'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: json
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - ">="
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: 1.8.0
|
|
34
48
|
type: :runtime
|
|
35
49
|
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - ">="
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: 1.8.0
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: codecov
|
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - "~>"
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '0.1'
|
|
62
|
+
type: :development
|
|
63
|
+
prerelease: false
|
|
36
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
65
|
requirements:
|
|
38
66
|
- - "~>"
|
|
39
67
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: '0.
|
|
68
|
+
version: '0.1'
|
|
41
69
|
- !ruby/object:Gem::Dependency
|
|
42
70
|
name: dotenv
|
|
43
71
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -58,14 +86,14 @@ dependencies:
|
|
|
58
86
|
requirements:
|
|
59
87
|
- - "~>"
|
|
60
88
|
- !ruby/object:Gem::Version
|
|
61
|
-
version: '3.
|
|
89
|
+
version: '3.10'
|
|
62
90
|
type: :development
|
|
63
91
|
prerelease: false
|
|
64
92
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
93
|
requirements:
|
|
66
94
|
- - "~>"
|
|
67
95
|
- !ruby/object:Gem::Version
|
|
68
|
-
version: '3.
|
|
96
|
+
version: '3.10'
|
|
69
97
|
- !ruby/object:Gem::Dependency
|
|
70
98
|
name: rake
|
|
71
99
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -114,14 +142,28 @@ dependencies:
|
|
|
114
142
|
requirements:
|
|
115
143
|
- - "~>"
|
|
116
144
|
- !ruby/object:Gem::Version
|
|
117
|
-
version: '1.
|
|
145
|
+
version: '1.5'
|
|
118
146
|
type: :development
|
|
119
147
|
prerelease: false
|
|
120
148
|
version_requirements: !ruby/object:Gem::Requirement
|
|
121
149
|
requirements:
|
|
122
150
|
- - "~>"
|
|
123
151
|
- !ruby/object:Gem::Version
|
|
124
|
-
version: '1.
|
|
152
|
+
version: '1.5'
|
|
153
|
+
- !ruby/object:Gem::Dependency
|
|
154
|
+
name: rubocop-rspec
|
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
|
156
|
+
requirements:
|
|
157
|
+
- - "~>"
|
|
158
|
+
- !ruby/object:Gem::Version
|
|
159
|
+
version: '1.37'
|
|
160
|
+
type: :development
|
|
161
|
+
prerelease: false
|
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
163
|
+
requirements:
|
|
164
|
+
- - "~>"
|
|
165
|
+
- !ruby/object:Gem::Version
|
|
166
|
+
version: '1.37'
|
|
125
167
|
- !ruby/object:Gem::Dependency
|
|
126
168
|
name: simplecov
|
|
127
169
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -142,14 +184,14 @@ dependencies:
|
|
|
142
184
|
requirements:
|
|
143
185
|
- - "~>"
|
|
144
186
|
- !ruby/object:Gem::Version
|
|
145
|
-
version: '
|
|
187
|
+
version: '6.0'
|
|
146
188
|
type: :development
|
|
147
189
|
prerelease: false
|
|
148
190
|
version_requirements: !ruby/object:Gem::Requirement
|
|
149
191
|
requirements:
|
|
150
192
|
- - "~>"
|
|
151
193
|
- !ruby/object:Gem::Version
|
|
152
|
-
version: '
|
|
194
|
+
version: '6.0'
|
|
153
195
|
description: Opinionated Ruby client for the Lokalise platform API allowing to work
|
|
154
196
|
with translations, projects, users and other resources as with Ruby objects.
|
|
155
197
|
email:
|
|
@@ -181,6 +223,7 @@ files:
|
|
|
181
223
|
- lib/ruby-lokalise-api/collections/project.rb
|
|
182
224
|
- lib/ruby-lokalise-api/collections/project_comment.rb
|
|
183
225
|
- lib/ruby-lokalise-api/collections/project_language.rb
|
|
226
|
+
- lib/ruby-lokalise-api/collections/queued_process.rb
|
|
184
227
|
- lib/ruby-lokalise-api/collections/screenshot.rb
|
|
185
228
|
- lib/ruby-lokalise-api/collections/snapshot.rb
|
|
186
229
|
- lib/ruby-lokalise-api/collections/system_language.rb
|
|
@@ -208,6 +251,7 @@ files:
|
|
|
208
251
|
- lib/ruby-lokalise-api/resources/project.rb
|
|
209
252
|
- lib/ruby-lokalise-api/resources/project_comment.rb
|
|
210
253
|
- lib/ruby-lokalise-api/resources/project_language.rb
|
|
254
|
+
- lib/ruby-lokalise-api/resources/queued_process.rb
|
|
211
255
|
- lib/ruby-lokalise-api/resources/screenshot.rb
|
|
212
256
|
- lib/ruby-lokalise-api/resources/snapshot.rb
|
|
213
257
|
- lib/ruby-lokalise-api/resources/system_language.rb
|
|
@@ -228,6 +272,7 @@ files:
|
|
|
228
272
|
- lib/ruby-lokalise-api/rest/orders.rb
|
|
229
273
|
- lib/ruby-lokalise-api/rest/payment_cards.rb
|
|
230
274
|
- lib/ruby-lokalise-api/rest/projects.rb
|
|
275
|
+
- lib/ruby-lokalise-api/rest/queued_processes.rb
|
|
231
276
|
- lib/ruby-lokalise-api/rest/screenshots.rb
|
|
232
277
|
- lib/ruby-lokalise-api/rest/snapshots.rb
|
|
233
278
|
- lib/ruby-lokalise-api/rest/tasks.rb
|
|
@@ -255,6 +300,7 @@ files:
|
|
|
255
300
|
- spec/lib/ruby-lokalise-api/rest/orders_spec.rb
|
|
256
301
|
- spec/lib/ruby-lokalise-api/rest/payment_cards_spec.rb
|
|
257
302
|
- spec/lib/ruby-lokalise-api/rest/projects_spec.rb
|
|
303
|
+
- spec/lib/ruby-lokalise-api/rest/queued_processes_spec.rb
|
|
258
304
|
- spec/lib/ruby-lokalise-api/rest/screenshots_spec.rb
|
|
259
305
|
- spec/lib/ruby-lokalise-api/rest/snapshots_spec.rb
|
|
260
306
|
- spec/lib/ruby-lokalise-api/rest/tasks_spec.rb
|
|
@@ -281,14 +327,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
281
327
|
requirements:
|
|
282
328
|
- - ">="
|
|
283
329
|
- !ruby/object:Gem::Version
|
|
284
|
-
version:
|
|
330
|
+
version: '0'
|
|
285
331
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
286
332
|
requirements:
|
|
287
333
|
- - ">="
|
|
288
334
|
- !ruby/object:Gem::Version
|
|
289
335
|
version: '0'
|
|
290
336
|
requirements: []
|
|
291
|
-
rubygems_version: 3.
|
|
337
|
+
rubygems_version: 3.1.4
|
|
292
338
|
signing_key:
|
|
293
339
|
specification_version: 4
|
|
294
340
|
summary: Ruby interface to the Lokalise API
|
|
@@ -306,6 +352,7 @@ test_files:
|
|
|
306
352
|
- spec/lib/ruby-lokalise-api/rest/orders_spec.rb
|
|
307
353
|
- spec/lib/ruby-lokalise-api/rest/payment_cards_spec.rb
|
|
308
354
|
- spec/lib/ruby-lokalise-api/rest/projects_spec.rb
|
|
355
|
+
- spec/lib/ruby-lokalise-api/rest/queued_processes_spec.rb
|
|
309
356
|
- spec/lib/ruby-lokalise-api/rest/screenshots_spec.rb
|
|
310
357
|
- spec/lib/ruby-lokalise-api/rest/snapshots_spec.rb
|
|
311
358
|
- spec/lib/ruby-lokalise-api/rest/tasks_spec.rb
|