ruby-lokalise-api 2.10.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/.github/CODE_OF_CONDUCT.md +1 -1
  3. data/.github/CONTRIBUTING.md +2 -2
  4. data/CHANGELOG.md +23 -0
  5. data/README.md +275 -180
  6. data/lib/ruby-lokalise-api.rb +2 -0
  7. data/lib/ruby-lokalise-api/client.rb +1 -0
  8. data/lib/ruby-lokalise-api/collections/base.rb +3 -2
  9. data/lib/ruby-lokalise-api/collections/queued_process.rb +15 -0
  10. data/lib/ruby-lokalise-api/data/attributes.json +12 -1
  11. data/lib/ruby-lokalise-api/resources/base.rb +33 -17
  12. data/lib/ruby-lokalise-api/resources/branch.rb +1 -1
  13. data/lib/ruby-lokalise-api/resources/contributor.rb +1 -1
  14. data/lib/ruby-lokalise-api/resources/custom_translation_status.rb +1 -1
  15. data/lib/ruby-lokalise-api/resources/file.rb +4 -1
  16. data/lib/ruby-lokalise-api/resources/key.rb +1 -1
  17. data/lib/ruby-lokalise-api/resources/key_comment.rb +1 -1
  18. data/lib/ruby-lokalise-api/resources/order.rb +2 -0
  19. data/lib/ruby-lokalise-api/resources/payment_card.rb +1 -1
  20. data/lib/ruby-lokalise-api/resources/project.rb +1 -1
  21. data/lib/ruby-lokalise-api/resources/queued_process.rb +18 -0
  22. data/lib/ruby-lokalise-api/resources/screenshot.rb +1 -1
  23. data/lib/ruby-lokalise-api/resources/snapshot.rb +3 -1
  24. data/lib/ruby-lokalise-api/resources/task.rb +1 -1
  25. data/lib/ruby-lokalise-api/resources/team_user.rb +1 -1
  26. data/lib/ruby-lokalise-api/resources/translation.rb +1 -1
  27. data/lib/ruby-lokalise-api/resources/webhook.rb +1 -1
  28. data/lib/ruby-lokalise-api/rest/comments.rb +5 -5
  29. data/lib/ruby-lokalise-api/rest/contributors.rb +5 -5
  30. data/lib/ruby-lokalise-api/rest/custom_translation_statuses.rb +6 -6
  31. data/lib/ruby-lokalise-api/rest/files.rb +3 -3
  32. data/lib/ruby-lokalise-api/rest/keys.rb +7 -7
  33. data/lib/ruby-lokalise-api/rest/languages.rb +6 -6
  34. data/lib/ruby-lokalise-api/rest/payment_cards.rb +3 -3
  35. data/lib/ruby-lokalise-api/rest/projects.rb +6 -6
  36. data/lib/ruby-lokalise-api/rest/queued_processes.rb +26 -0
  37. data/lib/ruby-lokalise-api/rest/screenshots.rb +5 -5
  38. data/lib/ruby-lokalise-api/rest/snapshots.rb +4 -4
  39. data/lib/ruby-lokalise-api/rest/tasks.rb +5 -5
  40. data/lib/ruby-lokalise-api/rest/team_users.rb +4 -4
  41. data/lib/ruby-lokalise-api/rest/teams.rb +1 -1
  42. data/lib/ruby-lokalise-api/rest/translation_providers.rb +2 -2
  43. data/lib/ruby-lokalise-api/rest/translations.rb +3 -3
  44. data/lib/ruby-lokalise-api/rest/webhooks.rb +5 -5
  45. data/lib/ruby-lokalise-api/version.rb +1 -1
  46. data/ruby-lokalise-api.gemspec +1 -2
  47. data/spec/lib/ruby-lokalise-api/error_spec.rb +8 -0
  48. data/spec/lib/ruby-lokalise-api/rest/branches_spec.rb +12 -0
  49. data/spec/lib/ruby-lokalise-api/rest/comments_spec.rb +12 -0
  50. data/spec/lib/ruby-lokalise-api/rest/contributors_spec.rb +12 -0
  51. data/spec/lib/ruby-lokalise-api/rest/custom_translation_statuses_spec.rb +12 -0
  52. data/spec/lib/ruby-lokalise-api/rest/files_spec.rb +17 -9
  53. data/spec/lib/ruby-lokalise-api/rest/keys_spec.rb +12 -0
  54. data/spec/lib/ruby-lokalise-api/rest/orders_spec.rb +12 -0
  55. data/spec/lib/ruby-lokalise-api/rest/payment_cards_spec.rb +12 -0
  56. data/spec/lib/ruby-lokalise-api/rest/projects_spec.rb +12 -0
  57. data/spec/lib/ruby-lokalise-api/rest/queued_processes_spec.rb +58 -0
  58. data/spec/lib/ruby-lokalise-api/rest/screenshots_spec.rb +12 -0
  59. data/spec/lib/ruby-lokalise-api/rest/snapshots_spec.rb +25 -0
  60. data/spec/lib/ruby-lokalise-api/rest/tasks_spec.rb +12 -0
  61. data/spec/lib/ruby-lokalise-api/rest/team_users_spec.rb +12 -0
  62. data/spec/lib/ruby-lokalise-api/rest/translations_spec.rb +12 -0
  63. data/spec/lib/ruby-lokalise-api/rest/webhooks_spec.rb +13 -0
  64. metadata +11 -6
