pivo_flow 0.7.1 → 0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: bc58c87f0cb7c6e04e4b648d255976a24e4e6dd3
4
- data.tar.gz: a735b46f5c33d07117f56d9db687839a5697a115
2
+ SHA256:
3
+ metadata.gz: 5f7dcca49848718602868e48648001b3e2a6f2757c6e9df5f4d25d51fd1a9956
4
+ data.tar.gz: df0d347dd0a6a4e88c1c0bd04400eddf245b531a41e195fb898362ab7f7b9c3e
5
5
  SHA512:
6
- metadata.gz: e959b3fc862acefde0f48989975f3754267f9df8819235553bc4f82336b87e9e07b6f82b13235331b3a1d3906fb056ec3cffb6c7c5cd1cbda52a8c2307518e14
7
- data.tar.gz: 8df4ef1b15af10b7023d540271a9a457d224de7d721bc4bebf8f889612b680246e54fbc29c7764f76d488ebcc82c8b6dd943e21a89852c0c25ff70bf5207a31d
6
+ metadata.gz: 9ab6bb9670e58dc28f713f1c56811a04bdecfccf1d0dbefa9b1aaa1da7d77973e4383c3b6d60052f3ddf6cc6eb5f2123a586579f151684c62d04509ffb4fae3f
7
+ data.tar.gz: e04ed5b10700124753a57812396096a3469be2011015808af09518c1ff9da7046bd4464654d343c19c9213000b4797a3f77d524d2166dae8a08311e3d11aa501
@@ -3,7 +3,15 @@ version: 2
3
3
  .build_template: &build_definition
4
4
  steps:
5
5
  - checkout
6
- - run: bundle install
6
+ - restore_cache:
7
+ keys:
8
+ - v2-pivo-flow-bundle-{{ .Environment.CIRCLE_JOB }}-{{ checksum "pivo_flow.gemspec" }}
9
+ - v2-pivo-flow-bundle-{{ .Environment.CIRCLE_JOB }}-
10
+ - run: bundle check || bundle install
11
+ - save_cache:
12
+ key: v2-pivo-flow-bundle-{{ .Environment.CIRCLE_JOB }}-{{ checksum "pivo_flow.gemspec" }}
13
+ paths:
14
+ - /usr/local/bundle
7
15
  - run: bundle exec rspec --require spec_helper --format documentation --color spec
8
16
  working_directory: ~/app
9
17
 
@@ -2,6 +2,12 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ # 0.8 - 2018-12-29
6
+
7
+ ## Fixed
8
+
9
+ * [Fix branches that have slashes in them](https://github.com/lubieniebieski/pivo_flow/pull/28)
10
+
5
11
  # 0.7 - 2017-10-06
6
12
 
7
13
  Thanks [David Balatero](https://github.com/dbalatero) for your help with this
@@ -1,6 +1,6 @@
1
1
  module PivoFlow
2
2
  module State
3
- extend self
3
+ module_function
4
4
 
5
5
  def current_branch_name
6
6
  Grit::Repo.new(Dir.pwd).head.name
@@ -11,7 +11,9 @@ module PivoFlow
11
11
  end
12
12
 
13
13
  def current_story_id_file_path
14
- File.join(story_id_tmp_path, current_branch_name)
14
+ flat_branch_name = current_branch_name.gsub('/', '--')
15
+
16
+ File.join(story_id_tmp_path, flat_branch_name)
15
17
  end
16
18
 
17
19
  def current_story_id
@@ -1,3 +1,3 @@
1
1
  module PivoFlow
2
- VERSION = '0.7.1'
2
+ VERSION = '0.8'
3
3
  end
@@ -1,36 +1,46 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe PivoFlow::State do
4
- describe "#current_story_id_file_path" do
5
- before do
6
- allow(PivoFlow::State).to receive(:current_branch_name) { "cool-branch" }
7
- end
4
+ describe '#current_story_id_file_path' do
5
+ it 'should return a path to a branch-based file name' do
6
+ with_branch_name 'cool-branch'
8
7
 
9
- it "should return a path to a branch-based file name" do
10
8
  expect(PivoFlow::State.current_story_id_file_path).to eq(
11
9
  "#{Dir.pwd}/tmp/.pivo_flow/stories/cool-branch"
12
10
  )
13
11
  end
12
+
13
+ it 'should deal with slashes in the branch name' do
14
+ with_branch_name 'feature/my-cool-feature/a-thing'
15
+
16
+ expect(PivoFlow::State.current_story_id_file_path).to eq(
17
+ "#{Dir.pwd}/tmp/.pivo_flow/stories/feature--my-cool-feature--a-thing"
18
+ )
19
+ end
20
+
21
+ def with_branch_name(name)
22
+ allow(PivoFlow::State).to receive(:current_branch_name) { name }
23
+ end
14
24
  end
15
25
 
16
- describe "#current_story_id" do
26
+ describe '#current_story_id' do
17
27
  let(:tmp_file) { "#{Dir.pwd}/tmp/.pivo_flow/stories/cool-branch" }
18
28
 
19
29
  before do
20
- allow(PivoFlow::State).to receive(:current_branch_name) { "cool-branch" }
30
+ allow(PivoFlow::State).to receive(:current_branch_name) { 'cool-branch' }
21
31
 
22
32
  FileUtils.mkdir_p(PivoFlow::State.story_id_tmp_path)
23
- File.write(tmp_file, "123456")
33
+ File.write(tmp_file, '123456')
24
34
  end
25
35
 
26
36
  after { FileUtils.remove_file(tmp_file) }
27
37
 
28
- it "should read it from the tmp file" do
29
- expect(PivoFlow::State.current_story_id).to eq("123456")
38
+ it 'should read it from the tmp file' do
39
+ expect(PivoFlow::State.current_story_id).to eq('123456')
30
40
  end
31
41
 
32
42
  it "should return nil if there's no file for it yet" do
33
- allow(PivoFlow::State).to receive(:current_branch_name) { "different" }
43
+ allow(PivoFlow::State).to receive(:current_branch_name) { 'different' }
34
44
 
35
45
  expect(PivoFlow::State.current_story_id).to be_nil
36
46
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pivo_flow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: '0.8'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Nowak
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-01 00:00:00.000000000 Z
11
+ date: 2018-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pivotal-tracker
@@ -177,7 +177,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
177
177
  version: '0'
178
178
  requirements: []
179
179
  rubyforge_project:
180
- rubygems_version: 2.6.11
180
+ rubygems_version: 2.7.3
181
181
  signing_key:
182
182
  specification_version: 4
183
183
  summary: Simple pivotal tracker integration for day to day work with git