pixab 2.4.0 → 2.5.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: 857301e3eb6ed6a88bd64b764698de017088e1d7cabb7eb5ddefbd9161fcb904
4
- data.tar.gz: e2e740a5b16c665a23c9b909bdf30c910356c69f59141b3ac0296d8c07c1271b
3
+ metadata.gz: 65ac3034471869b3d54c91cb78037e992a5afa7e14c04a778d19de6a8550da2a
4
+ data.tar.gz: cae519a48fd8ad1abd49f4787895c6d9b37cdf9d06fb22516e3b6f7c30a1e247
5
5
  SHA512:
6
- metadata.gz: a8441858d9f113240a710bde966e5332c9d3e50850e9c4f07302548a70503181f175cba76b326d9048b5ed20a29b3f3a2e664d81606b0e929e2d0d1f036a7ef3
7
- data.tar.gz: c6ed08f5fffe019e9c159c0e1f5573541f6e5559d66349d87e268655f1115b2620a126c81f7093c7a3389a4a8755662bdf3b0bd76a615127c4b54ccdee9df3be
6
+ metadata.gz: 22e700b31c5ba8f69ff5c353dc8758629d9e4e0a38c149899a07aad127f5f9e8a3b5941491b0715687cbce4fc06b515acaf40383f5bc1b927a543ebbba4352d3
7
+ data.tar.gz: a8931cca6d82419583204f6ebf7aae5415e2cd2d4f61f926be3c515258c11d2d34d076f01a16c043389409dc60d338ec76c70d22f6196e833f4a59fcc0cbcc22
data/Gemfile.lock ADDED
@@ -0,0 +1,47 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ pixab (2.4.0)
5
+ colored2
6
+ nokogiri
7
+ rest-client
8
+ ruby-progressbar
9
+ rubyzip
10
+ yaml
11
+
12
+ GEM
13
+ remote: https://rubygems.org/
14
+ specs:
15
+ colored2 (3.1.2)
16
+ domain_name (0.6.20240107)
17
+ http-accept (1.7.0)
18
+ http-cookie (1.0.8)
19
+ domain_name (~> 0.5)
20
+ logger (1.6.6)
21
+ mime-types (3.6.0)
22
+ logger
23
+ mime-types-data (~> 3.2015)
24
+ mime-types-data (3.2025.0304)
25
+ netrc (0.11.0)
26
+ nokogiri (1.15.7-x86_64-darwin)
27
+ racc (~> 1.4)
28
+ racc (1.8.1)
29
+ rake (13.2.1)
30
+ rest-client (2.1.0)
31
+ http-accept (>= 1.7.0, < 2.0)
32
+ http-cookie (>= 1.0.2, < 2.0)
33
+ mime-types (>= 1.16, < 4.0)
34
+ netrc (~> 0.8)
35
+ ruby-progressbar (1.13.0)
36
+ rubyzip (2.4.1)
37
+ yaml (0.4.0)
38
+
39
+ PLATFORMS
40
+ x86_64-darwin-19
41
+
42
+ DEPENDENCIES
43
+ pixab!
44
+ rake (~> 13.0)
45
+
46
+ BUNDLED WITH
47
+ 2.3.22
data/exe/pixab CHANGED
@@ -3,10 +3,10 @@
3
3
  # encoding: UTF-8
4
4
 
5
5
  require_relative "../lib/pixab/version"
6
- require_relative '../lib/MergeRequest.rb'
7
- require_relative '../lib/ComponentSynchronizer.rb'
8
- require_relative '../lib/Localization.rb'
9
- require_relative '../lib/Package.rb'
6
+ require_relative '../lib/projects/MergeRequest.rb'
7
+ require_relative '../lib/projects/ComponentSynchronizer.rb'
8
+ require_relative '../lib/projects/Package.rb'
9
+ require_relative '../lib/localization/phrase/Localization.rb'
10
10
  require_relative '../lib/localization/smartcat/LocalizationSmartcat.rb'
11
11
  require_relative '../lib/localization/smartcat/LocalizationSmartcatImport.rb'
12
12
  require_relative '../lib/localization/smartcat/LocalizationSmartcatMerge.rb'
