ruby-lokalise-api 2.8.0 → 2.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/Gemfile +2 -0
  4. data/README.md +1 -0
  5. data/Rakefile +6 -1
  6. data/lib/ruby-lokalise-api.rb +2 -0
  7. data/lib/ruby-lokalise-api/client.rb +2 -0
  8. data/lib/ruby-lokalise-api/collections/base.rb +2 -0
  9. data/lib/ruby-lokalise-api/collections/branch.rb +3 -1
  10. data/lib/ruby-lokalise-api/collections/contributor.rb +2 -0
  11. data/lib/ruby-lokalise-api/collections/custom_translation_status.rb +3 -1
  12. data/lib/ruby-lokalise-api/collections/file.rb +2 -0
  13. data/lib/ruby-lokalise-api/collections/key.rb +2 -0
  14. data/lib/ruby-lokalise-api/collections/key_comment.rb +2 -0
  15. data/lib/ruby-lokalise-api/collections/order.rb +2 -0
  16. data/lib/ruby-lokalise-api/collections/payment_card.rb +2 -0
  17. data/lib/ruby-lokalise-api/collections/project.rb +2 -0
  18. data/lib/ruby-lokalise-api/collections/project_comment.rb +2 -0
  19. data/lib/ruby-lokalise-api/collections/project_language.rb +2 -0
  20. data/lib/ruby-lokalise-api/collections/screenshot.rb +2 -0
  21. data/lib/ruby-lokalise-api/collections/snapshot.rb +2 -0
  22. data/lib/ruby-lokalise-api/collections/system_language.rb +2 -0
  23. data/lib/ruby-lokalise-api/collections/task.rb +2 -0
  24. data/lib/ruby-lokalise-api/collections/team.rb +2 -0
  25. data/lib/ruby-lokalise-api/collections/team_user.rb +2 -0
  26. data/lib/ruby-lokalise-api/collections/team_user_group.rb +3 -1
  27. data/lib/ruby-lokalise-api/collections/translation.rb +2 -0
  28. data/lib/ruby-lokalise-api/collections/translation_provider.rb +2 -0
  29. data/lib/ruby-lokalise-api/collections/webhook.rb +2 -0
  30. data/lib/ruby-lokalise-api/connection.rb +3 -1
  31. data/lib/ruby-lokalise-api/error.rb +2 -0
  32. data/lib/ruby-lokalise-api/json_handler.rb +4 -0
  33. data/lib/ruby-lokalise-api/request.rb +2 -0
  34. data/lib/ruby-lokalise-api/resources/base.rb +2 -0
  35. data/lib/ruby-lokalise-api/resources/branch.rb +2 -0
  36. data/lib/ruby-lokalise-api/resources/contributor.rb +3 -1
  37. data/lib/ruby-lokalise-api/resources/custom_translation_status.rb +3 -1
  38. data/lib/ruby-lokalise-api/resources/file.rb +2 -0
  39. data/lib/ruby-lokalise-api/resources/key.rb +2 -0
  40. data/lib/ruby-lokalise-api/resources/key_comment.rb +4 -2
  41. data/lib/ruby-lokalise-api/resources/order.rb +2 -0
  42. data/lib/ruby-lokalise-api/resources/payment_card.rb +2 -0
  43. data/lib/ruby-lokalise-api/resources/project.rb +2 -0
  44. data/lib/ruby-lokalise-api/resources/project_comment.rb +3 -1
  45. data/lib/ruby-lokalise-api/resources/project_language.rb +4 -2
  46. data/lib/ruby-lokalise-api/resources/screenshot.rb +2 -0
  47. data/lib/ruby-lokalise-api/resources/snapshot.rb +2 -0
  48. data/lib/ruby-lokalise-api/resources/system_language.rb +3 -1
  49. data/lib/ruby-lokalise-api/resources/task.rb +2 -0
  50. data/lib/ruby-lokalise-api/resources/team.rb +2 -0
  51. data/lib/ruby-lokalise-api/resources/team_user.rb +3 -1
  52. data/lib/ruby-lokalise-api/resources/team_user_group.rb +4 -2
  53. data/lib/ruby-lokalise-api/resources/translation.rb +2 -0
  54. data/lib/ruby-lokalise-api/resources/translation_provider.rb +2 -0
  55. data/lib/ruby-lokalise-api/resources/webhook.rb +2 -0
  56. data/lib/ruby-lokalise-api/rest/branches.rb +2 -0
  57. data/lib/ruby-lokalise-api/rest/comments.rb +2 -0
  58. data/lib/ruby-lokalise-api/rest/contributors.rb +2 -0
  59. data/lib/ruby-lokalise-api/rest/custom_translation_statuses.rb +2 -0
  60. data/lib/ruby-lokalise-api/rest/files.rb +2 -0
  61. data/lib/ruby-lokalise-api/rest/keys.rb +2 -0
  62. data/lib/ruby-lokalise-api/rest/languages.rb +2 -0
  63. data/lib/ruby-lokalise-api/rest/orders.rb +2 -0
  64. data/lib/ruby-lokalise-api/rest/payment_cards.rb +2 -0
  65. data/lib/ruby-lokalise-api/rest/projects.rb +2 -0
  66. data/lib/ruby-lokalise-api/rest/screenshots.rb +2 -0
  67. data/lib/ruby-lokalise-api/rest/snapshots.rb +2 -0
  68. data/lib/ruby-lokalise-api/rest/tasks.rb +2 -0
  69. data/lib/ruby-lokalise-api/rest/team_user_group.rb +2 -0
  70. data/lib/ruby-lokalise-api/rest/team_users.rb +2 -0
  71. data/lib/ruby-lokalise-api/rest/teams.rb +2 -0
  72. data/lib/ruby-lokalise-api/rest/translation_providers.rb +2 -0
  73. data/lib/ruby-lokalise-api/rest/translations.rb +2 -0
  74. data/lib/ruby-lokalise-api/rest/webhooks.rb +2 -0
  75. data/lib/ruby-lokalise-api/utils/attribute_helpers.rb +2 -0
  76. data/lib/ruby-lokalise-api/utils/endpoint_helpers.rb +2 -0
  77. data/lib/ruby-lokalise-api/utils/string_utils.rb +2 -0
  78. data/lib/ruby-lokalise-api/version.rb +3 -1
  79. data/ruby-lokalise-api.gemspec +7 -2
  80. data/spec/lib/ruby-lokalise-api/connection_spec.rb +10 -7
  81. data/spec/lib/ruby-lokalise-api/custom_json_parser_spec.rb +9 -5
  82. data/spec/lib/ruby-lokalise-api/error_spec.rb +7 -4
  83. data/spec/lib/ruby-lokalise-api/rest/branches_spec.rb +7 -5
  84. data/spec/lib/ruby-lokalise-api/rest/comments_spec.rb +7 -5
  85. data/spec/lib/ruby-lokalise-api/rest/contributors_spec.rb +6 -4
  86. data/spec/lib/ruby-lokalise-api/rest/custom_translation_statuses_spec.rb +6 -4
  87. data/spec/lib/ruby-lokalise-api/rest/files_spec.rb +4 -2
  88. data/spec/lib/ruby-lokalise-api/rest/keys_spec.rb +8 -6
  89. data/spec/lib/ruby-lokalise-api/rest/languages_spec.rb +8 -6
  90. data/spec/lib/ruby-lokalise-api/rest/orders_spec.rb +4 -2
  91. data/spec/lib/ruby-lokalise-api/rest/payment_cards_spec.rb +5 -3
  92. data/spec/lib/ruby-lokalise-api/rest/projects_spec.rb +6 -4
  93. data/spec/lib/ruby-lokalise-api/rest/screenshots_spec.rb +6 -4
  94. data/spec/lib/ruby-lokalise-api/rest/snapshots_spec.rb +6 -4
  95. data/spec/lib/ruby-lokalise-api/rest/tasks_spec.rb +6 -4
  96. data/spec/lib/ruby-lokalise-api/rest/team_user_groups_spec.rb +8 -6
  97. data/spec/lib/ruby-lokalise-api/rest/team_users_spec.rb +6 -4
  98. data/spec/lib/ruby-lokalise-api/rest/teams_spec.rb +2 -0
  99. data/spec/lib/ruby-lokalise-api/rest/translation_providers_spec.rb +4 -2
  100. data/spec/lib/ruby-lokalise-api/rest/translations_spec.rb +8 -6
  101. data/spec/lib/ruby-lokalise-api/rest/webhooks_spec.rb +4 -2
  102. data/spec/lib/ruby-lokalise-api/utils/snakecase_spec.rb +2 -0
  103. data/spec/lib/ruby-lokalise-api_spec.rb +12 -9
  104. data/spec/spec_helper.rb +8 -1
  105. data/spec/support/test_client.rb +2 -0
  106. data/spec/support/vcr.rb +2 -0
  107. metadata +49 -7
