dngg 0.0.4 → 0.0.5

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: 6a44d21d8641e361b5ffa3b19b5b4198ef7da899f21364f0042e33df241ddfe0
4
- data.tar.gz: 6023c6a7996eea055fc8cd3cd90af3db0023b74d04d5b90dbd130f3593eec63e
3
+ metadata.gz: ed83c69c8ffd9f281d9bda6d8d0a2534f5f543b80052dc9b445c49a99144ce5d
4
+ data.tar.gz: 2406d79be38a740e8ed633c4c89efab8ba1036d524405cdb8972e9a1136a15db
5
5
  SHA512:
6
- metadata.gz: b7603c1f0d4a837a8985ee257d2da193b28b7316c19a493d49f22c003e2f8aad4a2ee4a323eb969cb43996f4b52629ae10bdb507f1c76f5f34a33b03a6ce5dec
7
- data.tar.gz: fe2b17bccd2ed52dd0cb45a42e6703dde4ed6186243ad88498483cc263228994e717adfde40bbb56d3c4d23d986461cdb90feb75554f6066395f4970f31223ca
6
+ metadata.gz: cc0258704a57f9703daf63be525ca98f7b8065c4c392cbcd8814972116b5d9542439b829579011c3436da2d273830ad4eda4e236a0eaa686e72450af35301d21
7
+ data.tar.gz: df102c00a4c7b29081032559a9797f6f03a75d4226af1f71841c082f3c3f9ce9da4ccd61d077864f8a9533bbb4eb5ea8e7a09561bfb068e0e0833e0c4e2616ce
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dngg (0.0.4)
4
+ dngg (0.0.5)
5
5
  colorize (= 0.8.1)
6
6
  oj (= 3.8.0)
7
7
  thor (= 1.0.0)
data/lib/dngg.rb CHANGED
@@ -20,6 +20,10 @@ module DNGG
20
20
  include Finish
21
21
  include MR
22
22
 
23
+ def self.exit_on_failure?
24
+ true
25
+ end
26
+
23
27
  desc 'sync', '当前分支同步(拉取)远程代码'
24
28
  def sync
25
29
  sync_flow
@@ -73,5 +77,4 @@ module DNGG
73
77
  puts VERSION
74
78
  end
75
79
  end
76
- # Cli.start(ARGV)
77
80
  end
@@ -80,8 +80,8 @@ module DNGG
80
80
 
81
81
  if current_branch_head_commit!="origin/#{@@current_branch}" && # 判断远程分支是否存在
82
82
  get_head_commit("origin/#{@@current_branch}") != get_head_commit("origin/#{@@target_branch}")
83
- # origin git@git.souche.com:Destiny_Android/Destiny_Android.git (push)
84
- # origin http://git.souche.com/Destiny_Android/Mine.git (push)
83
+ # origin git@gitlab.qima-inc.com:guang-mobile-shop/AiGuangMaxApp.git (push)
84
+ # origin https://gitlab.qima-inc.com/guang-mobile-shop/AiGuangMaxApp.git (push)
85
85
  result = `git remote -v | grep push`
86
86
  project_name = result.split('.com/')[1]
87
87
  if project_name == nil || project_name.strip == ''
@@ -90,14 +90,13 @@ module DNGG
90
90
 
91
91
  if project_name != nil
92
92
  project_name = project_name.split('.git')[0].gsub('/', '%2F')
93
-
94
93
  begin
95
94
  params = {}
96
95
  params['source_branch'] = @@current_branch
97
96
  params['target_branch'] = @@target_branch
98
97
  params['title'] = @@msg
99
98
  # params['remove_source_branch'] = true
100
- uri = URI.parse("https://git.souche-inc.com/api/v4/projects/#{project_name}/merge_requests?private_token=#{@@token}")
99
+ uri = URI.parse("https://gitlab.qima-inc.com/api/v4/projects/#{project_name}/merge_requests?private_token=#{@@token}")
101
100
  response = Net::HTTP.post_form(uri, params)
102
101
  result = Oj.load(response.body)
103
102
 
@@ -121,6 +120,8 @@ module DNGG
121
120
  @@token = init_check_token
122
121
  create_mr(sub)
123
122
  return
123
+ when Net::HTTPForbidden then
124
+ puts response.body.red
124
125
  end
125
126
  rescue => e
126
127
  puts "error: #{e}".red
data/lib/dngg/mr/email.rb CHANGED
@@ -4,18 +4,21 @@ require 'net/smtp'
4
4
  module DNGG
5
5
  module Email
6
6
  def send_email(user,title,msg)
7
+ user_mail = `git config user.email`
7
8
  message = <<END_OF_MESSAGE
8
- DNGG Merge Request <android.dev@guang.com>
9
+ DNGG Merge Request <team_android@aiguang.com>
10
+ From: #{user}
9
11
  To: Guang Android Team
10
12
  Subject: [#{user}] #{title}
11
13
 
12
14
  #{msg}
15
+
13
16
  END_OF_MESSAGE
14
17
 
15
- Net::SMTP.start('smtp.exmail.qq.com', 25, 'iSnow',
16
- 'zhuruixue@aiguang.com', 'wwL9RS9cLeBxv7co') do |smtp|
17
- smtp.send_message message,
18
- 'android.dev@guang.com'
18
+ Net::SMTP.start('smtp.exmail.qq.com',25,'zhuruixue',
19
+ 'zhuruixue@aiguang.com','wwL9RS9cLeBxv7co', :plain) do |smtp|
20
+ smtp.send_message message, 'zhuruixue@aiguang.com',
21
+ 'team_android@aiguang.com'
19
22
  end
20
23
  end
21
24
  end
data/lib/dngg/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module DNGG
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
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.4
4
+ version: 0.0.5
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-26 00:00:00.000000000 Z
11
+ date: 2021-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor