gitall 1.1.24 → 1.1.26

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: d2a4eb79a16219d3d11497884258f13f158c88d30d64b6d06173704fd6f63e81
4
- data.tar.gz: 97bd76942919c56d6ba8554b68792d45ce33b092a54e7fe4d02fba2a2d702a7a
3
+ metadata.gz: d2225c61cc4a524e15452245f2932d545332f491c76108601889f180f3815173
4
+ data.tar.gz: c9c84a2f7a840febfe06484b60852865ff1ad89e2394a654e57db1533e392d06
5
5
  SHA512:
6
- metadata.gz: fcaaff5e29d22367863c0a9adb9d4861a04330c30e3318eab7ad5b085884ad9238328b50e945d34167e966cd21e037c00644277a10903ffdca3fccc94617a0df
7
- data.tar.gz: 7311092a8c440b8987bca560d62ce0b742d51e839441e1d925ff9cd79f3e61a717d9fb3db008f8919f85038f88c09d32bcbecb9b42b10498895faebab2752b86
6
+ metadata.gz: f82076383a5822fb35a8204f65871b11e5ef3d6c8e3c2624445cb6dc43ada3ac7a046976c42c42b2d1ba1221864227b80463d465cc8ac57acd5ff01b0fc61b37
7
+ data.tar.gz: 99b15316c34e9e4a643a8f5df0386d60094363a3dbfcd7ed7f942107b0c61c045737461a02f445b318c1ab17245b28675480243230188ff92d609a00d8672977
@@ -7,12 +7,12 @@
7
7
  # GitLab Event Parsing
8
8
  class GitLabParser
9
9
  def GitLabParser.parse(json)
10
- j = RecursiveOpenStruct.new(json)
10
+ j = RecursiveOpenStruct.new(json)
11
11
  response = []
12
- kind = j.object_kind
12
+ kind = j.object_kind
13
13
  case kind
14
14
  when 'note'
15
- repo = j.project.path_with_namespace
15
+ repo = j.project.path_with_namespace
16
16
  ntype = j.object_attributes.noteable_type
17
17
  case ntype
18
18
  when 'MergeRequest'
@@ -24,10 +24,10 @@ class GitLabParser
24
24
  response << "[#{repo}] #{mr_user} commented on Merge Request ##{mr_id} \u2014 #{mr_note}"
25
25
  response << "'#{mr_title}' => #{mr_url}"
26
26
  when 'Commit'
27
- c_note = j.object_attributes.note
28
- c_sha = j.commit.id[0...7]
29
- c_url = j.object_attributes.url
30
- c_user = j.user.name
27
+ c_note = j.object_attributes.note
28
+ c_sha = j.commit.id[0...7]
29
+ c_url = j.object_attributes.url
30
+ c_user = j.user.name
31
31
  response << "[#{repo}] #{c_user} commented on commit (#{c_sha}) \u2014 #{c_note} <#{c_url}>"
32
32
  when 'Issue'
33
33
  i_id = j.issue.iid
@@ -36,8 +36,8 @@ class GitLabParser
36
36
  i_title = j.issue.title
37
37
  i_user = j.user.name
38
38
  response << "[#{repo}] #{i_user} commented on Issue ##{i_id} (#{i_title}) \u2014 #{i_msg} <#{i_url}>"
39
- else
40
- # type code here
39
+ else
40
+ # type code here
41
41
  end
42
42
  when 'issue'
43
43
  i_repo = j.project.path_with_namespace
@@ -62,41 +62,51 @@ class GitLabParser
62
62
  response << "[#{mr_lcsha}] \u2014 #{mr_lcmessage} <#{mr_url}>"
63
63
  when 'push' # comes to
64
64
  # shove
65
- branch = j.ref.split('/')[-1]
66
- commits = j.commits
67
- added = 0
68
- removed = 0
65
+ branch = j.ref.split('/')[-1]
66
+ commits = j.commits
67
+ added = 0
68
+ removed = 0
69
69
  modified = 0
70
70
  commits.each do |h|
71
71
  added += h['added'].length
72
72
  removed += h['removed'].length
73
73
  modified += h['modified'].length
74
74
  end
75
- owner = j.project.namespace
76
- project = j.project.name
77
- pusher = j.user_name
75
+ owner = j.project.namespace
76
+ project = j.project.name
77
+ pusher = j.user_name
78
78
  commit_count = j.total_commits_count
79
- repo_url = j.project.web_url
79
+ repo_url = j.project.web_url
80
80
  response << "[#{owner}/#{project}] #{pusher} pushed #{commit_count} commit(s) [+#{added}/-#{removed}/±#{modified}] to [#{branch}] at <#{repo_url}>"
81
81
  if commits.length > 3
82
82
  coms = commits[0..2]
83
83
  coms.each do |n|
84
- id = n['id']
85
- msg = n['message'].lines[0]
84
+ id = n['id']
85
+ msg = n['message'].lines[0]
86
86
  author = n['author']['name']
87
87
  response << "#{author} — #{msg.chomp} [#{id[0...7]}]"
88
88
  end
89
89
  response << "and #{commits.from(3).length} commits..."
90
90
  else
91
91
  commits.each do |n|
92
- id = n['id'][0...7]
93
- msg = n['message'].lines[0]
92
+ id = n['id'][0...7]
93
+ msg = n['message'].lines[0]
94
94
  author = n['author']['name']
95
95
  response << "#{author} — #{msg.chomp} [#{id}]"
96
96
  end
97
97
  end
98
- else
99
- # type code here
98
+ when 'tag_push'
99
+ owner = j.project.namespace
100
+ project = j.project.name
101
+ pusher = j.user_name
102
+ commit_count = j.total_commits_count
103
+ repo_url = j.project.web_url
104
+ tag = j.ref.split('/')[-1]
105
+ response << "[#{owner}/#{project}] #{pusher} added/modified/removed tag #{tag}"
106
+ response << "[#{owner}/#{project}] Release: <https://gitlab.com/#{owner}/#{project}/releases/tag/#{tag}>"
107
+
108
+ else
109
+ # type code here
100
110
  end
101
111
  return response
102
112
  end
@@ -1,3 +1,3 @@
1
1
  module GitAll
2
- VERSION = '1.1.24'
2
+ VERSION = '1.1.26'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitall
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.24
4
+ version: 1.1.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ken Spencer