deploy_log 0.1.8a → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/deploy_log/github/helper.rb +20 -17
- data/lib/deploy_log/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0be5986780967ad9c7fe713a71f69b392919affb3ebaf82cab6adbb7c20dad22
|
4
|
+
data.tar.gz: 44e92a417ff45c4833939879c1b5e4adc7e8f3a2b309350e42a003f6f52222ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82bda4ccab174bf8c523f86d4ab04d1f29e2b8b26fb9db0b26e799d7d443ab051d7acbd83ac653ccaa92e6667603417e46c3e0e26c713029ee74f2c415532dcc
|
7
|
+
data.tar.gz: 533e5362acfbe7d55970ceca4d3aea9e7f583e377465175a5600df2df903188fdb80aeec7ab70e52c59374d1917f90ee7758a48ab39f23a3de9b30b55ea38dac
|
@@ -5,13 +5,11 @@ require 'octokit'
|
|
5
5
|
module DeployLog
|
6
6
|
module Github
|
7
7
|
class Helper
|
8
|
-
LINE_FORMAT = "%s (%s)\n - Created by %s\n - Branch: %s\n - Merged by %s on %s\n - Changes: %s\n\n"
|
8
|
+
LINE_FORMAT = "%s (%s)\n - Created by %s\n - Branch: %s\n - Merged by %s on %s\n - Changes: %s\n -- %s\n\n"
|
9
9
|
|
10
10
|
def initialize(user_repo)
|
11
11
|
@client = ::Octokit::Client.new(login: ENV['GITHUB_USER'], password: ENV['GITHUB_TOKEN'])
|
12
12
|
@repo_location = user_repo
|
13
|
-
# cache last API response
|
14
|
-
@last_response = nil
|
15
13
|
end
|
16
14
|
|
17
15
|
def pulls_in_timeframe(date_start = nil, date_end = nil)
|
@@ -27,7 +25,6 @@ module DeployLog
|
|
27
25
|
File.open('/tmp/github-deploys.log', 'w+') do |f|
|
28
26
|
list.each do |pr|
|
29
27
|
next unless (date_start..date_end).cover? pr.merged_at
|
30
|
-
_c = committers_for(pr.number)
|
31
28
|
|
32
29
|
prs_covered += 1
|
33
30
|
|
@@ -39,8 +36,9 @@ module DeployLog
|
|
39
36
|
pr.user.login,
|
40
37
|
pr.head.ref,
|
41
38
|
user_who_merged(pr.number),
|
42
|
-
formatted_time(pr.merged_at),
|
43
|
-
pr.diff_url
|
39
|
+
formatted_time(pr.merged_at, true),
|
40
|
+
pr.diff_url,
|
41
|
+
committers_for(pr.number).join("\n -- ")
|
44
42
|
)
|
45
43
|
)
|
46
44
|
end
|
@@ -74,8 +72,9 @@ module DeployLog
|
|
74
72
|
pr.user.login,
|
75
73
|
pr.head.ref,
|
76
74
|
user_who_merged(pr.number),
|
77
|
-
formatted_time(pr.merged_at),
|
78
|
-
pr.diff_url
|
75
|
+
formatted_time(pr.merged_at, true),
|
76
|
+
pr.diff_url,
|
77
|
+
committers_for(pr.number).join("\n -- ")
|
79
78
|
)
|
80
79
|
)
|
81
80
|
end
|
@@ -90,22 +89,26 @@ module DeployLog
|
|
90
89
|
|
91
90
|
private
|
92
91
|
|
93
|
-
def user_who_merged(
|
94
|
-
pr = @client.pull_request(@repo_location,
|
95
|
-
@last_response = pr
|
96
|
-
|
92
|
+
def user_who_merged(num)
|
93
|
+
pr = @client.pull_request(@repo_location, num)
|
97
94
|
pr.merged_by.login
|
98
95
|
end
|
99
96
|
|
100
97
|
def committers_for(num)
|
101
|
-
|
102
|
-
|
98
|
+
commits = @client.pull_request_commits(@repo_location, num)
|
99
|
+
commits.map do |c|
|
100
|
+
"#{c.author.login} committed '#{c.commit.message}'"
|
101
|
+
end
|
103
102
|
end
|
104
103
|
|
105
|
-
def formatted_time(time,
|
104
|
+
def formatted_time(time, use_local_time = false)
|
106
105
|
time = Time.now if time.nil?
|
107
|
-
time = time.localtime if
|
108
|
-
|
106
|
+
time = time.localtime if use_local_time
|
107
|
+
|
108
|
+
fmt = '%e/%-m/%Y @ %I:%M:%S%P'
|
109
|
+
fmt += ' UTC' unless use_local_time
|
110
|
+
|
111
|
+
time.strftime(fmt)
|
109
112
|
end
|
110
113
|
|
111
114
|
def nested_hash_value(obj, key)
|
data/lib/deploy_log/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deploy_log
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Priebe
|
@@ -118,9 +118,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
118
118
|
version: '0'
|
119
119
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
120
|
requirements:
|
121
|
-
- - "
|
121
|
+
- - ">="
|
122
122
|
- !ruby/object:Gem::Version
|
123
|
-
version:
|
123
|
+
version: '0'
|
124
124
|
requirements: []
|
125
125
|
rubygems_version: 3.0.1
|
126
126
|
signing_key:
|