git-story-workflow 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/git-story-workflow.gemspec +3 -3
- data/lib/git/story/app.rb +38 -14
- data/lib/git/story/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 604d9f538483bddd638458e260340f843912626f
|
4
|
+
data.tar.gz: c4f7f61e8f34a2a270de9ef49de90440c67a2e91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca18fef7ef837044280e3c856857d4f7dc5d2196ff486a3d98f673333474d224b342dc6352d01960fa65f0a6ae55417b6c544c817547ac9ef7aeaa3025a5e54f
|
7
|
+
data.tar.gz: a4a5fb4c523a2a6a7eb6a912cbb8fd4134d786a27f4253b566630764a4134564856bb83c264bf38019b5e402d7d44d396a59f916351a9fee76330df67be8fad8
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.7
|
data/git-story-workflow.gemspec
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: git-story-workflow 0.0.
|
2
|
+
# stub: git-story-workflow 0.0.7 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "git-story-workflow".freeze
|
6
|
-
s.version = "0.0.
|
6
|
+
s.version = "0.0.7"
|
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]
|
10
10
|
s.authors = ["Florian Frank".freeze]
|
11
|
-
s.date = "2017-10-
|
11
|
+
s.date = "2017-10-17"
|
12
12
|
s.description = "Gem abstracting a git workflow\u2026".freeze
|
13
13
|
s.email = "flori@ping.de".freeze
|
14
14
|
s.executables = ["git-story".freeze]
|
data/lib/git/story/app.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'time'
|
2
|
+
|
1
3
|
class Git::Story::App
|
2
4
|
class ::String
|
3
5
|
include Term::ANSIColor
|
@@ -18,6 +20,10 @@ class Git::Story::App
|
|
18
20
|
attr_accessor :story_base_name
|
19
21
|
|
20
22
|
attr_accessor :story_id
|
23
|
+
|
24
|
+
attr_accessor :story_created_at
|
25
|
+
|
26
|
+
attr_accessor :story_author
|
21
27
|
end
|
22
28
|
|
23
29
|
def initialize(argv = ARGV, debug: ENV['DEBUG'].to_i == 1)
|
@@ -78,11 +84,21 @@ class Git::Story::App
|
|
78
84
|
end
|
79
85
|
end
|
80
86
|
|
81
|
-
command doc: 'list all stories'
|
82
|
-
def list(mark_red: current(check: false))
|
87
|
+
command doc: '[AUTHOR] list all stories'
|
88
|
+
def list(author = nil, mark_red: current(check: false))
|
83
89
|
stories.map { |b|
|
90
|
+
next if author && !b.story_author.include?(author)
|
84
91
|
(bn = b.story_base_name) == mark_red ? bn.red : bn.green
|
85
|
-
}
|
92
|
+
}.compact
|
93
|
+
end
|
94
|
+
|
95
|
+
command doc: '[AUTHOR] list all stories with details'
|
96
|
+
def list_details(author = nil, mark_red: current(check: false))
|
97
|
+
stories.sort_by { |b| -b.story_created_at.to_f }.map { |b|
|
98
|
+
next if author && !b.story_author.include?(author)
|
99
|
+
name = (bn = b.story_base_name) == mark_red ? bn.red : bn.green
|
100
|
+
"#{name} #{b.story_author} #{b.story_created_at.iso8601.yellow}"
|
101
|
+
}.compact
|
86
102
|
end
|
87
103
|
|
88
104
|
command doc: 'list all production deploy tags'
|
@@ -232,17 +248,25 @@ class Git::Story::App
|
|
232
248
|
|
233
249
|
def stories
|
234
250
|
sh 'git remote prune origin', error: false
|
235
|
-
capture("git
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
251
|
+
refs = capture("git for-each-ref --format='%(refname);%(committerdate);%(authorname) %(authoremail)'")
|
252
|
+
refs = refs.lines.map { |l|
|
253
|
+
r = l.chomp.split(?;)
|
254
|
+
next unless r[0] =~ %r(/origin/)
|
255
|
+
r[0] = File.basename(r[0])
|
256
|
+
next unless r[0] =~ BRANCH_NAME_REGEX
|
257
|
+
r[1] = Time.parse(r[1])
|
258
|
+
r
|
259
|
+
}.compact.map do |r|
|
260
|
+
b = r[0]
|
261
|
+
b =~ BRANCH_NAME_REGEX
|
262
|
+
b.extend StoryAccessors
|
263
|
+
b.story_base_name = r[0]
|
264
|
+
b.story_name = $1
|
265
|
+
b.story_id = $2.to_i
|
266
|
+
b.story_created_at = r[1]
|
267
|
+
b.story_author = r[2]
|
268
|
+
b
|
269
|
+
end
|
246
270
|
end
|
247
271
|
|
248
272
|
def current_branch
|
data/lib/git/story/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git-story-workflow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Frank
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gem_hadar
|