story_branch 0.6.0alpha → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rubocop.yml +19 -0
- data/.rubocop.yml +9 -0
- data/.ruby-version +1 -1
- data/Gemfile.lock +1 -1
- data/README.md +1 -0
- data/exe/git-finish +1 -2
- data/lib/story_branch/commands/migrate.rb +3 -0
- data/lib/story_branch/github/project.rb +3 -2
- data/lib/story_branch/main.rb +17 -11
- data/lib/story_branch/pivotal/project.rb +2 -2
- data/lib/story_branch/pivotal/story.rb +1 -1
- data/lib/story_branch/version.rb +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1826485750874314fb2570c93b1330a89f88e36571a84fe63482a33ffbb50d34
|
4
|
+
data.tar.gz: 2914e9113a13b0ab0546485faa0b8acea1906f84b459f54c2d835433891bbb0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: baf40433309c1939869490828cdb7cbd2749ba9cb22f09579e0003f989fecf84ced996bc0ae64a6babc58debc43c601093659a231c1c3ef5a12e31055f9badde
|
7
|
+
data.tar.gz: b24f7b09b8eadee1960cd4a053f6007c23bb46535af08667e5fab08b6bbb15e622664110e05ba2783eacb6e07fe4033d901bd9b0e8d5ab5abd4c71e38fc359d2
|
@@ -0,0 +1,19 @@
|
|
1
|
+
name: Rubocop
|
2
|
+
|
3
|
+
on: [push]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
build:
|
7
|
+
|
8
|
+
runs-on: ubuntu-latest
|
9
|
+
|
10
|
+
steps:
|
11
|
+
- uses: actions/checkout@v1
|
12
|
+
- name: Set up Ruby 2.6
|
13
|
+
uses: actions/setup-ruby@v1
|
14
|
+
with:
|
15
|
+
ruby-version: 2.6.x
|
16
|
+
- name: Rubocop Linter
|
17
|
+
uses: andrewmcodes/rubocop-linter-action@v0.1.2
|
18
|
+
env:
|
19
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
data/.rubocop.yml
ADDED
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.6.1
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
[![Gem Version](https://badge.fury.io/rb/story_branch.png)](http://badge.fury.io/rb/story_branch)
|
2
2
|
[![CircleCI](https://circleci.com/gh/story-branch/story_branch/tree/master.svg?style=svg)](https://circleci.com/gh/story-branch/story_branch/tree/master)
|
3
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/7dbd75908417656853d7/maintainability)](https://codeclimate.com/github/story-branch/story_branch/maintainability)
|
3
4
|
|
4
5
|
# Story Branch
|
5
6
|
|
data/exe/git-finish
CHANGED
@@ -35,12 +35,14 @@ module StoryBranch
|
|
35
35
|
|
36
36
|
def project_id
|
37
37
|
return @project_id if @project_id
|
38
|
+
|
38
39
|
@project_id = old_config_value('project', 'PIVOTAL_PROJECT_ID')
|
39
40
|
@project_id
|
40
41
|
end
|
41
42
|
|
42
43
|
def api_key
|
43
44
|
return @api_key if @api_key
|
45
|
+
|
44
46
|
@api_key = old_config_value('api', 'PIVOTAL_API_KEY')
|
45
47
|
@api_key
|
46
48
|
end
|
@@ -52,6 +54,7 @@ module StoryBranch
|
|
52
54
|
def missing_old_config?
|
53
55
|
OLD_CONFIG_FILES.each { |file| return false if File.exist?(file) }
|
54
56
|
return false if env_set?
|
57
|
+
|
55
58
|
true
|
56
59
|
end
|
57
60
|
|
@@ -12,10 +12,11 @@ module StoryBranch
|
|
12
12
|
|
13
13
|
def stories(options = {})
|
14
14
|
stories = if options[:id]
|
15
|
-
[@repo.issues(options[:id]).get
|
15
|
+
[@repo.issues(options[:id]).get]
|
16
16
|
else
|
17
|
-
@repo.issues.get(params: options)
|
17
|
+
@repo.issues.get(params: options)
|
18
18
|
end
|
19
|
+
|
19
20
|
stories.reject!(&:pull_request)
|
20
21
|
stories.map { |s| Issue.new(s, @repo) }
|
21
22
|
end
|
data/lib/story_branch/main.rb
CHANGED
@@ -9,8 +9,9 @@ require_relative './config_manager'
|
|
9
9
|
require 'tty-prompt'
|
10
10
|
|
11
11
|
module StoryBranch
|
12
|
-
# Main story branch class. It is
|
12
|
+
# Main story branch class. It is responsible for the main interaction between
|
13
13
|
# the user and Pivotal Tracker. It is also responsible for config init.
|
14
|
+
|
14
15
|
# rubocop:disable Metrics/ClassLength
|
15
16
|
class Main
|
16
17
|
attr_accessor :tracker
|
@@ -41,13 +42,11 @@ module StoryBranch
|
|
41
42
|
end
|
42
43
|
|
43
44
|
def story_finish
|
44
|
-
current_story
|
45
|
+
current_story
|
45
46
|
return if unstaged_changes?
|
46
47
|
return if nothing_to_add?
|
47
48
|
|
48
|
-
|
49
|
-
commit_message = "[#{finish_tag} ##{current_story[:id]}] #{current_story[:title]}"
|
50
|
-
# rubocop:enable Metrics/LineLength
|
49
|
+
commit_message = build_finish_message
|
51
50
|
proceed = prompt.yes?("Commit with standard message? #{commit_message}")
|
52
51
|
if proceed
|
53
52
|
GitWrapper.commit commit_message
|
@@ -83,10 +82,14 @@ module StoryBranch
|
|
83
82
|
true
|
84
83
|
end
|
85
84
|
|
86
|
-
def
|
85
|
+
def current_story
|
86
|
+
return @current_story if @current_story
|
87
|
+
|
87
88
|
current_story = GitUtils.current_branch_story_parts
|
88
|
-
|
89
|
-
|
89
|
+
|
90
|
+
unless current_story.empty?
|
91
|
+
@current_story = @tracker.get_story_by_id(current_story[:id])
|
92
|
+
return @current_story if @current_story
|
90
93
|
end
|
91
94
|
|
92
95
|
prompt.error('No tracked feature associated with this branch')
|
@@ -152,9 +155,7 @@ module StoryBranch
|
|
152
155
|
end
|
153
156
|
|
154
157
|
def prompt
|
155
|
-
|
156
|
-
|
157
|
-
@prompt = TTY::Prompt.new(interrupt: :exit)
|
158
|
+
@prompt ||= TTY::Prompt.new(interrupt: :exit)
|
158
159
|
end
|
159
160
|
|
160
161
|
def finish_tag
|
@@ -167,6 +168,11 @@ module StoryBranch
|
|
167
168
|
@finish_tag
|
168
169
|
end
|
169
170
|
|
171
|
+
def build_finish_message
|
172
|
+
message_tag = [finish_tag, "##{current_story.id}"].join(' ').strip
|
173
|
+
"[#{message_tag}] #{current_story.title}"
|
174
|
+
end
|
175
|
+
|
170
176
|
def create_feature_branch(story)
|
171
177
|
return if story.nil?
|
172
178
|
|
@@ -14,9 +14,9 @@ module StoryBranch
|
|
14
14
|
# TODO: add other possible args
|
15
15
|
def stories(options = {}, estimated = true)
|
16
16
|
stories = if options[:id]
|
17
|
-
[@project.stories(options[:id]).get
|
17
|
+
[@project.stories(options[:id]).get]
|
18
18
|
else
|
19
|
-
@project.stories.get(params: options)
|
19
|
+
@project.stories.get(params: options)
|
20
20
|
end
|
21
21
|
stories = stories.map { |s| Story.new(s, @project) }
|
22
22
|
return stories if estimated == false
|
data/lib/story_branch/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: story_branch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rui Baltazar
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: exe
|
14
14
|
cert_chain: []
|
15
|
-
date: 2019-10-
|
15
|
+
date: 2019-10-27 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: blanket_wrapper
|
@@ -261,8 +261,10 @@ files:
|
|
261
261
|
- ".circleci/setup-rubygems.sh"
|
262
262
|
- ".github/ISSUE_TEMPLATE.md"
|
263
263
|
- ".github/PULL_REQUEST_TEMPLATE.md"
|
264
|
+
- ".github/workflows/rubocop.yml"
|
264
265
|
- ".gitignore"
|
265
266
|
- ".rspec"
|
267
|
+
- ".rubocop.yml"
|
266
268
|
- ".ruby-version"
|
267
269
|
- ".story_branch.yml"
|
268
270
|
- Changelog.md
|
@@ -336,9 +338,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
336
338
|
version: '2.7'
|
337
339
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
338
340
|
requirements:
|
339
|
-
- - "
|
341
|
+
- - ">="
|
340
342
|
- !ruby/object:Gem::Version
|
341
|
-
version:
|
343
|
+
version: '0'
|
342
344
|
requirements: []
|
343
345
|
rubygems_version: 3.0.3
|
344
346
|
signing_key:
|