sjpush 0.0.7 → 0.0.8

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 +32 -14
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c958e01a8f908e6dc0f76a7f538a3d8bfcfc769f429500ae48cd93e791a40ba2
4
- data.tar.gz: f468b7abc920e9669288c6b5cac5ae5262910393df29e7d8f4b2889883e187df
3
+ metadata.gz: a57927d6cb2608a9a10693bae413c6e5f0929340988c4e0115ab425c708b28da
4
+ data.tar.gz: '0148f1aacb820624a783dd5622b40240fd19f764d7df8a1729bb8accb75519e6'
5
5
  SHA512:
6
- metadata.gz: 9b2d001a3e75a261f3fc961bba1bbbd4b0bf934c78bedc780cdac7d41905b03ce1608f866dd1899d67199873a7d1462e7331b2e20d7362cc896937129b7e3a6f
7
- data.tar.gz: dcc8906d1b03e4f1b25f7dce61b257249070a63cab60bad00dd931520b98c8f989dcb76f691e5aea35567e8d8af820cedd3c444713fcf4ee16331267639e7744
6
+ metadata.gz: 4913e10cf41fb859cde03a14286c9c03f380f5ef43f857b68224537dbc7932a22cb9f7b039dfe02979e815e4fcc58d7d68828a4e8c5e997f556a94a37eec2cdb
7
+ data.tar.gz: 2780a0cd4b6fc903c66019c94dac9015c6844f260435fce665f42fa3bd8e8a8e7a9b6332c94c532ebd13de89f7bd56c997c7ca0eca80ff1edda95815f8a6ca7b
data/lib/sjpush.rb CHANGED
@@ -17,13 +17,19 @@ class ActionHandler
17
17
  Dir["*.podspec"].last
18
18
  end
19
19
 
20
- def updatePodspecVerAction()
20
+ def searchPodspec()
21
21
  s = ActionHandler.getPodspec()
22
22
  if s.nil?
23
23
  puts "\n已退出, 未搜索到 podspec 文件"
24
24
  exit
25
25
  end
26
26
 
27
+ return s
28
+ end
29
+
30
+ def updatePodspecVerAction()
31
+ s = searchPodspec()
32
+
27
33
  contents = String.new
28
34
  File.new(s, "r").each_line do |line|
29
35
  regex = "s.version([^']+)'([^']+)'*"
@@ -43,21 +49,31 @@ class ActionHandler
43
49
  end
44
50
 
45
51
  def getPodspecVersion()
46
- s = ActionHandler.getPodspec()
47
- if s.nil?
48
- puts "\n已退出, 未搜索到 podspec 文件"
49
- exit
52
+ s = searchPodspec()
53
+
54
+ File.new(s, "r").each_line do |line|
55
+ regex = "s.version(?:[^']+)'([^']+)'*"
56
+ if /#{regex}/ =~ line
57
+ @version = $1.to_i
58
+ break
59
+ end
50
60
  end
51
61
 
62
+ return @version
63
+ end
64
+
65
+ def getPodspecName()
66
+ s = searchPodspec()
67
+
52
68
  File.new(s, "r").each_line do |line|
53
- regex = "s.version([^']+)'([^']+)'*"
69
+ regex = "s.name(?:[^']+)'([^']+)'*"
54
70
  if /#{regex}/ =~ line
55
- @version = $2.to_i
71
+ @name = $1
56
72
  break
57
73
  end
58
74
  end
59
75
 
60
- return @version
76
+ return @name
61
77
  end
62
78
  end
63
79
 
@@ -111,10 +127,12 @@ class ActionHandler
111
127
  end
112
128
 
113
129
  def addNewTagForPodspecVersionAction()
114
- version = ActionHandler.getPodspecVersion()
115
130
  submit = getSubmitInfo()
116
- addCommand "git tag -a '#{version}' -m '#{submit}'"
117
- addCommand "git push origin #{version}"
131
+ version = ActionHandler.getPodspecVersion()
132
+ name = ActionHandler.getPodspecName()
133
+ tag = "#{name}-#{version}"
134
+ addCommand "git tag -a '#{tag}' -m '#{submit}'"
135
+ addCommand "git push origin #{tag}"
118
136
  end
119
137
 
120
138
  def deleteTagAction()
@@ -125,14 +143,14 @@ class ActionHandler
125
143
  end
126
144
 
127
145
  def podReleaseAction()
128
- s = ActionHandler.getPodspec()
129
- if s.nil?
146
+ spec = ActionHandler.getPodspec()
147
+ if spec.nil?
130
148
  puts "\n已退出, 未搜索到 podspec 文件"
131
149
  exit
132
150
  end
133
151
 
134
152
  repo = getCocoapodsRepo()
135
- addCommand "pod repo push #{repo} #{s} --allow-warnings --use-libraries"
153
+ addCommand "pod repo push #{repo} #{spec} --allow-warnings --use-libraries"
136
154
  end
137
155
 
138
156
  def executeCommands
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.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - SanJiang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-02 00:00:00.000000000 Z
11
+ date: 2019-06-24 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: 用于辅助git提交
14
14
  email: