cocoapods-dev-env 2.1.9 → 2.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c1282e851ae9b54c7bd13e7e05fe72de11a5a56662e1ecdc3af66745eb752e1d
4
- data.tar.gz: 30f1d0e013d4d56f9f4ff6ea165f6e60d0b8e2a5385a8df85695872e7935507b
3
+ metadata.gz: 4a038dfb3ff16131336b6a19559894287912a3f6ced0744c49a86c652cd1ddaa
4
+ data.tar.gz: ad4a7ed1a167fe98f917d8fd0c88043e5044feac82b43f20caa876f35a6bb11e
5
5
  SHA512:
6
- metadata.gz: 8f7628345e1abff5bddcd84d006a11e98e13d2b3cf8b03ab6c15f3e90760ea4087ecc12952544c89960ded37ddf76108133516b0f8097b4259325f0712a8889f
7
- data.tar.gz: 7036a12b59e37c374a8377836a5968bf56424ad16b1e9f7d2adb4526b589ebd45c86da355fd8febdceac61f3459eb368425b22429d48c53917f94c412147cb9e
6
+ metadata.gz: 9aca16d5799bd66c625a996fff9bdb1d77ea5b54509403fadf000c9f4cea43d7fbc6cb2f593d3aa81a41465f5edd0cfe647c3d86da2105bdac5960238abc5f7d
7
+ data.tar.gz: 3eb99069ed6078dc8b66c912d3270abaa30a59ba704e384d7603882bde181d1a8022697e7e9fff7366f4d735744a988af65d290c3a733cb97b6572b26cff1668
@@ -1,7 +1,7 @@
1
1
  module Cocoapods
2
2
  module Dev
3
3
  module Env
4
- VERSION = '2.1.9'
4
+ VERSION = '2.2.1'
5
5
  end
6
6
  end
7
7
  end
data/lib/dev_env_entry.rb CHANGED
@@ -101,14 +101,11 @@ module Pod
101
101
  if tag != nil
102
102
  options[:tag] = tag
103
103
  end
104
- defaultLocalPath = $parrentPath + defaultLocalPath
105
- else
106
- UI.puts 'XXXXXXXXXXXXXXXX123' + parentPodInfo.requirement.to_s()
104
+ elsif (parentPodInfo.podspec_repo.start_with?("http") || parentPodInfo.podspec_repo.start_with?("git"))
105
+ #UI.puts 'XXXXXXXXXXXXXXXX123' + parentPodInfo.inspect
107
106
  requirements.insert(0, parentPodInfo.requirement.to_s)
108
107
  options[:source] = parentPodInfo.podspec_repo
109
108
  end
110
-
111
- # dependency.setRequirement(parentPodInfo.requirement
112
109
  end
113
110
  return
114
111
  elsif options[:git] == nil
data/lib/dev_env_utils.rb CHANGED
@@ -1,169 +1,157 @@
1
1
  require 'cocoapods'
2
2
 
3
3
  class DevEnvUtils
4
-
5
- def self.searchAndOpenLocalExample(path)
6
- _currentDir = Dir.pwd
7
- Dir.chdir(path)
8
- Dir.chdir("Example")
9
- `pod install`
10
- projPaths = Dir::glob("*.xcworkspace")
11
- if projPaths.count > 0
12
- `open -a Terminal ./`
13
- `open #{projPaths[0]}`
14
- end
15
- Dir.chdir(_currentDir)
4
+ def self.searchAndOpenLocalExample(path)
5
+ _currentDir = Dir.pwd
6
+ Dir.chdir(path)
7
+ Dir.chdir('Example')
8
+ `pod install`
9
+ projPaths = Dir.glob('*.xcworkspace')
10
+ if projPaths.count > 0
11
+ `open -a Terminal ./`
12
+ `open #{projPaths[0]}`
16
13
  end
17
-
18
- def self.checkAndRemoveSubmodule(path)
19
- _currentDir = Dir.pwd
20
- Dir.chdir(path)
21
- output = `git status -s`
22
- puts output
23
- if output.length == 0
24
- output = `git status`
25
- if output.include?("push")
26
- raise "submodule #{path} 移除失败,有推送的修改"
27
- end
28
- else
29
- raise "submodule #{path} 移除失败,有未提交的修改"
30
- end
31
- Dir.chdir(_currentDir)
32
- `
14
+ Dir.chdir(_currentDir)
15
+ end
16
+
17
+ def self.checkAndRemoveSubmodule(path)
18
+ _currentDir = Dir.pwd
19
+ Dir.chdir(path)
20
+ output = `git status -s`
21
+ puts output
22
+ if output.length == 0
23
+ output = `git status`
24
+ raise "submodule #{path} 移除失败,有推送的修改" if output.include?('push')
25
+ else
26
+ raise "submodule #{path} 移除失败,有未提交的修改"
27
+ end
28
+ Dir.chdir(_currentDir)
29
+ `
33
30
  git submodule deinit #{path}