@@ -1,5 +1,5 @@
1
- require_relative '../GitUtils.rb'
2
- require_relative '../Platform.rb'
1
+ require_relative '../git/GitUtils.rb'
2
+ require_relative './Platform.rb'
3
3
 
4
4
  module Pixab
5
5
 
@@ -36,14 +36,14 @@ module Pixab
36
36
  end
37
37
 
38
38
  def display_default_dialog(default_text)
39
- input_msg = `osascript -e 'display dialog "#{default_text}"'`.chomp
39
+ input_msg = `osascript -e 'display dialog "#{default_text}"' 2>/dev/null`.chomp
40
40
  reg = /button returned:(.+)/
41
41
  input_msg.match(reg)
42
42
  !$1.nil?
43
43
  end
44
44
 
45
45
  def display_dialog(default_text, default_answer = "")
46
- input_msg = `osascript -e 'display dialog "#{default_text}" default answer "#{default_answer}"'`.chomp
46
+ input_msg = `osascript -e 'display dialog "#{default_text}" default answer "#{default_answer}"' 2>/dev/null`.chomp
47
47
  reg = /text returned:(.+)/
48
48
  input_msg.match(reg)
49
49
  $1.nil? ? "" : $1
@@ -1,5 +1,5 @@
1
1
  require 'colored2'
2
- require_relative '../GitUtils.rb'
2
+ require_relative '../git/GitUtils.rb'
3
3
  require_relative '../gitlab/GitRepoInfo.rb'
4
4
 
5
5
  module Pixab
@@ -1,5 +1,5 @@
1
1
  require 'colored2'
2
- require_relative '../GitUtils.rb'
2
+ require_relative '../git/GitUtils.rb'
3
3
 
4
4
  module Pixab
5
5
 
@@ -2,7 +2,7 @@
2
2
  # encoding: UTF-8
3
3
 
4
4
  require 'open3'
5
- require_relative './Utilities.rb'
5
+ require_relative '../Utilities/Utilities.rb'
6
6
 
7
7
  module Pixab
8
8
 
@@ -1,5 +1,5 @@
1
1
  require 'colored2'
2
- require_relative '../GitUtils.rb'
2
+ require_relative '../git/GitUtils.rb'
3
3
 
4
4
  module Pixab
5
5
 
@@ -1,7 +1,7 @@
1
1
  require 'colored2'
2
- require_relative '../Platform.rb'
2
+ require_relative '../Utilities/Platform.rb'
3
3
  require_relative './GitlabInfo.rb'
4
- require_relative '../Utilities.rb'
4
+ require_relative '../Utilities/Utilities.rb'
5
5
  require_relative './GitlabMR.rb'
6
6
  require_relative '../Utilities/UserInfo.rb'
7
7
 
@@ -2,7 +2,7 @@
2
2
  # encoding: UTF-8
3
3
 
4
4
  require "fileutils"
5
- require_relative './Utilities.rb'
5
+ require_relative '../../Utilities/Utilities.rb'
6
6
 
7
7
  module Pixab
8
8
 
data/lib/mbox/MboxAdd.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'open3'
2
2
  require_relative './AirBrushProjectInfo.rb'
3
- require_relative '../Utilities.rb'
4
- require_relative '../RepoManager.rb'
3
+ require_relative '../Utilities/Utilities.rb'
4
+ require_relative '../projects/RepoManager.rb'
5
5
 
6
6
  module Pixab
7
7
 
data/lib/pixab/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pixab
4
- VERSION = "2.4.0"
4
+ VERSION = "2.5.0"
5
5
  end
@@ -4,7 +4,8 @@
4
4
  require "fileutils"
5
5
  require 'colored2'
6
6
  require 'open3'
7
- require_relative './GitUtils.rb'
7
+ require 'ruby-progressbar'
8
+ require_relative '../git/GitUtils.rb'
8
9
  require_relative './RepoManager.rb'
9
10
 
10
11
  module Pixab
@@ -18,7 +19,7 @@ module Pixab
18
19
  @repo_manager = repo_manager
19
20
  @is_need_build = false
20
21
  @is_need_remote_repo = false
21
- @is_need_pod_install = true
22
+ @is_need_pod_install = false
22
23
  @is_use__target_branch = true