@@ -60,6 +60,18 @@ RSpec.describe Lokalise::Client do
60
60
  expect(task.custom_translation_status_ids).to eq([])
61
61
  end
62
62
 
63
+ specify '#reload_data' do
64
+ task = VCR.use_cassette('task') do
65
+ test_client.task project_id, '11925'
66
+ end
67
+
68
+ reloaded_task = VCR.use_cassette('task') do
69
+ task.reload_data
70
+ end
71
+
72
+ expect(reloaded_task.task_id).to eq(task.task_id)
73
+ end
74
+
63
75
  specify '#create_task' do
64
76
  task = VCR.use_cassette('create_task') do
65
77
  test_client.create_task project_id, title: 'another rspec key',
@@ -41,6 +41,18 @@ RSpec.describe Lokalise::Client do
41
41
  expect(team_user.role).to eq('owner')
42
42
  end
43
43
 
44
+ specify '#reload_data' do
45
+ team_user = VCR.use_cassette('team_user') do
46
+ test_client.team_user team_id, '20181'
47
+ end
48
+
49
+ reloaded_team_user = VCR.use_cassette('team_user') do
50
+ team_user.reload_data
51
+ end
52
+
53
+ expect(reloaded_team_user.user_id).to eq(team_user.user_id)
54
+ end
55
+
44
56
  specify '#update_team_user' do
45
57
  team_user = VCR.use_cassette('update_team_user') do
46
58
  test_client.update_team_user team_id, team_user_id, role: 'admin'
@@ -76,6 +76,18 @@ RSpec.describe Lokalise::Client do
76
76
  expect(translation.custom_translation_statuses).to eq([])
77
77
  end
78
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
+
79
91
  specify '#update_translation' do
80
92
  translation = VCR.use_cassette('update_translation') do
81
93
  test_client.update_translation project_id, translation_id, translation: 'rspec trans',
@@ -41,6 +41,18 @@ RSpec.describe Lokalise::Client do
41
41
  expect(webhook.event_lang_map.first['event']).to eq('project.translation.updated')
42
42
  end
43
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
+
44
56
  specify '#create_webhook' do
45
57
  webhook = VCR.use_cassette('create_webhook') do
46
58
  test_client.create_webhook project_id,
@@ -91,6 +103,7 @@ RSpec.describe Lokalise::Client do
91
103
  test_client.webhook project_id, serious_webhook_id
92
104
  end
93
105
 
106
+ expect(webhook.branch).to eq('master')
94
107
  expect(webhook.webhook_id).to eq(serious_webhook_id)
95
108
 