@@ -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(:webhook_id) { 'c7eb7e6e3c2fb2b26d0b64d0de083a5a71675b3d' }
4
6
  let(:new_webhook_id) { 'b345ccc6499920c490e8f4fe9487b1378dbf1dbf' }
5
7
 
6
8
  describe '#webhooks' do
7
- it 'should return all webhooks' do
9
+ it 'returns all webhooks' do
8
10
  webhooks = VCR.use_cassette('webhooks') do
9
11
  test_client.webhooks project_id
10
12
  end.collection
@@ -13,7 +15,7 @@ RSpec.describe Lokalise::Client do
13
15
  expect(webhooks.first.url).to eq('https://serios.webhook')
14
16
  end
15
17
 
16
- it 'should support pagination' do
18
+ it 'supports pagination' do
17
19
  webhooks = VCR.use_cassette('all_webhooks_pagination') do
18
20
  test_client.webhooks project_id, limit: 1, page: 2
19
21
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec.describe String do
2
4
  let(:snake_result) { 'snake_case' }
3
5
  let(:bc_result) { 'Klass' }
@@ -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
- Lokalise.reset_client!
12
- current_client = Lokalise.instance_variable_get '@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(:each) { Lokalise.reset_client! }
18
- after(:all) { Lokalise.reset_client! }
18
+ context 'with client params' do
19
+ before { described_class.reset_client! }
20
+
21
+ after { described_class.reset_client! }
19
22
 
