fastlane-plugin-csv_translation 1.0.1 → 1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e4d048982fd2ec8146f7365d2374e0b3aac8e50c0b2ac515fe132a005c720527
4
- data.tar.gz: d1778628a29f95e418d515a9ebb92e4179c7dcf9d95e98b24ecb3d168d26ff35
3
+ metadata.gz: 429b0130e18889c08894e5db31651595c12cceefe2422186e09e454474b6935f
4
+ data.tar.gz: d7ba4a687ab5f2ec3988e910746b340ca938a0982387504ec91350819c269414
5
5
  SHA512:
6
- metadata.gz: 824bbaf8367d2307a8c65a9c05990919ae160cc265cff26148987b5aa1b77323e6592f076fcb60d2b918b2fee8ead2bb4a53fe15579842220e3b8984ef418c0d
7
- data.tar.gz: 345a9c164cc8b1ec7041907a4f7d7e6710287165e4e3ce1ad61bc9c1b262b89f5d5e8aa6f6f2056175634dd8b77308af27a3b2a5c0277ab631593781f0d1b19f
6
+ metadata.gz: 66a16815bcbf0954501a4afc14532950326d5b550e38b0a2f1ce563abc2b0ad5820fb47441733ab271ef61e14ac55adef9a71ed3871d6ab70e3f46c85460b4f2
7
+ data.tar.gz: abf48d7ae57f9fe2d3276a4e64724e20d6a9d3560193bafabf3af589f3f74834a673156b7540d3b2af52c654aa18f89858130ecfe33234dd9f55741a220ec1f8
@@ -17,12 +17,15 @@ module Fastlane
17
17
 
18
18
  csv_file_path = "#{csv_file_folder}/#{params[:file_path]}"
19
19
  csv_row_identifier = params[:identifier]
20
+ csv_row_identifier_header = params[:identifier_header]
20
21
 
21
22
  require 'csv'
22
23
 
23
24
  # picking translation request-identifier entry from the feature_branch csv file
24
- feature_branch_translation_requests = CSV.table(csv_file_path, headers: true)
25
- feature_branch_translation_requests = feature_branch_translation_requests.select { |row| row.map { |value| value.to_s }.join("").include?(csv_row_identifier) }
25
+ feature_branch_translation_requests = CSV.foreach(csv_file_path, headers: true).map { |row| row.to_h }
26
+ feature_branch_translation_requests = feature_branch_translation_requests.select do |translation_request|
27
+ translation_request[csv_row_identifier_header].eql?(csv_row_identifier)
28
+ end
26
29
 
27
30
  # rebasing CSV file
28
31
  git_commit_info = {}
@@ -66,7 +69,6 @@ module Fastlane
66
69
 
67
70
  # Step5: Append back feature branch translation_requests
68
71
  all_translation_requests = CSV.table(csv_file_path, headers: true)
69
- all_translation_requests.delete_if { |row| row.map { |value| value.to_s }.join("").include?(csv_row_identifier) }
70
72
 
71
73
  headers = CSV.open(csv_file_path, &:readline)
72
74
  CSV.open(csv_file_path, "w", write_headers: true, headers: headers, force_quotes: true) do |csv|
@@ -113,6 +115,12 @@ module Fastlane
113
115
  env_name: "FL_REBASE_CSV_TRANSLATION_REQUEST_FILE_PATH",
114
116
  description: "The file path to your csv file",
115
117
  is_string: true),
118
+ FastlaneCore::ConfigItem.new(key: :identifier_header,
119
+ env_name: "FL_REBASE_CSV_TRANSLATION_REQUEST_IDENTIFIER_HEADER",
120
+ description: "An identifier header(column name) of the CSV file",
121
+ is_string: true,
122
+ optional: true,
123
+ default_value: "Ticket"),
116
124
  FastlaneCore::ConfigItem.new(key: :identifier,
117
125
  env_name: "FL_REBASE_CSV_TRANSLATION_REQUEST_IDENTIFIER",
118
126
  description: "An identifier value of the CSV file row",
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module CsvTranslation
3
- VERSION = "1.0.1"
3
+ VERSION = "1.1.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-csv_translation
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manish Rathi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-15 00:00:00.000000000 Z
11
+ date: 2020-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry