deploy_log 0.1.9 → 0.2.0
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/lib/deploy_log/calendar.rb +25 -3
- data/lib/deploy_log/github/deploys.rb +3 -3
- data/lib/deploy_log/version.rb +1 -1
- data/lib/deploy_log.rb +1 -0
- 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: 9a55f9f4ac0e32ac7583402b612176d5d4213e87c423bb1f893ecea5fa9a4f07
|
4
|
+
data.tar.gz: fd1ee61246e3457f233906078e7d467e80792c87e850ae608424d4f43d27a76b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 534b369854c1cb72f47f9598a0e352c29eb4c17f978298a8c1e3d9493e20ddf7684944990a14324fb17a3e4332bda12d54c8136975e2514dc06eebe407bb29ae
|
7
|
+
data.tar.gz: f9c11c4773037cf5ccb59574188b494eb07837f940bb9983c05f60849ac44c0eae03755a9e56002337c85eee40551ac7e84cc0296e1473b5a78d32194655ec18
|
data/lib/deploy_log/calendar.rb
CHANGED
@@ -2,8 +2,30 @@
|
|
2
2
|
|
3
3
|
module DeployLog
|
4
4
|
class Calendar
|
5
|
-
def
|
6
|
-
|
5
|
+
def week(week_num)
|
6
|
+
year_calendar(2019).to_a[week_num]
|
7
|
+
end
|
8
|
+
|
9
|
+
private
|
10
|
+
|
11
|
+
def range_for(year)
|
12
|
+
start = Date.parse("#{year}-01-01")
|
13
|
+
finish = Date.parse("#{year}-12-31")
|
14
|
+
|
15
|
+
(start..finish)
|
16
|
+
end
|
17
|
+
|
18
|
+
def year_calendar(year)
|
19
|
+
date_range = range_for(year)
|
20
|
+
output = (1..52).to_a.map { |w| { w => [] } }
|
21
|
+
|
22
|
+
date_range.each do |day|
|
23
|
+
output[day.cweek] = {}
|
24
|
+
output[day.cweek][:first] = (day - 7).to_time
|
25
|
+
output[day.cweek][:last] = day.to_time + (24 * 60 * 60) - 1
|
26
|
+
end
|
27
|
+
|
28
|
+
output
|
7
29
|
end
|
8
30
|
end
|
9
|
-
end
|
31
|
+
end
|
@@ -5,6 +5,7 @@ module DeployLog
|
|
5
5
|
class Deploys
|
6
6
|
def initialize
|
7
7
|
@github = Helper.new(ARGV.first)
|
8
|
+
@calendar = DeployLog::Calendar.new
|
8
9
|
end
|
9
10
|
|
10
11
|
def merged_between(start, finish = nil)
|
@@ -33,10 +34,9 @@ module DeployLog
|
|
33
34
|
def merged_during_week(week_num)
|
34
35
|
return Notify.error 'Week number (--week|-w) is a required argument' if week_num.nil?
|
35
36
|
|
36
|
-
|
37
|
-
finish = start + 24 * 60 * 60 - 1
|
37
|
+
week = @calendar.week(week_num.to_i)
|
38
38
|
|
39
|
-
@github.pulls_in_timeframe(
|
39
|
+
@github.pulls_in_timeframe(week[:first], week[:last])
|
40
40
|
end
|
41
41
|
|
42
42
|
def pr_title(title)
|
data/lib/deploy_log/version.rb
CHANGED
data/lib/deploy_log.rb
CHANGED