23
24
 
24
25
  if commands.nil?
@@ -33,6 +34,8 @@ module Pixab
33
34
  @is_need_remote_repo = true
34
35
  when "--no-pod-install"
35
36
  @is_need_pod_install = false
37
+ when "--pod-install"
38
+ @is_need_pod_install = true
36
39
  when "--current-branch"
37
40
  @is_use__target_branch = false
38
41
  else
@@ -46,23 +49,28 @@ module Pixab
46
49
 
47
50
  active_repo_names = nil
48
51
  if is_need_remote_repo
49
- puts "\n》》》》》正在将本地调试仓替换为远程仓 》》》》》》》》》》\n".green
52
+ puts "\n⤴️ 正在将本地调试仓替换为远程仓\n".green
50
53
  active_repo_names = replace_local_to_remote
51
54
  end
52
55
 
53
- puts "\n》》》》》正在合并主工程代码 》》》》》》》》》》》》》》》\n".green
56
+ puts "\n🔀 正在合并主工程代码".green
54
57
  merge_and_check
55
58
 
56
- puts "\n》》》》》正在读取最新提交,并更新pod 》》》》》》》》》》\n".green
59
+ puts "\n📥 正在读取最新提交".green
57
60
  replace_podfile
58
61
 
62
+ if is_need_pod_install
63
+ puts "\n📦 正在执行pod install\n".green
64
+ pod_install
65
+ end
66
+
59
67
  if is_need_remote_repo
60
- puts "\n》》》》》正在将远程仓复原为本地调试仓 》》》》》》》》》》\n".green
68
+ puts "\n⤵️ 正在将远程仓复原为本地调试仓\n".green
61
69
  reset_remote_to_local(active_repo_names)
62
70
  end
63
71
 
64
72
  if is_need_build
65
- puts "\n》》》》》正在进行Xcode编译 》》》》》》》》》》》》》》》\n".green
73
+ puts "\n🛠️ 正在进行Xcode编译\n".green
66
74
  FileUtils.cd("#{repo_manager.root_path}/#{main_repo_name}")
67
75
  build
68
76
  end
@@ -122,6 +130,12 @@ module Pixab
122
130
 
123
131
  # 替换主工程Podfile
124
132
  def replace_podfile
133
+ progressbar = ProgressBar.create(
134
+ total: repos.length,
135
+ format: '%t |%B| %p%%',
136
+ length: 50
137
+ )
138
+
125
139
  # 获取每个子库最新的commit id
126
140
  repo_commite_id = {}
127
141
  repos.each do |repo|
@@ -129,15 +143,23 @@ module Pixab
129
143
 
130
144
  FileUtils.cd("#{repo_manager.root_path}/#{repo_name}")
131
145
  repo_target_branch = @is_use__target_branch ? repo_target_branch = repo["target_branch"] : GitUtils.current_branch
132
- next unless GitUtils.check_remote_branch_exists_fast("origin/#{repo_target_branch}")
146
+ unless GitUtils.check_remote_branch_exists_fast("origin/#{repo_target_branch}")
147
+ progressbar.increment
148
+ next
149
+ end
133
150
 
134
- stdout, status = Open3.capture2("git fetch origin #{repo_target_branch}")
135
- next unless status.success?
151
+ stdout, status = Open3.capture2("git fetch origin #{repo_target_branch} --quiet")
152
+ unless status.success?
153
+ progressbar.increment
154
+ break
155
+ end
136
156
 
137
157
  commit_id = `git log origin/#{repo_target_branch} -n 1 --pretty=format:"%H"`
138
158
  if !commit_id.nil?
139
159
  repo_commite_id[repo_name] = commit_id
140
160
  end
161
+
162
+ progressbar.increment
141
163
  end
142
164
 
143
165
  podfile_path = "#{repo_manager.root_path}/#{main_repo_name}/AirBrushPodfiles/pix_ab_component.rb"
@@ -158,13 +180,14 @@ module Pixab
158
180
  end
159
181
  end
160
182
 
161
- if is_need_pod_install
162
- system "mbox pod install --repo-update"
163
- Utilities.check_shell_result("Error: execute `mbox pod install --repo-update` failed")
164
- end
165
-
166
183
  @updated_repo_names = updated_repo_names