34
31
  rm -rf #{path}
35
32
  git rm #{path}
36
33
  `
34
+ end
35
+
36
+ def self.checkTagIsEqualToHead(tag, path)
37
+ _currentDir = Dir.pwd
38
+ Dir.chdir(path)
39
+ result = `git describe --abbrev=4 HEAD`
40
+ Dir.chdir(_currentDir)
41
+ if result.include?(tag)
42
+ true
43
+ else
44
+ checkTagOrBranchIsEqalToHead(tag, path)
37
45
  end
38
-
39
- def self.checkTagIsEqualToHead(tag, path)
40
- _currentDir = Dir.pwd
41
- Dir.chdir(path)
42
- result = `git describe --abbrev=4 HEAD`
43
- Dir.chdir(_currentDir)
44
- if result.include?(tag)
45
- return true
46
- else
47
- return checkTagOrBranchIsEqalToHead(tag, path)
48
- end
46
+ end
47
+
48
+ # 这个函数有问题有时候拿不到相同的commit id
49
+ def self.checkTagOrBranchIsEqalToHead(branchOrTag, path)
50
+ _currentDir = Dir.pwd
51
+ Dir.chdir(path)
52
+ headCommitID = `git rev-parse HEAD`
53
+ tagCommitID = `git rev-parse #{branchOrTag}`
54
+ Pod::UI.puts "#{`pwd`} headCommitID:#{headCommitID} \n #{branchOrTag}ComitID:#{tagCommitID}"
55
+ Dir.chdir(_currentDir)
56
+ (headCommitID.length > 0 && headCommitID == tagCommitID)
57
+ end
58
+
59
+ def self.checkGitStatusAndPush(pod_name)
60
+ output = `git status -s`
61
+ puts output
62
+ if output.length == 0
63
+ output = `git status`
64
+ if output.include?('push')
65
+ ret = system('git push')
66
+ raise "💔 #{pod_name.yellow} push 失败" if ret != true
67
+ end
68
+ else
69
+ raise "💔 #{pod_name.yellow} 有未提交的数据"
49
70
  end
50
-
51
- # 这个函数有问题有时候拿不到相同的commit id
52
- def self.checkTagOrBranchIsEqalToHead(branchOrTag, path)
53
- _currentDir = Dir.pwd
54
- Dir.chdir(path)
55
- headCommitID = `git rev-parse HEAD`
56
- tagCommitID = `git rev-parse #{branchOrTag}`
57
- Pod::UI.puts "#{`pwd`} headCommitID:#{headCommitID} \n #{branchOrTag}ComitID:#{tagCommitID}"
58
- Dir.chdir(_currentDir)
59
- return (headCommitID.length > 0 && headCommitID == tagCommitID)
71
+ end
72
+
73
+ def self.checkRemoteTagExist(tag)
74
+ `git push --tags`
75
+ system("git ls-remote --exit-code origin refs/tags/#{tag}")
76
+ end
77
+
78
+ def self.addGitTagAndPush(tag, pod_name)
79
+ ret = system("git tag #{tag}")
80
+ if ret == true
81
+ ret = system("git push origin #{tag}")
82
+ raise "💔 #{pod_name.yellow} push tag 失败" if ret != true
60
83
  end
61
-
62
- def self.checkGitStatusAndPush(pod_name)
63
- output = `git status -s`
64
- puts output
65
- if output.length == 0
66
- output = `git status`
67
- if output.include?("push")
68
- ret = system("git push")
69
- if ret != true
70
- raise "💔 #{pod_name.yellow} push 失败"
71
- end
72
- end
73
- else
74
- raise "💔 #{pod_name.yellow} 有未提交的数据"
75
- end
84
+ ret
85
+ end
86
+
87
+ def self.inputNeedJumpForReson(str)
88
+ return false if ARGV.include? '--silent'
89
+
90
+ puts str.green
91
+ puts '是(Y), 任意其他输入或直接回车跳过'.green
92
+ input = STDIN.gets
93
+ input[0, 1] == 'Y'
94
+ end
95
+
96
+ def self.changeVersionInCocoapods(name, newVersion)
97
+ if newVersion.nil?
98
+ Pod::UI.puts '💔 传入的修改目标版本号为空,无法设置版本号'.yellow
99
+ return
76
100
  end
