git-commit-story 0.1.5 → 0.1.6
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 +7 -0
- data/Gemfile.lock +4 -1
- data/git-commit-story.gemspec +1 -1
- data/lib/git-commit-story.rb +10 -2
- data/spec/lib/git-commit-story_spec.rb +18 -7
- metadata +13 -19
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: d303aa1c12ecd6c47e0456c40aef691b26d7ca06
|
4
|
+
data.tar.gz: 7797d219b55a4663f83f5d8aabf3df67036fed5c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 1b00fd9c9be2df7ea955ade59d277b835b92737fa04aea689e9033e8d0d86f1dfa2bfbe21aae25d44fd0ab28767c41049194b6a8c6030173535a52765a797b48
|
7
|
+
data.tar.gz: ba6f9a7a0f25536f3bfcbe6462b1769e7d881f1d4956741190f316580656e938deb041bf22d7c1b2f677439a163feff6c3718f92bb635358533f47526399df33
|
data/Gemfile.lock
CHANGED
data/git-commit-story.gemspec
CHANGED
@@ -2,7 +2,7 @@ Gem::Specification.new do |s|
|
|
2
2
|
s.name = "git-commit-story"
|
3
3
|
s.executables << "git-commit-story"
|
4
4
|
s.executables << "git-cs"
|
5
|
-
s.version = "0.1.
|
5
|
+
s.version = "0.1.6"
|
6
6
|
s.date = "2013-05-11"
|
7
7
|
s.summary = "StreamSend git commit wrapper"
|
8
8
|
s.description = "Thin wrapper around git commit that adds a story id to commit messages"
|
data/lib/git-commit-story.rb
CHANGED
@@ -25,7 +25,7 @@ class GitCommitStory
|
|
25
25
|
|
26
26
|
def story_id
|
27
27
|
if @options[:story_id]
|
28
|
-
@options[:story_id]
|
28
|
+
strip_leading_pound @options[:story_id]
|
29
29
|
else
|
30
30
|
prompt = if @options[:previous_story_id]
|
31
31
|
"Enter a story [#{@options[:previous_story_id]}]: "
|
@@ -42,11 +42,19 @@ class GitCommitStory
|
|
42
42
|
abort
|
43
43
|
end
|
44
44
|
else
|
45
|
-
@options[:story_id] = response
|
45
|
+
@options[:story_id] = strip_leading_pound response
|
46
46
|
end
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
|
+
def strip_leading_pound(string)
|
51
|
+
if string[0] == "#"
|
52
|
+
string[1..-1]
|
53
|
+
else
|
54
|
+
string
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
50
58
|
def final_commit_message
|
51
59
|
message = ""
|
52
60
|
if options[:commit_message]
|
@@ -3,6 +3,7 @@ require "yaml"
|
|
3
3
|
|
4
4
|
describe GitCommitStory do
|
5
5
|
let(:config_file_name) { ".git-commit-story.yml" }
|
6
|
+
let(:git_commit_story) { GitCommitStory.new({}) }
|
6
7
|
|
7
8
|
before do
|
8
9
|
YAML.stub(:load_file).with(config_file_name).and_return({})
|
@@ -25,16 +26,14 @@ describe GitCommitStory do
|
|
25
26
|
it "prompts for a story" do
|
26
27
|
$stdout.should_receive(:print).with("Enter a story: ")
|
27
28
|
$stdin.should_receive(:gets).and_return("story")
|
28
|
-
|
29
|
-
gcs.story_id
|
29
|
+
git_commit_story.story_id
|
30
30
|
end
|
31
31
|
|
32
32
|
it "saves the new story id to options" do
|
33
33
|
new_story_id = "my new story"
|
34
34
|
$stdin.stub(:gets).and_return("#{new_story_id}\n")
|
35
|
-
|
36
|
-
|
37
|
-
gcs.options[:story_id].should == new_story_id
|
35
|
+
git_commit_story.story_id
|
36
|
+
git_commit_story.options[:story_id].should == new_story_id
|
38
37
|
end
|
39
38
|
|
40
39
|
it "includes a saved story id in the prompt" do
|
@@ -53,12 +52,24 @@ describe GitCommitStory do
|
|
53
52
|
gcs.story_id
|
54
53
|
gcs.options[:story_id].should == new_story_id
|
55
54
|
end
|
55
|
+
|
56
|
+
it "removes any leading #" do
|
57
|
+
$stdout.stub(:print).with("Enter a story: ")
|
58
|
+
$stdin.stub(:gets).and_return("#story")
|
59
|
+
gcs = GitCommitStory.new({})
|
60
|
+
gcs.story_id.should == "story"
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
describe "#strip_leading_pound" do
|
65
|
+
it "removes leading pounds" do
|
66
|
+
git_commit_story.strip_leading_pound("#foo").should == "foo"
|
67
|
+
end
|
56
68
|
end
|
57
69
|
|
58
70
|
it "reads .git-commit-story.yml if one exists" do
|
59
71
|
YAML.should_receive(:load_file).with(config_file_name).and_return({foo: "bar"})
|
60
|
-
|
61
|
-
gcs.options[:foo].should == "bar"
|
72
|
+
git_commit_story.options[:foo].should == "bar"
|
62
73
|
end
|
63
74
|
|
64
75
|
it "overrides config file options with passed options" do
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git-commit-story
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
5
|
-
prerelease:
|
4
|
+
version: 0.1.6
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Jeff Roush
|
@@ -14,33 +13,29 @@ dependencies:
|
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rspec
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :development
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: watchr
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - ">="
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '0'
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - ">="
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '0'
|
46
41
|
description: Thin wrapper around git commit that adds a story id to commit messages
|
@@ -51,9 +46,9 @@ executables:
|
|
51
46
|
extensions: []
|
52
47
|
extra_rdoc_files: []
|
53
48
|
files:
|
54
|
-
- .gitignore
|
55
|
-
- .rspec
|
56
|
-
- .rvmrc
|
49
|
+
- ".gitignore"
|
50
|
+
- ".rspec"
|
51
|
+
- ".rvmrc"
|
57
52
|
- Gemfile
|
58
53
|
- Gemfile.lock
|
59
54
|
- README.md
|
@@ -65,26 +60,25 @@ files:
|
|
65
60
|
- spec_watchr.rb
|
66
61
|
homepage: https://github.com/Jeff-R/git-commit-story
|
67
62
|
licenses: []
|
63
|
+
metadata: {}
|
68
64
|
post_install_message:
|
69
65
|
rdoc_options: []
|
70
66
|
require_paths:
|
71
67
|
- lib
|
72
68
|
required_ruby_version: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
69
|
requirements:
|
75
|
-
- -
|
70
|
+
- - ">="
|
76
71
|
- !ruby/object:Gem::Version
|
77
72
|
version: '0'
|
78
73
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
79
|
-
none: false
|
80
74
|
requirements:
|
81
|
-
- -
|
75
|
+
- - ">="
|
82
76
|
- !ruby/object:Gem::Version
|
83
77
|
version: '0'
|
84
78
|
requirements: []
|
85
79
|
rubyforge_project:
|
86
|
-
rubygems_version:
|
80
|
+
rubygems_version: 2.4.8
|
87
81
|
signing_key:
|
88
|
-
specification_version:
|
82
|
+
specification_version: 4
|
89
83
|
summary: StreamSend git commit wrapper
|
90
84
|
test_files: []
|