git-story-workflow 0.9.9 → 0.9.10
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/VERSION +1 -1
- data/git-story-workflow.gemspec +2 -2
- data/lib/git/story/app.rb +26 -15
- data/lib/git/story/version.rb +1 -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: cc6fc0d57caaf1bf1ddc9479956304a9826d639dd64f738c541abdecb9e10658
|
4
|
+
data.tar.gz: 8006409b423a1237f8ab8fbf84e4453b50c15343e1caf3a16a7e308d465baba6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed5c753dc90f1e5122cbea04a8d8146eadcdc532bb8fb0f2034860090329e0d3d8c0e5bdc7c219e775b22897659afdafe1e1d4b66ac2368017dce3171fce4bd6
|
7
|
+
data.tar.gz: 86d2cc86c1a2a5279566056f7ad17302f383a3c738f0331496012cb8a8665ca634516f801d2c8059443d9c9e602fd26ddab05226bfaa3692adef2711e615cd3f
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.9.
|
1
|
+
0.9.10
|
data/git-story-workflow.gemspec
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: git-story-workflow 0.9.
|
2
|
+
# stub: git-story-workflow 0.9.10 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "git-story-workflow".freeze
|
6
|
-
s.version = "0.9.
|
6
|
+
s.version = "0.9.10"
|
7
7
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
9
9
|
s.require_paths = ["lib".freeze]
|
data/lib/git/story/app.rb
CHANGED
@@ -223,24 +223,23 @@ class Git::Story::App
|
|
223
223
|
|
224
224
|
command doc: 'list all production deploy tags'
|
225
225
|
def deploy_tags
|
226
|
-
|
226
|
+
tags.map { |t| tag_name(t) }
|
227
227
|
end
|
228
228
|
|
229
229
|
command doc: 'output the times of all production deploys'
|
230
230
|
def deploys
|
231
|
-
|
231
|
+
tags.map { |t| format_tag(t) }
|
232
232
|
end
|
233
233
|
alias deploy_list deploys
|
234
234
|
|
235
235
|
command doc: 'output the last production deploy tag'
|
236
236
|
def deploy_tags_last
|
237
|
-
|
237
|
+
tag_name(tags.last)
|
238
238
|
end
|
239
239
|
|
240
240
|
command doc: 'output the time of the last production deploy'
|
241
241
|
def deploy_last
|
242
|
-
|
243
|
-
format_tag(tag)
|
242
|
+
format_tag(tags.last)
|
244
243
|
end
|
245
244
|
|
246
245
|
command doc: '[REF] output log of changes since last production deploy tag'
|
@@ -361,12 +360,13 @@ class Git::Story::App
|
|
361
360
|
private
|
362
361
|
|
363
362
|
def default_ref
|
364
|
-
|
363
|
+
tags.last
|
365
364
|
end
|
366
365
|
|
367
366
|
def build_ref_range(ref)
|
368
|
-
|
369
|
-
|
367
|
+
ref = tag_name(ref)
|
368
|
+
if 'previous' == ref and (previous = tags.last(2)).size == 2
|
369
|
+
previous.map { |t| tag_name(t) } * '..'
|
370
370
|
elsif /^(?<before>.+?)?\.\.(?<after>.+)?\z/ =~ ref
|
371
371
|
if before && after
|
372
372
|
"#{before}..#{after}"
|
@@ -383,6 +383,10 @@ class Git::Story::App
|
|
383
383
|
end
|
384
384
|
|
385
385
|
def tags
|
386
|
+
capture(deploy_tag_command).lines.map(&:chomp)
|
387
|
+
end
|
388
|
+
|
389
|
+
def deploy_tag_command
|
386
390
|
fetch_tags
|
387
391
|
if command = complex_config.story.deploy_tag_command?
|
388
392
|
command
|
@@ -519,24 +523,31 @@ class Git::Story::App
|
|
519
523
|
|
520
524
|
def tag_time(tag)
|
521
525
|
case tag
|
522
|
-
when %r(\d{4}/\d{2}/\d{2}\d{2}:\d{2})
|
523
|
-
Time.strptime($&, '%Y/%m/%d%H:%M')
|
524
|
-
when /\d{4}_\d{2}_\d{2}-\d{2}_\d{2}/
|
525
|
-
Time.strptime($&, '%Y_%m_%d-%H_%M')
|
526
|
+
when %r(\A\d{4}/\d{2}/\d{2}\d{2}:\d{2}:\d{2} (\S+))
|
527
|
+
return Time.strptime($&, '%Y/%m/%d%H:%M'), $1
|
528
|
+
when /\d{4}_\d{2}_\d{2}-\d{2}_\d{2}\z/
|
529
|
+
return Time.strptime($&, '%Y_%m_%d-%H_%M'), tag
|
530
|
+
else
|
531
|
+
return nil, tag
|
526
532
|
end
|
527
533
|
end
|
528
534
|
|
535
|
+
def tag_name(tag)
|
536
|
+
tag_time(tag)&.last
|
537
|
+
end
|
538
|
+
|
529
539
|
def format_tag(tag)
|
530
|
-
|
540
|
+
time, tag_name = tag_time(tag)
|
541
|
+
if time
|
531
542
|
day = Time::RFC2822_DAY_NAME[time.wday]
|
532
543
|
"%s %s %s %s" % [
|
533
544
|
time.iso8601.green,
|
534
545
|
day.green,
|
535
|
-
|
546
|
+
tag_name.to_s.yellow,
|
536
547
|
"was #{Tins::Duration.new((Time.now - time).floor)} ago".green,
|
537
548
|
]
|
538
549
|
else
|
539
|
-
|
550
|
+
tag_name
|
540
551
|
end
|
541
552
|
end
|
542
553
|
|
data/lib/git/story/version.rb
CHANGED