crowdin-api 1.1.1 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test-and-lint.yml +1 -1
- data/.gitignore +2 -2
- data/.rubocop_todo.yml +114 -42
- data/README.md +26 -13
- data/bin/crowdin-console +5 -5
- data/crowdin-api.gemspec +1 -2
- data/lib/crowdin-api/api_resources/dictionaries.rb +32 -0
- data/lib/crowdin-api/api_resources/distributions.rb +92 -0
- data/lib/crowdin-api/api_resources/glossaries.rb +199 -0
- data/lib/crowdin-api/api_resources/labels.rb +98 -0
- data/lib/crowdin-api/api_resources/languages.rb +61 -0
- data/lib/crowdin-api/api_resources/machine_translation_engines.rb +79 -0
- data/lib/crowdin-api/api_resources/projects.rb +124 -0
- data/lib/crowdin-api/api_resources/reports.rb +120 -0
- data/lib/crowdin-api/api_resources/screenshots.rb +172 -0
- data/lib/crowdin-api/{api-resources → api_resources}/source_files.rb +68 -130
- data/lib/crowdin-api/{api-resources → api_resources}/source_strings.rb +19 -24
- data/lib/crowdin-api/api_resources/storages.rb +54 -0
- data/lib/crowdin-api/api_resources/string_comments.rb +68 -0
- data/lib/crowdin-api/api_resources/string_translations.rb +193 -0
- data/lib/crowdin-api/api_resources/tasks.rb +102 -0
- data/lib/crowdin-api/api_resources/teams.rb +135 -0
- data/lib/crowdin-api/api_resources/translation_memory.rb +131 -0
- data/lib/crowdin-api/{api-resources → api_resources}/translation_status.rb +24 -30
- data/lib/crowdin-api/{api-resources → api_resources}/translations.rb +41 -59
- data/lib/crowdin-api/api_resources/users.rb +161 -0
- data/lib/crowdin-api/api_resources/vendors.rb +21 -0
- data/lib/crowdin-api/api_resources/webhooks.rb +68 -0
- data/lib/crowdin-api/api_resources/workflows.rb +59 -0
- data/lib/crowdin-api/client/client.rb +72 -50
- data/lib/crowdin-api/client/configuration.rb +16 -12
- data/lib/crowdin-api/client/version.rb +1 -1
- data/lib/crowdin-api/core/errors.rb +2 -1
- data/lib/crowdin-api/core/{api_errors_raiser.rb → errors_raisers.rb} +21 -11
- data/lib/crowdin-api/core/request.rb +53 -88
- data/lib/crowdin-api/core/send_request.rb +67 -0
- data/lib/crowdin-api.rb +20 -11
- data/spec/api_resources/dictionaries_spec.rb +23 -0
- data/spec/api_resources/distributions_spec.rb +71 -0
- data/spec/api_resources/glossaries_spec.rb +167 -0
- data/spec/api_resources/labels_spec.rb +71 -0
- data/spec/api_resources/languages_spec.rb +51 -0
- data/spec/api_resources/machine_translation_engines_spec.rb +63 -0
- data/spec/api_resources/projects_spec.rb +215 -0
- data/spec/api_resources/reports_spec.rb +95 -0
- data/spec/api_resources/screenshots_spec.rb +134 -0
- data/spec/api_resources/source_files_spec.rb +13 -0
- data/spec/api_resources/source_strings_spec.rb +51 -0
- data/spec/api_resources/storages_spec.rb +13 -0
- data/spec/api_resources/string_comments_spec.rb +13 -0
- data/spec/api_resources/string_translations_spec.rb +13 -0
- data/spec/api_resources/tasks_spec.rb +79 -0
- data/spec/api_resources/teams_spec.rb +13 -0
- data/spec/api_resources/translation_memory_spec.rb +13 -0
- data/spec/api_resources/translation_status_spec.rb +15 -0
- data/spec/api_resources/translations_spec.rb +107 -0
- data/spec/api_resources/users_spec.rb +117 -0
- data/spec/api_resources/vendors_spec.rb +13 -0
- data/spec/api_resources/webhooks_spec.rb +51 -0
- data/spec/api_resources/workflows_spec.rb +41 -0
- data/spec/spec_helper.rb +20 -2
- data/spec/unit/client_spec.rb +85 -0
- metadata +65 -28
- data/bin/setup +0 -6
- data/lib/crowdin-api/api-resources/languages.rb +0 -81
- data/lib/crowdin-api/api-resources/projects.rb +0 -134
- data/lib/crowdin-api/api-resources/storages.rb +0 -102
- data/lib/crowdin-api/api-resources/workflows.rb +0 -59
- data/spec/core/config-instance_spec.rb +0 -72
- data/spec/crowdin-api_spec.rb +0 -7
@@ -1,72 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'Config instance' do
|
4
|
-
before do
|
5
|
-
@crowdin = Crowdin::Client.new do |config|
|
6
|
-
config.api_token = 'api_token'
|
7
|
-
config.project_id = 1
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
it 'show have a #project_id' do
|
12
|
-
expect(@crowdin.config.project_id).to_not be_nil
|
13
|
-
end
|
14
|
-
|
15
|
-
it 'should have a #api_token' do
|
16
|
-
expect(@crowdin.config.api_token).to_not be_nil
|
17
|
-
end
|
18
|
-
|
19
|
-
it '#target_api_url should equal /api/v2 by default' do
|
20
|
-
expect(@crowdin.config.target_api_url).to eq('/api/v2')
|
21
|
-
end
|
22
|
-
|
23
|
-
describe '#logger_enabled?' do
|
24
|
-
it 'should be false by default' do
|
25
|
-
expect(@crowdin.config.logger_enabled?).to be_falsey
|
26
|
-
end
|
27
|
-
|
28
|
-
it 'should equal specified argument' do
|
29
|
-
@crowdin = Crowdin::Client.new do |config|
|
30
|
-
config.enable_logger = true
|
31
|
-
end
|
32
|
-
|
33
|
-
expect(@crowdin.config.logger_enabled?).to be_truthy
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
describe '#enterprise_mode?' do
|
38
|
-
it 'should be false by default' do
|
39
|
-
expect(@crowdin.config.enterprise_mode?).to be_falsey
|
40
|
-
end
|
41
|
-
|
42
|
-
it 'should equal specified arguments' do
|
43
|
-
@crowdin = Crowdin::Client.new do |config|
|
44
|
-
config.organization_domain = 'organization_domain'
|
45
|
-
end
|
46
|
-
|
47
|
-
expect(@crowdin.config.enterprise_mode?).to be_truthy
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
describe '#base_url' do
|
52
|
-
it 'should equal https://api.crowdin.com by default' do
|
53
|
-
expect(@crowdin.config.base_url).to eq('https://api.crowdin.com')
|
54
|
-
end
|
55
|
-
|
56
|
-
it 'should equal specified organization domain' do
|
57
|
-
@crowdin = Crowdin::Client.new do |config|
|
58
|
-
config.organization_domain = 'organization_domain'
|
59
|
-
end
|
60
|
-
|
61
|
-
expect(@crowdin.config.base_url).to eq('https://organization_domain.api.crowdin.com')
|
62
|
-
end
|
63
|
-
|
64
|
-
it 'should equal full specified organization domain when user specify full url (with .com)' do
|
65
|
-
@crowdin = Crowdin::Client.new do |config|
|
66
|
-
config.organization_domain = 'organization_domain.com'
|
67
|
-
end
|
68
|
-
|
69
|
-
expect(@crowdin.config.base_url).to eq('organization_domain.com')
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|