96
109
  response = VCR.use_cassette('regenerate_webhook_secret_2') do
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: 2.10.0
4
+ version: 3.0.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: 2020-02-28 00:00:00.000000000 Z
11
+ date: 2020-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '3.8'
89
+ version: '3.10'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '3.8'
96
+ version: '3.10'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rake
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -223,6 +223,7 @@ files:
223
223
  - lib/ruby-lokalise-api/collections/project.rb
224
224
  - lib/ruby-lokalise-api/collections/project_comment.rb
225
225
  - lib/ruby-lokalise-api/collections/project_language.rb
226
+ - lib/ruby-lokalise-api/collections/queued_process.rb
226
227
  - lib/ruby-lokalise-api/collections/screenshot.rb
227
228
  - lib/ruby-lokalise-api/collections/snapshot.rb
228
229
  - lib/ruby-lokalise-api/collections/system_language.rb
@@ -250,6 +251,7 @@ files:
250
251
  - lib/ruby-lokalise-api/resources/project.rb
251
252
  - lib/ruby-lokalise-api/resources/project_comment.rb
252
253
  - lib/ruby-lokalise-api/resources/project_language.rb
254
+ - lib/ruby-lokalise-api/resources/queued_process.rb
253
255
  - lib/ruby-lokalise-api/resources/screenshot.rb
254
256
  - lib/ruby-lokalise-api/resources/snapshot.rb
255
257
  - lib/ruby-lokalise-api/resources/system_language.rb
@@ -270,6 +272,7 @@ files:
270
272
  - lib/ruby-lokalise-api/rest/orders.rb
271
273
  - lib/ruby-lokalise-api/rest/payment_cards.rb
272
274
  - lib/ruby-lokalise-api/rest/projects.rb
275
+ - lib/ruby-lokalise-api/rest/queued_processes.rb
273
276
  - lib/ruby-lokalise-api/rest/screenshots.rb
274
277
  - lib/ruby-lokalise-api/rest/snapshots.rb
275
278
  - lib/ruby-lokalise-api/rest/tasks.rb
@@ -297,6 +300,7 @@ files:
297
300
  - spec/lib/ruby-lokalise-api/rest/orders_spec.rb
298
301
  - spec/lib/ruby-lokalise-api/rest/payment_cards_spec.rb
299
302
  - spec/lib/ruby-lokalise-api/rest/projects_spec.rb
303
+ - spec/lib/ruby-lokalise-api/rest/queued_processes_spec.rb
300
304
  - spec/lib/ruby-lokalise-api/rest/screenshots_spec.rb
301
305
  - spec/lib/ruby-lokalise-api/rest/snapshots_spec.rb
302
306
  - spec/lib/ruby-lokalise-api/rest/tasks_spec.rb
@@ -323,14 +327,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
323
327
  requirements:
324
328
  - - ">="
325
329
  - !ruby/object:Gem::Version
326
- version: 2.4.0
330
+ version: '0'
327
331
  required_rubygems_version: !ruby/object:Gem::Requirement
328
332
  requirements:
329
333
  - - ">="
330
334
  - !ruby/object:Gem::Version
331
335
  version: '0'
332
336
  requirements: []
333
- rubygems_version: 3.1.2
337
+ rubygems_version: 3.1.3
334
338
  signing_key:
335
339
  specification_version: 4
336
340
  summary: Ruby interface to the Lokalise API
@@ -348,6 +352,7 @@ test_files:
348
352
  - spec/lib/ruby-lokalise-api/rest/orders_spec.rb
349
353
  - spec/lib/ruby-lokalise-api/rest/payment_cards_spec.rb
350
354
  - spec/lib/ruby-lokalise-api/rest/projects_spec.rb
355
+ - spec/lib/ruby-lokalise-api/rest/queued_processes_spec.rb
351
356
  - spec/lib/ruby-lokalise-api/rest/screenshots_spec.rb
352
357
  - spec/lib/ruby-lokalise-api/rest/snapshots_spec.rb
353
358
  - spec/lib/ruby-lokalise-api/rest/tasks_spec.rb