hiptest-publisher-fork 3.4.8 → 3.4.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,9 +18,6 @@ require 'hiptest-publisher/string'
18
18
  require 'hiptest-publisher/utils'
19
19
  require 'hiptest-publisher/version_checker'
20
20
  require 'hiptest-publisher/xml_parser'
21
- require 'i18n'
22
-
23
-
24
21
 
25
22
  module Hiptest
26
23
  class Publisher
@@ -94,12 +91,12 @@ module Hiptest
94
91
  raise
95
92
  end
96
93
  rescue => err
97
- reporter.show_failure("errors.default")
94
+ reporter.show_failure(I18n.t("errors.default"))
98
95
  reporter.dump_error(err)
99
96
  end
100
97
 
101
98
  def get_project(xml)
102
- reporter.with_status_message 'build_data.title' do
99
+ reporter.with_status_message I18n.t('build_data.title') do
103
100
  parser = Hiptest::XMLParser.new(xml, reporter)
104
101
  return parser.build_project
105
102
  end
@@ -117,10 +114,10 @@ module Hiptest
117
114
  return true if @cli_options.force_overwrite
118
115
 
119
116
  if $stdout.tty?
120
- answer = reporter.ask("Do you want to overwrite the file at #{path}? (y/yes)")
117
+ answer = reporter.ask(I18n.t('overwrite.ask_confirmation', path: path))
121
118
  return ['y', 'yes'].include?(answer)
122
119
  else
123
- reporter.warning_message("File at #{path} already exists!")
120
+ reporter.warning_message(I18n.t('overwrite.warning_message', path: path))
124
121
  return false
125
122
  end
126
123
  end
@@ -145,7 +142,7 @@ module Hiptest
145
142
  node_rendering_context.path,
146
143
  node_rendering_context.node,
147
144
  node_rendering_context,
148
- "node_rendering_context.description",
145
+ I18n.t(:exporting_file, name: node_rendering_context.description),
149
146
  ask_overwrite: ask_overwrite
150
147
  )
151
148
  end
@@ -157,14 +154,14 @@ module Hiptest
157
154
 
158
155
  write_to_file(
159
156
  "#{@cli_options.output_directory}/actionwords_signature.yaml",
160
- 'actionwords_diff.exporting_title',
157
+ I18n.t('actionwords_diff.exporting_title'),
161
158
  ask_overwrite: true
162
159
  ) { Hiptest::SignatureExporter.export_actionwords(@project).to_yaml }
163
160
  end
164
161
 
165
162
  def compute_actionwords_diff
166
163
  old = nil
167
- reporter.with_status_message('Loading previous definition...') do
164
+ reporter.with_status_message I18n.t('actionwords_diff.loading_previous_definition') do
168
165
  old = YAML.load_file("#{@cli_options.output_directory}/actionwords_signature.yaml")
169
166
  end
170
167
 
@@ -182,7 +179,7 @@ module Hiptest
182
179
 
183
180
  def analyze_project_data
184
181
  return if @project_data_analyzed
185
- reporter.with_status_message("#{:analyzing_data}") do
182
+ reporter.with_status_message I18n.t(:analyzing_data) do
186
183
  @language_config = LanguageConfigParser.new(@cli_options)
187
184
  Hiptest::NodeModifiers.add_all(@project, @cli_options.sort)
188
185
  end
@@ -200,16 +197,16 @@ module Hiptest
200
197
  def print_categories
201
198
  language_config = LanguageConfigParser.new(@cli_options)
202
199
  group_names = language_config.group_names
203
- puts 'help.categories.title'
200
+ puts I18n.t('help.categories.title', language: @cli_options.language)
204
201
  group_names.each do |group_name|
205
202
  puts " - #{group_name}"
206
203
  end
207
- puts 'help.categories.usage_example'
204
+ puts I18n.t('help.categories.usage_example', language: @cli_options.language, first: group_names.first, second: group_names[1])
208
205
  end
209
206
 
210
207
  def post_results
211
208
  response = nil
