deploy_log 0.1.3 → 0.1.4
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 +4 -4
- data/bin/deploy_log +1 -1
- data/lib/deploy_log/github/deploys.rb +5 -7
- data/lib/deploy_log/github/helper.rb +4 -5
- data/lib/deploy_log/version.rb +3 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a27a0cdd050660183c126442e8200d7d68179cda6f16da222cee3112220734c
|
4
|
+
data.tar.gz: 8165b8f69d8c738ec6ebd94490c7bc6d490efe944a171d05e4142484b0429df8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d06a24b59094fa8650567974228653ae0267bf33044c78e4e88cd3c828b548d649b186533b39d326cf933108a3dee4c029b3006d7dbd2049c6b71cfd37fdcdc
|
7
|
+
data.tar.gz: 76df1d0276aa4aee03cbfdc8e42e87bf0957a825998cac71d208ec89ce314d2e33aacaf11aa43b37e9ab777a406cf294c2e2871b8da33f22493a635c88282f8a
|
data/bin/deploy_log
CHANGED
@@ -29,7 +29,7 @@ OptionParser.new do |opt|
|
|
29
29
|
end.parse!
|
30
30
|
|
31
31
|
model = DeployLog::Github::Deploys.new
|
32
|
-
model.merged_between(start, finish) if start
|
32
|
+
model.merged_between(start, finish) if start
|
33
33
|
model.pr_title(title) if title
|
34
34
|
model.pr_for_branch(branch) if branch
|
35
35
|
model.merged_today if title.nil? && branch.nil? && start.nil? && finish.nil?
|
@@ -7,10 +7,10 @@ module DeployLog
|
|
7
7
|
@github = Helper.new(ARGV.first)
|
8
8
|
end
|
9
9
|
|
10
|
-
def merged_between(start, finish)
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
def merged_between(start, finish = nil)
|
11
|
+
return Notify.error 'Start (--start=) is a required argument' if start.nil?
|
12
|
+
|
13
|
+
finish = Date.today.to_time + (24 * 60 * 60) - 1 if finish.nil?
|
14
14
|
|
15
15
|
@github.pulls_in_timeframe(start, finish)
|
16
16
|
end
|
@@ -23,9 +23,7 @@ module DeployLog
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def merged_on(start)
|
26
|
-
|
27
|
-
Notify.error("Start date (--start=) is required")
|
28
|
-
end
|
26
|
+
return Notify.error 'Start (--start=) is a required argument' if start.nil?
|
29
27
|
|
30
28
|
finish = start + 24 * 60 * 60 - 1
|
31
29
|
|
@@ -5,6 +5,8 @@ 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"
|
9
|
+
|
8
10
|
def initialize(user_repo)
|
9
11
|
@client = ::Octokit::Client.new(login: ENV['GITHUB_USER'], password: ENV['GITHUB_TOKEN'])
|
10
12
|
@repo_location = user_repo
|
@@ -18,7 +20,6 @@ module DeployLog
|
|
18
20
|
sort: 'long-running'
|
19
21
|
)
|
20
22
|
|
21
|
-
pr_format_str = "%s (%s)\n - Created by %s\n - Branch: %s\n - Merged by %s on %s\n - Changes: %s\n\n"
|
22
23
|
prs_covered = 0
|
23
24
|
|
24
25
|
File.open('/tmp/github-deploys.log', 'w+') do |f|
|
@@ -29,7 +30,7 @@ module DeployLog
|
|
29
30
|
|
30
31
|
f.write(
|
31
32
|
sprintf(
|
32
|
-
|
33
|
+
LINE_FORMAT,
|
33
34
|
pr.title,
|
34
35
|
pr.html_url,
|
35
36
|
pr.user.login,
|
@@ -54,8 +55,6 @@ module DeployLog
|
|
54
55
|
:state => :all,
|
55
56
|
:per_page => 100
|
56
57
|
)
|
57
|
-
# pr_format_str = "%s (%s)\n - Created by %s\n - Branch: %s\n - Changes: %s\n\n"
|
58
|
-
pr_format_str = "%s (%s)\n - Created by %s\n - Branch: %s\n - Merged by %s on %s\n - Changes: %s\n\n"
|
59
58
|
prs_covered = 0
|
60
59
|
|
61
60
|
File.open('/tmp/github-deploys.log', 'w+') do |f|
|
@@ -66,7 +65,7 @@ module DeployLog
|
|
66
65
|
|
67
66
|
f.write(
|
68
67
|
sprintf(
|
69
|
-
|
68
|
+
LINE_FORMAT,
|
70
69
|
pr.title,
|
71
70
|
pr.html_url,
|
72
71
|
pr.user.login,
|
data/lib/deploy_log/version.rb
CHANGED