20
- it 'should be possible to customize timeout' do
21
- custom_client = Lokalise.client(ENV['LOKALISE_API_TOKEN'], timeout: 600)
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 'should be possible to customize open timeout' do
26
- custom_client = Lokalise.client(ENV['LOKALISE_API_TOKEN'], open_timeout: 100)
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
@@ -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
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module TestClient
2
4
  def test_client(token = nil, params = {})
3
5
  Lokalise.client(token || ENV['LOKALISE_API_TOKEN'], params)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'vcr'
2
4
 
3
5
  VCR.configure do |c|
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.8.0
4
+ version: 2.9.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: 2019-11-13 00:00:00.000000000 Z
11
+ date: 2020-01-05 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.13'
33
+ version: '1.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0.13'
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: '2.3'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '2.3'
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
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0.1'
41
69
  - !ruby/object:Gem::Dependency
42
70
  name: dotenv
43
71
  requirement: !ruby/object:Gem::Requirement
@@ -114,14 +142,28 @@ dependencies:
114
142
  requirements:
115
143
  - - "~>"
116
144
  - !ruby/object:Gem::Version
117
- version: '1.0'
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.0'
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
@@ -288,7 +330,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
288
330
  - !ruby/object:Gem::Version
289
331
  version: '0'
290
332
  requirements: []
291
- rubygems_version: 3.0.6
333
+ rubygems_version: 3.1.2
292
334
  signing_key:
293
335
  specification_version: 4
294
336
  summary: Ruby interface to the Lokalise API