story_express 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: afb91bc21dabda3ad9e28a05007df2538dc205c8
4
+ data.tar.gz: 3efa6b3fa545563c64935738218675cc3e7f0e0f
5
+ SHA512:
6
+ metadata.gz: d2ec5ad43f7c2ca400294485ef00e5e55c413a682bca71ec9591a5c74587e19b737b48547e7427bf5cfc8f9971b4fcd8013288cc12baf7b66526dcb0c5011e37
7
+ data.tar.gz: 0572db05d7769e3fdb8c578755785f57ce9a2fbf05e1c0baf582cc0b1221a09691b4b9656ffd05a3069ef9ad6c4cb324c5792b99bf6a0b7b45759d14b73e6488
data/.gitignore ADDED
@@ -0,0 +1,15 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
15
+ .idea
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.travis.yml ADDED
@@ -0,0 +1,3 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1.5
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in story_express.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Shelby Doolittle
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # StoryExpress
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'story_express'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install story_express
20
+
21
+ ## Usage
22
+
23
+ TODO: Write usage instructions here
24
+
25
+ ## Contributing
26
+
27
+ 1. Fork it ( https://github.com/[my-github-username]/story_express/fork )
28
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
29
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
30
+ 4. Push to the branch (`git push origin my-new-feature`)
31
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,7 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
7
+
data/bin/story_express ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'story_express'
4
+ require 'pivotal-tracker'
5
+
6
+ PivotalTracker::Client.token = ENV['TRACKER_TOKEN']
7
+ PivotalTracker::Client.use_ssl = true
8
+
9
+ StoryExpress.deliver
@@ -0,0 +1,7 @@
1
+ module StoryExpress
2
+ module GitReader
3
+ def self.grep_log(string)
4
+ `git log --grep '#{string}'`
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,10 @@
1
+ module StoryExpress
2
+ class Rider
3
+ def deliver(stories)
4
+ stories.each do |story|
5
+ story.notes.create text: 'Delivered by (Story Express)[https://github.com/shelbyd/story_express].'
6
+ story.update 'current_state' => 'delivered'
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,13 @@
1
+ require 'pivotal-tracker'
2
+
3
+ module StoryExpress
4
+ class StoryFinder
5
+ def self.deliverables
6
+ project = PivotalTracker::Project.find(ENV['TRACKER_PROJECT_ID'])
7
+ stories = project.stories.all(state: 'finished', story_type: ['bug', 'feature'])
8
+ stories.select do |story|
9
+ GitReader.grep_log("finishes ##{story.id}").length > 0
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,3 @@
1
+ module StoryExpress
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,10 @@
1
+ require 'story_express/version'
2
+ require 'story_express/rider'
3
+ require 'story_express/story_finder'
4
+ require 'story_express/git_reader'
5
+
6
+ module StoryExpress
7
+ def self.deliver
8
+ Rider.new.deliver StoryFinder.deliverables
9
+ end
10
+ end
@@ -0,0 +1,11 @@
1
+ git co . &&
2
+ git pull -r &&
3
+ bundle exec rake &&
4
+ sed -i "s/VERSION.*/VERSION = \"$1\"/g" ./lib/story_express/version.rb &&
5
+ git ci -am "version $1" &&
6
+ git tag $1 &&
7
+ git push &&
8
+ git push origin $1 &&
9
+ rm *.gem &&
10
+ gem build story_express.gemspec &&
11
+ gem push "story_express-$1.gem"
@@ -0,0 +1,2 @@
1
+ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
2
+ require 'story_express'
@@ -0,0 +1,29 @@
1
+ require 'spec_helper'
2
+
3
+ describe StoryExpress::Rider do
4
+ describe '#deliver' do
5
+ let(:stories) do
6
+ [
7
+ spy(:story_1, notes: spy(:story_1_notes)),
8
+ spy(:story_2, notes: spy(:story_2_notes)),
9
+ spy(:story_3, notes: spy(:story_3_notes)),
10
+ ]
11
+ end
12
+
13
+ it 'updates each story to delivered' do
14
+ subject.deliver stories
15
+
16
+ stories.each do |story|
17
+ expect(story).to have_received(:update).with({'current_state' => 'delivered'})
18
+ end
19
+ end
20
+
21
+ it 'adds a note that each story was delivered by Story Express' do
22
+ subject.deliver stories
23
+
24
+ stories.each do |story|
25
+ expect(story.notes).to have_received(:create).with(text: 'Delivered by (Story Express)[https://github.com/shelbyd/story_express].')
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,18 @@
1
+ require 'spec_helper'
2
+
3
+ describe StoryExpress::StoryFinder do
4
+ describe '.deliverables' do
5
+ let(:project) { double(:project, stories: double(:stories)) }
6
+ let(:finished_marked_story) { double(:finished_marked_story, id: 'finished_marked_story') }
7
+ let(:finished_unmarked_story) { double(:finished_unmarked_story, id: 'finished_unmarked_story') }
8
+
9
+ it 'returns finished stories that have been marked finished' do
10
+ allow(PivotalTracker::Project).to receive(:find).with(ENV['TRACKER_PROJECT_ID']).and_return(project)
11
+ allow(project.stories).to receive(:all).with(state: 'finished', story_type: ['bug', 'feature']).and_return([finished_marked_story, finished_unmarked_story])
12
+ allow(StoryExpress::GitReader).to receive(:grep_log).with('finishes #finished_marked_story').and_return('[finishes #finished_marked_story]')
13
+ allow(StoryExpress::GitReader).to receive(:grep_log).with('finishes #finished_unmarked_story').and_return('')
14
+
15
+ expect(StoryExpress::StoryFinder.deliverables).to eq [finished_marked_story]
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,20 @@
1
+ require 'spec_helper'
2
+
3
+ describe StoryExpress do
4
+ it 'has a version number' do
5
+ expect(StoryExpress::VERSION).not_to be nil
6
+ end
7
+
8
+ describe '.deliver' do
9
+ it 'delivers all the finished stories' do
10
+ rider = spy(StoryExpress::Rider)
11
+ allow(StoryExpress::Rider).to receive(:new).and_return(rider)
12
+ stories_to_deliver = [double(:story)]
13
+ allow(StoryExpress::StoryFinder).to receive(:deliverables).and_return(stories_to_deliver)
14
+
15
+ StoryExpress.deliver
16
+
17
+ expect(rider).to have_received(:deliver).with(stories_to_deliver)
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'story_express/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "story_express"
8
+ spec.version = StoryExpress::VERSION
9
+ spec.authors = ["Shelby Doolittle"]
10
+ spec.email = ["shelby@shelbyd.com"]
11
+ spec.summary = %q{Story Express delivers your stories to your PM.}
12
+ spec.description = %q{Run story express at the end of your build to automatically deliver all the stories that passed the build.}
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_dependency "pivotal-tracker", "~> 0.5"
22
+
23
+ spec.add_development_dependency "bundler", "~> 1.7"
24
+ spec.add_development_dependency "rake", "~> 10.0"
25
+ spec.add_development_dependency "rspec", "~> 3.1"
26
+ end
metadata ADDED
@@ -0,0 +1,125 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: story_express
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Shelby Doolittle
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-02-03 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: pivotal-tracker
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.5'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.5'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.7'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.7'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.1'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.1'
69
+ description: Run story express at the end of your build to automatically deliver all
70
+ the stories that passed the build.
71
+ email:
72
+ - shelby@shelbyd.com
73
+ executables:
74
+ - story_express
75
+ extensions: []
76
+ extra_rdoc_files: []
77
+ files:
78
+ - ".gitignore"
79
+ - ".rspec"
80
+ - ".travis.yml"
81
+ - Gemfile
82
+ - LICENSE.txt
83
+ - README.md
84
+ - Rakefile
85
+ - bin/story_express
86
+ - lib/story_express.rb
87
+ - lib/story_express/git_reader.rb
88
+ - lib/story_express/rider.rb
89
+ - lib/story_express/story_finder.rb
90
+ - lib/story_express/version.rb
91
+ - scripts/release_version.sh
92
+ - spec/spec_helper.rb
93
+ - spec/story_express/rider_spec.rb
94
+ - spec/story_express/story_finder_spec.rb
95
+ - spec/story_express_spec.rb
96
+ - story_express.gemspec
97
+ homepage: ''
98
+ licenses:
99
+ - MIT
100
+ metadata: {}
101
+ post_install_message:
102
+ rdoc_options: []
103
+ require_paths:
104
+ - lib
105
+ required_ruby_version: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ required_rubygems_version: !ruby/object:Gem::Requirement
111
+ requirements:
112
+ - - ">="
113
+ - !ruby/object:Gem::Version
114
+ version: '0'
115
+ requirements: []
116
+ rubyforge_project:
117
+ rubygems_version: 2.4.3
118
+ signing_key:
119
+ specification_version: 4
120
+ summary: Story Express delivers your stories to your PM.
121
+ test_files:
122
+ - spec/spec_helper.rb
123
+ - spec/story_express/rider_spec.rb
124
+ - spec/story_express/story_finder_spec.rb
125
+ - spec/story_express_spec.rb