77
-
78
- def self.checkRemoteTagExist(tag)
79
- `git push --tags`
80
- ret = system("git ls-remote --exit-code origin refs/tags/#{tag}")
81
- return ret
82
- end
83
-
84
- def self.addGitTagAndPush(tag, pod_name)
85
- ret = system("git tag #{tag}")
86
- if ret == true
87
- ret = system("git push origin #{tag}")
88
- if ret != true
89
- raise "💔 #{pod_name.yellow} push tag 失败"
90
- end
91
- end
92
- return ret
93
- end
94
-
95
- def self.inputNeedJumpForReson(str)
96
- if ARGV.include? '--silent'
97
- return false
98
- end
99
-
100
- puts str.green
101
- puts '是(Y), 任意其他输入或直接回车跳过'.green
102
- input = STDIN.gets
103
- if input[0,1] == "Y"
104
- return true
105
- else
106
- return false
107
- end
108
- end
109
-
110
- def self.changeVersionInCocoapods(name, newVersion)
111
- if (newVersion == nil)
112
- Pod::UI.puts "💔 传入的修改目标版本号为空,无法设置版本号".yellow
113
- return
114
- end
115
- newVersion = get_pure_version(newVersion)
116
- specName = name + ".podspec"
117
- FileProcesserManager.new(specName,
118
- [
119
- FileProcesser.new(-> (fileContent) {
120
- return fileContent.gsub(/(\.version *= *')(.*')/, "\\1" + newVersion + "'")
121
- })
122
- ]).process()
123
- `git add #{specName}
101
+ newVersion = get_pure_version(newVersion)
102
+ specName = name + '.podspec'
103
+ FileProcesserManager.new(specName,
104
+ [
105
+ FileProcesser.new(lambda { |fileContent|
106
+ return fileContent.gsub(/(\.version *= *')(.*')/,
107
+ '\\1' + newVersion + "'")
108
+ }),
109
+ FileProcesser.new(lambda { |fileContent|
110
+ return fileContent.gsub(/(\.version *= *")(.*")/,
111
+ '\\1' + newVersion + '"')
112
+ })
113
+ ]).process
114
+ `git add #{specName}
124
115
  git commit -m "Mod: 修改版本号为:#{newVersion} by cocoapods_dev_env plugin"`
125
- end
116
+ end
126
117
 
127
- def self.get_pure_version(version)
128
- return version.split.last.scan(/\d+/).join('.')
129
- end
118
+ def self.get_pure_version(version)
119
+ version.split.last.scan(/\d+/).join('.')
120
+ end
130
121
  end
131
122
 
132
-
133
- class Podfile
134
-
123
+ module Pod
124
+ class Podfile
135
125
  class TargetDefinition
126
+ def getReposStrForLint
127
+ return '' if podfile.sources.size == 0
136
128
 
137
- def getReposStrForLint()
138
- if podfile.sources.size == 0
139
- return ""
140
- end
141
- str = " --sources="
142
- podfile.sources.each do |source|
143
- str += source
144
- str += ","
145
- end
146
- Pod::UI.puts str
147
- return str
148
- end
149
-
150
- def getUserRepoAddress()
151
- if podfile.sources.size == 0
152
- raise "💔 发布release必须配置仓库的地址, e.g.: source 'https://github.com/CocoaPods/Specs.git'"
153
- end
154
- index = nil
155
- begin
156
- Pod::UI.puts "\n\n⌨️ 请输入要发布到的cocoapods仓库序号, 按回车确认: ".yellow
157
- num = 1
158
- podfile.sources.each do |source|
159
- Pod::UI.puts "#{num.to_s.yellow}. #{source.green}"
160
- num += 1
161
- end
162
- index = STDIN.gets.to_i - 1
163
- end until (index >= 0 && index < podfile.sources.size)
164
- source = podfile.sources[index]
165
- Pod::UI.puts "#{"选择了发布到: ".yellow}. #{source.green}(#{index + 1})"
166
- return source
129
+ str = ' --sources='
130
+ podfile.sources.each do |source|
131
+ str += source
132
+ str += ','
167
133
  end
134
+ Pod::UI.puts str
135
+ str
136
+ end
137
+
138
+ def getUserRepoAddress
139
+ raise "💔 发布release必须配置仓库的地址, e.g.: source 'https://github.com/CocoaPods/Specs.git'" if podfile.sources.size == 0
140
+
141
+ index = nil
142
+ begin
143
+ Pod::UI.puts "\n\n⌨️ 请输入要发布到的cocoapods仓库序号, 按回车确认: ".yellow
144
+ num = 1
145
+ podfile.sources.each do |source|
146
+ Pod::UI.puts "#{num.to_s.yellow}. #{source.green}"
147
+ num += 1
148
+ end
149
+ index = STDIN.gets.to_i - 1
150
+ end until (index >= 0 && index < podfile.sources.size)
151
+ source = podfile.sources[index]
152
+ Pod::UI.puts "#{'选择了发布到: '.yellow}. #{source.green}(#{index + 1})"
153
+ source
154
+ end
168
155
  end
156
+ end
169
157
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-dev-env
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.9
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - 吴锡苗
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-03-21 00:00:00.000000000 Z
11
+ date: 2022-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: luna-binary-uploader