pixab 1.8.0 → 1.8.1
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 +4 -4
- data/lib/LocalizationSmartcatImport.rb +12 -2
- data/lib/LocalizationSmartcatInfo.rb +2 -0
- data/lib/LocalizationSmartcatMerge.rb +1 -1
- data/lib/pixab/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f7a1aa87941f9dd40ce7081271a52f5766433522e97d2fef66bbd65a5fdf0c6
|
4
|
+
data.tar.gz: b81b6f80cbce8298e1c94186a5a527dba99873f950084b79784e1aac765a88ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e75b6835902ada48dbeaec2e064ba509726d144cf7004d18841d6f268c08f6ad4e80194813f7bf7401b650fe10d1406347234877604a85791ae6b4c7cfaec556
|
7
|
+
data.tar.gz: f3e495b4c839a8d87e3d6210a26172368d1eb5dc951083364a97cd2e970e5e55eeb8c72a3dad832493edaabf4603b94abae3f380012b7e658517979867683ef3
|
@@ -6,7 +6,11 @@ module Pixab
|
|
6
6
|
|
7
7
|
class LocalizationSmartcatImport
|
8
8
|
|
9
|
-
attr_accessor :project, :collection, :format, :tags, :completion_state, :conflicting_values
|
9
|
+
attr_accessor :project, :collection, :format, :tags, :completion_state, :conflicting_values, :delete_file_after_import
|
10
|
+
|
11
|
+
def initialize()
|
12
|
+
@delete_file_after_import = false
|
13
|
+
end
|
10
14
|
|
11
15
|
def run(commands = nil)
|
12
16
|
commands.each_index do |index|
|
@@ -40,6 +44,10 @@ module Pixab
|
|
40
44
|
@completion_state = commands[index + 1]
|
41
45
|
when '--conflicting-values'
|
42
46
|
@conflicting_values = commands[index + 1]
|
47
|
+
when '--delete-file-after-import'
|
48
|
+
@delete_file_after_import = true
|
49
|
+
when '--keep-file-after-import'
|
50
|
+
@delete_file_after_import = false
|
43
51
|
end
|
44
52
|
end
|
45
53
|
|
@@ -70,7 +78,9 @@ module Pixab
|
|
70
78
|
import_params = generate_import_params_from_file_name(entry)
|
71
79
|
import_id = import_localization(import_url, import_params, file_path)
|
72
80
|
puts "#{entry} 正在上传中,上传ID:#{import_id}"
|
73
|
-
|
81
|
+
if @delete_file_after_import
|
82
|
+
File.delete(file_path) if File.exist?(file_path)
|
83
|
+
end
|
74
84
|
end
|
75
85
|
|
76
86
|
puts "\n》》》》》本地化文案上传已完成 》》》》》》》》》》\n".green
|
data/lib/pixab/version.rb
CHANGED