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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ea5e126059d8afc2bf728cbad73ebdc6daef4302d8d1eb175d25799191949f75
4
- data.tar.gz: fe311f10dbde070db2f146060bcd79c531a49c0f08d5429be5e0e36696e9d823
3
+ metadata.gz: 5f7a1aa87941f9dd40ce7081271a52f5766433522e97d2fef66bbd65a5fdf0c6
4
+ data.tar.gz: b81b6f80cbce8298e1c94186a5a527dba99873f950084b79784e1aac765a88ae
5
5
  SHA512:
6
- metadata.gz: dc0aa68915ddc765958ec7931afe991779b4ec29559af33701b64dcd737bd7df019aee59717a16f1fcf4ef4e6f14b6f13f631bd7a93fe4a254ff9ad4d8bb5765
7
- data.tar.gz: 87b5b227fffc9666c624c92f18ff9866a5b00cef3d3e0d7d549bc6a0ce032bf139186a388368a500788b30e24b2dbf95cf3e21ae35604b2150fa854fad109c10
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
- File.delete(file_path) if File.exist?(file_path)
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
@@ -12,6 +12,8 @@ module Pixab
12
12
 
13
13
  Project_AirBrushVideo = '16cbeffd-bb6e-46e8-a32e-9c79d23a796f'
14
14
 
15
+ Project_AirBrush_test = '0dafd468-f131-4c33-91f8-66d13e1eb6f4'
16
+
15
17
  end
16
18
 
17
19
  end
@@ -8,7 +8,7 @@ module Pixab
8
8
 
9
9
  def run(commands=nil)
10
10
  download_params = []
11
- import_params = []
11
+ import_params = ["--delete-file-after-import"]
12
12
  commands.each_index do |index|
13
13
  command = commands[index]
14
14
 
data/lib/pixab/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pixab
4
- VERSION = "1.8.0"
4
+ VERSION = "1.8.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pixab
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.0
4
+ version: 1.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - 廖再润