git-story-workflow 0.0.0 → 0.0.1
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 +4 -4
- data/lib/git/story/app.rb +20 -6
- data/lib/git/story/version.rb +1 -1
- data/spec/git/story/{feature_spec.rb → app_spec.rb} +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46807494af7a6be5225943b1039b703e780e17a5
|
4
|
+
data.tar.gz: 5127db01c16bbc1da8eaae977a1daa697a0ad8d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f05b445a33d9259f375c3b092e256f27ef2ee16ec4c634beb580ef0163281536f32223517f7e85937856817e235edfb5fdc82f7fb4ff132052683545a3327510
|
7
|
+
data.tar.gz: 821da3ebd77d2426467121f112eca6e21a9f1d8488b587476c95179aa56891ac7bb35020d2285b68fa26bacbfbaf59058bc91fdff75487be868e9d1348fafa69
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.1
|
data/git-story-workflow.gemspec
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: git-story-workflow 0.0.
|
2
|
+
# stub: git-story-workflow 0.0.1 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.1"
|
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]
|
@@ -13,13 +13,13 @@ Gem::Specification.new do |s|
|
|
13
13
|
s.email = "flori@ping.de".freeze
|
14
14
|
s.executables = ["git-story".freeze]
|
15
15
|
s.extra_rdoc_files = ["README.md".freeze, "lib/git/story.rb".freeze, "lib/git/story/app.rb".freeze, "lib/git/story/setup.rb".freeze, "lib/git/story/utils.rb".freeze, "lib/git/story/version.rb".freeze]
|
16
|
-
s.files = [".gitignore".freeze, "COPYING".freeze, "Gemfile".freeze, "README.md".freeze, "Rakefile".freeze, "VERSION".freeze, "bin/git-story".freeze, "config/story.yml".freeze, "git-story-workflow.gemspec".freeze, "lib/git/story.rb".freeze, "lib/git/story/app.rb".freeze, "lib/git/story/prepare-commit-msg".freeze, "lib/git/story/setup.rb".freeze, "lib/git/story/utils.rb".freeze, "lib/git/story/version.rb".freeze, "spec/git/story/
|
16
|
+
s.files = [".gitignore".freeze, "COPYING".freeze, "Gemfile".freeze, "README.md".freeze, "Rakefile".freeze, "VERSION".freeze, "bin/git-story".freeze, "config/story.yml".freeze, "git-story-workflow.gemspec".freeze, "lib/git/story.rb".freeze, "lib/git/story/app.rb".freeze, "lib/git/story/prepare-commit-msg".freeze, "lib/git/story/setup.rb".freeze, "lib/git/story/utils.rb".freeze, "lib/git/story/version.rb".freeze, "spec/git/story/app_spec.rb".freeze, "spec/spec_helper.rb".freeze]
|
17
17
|
s.homepage = "http://flori.github.com/git-story-workflow".freeze
|
18
18
|
s.licenses = ["Apache-2.0".freeze]
|
19
19
|
s.rdoc_options = ["--title".freeze, "Git-story-workflow".freeze, "--main".freeze, "README.md".freeze]
|
20
20
|
s.rubygems_version = "2.6.13".freeze
|
21
21
|
s.summary = "Gem abstracting a git workflow".freeze
|
22
|
-
s.test_files = ["spec/git/story/
|
22
|
+
s.test_files = ["spec/git/story/app_spec.rb".freeze, "spec/spec_helper.rb".freeze]
|
23
23
|
|
24
24
|
if s.respond_to? :specification_version then
|
25
25
|
s.specification_version = 4
|
data/lib/git/story/app.rb
CHANGED
@@ -30,15 +30,23 @@ class Git::Story::App
|
|
30
30
|
if command_of(@command)
|
31
31
|
puts __send__(@command, *@argv)
|
32
32
|
else
|
33
|
-
|
33
|
+
@command and @command = @command.inspect
|
34
|
+
@command ||= 'n/a'
|
35
|
+
STDERR.puts "Unknown command #{@command}\n\n#{help.join(?\n)}"
|
36
|
+
exit 1
|
34
37
|
end
|
35
38
|
rescue Errno::EPIPE
|
36
39
|
end
|
37
40
|
|
38
41
|
command doc: 'this help'
|
39
42
|
def help
|
43
|
+
result = [ 'Available commands are:' ]
|
40
44
|
longest = command_annotations.keys.map(&:size).max
|
41
|
-
|
45
|
+
result.concat(
|
46
|
+
command_annotations.map { |name, a|
|
47
|
+
"#{name.to_s.ljust(longest)} #{a[:doc]}"
|
48
|
+
}
|
49
|
+
)
|
42
50
|
end
|
43
51
|
|
44
52
|
command doc: 'output the current story branch if it is checked out'
|
@@ -47,16 +55,22 @@ class Git::Story::App
|
|
47
55
|
current_branch
|
48
56
|
end
|
49
57
|
|
50
|
-
def
|
58
|
+
def provide_name(story_id = nil)
|
51
59
|
until story_id.present?
|
52
60
|
story_id = ask(prompt: 'Story id? ').strip
|
53
61
|
end
|
54
62
|
story_id = story_id.gsub(/[^0-9]+/, '')
|
55
|
-
stories
|
56
63
|
@story_id = Integer(story_id)
|
64
|
+
if stories.any? { |s| s.story_id == @story_id }
|
65
|
+
@reason = "story for ##@story_id already created"
|
66
|
+
return
|
67
|
+
end
|
57
68
|
if name = fetch_story_name(@story_id)
|
58
69
|
name = name.downcase.gsub(/[^a-z0-9-]+/, '-').gsub(/(\A-*|[\-0-9]*\z)/, '')
|
59
70
|
[ 'story', name, @story_id ] * ?_
|
71
|
+
else
|
72
|
+
@reason = "name for ##@story_id could not be fetched from tracker"
|
73
|
+
return
|
60
74
|
end
|
61
75
|
end
|
62
76
|
|
@@ -113,8 +127,8 @@ class Git::Story::App
|
|
113
127
|
command doc: '[STORYID] create a story for story STORYID'
|
114
128
|
def create(story_id = nil)
|
115
129
|
sh 'git fetch'
|
116
|
-
name =
|
117
|
-
error "
|
130
|
+
name = provide_name(story_id) or
|
131
|
+
error "Cannot provide a new story name for story ##{story_id}: #{@reason.inspect}"
|
118
132
|
if old_story = stories.find { |s| s.story_id == @story_id }
|
119
133
|
error "story ##{@story_id} already exists in #{old_story}".red
|
120
134
|
end
|
data/lib/git/story/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Frank
|
@@ -136,7 +136,7 @@ files:
|
|
136
136
|
- lib/git/story/setup.rb
|
137
137
|
- lib/git/story/utils.rb
|
138
138
|
- lib/git/story/version.rb
|
139
|
-
- spec/git/story/
|
139
|
+
- spec/git/story/app_spec.rb
|
140
140
|
- spec/spec_helper.rb
|
141
141
|
homepage: http://flori.github.com/git-story-workflow
|
142
142
|
licenses:
|
@@ -167,5 +167,5 @@ signing_key:
|
|
167
167
|
specification_version: 4
|
168
168
|
summary: Gem abstracting a git workflow
|
169
169
|
test_files:
|
170
|
-
- spec/git/story/
|
170
|
+
- spec/git/story/app_spec.rb
|
171
171
|
- spec/spec_helper.rb
|