167
184
  end
185
+
186
+ # 执行 pod install
187
+ def pod_install
188
+ system "mbox pod install --repo-update"
189
+ Utilities.check_shell_result("Error: execute `mbox pod install --repo-update` failed")
190
+ end
168
191
 
169
192
  # 编译
170
193
  def build
@@ -3,9 +3,9 @@
3
3
 
4
4
  require "fileutils"
5
5
  require 'colored2'
6
- require_relative './Utilities.rb'
6
+ require_relative '../Utilities/Utilities.rb'
7
7
  require_relative './RepoManager.rb'
8
- require_relative './GitUtils.rb'
8
+ require_relative '../git/GitUtils.rb'
9
9
 
10
10
  module Pixab
11
11
 
@@ -2,7 +2,7 @@
2
2
  # encoding: UTF-8
3
3
 
4
4
  require "fileutils"
5
- require_relative './GitUtils.rb'
5
+ require_relative '../git/GitUtils.rb'
6
6
  require_relative './RepoManager.rb'
7
7
 
8
8
  module Pixab
data/pixab.gemspec CHANGED
@@ -38,6 +38,7 @@ Gem::Specification.new do |spec|
38
38
  spec.add_dependency 'nokogiri'
39
39
  spec.add_dependency 'rest-client'
40
40
  spec.add_dependency 'yaml'
41
+ spec.add_dependency 'ruby-progressbar'
41
42
 
42
43
  # For more information and examples about making a new gem, check out our
43
44
  # guide at: https://bundler.io/guides/creating_gem.html
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pixab
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - 廖再润
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-03-03 00:00:00.000000000 Z
11
+ date: 2025-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colored2
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: ruby-progressbar
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
83
97
  description: Write a longer description or delete this line.
84
98
  email:
85
99
  - lzr3@us.meitu.com
@@ -91,29 +105,26 @@ files:
91
105
  - CHANGELOG.md
92
106
  - CODE_OF_CONDUCT.md
93
107
  - Gemfile
108
+ - Gemfile.lock
94
109
  - LICENSE.txt
95
110
  - README.md
96
111
  - Rakefile
97
112
  - exe/pixab
98
- - lib/ComponentSynchronizer.rb
99
- - lib/GitUtils.rb
100
- - lib/Localization.rb
101
- - lib/LocalizationPlatform.rb
102
- - lib/MergeRequest.rb
103
- - lib/Package.rb
104
- - lib/Platform.rb
105
- - lib/RepoManager.rb
106
- - lib/Utilities.rb
107
113
  - lib/Utilities/FileMode.rb
114
+ - lib/Utilities/Platform.rb
108
115
  - lib/Utilities/UserInfo.rb
116
+ - lib/Utilities/Utilities.rb
109
117
  - lib/feature/Feature.rb
110
118
  - lib/feature/FeatureCopy.rb
111
119
  - lib/feature/FeatureStart.rb
112
120
  - lib/git/Git.rb
121
+ - lib/git/GitUtils.rb
113
122
  - lib/gitlab/GitRepoInfo.rb
114
123
  - lib/gitlab/GitlabInfo.rb
115
124
  - lib/gitlab/GitlabMR.rb
116
125
  - lib/gitlab/GitlabMRManager.rb
126
+ - lib/localization/phrase/Localization.rb
127
+ - lib/localization/phrase/LocalizationPlatform.rb
117
128
  - lib/localization/smartcat/LocalizationSmartcat.rb
118
129
  - lib/localization/smartcat/LocalizationSmartcatImport.rb
119
130
  - lib/localization/smartcat/LocalizationSmartcatInfo.rb
@@ -126,6 +137,10 @@ files:
126
137
  - lib/mbox/MboxRemove.rb
127
138
  - lib/pixab.rb
128
139
  - lib/pixab/version.rb
140
+ - lib/projects/ComponentSynchronizer.rb
141
+ - lib/projects/MergeRequest.rb
142
+ - lib/projects/Package.rb
143
+ - lib/projects/RepoManager.rb
129
144
  - pixab.gemspec
130
145
  - sig/pixab.rbs
131
146
  homepage: https://github.com/LZRun
File without changes
File without changes