dngg 0.0.5 → 0.0.6

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: ed83c69c8ffd9f281d9bda6d8d0a2534f5f543b80052dc9b445c49a99144ce5d
4
- data.tar.gz: 2406d79be38a740e8ed633c4c89efab8ba1036d524405cdb8972e9a1136a15db
3
+ metadata.gz: 2ecfeb442ed96915e6fdc9101590f01e2efe062593976b072cf298319781a9d7
4
+ data.tar.gz: 7a74ad2ec1d7ec59b18696ca68f8e01f3cf435e9fad1d38e8db0e18eac42a60e
5
5
  SHA512:
6
- metadata.gz: cc0258704a57f9703daf63be525ca98f7b8065c4c392cbcd8814972116b5d9542439b829579011c3436da2d273830ad4eda4e236a0eaa686e72450af35301d21
7
- data.tar.gz: df102c00a4c7b29081032559a9797f6f03a75d4226af1f71841c082f3c3f9ce9da4ccd61d077864f8a9533bbb4eb5ea8e7a09561bfb068e0e0833e0c4e2616ce
6
+ metadata.gz: ae5244fd440c15209f5e0d40c8a77ad4c87a4e12aeae9cbcac792fa7f3846e6f2ec83589dbab9fbd6003eb1a4e3c08073b95d802c0193f3a9cc11245e65ee73b
7
+ data.tar.gz: 4d9bfb71b7254a58483437faf444b66efc39cc6ff3b66c14bf423a2615c3da27d697c5272cba80ac397b850d5d745afdda34a9dd3807773fb5dc7e9018e8ef64
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dngg (0.0.5)
4
+ dngg (0.0.6)
5
5
  colorize (= 0.8.1)
6
6
  oj (= 3.8.0)
7
7
  thor (= 1.0.0)
@@ -59,16 +59,16 @@ module DNGG
59
59
  end
60
60
  end
61
61
  end
62
-
63
62
  whole_files = `git status -s`.split(/\n/).delete_if do |w|
64
63
  w == ''
65
64
  end
66
65
  return '' if whole_files.length != modified.length
67
-
68
66
  outputs = ''
69
67
  modified.each_with_index do |m, index|
70
68
  msg = get_lastest_msg_of_module(m)
71
- outputs += msg.insert(msg.index(':') + 1, "[#{get_module_name(m)}]")
69
+ if msg.index(':')
70
+ outputs += msg.insert(msg.index(':') + 1, "[#{get_module_name(m)}]")
71
+ end
72
72
  if index != modified.length - 1
73
73
  outputs += "\n"
74
74
  end
@@ -79,7 +79,7 @@ module DNGG
79
79
  end
80
80
 
81
81
  def get_module_name(module_name)
82
- module_name.split(/\//).last.downcase
82
+ module_name.split(/\//).last
83
83
  end
84
84
 
85
85
  end
@@ -8,7 +8,7 @@ def commit_check
8
8
  standards.each do |standard|
9
9
  check(standard)
10
10
  end
11
- puts '====> commit message不符合规范,请查看规范'.red
11
+ puts '====> commit message不符合规范,请查看规范 https://naxg5qz90v.feishu.cn/wiki/wikcnGAC0ayqRw5SSyj6QFQESKb'.red
12
12
  exit 1
13
13
  end
14
14
 
@@ -83,11 +83,11 @@ module DNGG
83
83
  def get_submodule_commit
84
84
  sub_tree = 'git ls-tree HEAD | grep "160000"'
85
85
  sub_commits = `#{sub_tree}`
86
- if sub_commits.strip == '' && (File.directory? 'submodules')
87
- Dir.chdir 'submodules'
88
- sub_commits = `#{sub_tree}`
89
- Dir.chdir '..'
90
- end
86
+ # if sub_commits.strip == '' && (File.directory? 'submodules')
87
+ # Dir.chdir 'submodules'
88
+ # sub_commits = `#{sub_tree}`
89
+ # Dir.chdir '..'
90
+ # end
91
91
  pattern = /(?<=\s)[0-9a-zA-Z]{40}(?=\s)/
92
92
  sub_commits = sub_commits.split(/\n/)
93
93
  result = []
@@ -144,16 +144,17 @@ module DNGG
144
144
  get_submodule.include?(module_name)
145
145
  end
146
146
 
147
+ # 寻找上次merge之后的commit消息
147
148
  def get_lastest_msg_not_merge
148
149
  depth = 1
149
- while (msg = get_lastest_msg(depth)).start_with?('Merge branch') do
150
+ while (msg = get_lastest_msg(depth)).start_with?('Merge ') do
150
151
  depth += 1
151
152
  end
152
153
  msg
153
154
  end
154
155
 
155
156
  def get_lastest_msg(depth)
156
- msg = `git log --format=%B -n #{depth}`.split(/\n\n/)
157
+ msg = `git log --oneline --format=%B -n #{depth}`.split(/\n\n/)
157
158
  msg[depth - 1].strip
158
159
  end
159
160
 
data/lib/dngg/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module DNGG
2
- VERSION = '0.0.5'
3
- end
2
+ VERSION = '0.0.6'
3
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dngg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - iSnow
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-27 00:00:00.000000000 Z
11
+ date: 2021-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor