sjpush 0.0.6 → 0.0.7

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/sjpush.rb +42 -22
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9e1f8e002e9f71c269fc7d6ea03a49ff826073c2188551c67302cd5241a0750c
4
- data.tar.gz: 96d0bae632e7786bd741df69dd10328e9f54c04b4d5bdb043fdca48ca01f5174
3
+ metadata.gz: c958e01a8f908e6dc0f76a7f538a3d8bfcfc769f429500ae48cd93e791a40ba2
4
+ data.tar.gz: f468b7abc920e9669288c6b5cac5ae5262910393df29e7d8f4b2889883e187df
5
5
  SHA512:
6
- metadata.gz: d51fc71d1b75a2838adad014563ce560820a4f730048ff0e59c717957374267314893ecdde3e02723c93d0ad9b4957d26c27e40954a390b4a74541069ae0dd37
7
- data.tar.gz: 6a2056029e7fb080d0c3f0e6a0a5aa3b44daf218f731753f7d3cf4f22a2f6402355ce2e333fd49269f14ef5a00e0302b2579ebf5463535abc16e2d7eaaf2b0e6
6
+ metadata.gz: 9b2d001a3e75a261f3fc961bba1bbbd4b0bf934c78bedc780cdac7d41905b03ce1608f866dd1899d67199873a7d1462e7331b2e20d7362cc896937129b7e3a6f
7
+ data.tar.gz: dcc8906d1b03e4f1b25f7dce61b257249070a63cab60bad00dd931520b98c8f989dcb76f691e5aea35567e8d8af820cedd3c444713fcf4ee16331267639e7744
data/lib/sjpush.rb CHANGED
@@ -20,7 +20,7 @@ class ActionHandler
20
20
  def updatePodspecVerAction()
21
21
  s = ActionHandler.getPodspec()
22
22
  if s.nil?
23
- puts "已退出, 未搜索到 podspec 文件"
23
+ puts "\n已退出, 未搜索到 podspec 文件"
24
24
  exit
25
25
  end
26
26
 
@@ -39,13 +39,13 @@ class ActionHandler
39
39
  file.syswrite(contents)
40
40
  file.close
41
41
 
42
- puts "podspec 版本已更新"
42
+ puts "\npodspec 版本已更新"
43
43
  end
44
44
 
45
45
  def getPodspecVersion()
46
46
  s = ActionHandler.getPodspec()
47
47
  if s.nil?
48
- puts "已退出, 未搜索到 podspec 文件"
48
+ puts "\n已退出, 未搜索到 podspec 文件"
49
49
  exit
50
50
  end
51
51
 
@@ -64,7 +64,22 @@ class ActionHandler
64
64
  def initialize()
65
65
  @commands = String.new
66
66
  end
67
-
67
+
68
+ def getSubmitInfo()
69
+ if @commitInfo.nil?
70
+ puts "\n请输入提交信息:"
71
+ @commitInfo = gets.strip!
72
+ end
73
+ return @commitInfo
74
+ end
75
+
76
+ def getCocoapodsRepo()
77
+ if @repo.nil?
78
+ puts "\n请输入仓库名:"
79
+ @repo = gets.strip!
80
+ end
81
+ return @repo
82
+ end
68
83
 
69
84
  # - Actions -
70
85
 
@@ -76,16 +91,8 @@ class ActionHandler
76
91
  end
77
92
  end
78
93
 
79
- def submitInfoAction()
80
- if @commitInfo.nil?
81
- puts "请输入提交信息:"
82
- @commitInfo = gets.strip!
83
- end
84
- return @commitInfo
85
- end
86
-
87
94
  def commitAction()
88
- submit = submitInfoAction()
95
+ submit = getSubmitInfo()
89
96
  addCommand "git add ."
90
97
  addCommand "git commit -m '#{submit}'"
91
98
  end
@@ -95,23 +102,23 @@ class ActionHandler
95
102
  end
96
103
 
97
104
  def addNewTagAction()
98
- puts "请输入新的标签:"
105
+ puts "\n请输入新的标签:"
99
106
  newTag = gets.strip!
100
107
 
101
- submit = submitInfoAction()
108
+ submit = getSubmitInfo()
102
109
  addCommand "git tag -a '#{newTag}' -m '#{submit}'"
103
110
  addCommand "git push origin #{newTag}"
104
111
  end
105
112
 
106
113
  def addNewTagForPodspecVersionAction()
107
114
  version = ActionHandler.getPodspecVersion()
108
- submit = submitInfoAction()
115
+ submit = getSubmitInfo()
109
116
  addCommand "git tag -a '#{version}' -m '#{submit}'"
110
117
  addCommand "git push origin #{version}"
111
118
  end
112
119
 
113
120
  def deleteTagAction()
114
- puts "请输入要删除的标签:"
121
+ puts "\n请输入要删除的标签:"
115
122
  tag = gets.strip!
116
123
  addCommand "git tag -d #{tag}"
117
124
  addCommand "git push origin :#{tag}"
@@ -120,10 +127,12 @@ class ActionHandler
120
127
  def podReleaseAction()
121
128
  s = ActionHandler.getPodspec()
122
129
  if s.nil?
123
- puts "已退出, 未搜索到 podspec 文件"
130
+ puts "\n已退出, 未搜索到 podspec 文件"
124
131
  exit
125
132
  end
126
- addCommand "pod repo push lanwuzheRepo #{s} --allow-warnings --use-libraries"
133
+
134
+ repo = getCocoapodsRepo()
135
+ addCommand "pod repo push #{repo} #{s} --allow-warnings --use-libraries"
127
136
  end
128
137
 
129
138
  def executeCommands
@@ -136,7 +145,7 @@ class ActionHandler
136
145
 
137
146
  DESC
138
147
  system @commands
139
- puts "操作完成"
148
+ puts "\n操作完成"
140
149
  end
141
150
 
142
151
 
@@ -165,6 +174,8 @@ class ActionHandler
165
174
  elsif seq == $seq_lazy_property.to_i
166
175
  require 'sjScript'
167
176
  exit
177
+ elsif seq = $seq_direct_release.to_i
178
+ directReleaseAction()
168
179
  end
169
180
 
170
181
  nextCommand(seq)
@@ -202,6 +213,16 @@ class ActionHandler
202
213
  end
203
214
  end
204
215
  end
216
+
217
+ # 一键发布
218
+ def directReleaseAction()
219
+ ActionHandler.updatePodspecVerAction()
220
+ getSubmitInfo()
221
+ commitAction()
222
+ pushAction()
223
+ addNewTagForPodspecVersionAction()
224
+ podReleaseAction()
225
+ end
205
226
  end
206
227
 
207
228
  seqs = [
@@ -213,10 +234,9 @@ $seq_release = "4. pod发布(pod repo push ..repo ..podspec)",
213
234
  $seq_delete_tag = "5. 删除标签",
214
235
  $seq_lazy_protocol = "6. 自动写协议",
215
236
  $seq_lazy_property = "7. 自动补全懒加载",
237
+ $seq_direct_release = "8. 一键发布"
216
238
  ]
217
239
 
218
- require "pp"
219
-
220
240
  # - seqs -
221
241
  puts "\n"
222
242
  puts "请输入操作序号:"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sjpush
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - SanJiang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-13 00:00:00.000000000 Z
11
+ date: 2019-04-02 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: 用于辅助git提交
14
14
  email: