story_branch 0.3.3 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +19 -25
- data/.github/PULL_REQUEST_TEMPLATE.md +14 -0
- data/.ruby-version +1 -1
- data/Changelog.md +145 -0
- data/Gemfile.lock +36 -37
- data/README.md +2 -0
- data/Roadmap.md +23 -0
- data/lib/story_branch/commands/add.rb +3 -2
- data/lib/story_branch/git_utils.rb +2 -2
- data/lib/story_branch/main.rb +131 -79
- data/lib/story_branch/pivotal_utils.rb +64 -116
- data/lib/story_branch/version.rb +1 -1
- data/story_branch.gemspec +9 -10
- metadata +20 -29
- data/Changelog +0 -341
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46d477c2727de7887ac34b2d2e4a5bb1082db251
|
4
|
+
data.tar.gz: 4e0e0c00d4eb031bd680c39476e880e71fc98adb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b39a085f360679091be09fdacf51d5905ec1f85293ea1f4987c9b3fd4dd2f87a663308182bcd23c9b465fff2c408d7514fc349469b55bebcf9d469518b366123
|
7
|
+
data.tar.gz: c8adc6a6c9c6630ff2868573654898cf0b1e4541bdc108701a4a467bf3df004c9e22eeeeb11ce3b5aa6d7f6dffb863a7d16623da071360e939bc13827b76061e
|
data/.circleci/config.yml
CHANGED
@@ -5,6 +5,22 @@ defaults: &defaults
|
|
5
5
|
- image: circleci/ruby:2.4.1-node-browsers
|
6
6
|
working_directory: ~/repo
|
7
7
|
|
8
|
+
workflows:
|
9
|
+
version: 2
|
10
|
+
test-and-publish:
|
11
|
+
jobs:
|
12
|
+
- test:
|
13
|
+
filters:
|
14
|
+
branches:
|
15
|
+
only: /.*/
|
16
|
+
|
17
|
+
- publish:
|
18
|
+
requires:
|
19
|
+
- test
|
20
|
+
filters:
|
21
|
+
branches:
|
22
|
+
only: master
|
23
|
+
|
8
24
|
jobs:
|
9
25
|
test:
|
10
26
|
<<: *defaults
|
@@ -72,36 +88,14 @@ jobs:
|
|
72
88
|
- run:
|
73
89
|
name: Publish to Rubygems
|
74
90
|
command: |
|
75
|
-
echo "-------- 8< --------"
|
76
|
-
ls ~/.gem/
|
77
|
-
|
78
|
-
cat ~/.gem/credentials
|
79
|
-
echo "-------- >8 --------"
|
80
|
-
|
81
91
|
CURRENT_VERSION=$(ruby -r "./lib/story_branch/version.rb" -e "puts StoryBranch::VERSION")
|
82
92
|
CURRENT_TAG=$(git tag --points-at HEAD)
|
83
93
|
|
84
|
-
if [[ "$CURRENT_TAG" == "$CURRENT_VERSION" ]]; then
|
94
|
+
if [[ "${CURRENT_TAG}" == "${CURRENT_VERSION}" ]]; then
|
85
95
|
gem build story_branch.gemspec
|
86
|
-
gem push
|
96
|
+
gem push "story_branch-${CURRENT_VERSION}.gem"
|
87
97
|
else
|
88
|
-
echo "Not a version
|
98
|
+
echo "Not tagged as a new version - skipping gem push"
|
89
99
|
fi
|
90
100
|
|
91
101
|
shred -u ~/.gem/credentials
|
92
|
-
|
93
|
-
workflows:
|
94
|
-
version: 2
|
95
|
-
test-and-publish:
|
96
|
-
jobs:
|
97
|
-
- test:
|
98
|
-
filters:
|
99
|
-
branches:
|
100
|
-
only: /.*/
|
101
|
-
|
102
|
-
- publish:
|
103
|
-
requires:
|
104
|
-
- test
|
105
|
-
filters:
|
106
|
-
branches:
|
107
|
-
only: master
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# Issue Title
|
2
|
+
|
3
|
+
- Resolving issues caused by that problem
|
4
|
+
|
5
|
+
# Main changes
|
6
|
+
|
7
|
+
- Did this to try to improve that
|
8
|
+
- Did something else for something else
|
9
|
+
|
10
|
+
# Remove from here below if there is nothing to be added to the changelog
|
11
|
+
CHANGELOG
|
12
|
+
- change 1
|
13
|
+
- change 2
|
14
|
+
--- 8< ---
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.5.1
|
data/Changelog.md
ADDED
@@ -0,0 +1,145 @@
|
|
1
|
+
# 0.3.3
|
2
|
+
Tue Jun 26 15:18:37 2018 +0800
|
3
|
+
|
4
|
+
- Deploy to Rubygems via CI/CD - CircleCI
|
5
|
+
|
6
|
+
# 0.3.1
|
7
|
+
Tue Jun 26 15:18:37 2018 +0800
|
8
|
+
|
9
|
+
- Fixed Story branch finish is broken
|
10
|
+
- Update to use Ruby 2.3.0 minimum
|
11
|
+
- Support multiple configurations
|
12
|
+
- Allow configuration of finish keyword
|
13
|
+
- Making use of TTY Prompt to collect input from the user
|
14
|
+
- Cleaned up some code on PivotalUtils to simplify logic
|
15
|
+
- Improved test coverage
|
16
|
+
- Added minimum version to gemspec
|
17
|
+
- Added .ruby-version file with ruby 2.3.1.
|
18
|
+
- Cleanup a lot of the rubocop warnings
|
19
|
+
- Running the commands using TTY::Command
|
20
|
+
- Added Migrate command to upgrade current public version to new version
|
21
|
+
- Updated dependencies
|
22
|
+
- Updated readme for a more comprehensive usage
|
23
|
+
|
24
|
+
# 0.2.13
|
25
|
+
Tue Nov 14 15:12:58 2017 +0800
|
26
|
+
|
27
|
+
- Fix abort on empty config file
|
28
|
+
|
29
|
+
# 0.2.12
|
30
|
+
Wed Jun 8 11:07:06 2016 +0800
|
31
|
+
|
32
|
+
- Remove byebug since it is not in dependency
|
33
|
+
- Load config from different files (home dir or project local)
|
34
|
+
|
35
|
+
# 0.2.9
|
36
|
+
Fri May 15 14:03:00 2015 +0800
|
37
|
+
|
38
|
+
- Fix strip newlines
|
39
|
+
|
40
|
+
# 0.2.8
|
41
|
+
Tue May 12 17:47:22 2015 +0800
|
42
|
+
|
43
|
+
- Removed pivotal-tracker gem dependency,
|
44
|
+
- Using Blanket Wrapper to access Pivotal API
|
45
|
+
|
46
|
+
# 0.2.7
|
47
|
+
Tue Apr 14 18:57:34 2015 +0800
|
48
|
+
|
49
|
+
- Remove deprecated CLI bins
|
50
|
+
|
51
|
+
# 0.2.5
|
52
|
+
Wed Sep 17 11:20:20 2014 +0800
|
53
|
+
|
54
|
+
- Fix error story_branch/issues/15 on git finish
|
55
|
+
- Fix error story_branch/issues/16 newlines in story names
|
56
|
+
- Fix existing branch / story validation
|
57
|
+
- Improve / simplify error messages
|
58
|
+
- Improve name sanitisation
|
59
|
+
- Added story unstart
|
60
|
+
|
61
|
+
# 0.2.4
|
62
|
+
Fri Aug 22 14:27:47 2014 +0800
|
63
|
+
|
64
|
+
- Fixes problem with story finish
|
65
|
+
|
66
|
+
# 0.2.3
|
67
|
+
Thu Aug 21 10:53:21 2014 +0800
|
68
|
+
|
69
|
+
- Fix rb-readline dependency
|
70
|
+
|
71
|
+
# 0.2.3
|
72
|
+
Tue Aug 19 10:35:43 2014 +0800
|
73
|
+
|
74
|
+
- Fix specs and rspec reporter
|
75
|
+
- Use rb-readline
|
76
|
+
- Fix Readline completion, using rb-readline
|
77
|
+
- Add pry for debugging support
|
78
|
+
- Output errors to stderr
|
79
|
+
- Modify completion system, general improvements
|
80
|
+
- Humanize / undash the commit message description (from the branch name)
|
81
|
+
|
82
|
+
# 0.2.2
|
83
|
+
Tue Aug 12 17:43:30 2014 +0800
|
84
|
+
|
85
|
+
- Add start and finish stories.
|
86
|
+
- Fix path in symlinks
|
87
|
+
|
88
|
+
# 0.1.8
|
89
|
+
Tue Jun 24 11:09:32 2014 +0800
|
90
|
+
|
91
|
+
- Remove constraint to master as feature parent.
|
92
|
+
- Add aliases for story_branch executable
|
93
|
+
|
94
|
+
# 0.1.5
|
95
|
+
Mon May 26 10:34:12 2014 +0800
|
96
|
+
|
97
|
+
- tidy up output and add LICENCE
|
98
|
+
|
99
|
+
# 0.1.4
|
100
|
+
Thu May 15 09:58:03 2014 +0800
|
101
|
+
|
102
|
+
- Update name generation / translation rules
|
103
|
+
- Squeeze multiple dashes in suggested branch name
|
104
|
+
- Remove logging
|
105
|
+
- Ignore .pairs
|
106
|
+
|
107
|
+
# 0.1.1
|
108
|
+
Mon Apr 21 11:44:22 2014 +0800
|
109
|
+
|
110
|
+
- Updated code to require gem instead of relative paths
|
111
|
+
- Finishes #4 test definition
|
112
|
+
- Clear test files for tests specifications
|
113
|
+
- Searches for existing file or environment set variable. Existing file overrides the env var
|
114
|
+
- Raise PIVOTAL_API_KEY exception if api key not found in env. added method to check if object is set with api_key and project_id
|
115
|
+
|
116
|
+
# 0.0.1
|
117
|
+
Sat Apr 19 00:24:41 2014 +0800
|
118
|
+
|
119
|
+
- Add usage info (draft) to file header
|
120
|
+
- Add simple_sanitize method to remove common punctuation from story
|
121
|
+
names / existing branch names
|
122
|
+
- Remove arbitrary 50 char limit on branch names
|
123
|
+
- Convert to a command utility gem + refactoring into a class
|
124
|
+
- Removed levenshtein dependency. added ruby min version
|
125
|
+
|
126
|
+
|
127
|
+
# 0.0.0
|
128
|
+
Sat Jan 25 19:04:01 2014 +0800
|
129
|
+
|
130
|
+
- Look for pivotal project id (.pivotal-id) in repo root (we assume
|
131
|
+
we're in project root.) (we do this and fallback to checking
|
132
|
+
environment var)
|
133
|
+
- Added Levenshtein Distance checking to branch names, to avoid names
|
134
|
+
which are too close together (and straight-up duplicates)
|
135
|
+
- Added read-line support and re-factored
|
136
|
+
- Read-line support (to use instead of gets)
|
137
|
+
- Allow injection of history into read-line invocations
|
138
|
+
- Injected selection numbers into story selection read-line history
|
139
|
+
- Dashed / down-cased story name as a suggestion for the new feature
|
140
|
+
branch name
|
141
|
+
- Injected dash/down-cased story name into new feature branch name
|
142
|
+
read-line history (move up to get it)
|
143
|
+
- Fix error testing PIVOTAL_PROJECT_ID
|
144
|
+
- Rename ptrak to story_branch
|
145
|
+
- Basic version passing
|
data/Gemfile.lock
CHANGED
@@ -1,17 +1,16 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
story_branch (0.
|
4
|
+
story_branch (0.4.0)
|
5
5
|
blanket_wrapper (~> 3.0)
|
6
6
|
git (~> 1.2)
|
7
7
|
levenshtein-ffi (~> 1.0)
|
8
8
|
pastel (~> 0.7.2)
|
9
|
-
rb-readline (~> 0.5)
|
10
9
|
thor (~> 0.20.0)
|
11
|
-
tty-command (~> 0.8.
|
10
|
+
tty-command (~> 0.8.2)
|
12
11
|
tty-config (~> 0.2.0)
|
13
12
|
tty-pager (~> 0.11.0)
|
14
|
-
tty-prompt (~> 0.
|
13
|
+
tty-prompt (~> 0.17.1)
|
15
14
|
|
16
15
|
GEM
|
17
16
|
remote: https://rubygems.org/
|
@@ -21,10 +20,9 @@ GEM
|
|
21
20
|
recursive-open-struct
|
22
21
|
diff-lcs (1.3)
|
23
22
|
equatable (0.5.0)
|
24
|
-
fakefs (0.
|
23
|
+
fakefs (0.18.0)
|
25
24
|
ffi (1.9.25)
|
26
|
-
git (1.
|
27
|
-
hitimes (1.3.0)
|
25
|
+
git (1.5.0)
|
28
26
|
httparty (0.16.2)
|
29
27
|
multi_xml (>= 0.5.2)
|
30
28
|
levenshtein-ffi (1.1.0)
|
@@ -34,51 +32,52 @@ GEM
|
|
34
32
|
pastel (0.7.2)
|
35
33
|
equatable (~> 0.5.0)
|
36
34
|
tty-color (~> 0.4.0)
|
37
|
-
rake (10.
|
38
|
-
rb-readline (0.5.5)
|
35
|
+
rake (10.5.0)
|
39
36
|
recursive-open-struct (1.1.0)
|
40
|
-
rspec (3.
|
41
|
-
rspec-core (~> 3.
|
42
|
-
rspec-expectations (~> 3.
|
43
|
-
rspec-mocks (~> 3.
|
44
|
-
rspec-core (3.0
|
45
|
-
rspec-support (~> 3.
|
46
|
-
rspec-expectations (3.
|
37
|
+
rspec (3.8.0)
|
38
|
+
rspec-core (~> 3.8.0)
|
39
|
+
rspec-expectations (~> 3.8.0)
|
40
|
+
rspec-mocks (~> 3.8.0)
|
41
|
+
rspec-core (3.8.0)
|
42
|
+
rspec-support (~> 3.8.0)
|
43
|
+
rspec-expectations (3.8.2)
|
47
44
|
diff-lcs (>= 1.2.0, < 2.0)
|
48
|
-
rspec-support (~> 3.
|
49
|
-
rspec-mocks (3.0
|
50
|
-
|
51
|
-
|
45
|
+
rspec-support (~> 3.8.0)
|
46
|
+
rspec-mocks (3.8.0)
|
47
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
48
|
+
rspec-support (~> 3.8.0)
|
49
|
+
rspec-support (3.8.0)
|
52
50
|
rspec_junit_formatter (0.4.1)
|
53
51
|
rspec-core (>= 2, < 4, != 2.12.0)
|
54
|
-
strings (0.1.
|
55
|
-
|
52
|
+
strings (0.1.4)
|
53
|
+
strings-ansi (~> 0.1.0)
|
54
|
+
unicode-display_width (~> 1.4.0)
|
56
55
|
unicode_utils (~> 1.4.0)
|
56
|
+
strings-ansi (0.1.0)
|
57
57
|
thor (0.20.0)
|
58
|
-
timers (4.
|
59
|
-
|
60
|
-
tty-
|
61
|
-
tty-command (0.8.1)
|
58
|
+
timers (4.2.0)
|
59
|
+
tty-color (0.4.3)
|
60
|
+
tty-command (0.8.2)
|
62
61
|
pastel (~> 0.7.0)
|
63
62
|
tty-config (0.2.0)
|
64
|
-
tty-cursor (0.
|
63
|
+
tty-cursor (0.6.0)
|
65
64
|
tty-pager (0.11.0)
|
66
65
|
strings (~> 0.1.0)
|
67
66
|
tty-screen (~> 0.6.4)
|
68
67
|
tty-which (~> 0.3.0)
|
69
|
-
tty-prompt (0.
|
68
|
+
tty-prompt (0.17.2)
|
70
69
|
necromancer (~> 0.4.0)
|
71
70
|
pastel (~> 0.7.0)
|
72
71
|
timers (~> 4.0)
|
73
|
-
tty-cursor (~> 0.
|
74
|
-
tty-reader (~> 0.
|
75
|
-
tty-reader (0.
|
76
|
-
tty-cursor (~> 0.
|
72
|
+
tty-cursor (~> 0.6.0)
|
73
|
+
tty-reader (~> 0.4.0)
|
74
|
+
tty-reader (0.4.0)
|
75
|
+
tty-cursor (~> 0.6.0)
|
77
76
|
tty-screen (~> 0.6.4)
|
78
77
|
wisper (~> 2.0.0)
|
79
|
-
tty-screen (0.6.
|
78
|
+
tty-screen (0.6.5)
|
80
79
|
tty-which (0.3.0)
|
81
|
-
unicode-display_width (1.
|
80
|
+
unicode-display_width (1.4.0)
|
82
81
|
unicode_utils (1.4.0)
|
83
82
|
wisper (2.0.0)
|
84
83
|
|
@@ -89,9 +88,9 @@ DEPENDENCIES
|
|
89
88
|
bundler (~> 1.16)
|
90
89
|
fakefs (~> 0.14)
|
91
90
|
rake (~> 10.0)
|
92
|
-
rspec (~> 3
|
93
|
-
rspec_junit_formatter
|
91
|
+
rspec (~> 3)
|
92
|
+
rspec_junit_formatter (~> 0.4)
|
94
93
|
story_branch!
|
95
94
|
|
96
95
|
BUNDLED WITH
|
97
|
-
1.
|
96
|
+
1.17.1
|
data/README.md
CHANGED
@@ -8,6 +8,8 @@ at the moment. It allows you to start and un-start stories as well as creating
|
|
8
8
|
branches based on the story name and id and have a final commit message marking
|
9
9
|
the story as Finished.
|
10
10
|
|
11
|
+
[View Changelog](Changelog.md)
|
12
|
+
|
11
13
|
## Installing
|
12
14
|
|
13
15
|
Install the gem:
|
data/Roadmap.md
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# Architecture view
|
2
|
+
|
3
|
+
::Main
|
4
|
+
- Read config
|
5
|
+
- Initialize utils to use
|
6
|
+
- Provide interface for opening/closing/config the gem
|
7
|
+
|
8
|
+
::ConfigManager
|
9
|
+
- load configuration files and have methods to fetch project id, api key and
|
10
|
+
finish tag according to the needs
|
11
|
+
|
12
|
+
::PivotalUtils
|
13
|
+
- Wrap PivotalTracker API
|
14
|
+
- Get Story List
|
15
|
+
- ...
|
16
|
+
|
17
|
+
::GithubUtils
|
18
|
+
- Wrap Github API
|
19
|
+
- Get Issue List
|
20
|
+
- Integrate with Project workflow (?)
|
21
|
+
|
22
|
+
::OtherTrackers
|
23
|
+
- Provide interface for extending to other trackers
|
@@ -15,7 +15,7 @@ module StoryBranch
|
|
15
15
|
class Add < StoryBranch::Command
|
16
16
|
def initialize(options)
|
17
17
|
@options = options
|
18
|
-
@config = ConfigManager.init_config(
|
18
|
+
@config = ConfigManager.init_config(Dir.home)
|
19
19
|
@local_config = ConfigManager.init_config('.')
|
20
20
|
end
|
21
21
|
|
@@ -28,7 +28,7 @@ module StoryBranch
|
|
28
28
|
private
|
29
29
|
|
30
30
|
def create_local_config
|
31
|
-
@local_config.
|
31
|
+
@local_config.append(project_id, to: :project_id)
|
32
32
|
@local_config.write(force: true)
|
33
33
|
end
|
34
34
|
|
@@ -40,6 +40,7 @@ module StoryBranch
|
|
40
40
|
|
41
41
|
def project_id
|
42
42
|
return @project_id if @project_id
|
43
|
+
|
43
44
|
@project_id = prompt.ask "Please provide this project's id:"
|
44
45
|
@project_id
|
45
46
|
end
|
@@ -22,7 +22,7 @@ module StoryBranch
|
|
22
22
|
false
|
23
23
|
end
|
24
24
|
|
25
|
-
def self.
|
25
|
+
def self.branch_for_story_exists?(id)
|
26
26
|
branch_names.each do |n|
|
27
27
|
branch_id = n.match(/-[1-9][0-9]+$/)
|
28
28
|
next unless branch_id
|
@@ -45,7 +45,7 @@ module StoryBranch
|
|
45
45
|
|
46
46
|
def self.current_branch_story_parts
|
47
47
|
matches = current_story
|
48
|
-
return unless matches.length == 3
|
48
|
+
return {} unless matches.length == 3
|
49
49
|
{ title: matches[1], id: matches[2].to_i }
|
50
50
|
end
|
51
51
|
|