212
- reporter.with_status_message('push.posting_results') do
209
+ reporter.with_status_message I18n.t('push.posting_results', file: @cli_options.push, site: @cli_options.site) do
213
210
  response = @client.push_results
214
211
  end
215
212
  if valid_hiptest_api_response?(response)
@@ -231,23 +228,23 @@ module Hiptest
231
228
  reported_tests = json.has_key?('test_import') ? json['test_import'] : []
232
229
  passed_count = reported_tests.size
233
230
 
234
- reporter.with_status_message("Tests imported summary: #{passed_count} tests imported.") do
235
- if @cli_options.verbose
236
- reported_tests.each do |imported_test|
237
- puts "Test imported: #{imported_test['name']}"
231
+ reporter.with_status_message I18n.t('push.tests_imported_summary', count: passed_count) do
232
+ if @cli_options.verbose
233
+ reported_tests.each do |imported_test|
234
+ puts I18n.t('push.test_imported', name: imported_test['name'])
235
+ end
238
236
  end
239
237
  end
240
- end
241
238
 
242
239
  display_empty_push_help if passed_count == 0
243
240
  end
244
241
 
245
242
  def report_hiptest_api_error(response)
246
- reporter.failure_message("'errors.api_error' with code: #{response.code}")
243
+ reporter.failure_message(I18n.t('errors.api_error', code: response.code))
247
244
  if response.code == "422" && response.body.start_with?("Unknown format")
248
245
  STDERR.print response.body.chomp + "\n"
249
246
  elsif response.code == "404"
250
- STDERR.print 'errors.project_not_found'
247
+ STDERR.print I18n.t('errors.project_not_found')
251
248
  end
252
249
  end
253
250
 
@@ -255,10 +252,10 @@ module Hiptest
255
252
  command = @cli_options.command_line_used(exclude: [:push, :push_format, :execution_environment])
256
253
  enhanced_command = "#{command} --without=actionwords"
257
254
  if @cli_options.test_run_id.nil? || @cli_options.test_run_id.empty?
258
- enhanced_command += " --test-run-id=<#{'push.test_run_id'}>"
255
+ enhanced_command += " --test-run-id=<#{I18n.t('push.test_run_id')}>"
259
256
  end
260
257
 
261
- puts 'push.empty_results'
258
+ puts I18n.t('push.empty_results', enhanced_command: enhanced_command)
262
259
  end
263
260
  end
264
261
  end
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hiptest-publisher-fork
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.8
4
+ version: 3.4.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - CucumberStudio R&D
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2022-05-18 00:00:00.000000000 Z
@@ -54,22 +54,22 @@ dependencies:
54
54
  name: i18n
55
55
  requirement: !ruby/object:Gem::Requirement
56
56
  requirements:
57
- - - "~>"
58
- - !ruby/object:Gem::Version
59
- version: '0.7'
60
57
  - - ">="
61
58
  - !ruby/object:Gem::Version
62
59
  version: 0.7.0
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: '0.7'
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - "~>"
68
- - !ruby/object:Gem::Version
69
- version: '0.7'
70
67
  - - ">="
71
68
  - !ruby/object:Gem::Version
72
69
  version: 0.7.0
70
+ - - "~>"
71
+ - !ruby/object:Gem::Version
72
+ version: '0.7'
73
73
  - !ruby/object:Gem::Dependency
74
74
  name: nokogiri
75
75
  requirement: !ruby/object:Gem::Requirement
@@ -761,7 +761,7 @@ homepage: https://cucumber.io
761
761
  licenses:
762
762
  - MIT
763
763
  metadata: {}
764
- post_install_message:
764
+ post_install_message:
765
765
  rdoc_options: []
766
766
  require_paths:
767
767
  - lib
@@ -776,8 +776,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
776
776
  - !ruby/object:Gem::Version
777
777
  version: '0'
778
778
  requirements: []
779
- rubygems_version: 3.3.3
780
- signing_key:
779
+ rubygems_version: 3.0.3.1
780
+ signing_key:
781
781
  specification_version: 4
782
782
  summary: Export your tests from CucumberStudio into executable tests.
783
783
  test_files: []