startling_pivotal 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: fb7a73abfa6b0e4f012f42df9a5e2d1baf6f75ba
4
+ data.tar.gz: a77104300c34d6c2ca317341d2c2ed61fc15368f
5
+ SHA512:
6
+ metadata.gz: d2ab29339933fbe58caedac6ac5fecd2c546d92d7ce6c568e13ee34de370b09c03ace824f7e5f74f075538dc26fe10079222ec385818101665279d4c51b89a25
7
+ data.tar.gz: cc435d781d10f05783d16a8b992539c5dda9bc12a1ea83a5b388d3b78e73c5a4171c91a1d853958501fc0b83608debe1dbacf11efeeae1a629ac5b994838ebd2
data/.ruby-gemset ADDED
@@ -0,0 +1 @@
1
+ startling-pivotal
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in startling-pivotal.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Shaun Dern
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,77 @@
1
+ # Startling Pivotal Tracker
2
+
3
+ Hooks into [Startling](https://rubygems.org/gems/startling) to start a Pivotal
4
+ Tracker story. Uses the story name for the pull request title and the story URL
5
+ for the pull request description.
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ gem 'startling_pivotal'
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install startling_pivotal
20
+
21
+ Generate configuration file in Rails:
22
+
23
+ $ rails g startling:configuration
24
+ $ rails g startling_pivotal:configuration
25
+
26
+ ## Configuration
27
+
28
+ ### Startling Pivotal Configuration
29
+
30
+ startling_pivotal_file.rb should be defined at the root of the project. It can
31
+ contain a block for configuration:
32
+
33
+ ```ruby
34
+ StartlingPivotal.configure do |config|
35
+ # Valid story estimations
36
+ # config.valid_estimates = [1, 2, 3]
37
+ end
38
+ ```
39
+
40
+ ### Startling Configuration
41
+
42
+ Add the following line to the beginning of the Startling configuration file:
43
+
44
+ ```ruby
45
+ require 'startling_pivotal'
46
+ ```
47
+
48
+ Add or update the following line of the Startling configuration file:
49
+
50
+ ```ruby
51
+ config.story_handler = :pivotal_start
52
+ ```
53
+
54
+ ## Usage
55
+
56
+ Start a new story with a given story id:
57
+
58
+ $ start 12345
59
+
60
+ Start a new story with a given story id and branch name:
61
+
62
+ $ start 12345 foo
63
+
64
+ Check story status:
65
+
66
+ $ story_status 12345
67
+
68
+ ## Contributing
69
+
70
+ 1. Create `.env` from the Secure Note `startling .env` in
71
+ LastPass.
72
+ 1. `gem install bundler`
73
+ 1. `bundle install`
74
+
75
+ ### Running tests
76
+
77
+ `rake`
data/Rakefile ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env rake
2
+
3
+ require 'rubygems'
4
+ require 'bundler/setup'
5
+ require 'bundler/gem_tasks'
6
+ require 'rspec/core/rake_task'
7
+
8
+ desc 'Default: run unit tests.'
9
+ task :default => :spec
10
+
11
+ desc "Run all specs"
12
+ RSpec::Core::RakeTask.new do |t|
13
+ t.pattern = 'spec/**/*_spec.rb'
14
+ t.rspec_opts = '--color'
15
+ end
data/bin/story_status ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ exit 1 if ARGV.empty?
4
+
5
+ require_relative '../lib/startling_pivotal'
6
+
7
+ story_states = []
8
+ ARGV.each do |story_id|
9
+ story_states << StartlingPivotal.story(story_id).current_state
10
+ end
11
+
12
+ puts ( story_states.all? { |s| s == "accepted" } ) ?
13
+ "accepted" :
14
+ "unaccepted"
@@ -0,0 +1,35 @@
1
+ require 'rails/generators'
2
+ require 'rails/generators/base'
3
+ require 'startling'
4
+
5
+ module StartlingPivotal
6
+ module Generators
7
+ class ConfigurationGenerator < Rails::Generators::Base
8
+ def create_config_file
9
+ create_file "startling_pivotal_file.rb" do
10
+ <<CONFIG
11
+ StartlingPivotal.configure do |config|
12
+ # Valid story estimations
13
+ # config.valid_estimates = [1, 2, 3]
14
+ end
15
+ CONFIG
16
+ end
17
+
18
+ Startling::Configuration::DEFAULT_STARTLINGFILES.each do |file_name|
19
+ if Dir.entries(Startling::GitLocal.new.project_root).include? file_name
20
+ inject_into_file file_name, before: 'Startling.configure do |config|' do
21
+ <<CONFIG
22
+ require 'startling_pivotal'
23
+
24
+ CONFIG
25
+ end
26
+
27
+ gsub_file file_name,
28
+ '# config.story_handler = :pivotal_start',
29
+ 'config.story_handler = :pivotal_start'
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,67 @@
1
+ require 'faraday'
2
+ require 'json'
3
+
4
+ module StartlingPivotal
5
+ class Api
6
+ def initialize(api_token: nil)
7
+ @api_token = api_token
8
+ end
9
+
10
+ def user_id
11
+ get("me")["id"]
12
+ end
13
+
14
+ def self.api_token_for_user(username, password)
15
+ connection = Faraday.new("https://www.pivotaltracker.com/services/v5")
16
+ connection.basic_auth(username, password)
17
+ parse_response(connection.get("me"))["api_token"]
18
+ end
19
+
20
+ def story(id)
21
+ get("stories/#{id}")
22
+ end
23
+
24
+ def update_story(id, attrs)
25
+ response = connection.put do |request|
26
+ request.url "stories/#{id}"
27
+ request.headers["Content-Type"] = "application/json"
28
+ request.headers["X-TrackerToken"] = api_token
29
+ request.body = attrs.to_json
30
+ end
31
+
32
+ Api.parse_response response
33
+ end
34
+
35
+ private
36
+ attr_reader :username, :password, :api_token
37
+
38
+ def connection
39
+ @connection ||= Faraday.new("https://www.pivotaltracker.com/services/v5") do |faraday|
40
+ # faraday.response :logger
41
+ faraday.request :url_encoded
42
+ faraday.adapter Faraday.default_adapter
43
+ end
44
+ end
45
+
46
+ def get(url, options = {})
47
+ response = connection.get do |request|
48
+ request.url url, options
49
+ request.headers["X-TrackerToken"] = api_token
50
+ end
51
+
52
+ Api.parse_response response
53
+ end
54
+
55
+ def self.parse_response(response)
56
+ verify_response response
57
+ JSON.parse response.body
58
+ end
59
+
60
+ def self.verify_response(response)
61
+ return if response.status == 200
62
+ puts "Request to #{response.env.url.to_s} failed"
63
+ puts response.body
64
+ raise "Request failed"
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,46 @@
1
+ require 'startling'
2
+ require_relative '../../startling_pivotal'
3
+
4
+ module Startling
5
+ module Commands
6
+ class PivotalStart < Base
7
+ def execute
8
+ StartlingPivotal::Configuration.load_configuration
9
+
10
+ logger.info "Starting story..."
11
+ estimate = ask_for_estimate unless story.estimated?
12
+ story_owners = [StartlingPivotal.user_id]
13
+ story.start(starter_ids: story_owners, estimate: estimate)
14
+ story
15
+ end
16
+
17
+ def ask_for_estimate
18
+ logger.info "'#{story.name}' is not estimated."
19
+ valid_estimates = StartlingPivotal.valid_estimates
20
+ begin
21
+ estimate = ask("Enter estimate (#{valid_estimates.join(", ")}): ")
22
+ estimate = Integer(estimate)
23
+ raise 'Invalid estimate' unless valid_estimates.include? estimate
24
+ return estimate.to_i
25
+ rescue => e
26
+ puts e.message
27
+ retry
28
+ end
29
+ end
30
+
31
+ def story
32
+ @story ||= StartlingPivotal.story(get_story_id)
33
+ end
34
+
35
+ def get_story_id
36
+ @story_id ||= prompt_for_story_id
37
+ end
38
+
39
+ def prompt_for_story_id
40
+ result = ask("Enter story id to start: ").gsub(/[^0-9]/, '')
41
+ abort "Pivotal id must be specified." if result.empty?
42
+ result
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,23 @@
1
+ module StartlingPivotal
2
+ class Configuration
3
+ DEFAULT_VALID_ESTIMATES = [1, 2, 3]
4
+ DEFAULT_CONFIG_FILE = 'startling_pivotal_file.rb'
5
+
6
+ attr_accessor :valid_estimates
7
+
8
+ def initialize
9
+ @valid_estimates = DEFAULT_VALID_ESTIMATES
10
+ end
11
+
12
+ def self.load_configuration
13
+ file_name = DEFAULT_CONFIG_FILE
14
+
15
+ if Dir.entries(Startling::GitLocal.new.project_root).include? file_name
16
+ load "#{Startling::GitLocal.new.project_root}/#{file_name}"
17
+ return file_name
18
+ end
19
+
20
+ nil
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,14 @@
1
+ require 'startling'
2
+ require_relative 'api'
3
+
4
+ module StartlingPivotal
5
+ class Helper
6
+ def api_token
7
+ @api_token ||= Startling.cache.fetch('.pivotal_api_token') do
8
+ username = ask("Enter your Pivotal Tracker username: ")
9
+ password = ask("Enter your Pivotal Tracker password: ") { |q| q.echo = false }
10
+ Api.api_token_for_user(username, password)
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,58 @@
1
+ require 'startling'
2
+
3
+ module StartlingPivotal
4
+ class Story < Startling::Story
5
+ attr_reader :story_id, :token, :api
6
+
7
+ def initialize(story_id, api)
8
+ @story_id = story_id
9
+ @api = api
10
+ end
11
+
12
+ def name ; remove_prefix(attrs["name"]) ; end
13
+ def story_type ; attrs["story_type"] ; end
14
+ def url ; attrs["url"] ; end
15
+ def estimate ; attrs["estimate"] ; end
16
+ def project_id ; attrs["project_id"] ; end
17
+ def current_state ; attrs["current_state"] ; end
18
+
19
+ def estimated?
20
+ return true if story_type != "feature"
21
+ return false if estimate.nil?
22
+ Integer(estimate) > 0
23
+ end
24
+
25
+ def update(new_attrs)
26
+ api.update_story story_id, new_attrs
27
+ end
28
+
29
+ def pull_request_title
30
+ name
31
+ end
32
+
33
+ def pull_request_body_text
34
+ url
35
+ end
36
+
37
+ def attrs
38
+ @attrs ||= api.story story_id
39
+ end
40
+
41
+ def start(starter_ids: nil, estimate: nil)
42
+ attrs = {
43
+ current_state: "started",
44
+ owner_ids: starter_ids,
45
+ }
46
+
47
+ attrs[:estimate] = estimate if estimate
48
+
49
+ update(attrs)
50
+ end
51
+
52
+ # Sometimes stories have a note in front of their title like
53
+ # *[BLOCKED]* or **[BLOCKED]**, this removes it.
54
+ def remove_prefix(name)
55
+ name.sub(/^(\*\*?.*?\*\*? *)+/, "").strip
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,3 @@
1
+ module StartlingPivotal
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,37 @@
1
+ require_relative 'startling_pivotal/api'
2
+ require_relative 'startling_pivotal/configuration'
3
+ require_relative 'startling_pivotal/helper'
4
+ require_relative 'startling_pivotal/story'
5
+ require_relative 'startling_pivotal/commands/pivotal_start'
6
+
7
+ module StartlingPivotal
8
+ class << self
9
+ attr_writer :configuration
10
+
11
+ def method_missing(method, *args, &block)
12
+ configuration.send(method, *args, &block)
13
+ end
14
+ end
15
+
16
+ def self.configuration
17
+ @configuration ||= Configuration.new
18
+ end
19
+
20
+ def self.configure
21
+ yield(configuration)
22
+ end
23
+
24
+ def self.api
25
+ @api ||= Api.new(api_token: Helper.new.api_token)
26
+ end
27
+
28
+ def self.user_id
29
+ @user_id ||= begin
30
+ api.user_id
31
+ end
32
+ end
33
+
34
+ def self.story(id)
35
+ Story.new(id, api)
36
+ end
37
+ end
@@ -0,0 +1,19 @@
1
+ # This file was generated by the `rspec --init` command. Conventionally, all
2
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
3
+ # Require this file using `require "spec_helper"` to ensure that it is only
4
+ # loaded once.
5
+ #
6
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
7
+ RSpec.configure do |config|
8
+ config.run_all_when_everything_filtered = true
9
+ config.filter_run :focus
10
+
11
+ # Run specs in random order to surface order dependencies. If you find an
12
+ # order dependency and want to debug it, you can fix the order by providing
13
+ # the seed, which is printed after each run.
14
+ # --seed 1234
15
+ config.order = 'random'
16
+ end
17
+
18
+ require 'pry'
19
+ Dir['./spec/support/**/*.rb'].map {|f| require f}
@@ -0,0 +1,46 @@
1
+ require 'spec_helper'
2
+ require 'startling_pivotal/api'
3
+
4
+ module StartlingPivotal
5
+ describe Api do
6
+ let(:api_token) { Tokens.pivotal_tracker }
7
+ let(:api) { Api.new(api_token: api_token) }
8
+
9
+ specify "#user_id should return the id of the current user",
10
+ vcr: { cassette_name: "pivotal_tracker_api_user_id" } do
11
+ expect(api.user_id).to eq(1240260)
12
+ end
13
+
14
+ specify ".api_token should return the api_token of the user",
15
+ vcr: { cassette_name: "pivotal_tracker_api_api_token" } do
16
+ token = Api.api_token_for_user "aaron+tchtesting@substantial.com", "asdfasdf"
17
+ expect(token).to eq(api_token)
18
+ end
19
+
20
+ # Uses https://www.pivotaltracker.com/story/show/65069954
21
+ #
22
+ # Preconditions:
23
+ # Name should match tested name.
24
+ specify "#story should return story details",
25
+ vcr: { cassette_name: "pivotal_tracker_api_story" } do
26
+ story = api.story(65069954)
27
+ expect(story["name"]).to eq("TEST: pivotal_tracker_api_story")
28
+ end
29
+
30
+ # Uses https://www.pivotaltracker.com/story/show/65072638
31
+ #
32
+ # Preconditions:
33
+ # Story should not have an estimate
34
+ specify "#update_story should update the story",
35
+ vcr: { cassette_name: "pivotal_tracker_api_update_story" } do
36
+ story_id = 65072638
37
+ story = api.story(story_id)
38
+ expect(story["estimate"]).to be_nil
39
+
40
+ api.update_story story_id, estimate: 8
41
+
42
+ story = api.story(story_id)
43
+ expect(story["estimate"]).to eq(8)
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,57 @@
1
+ require 'spec_helper'
2
+ require 'startling'
3
+ require 'startling_pivotal/configuration'
4
+
5
+ module StartlingPivotal
6
+ describe Configuration do
7
+ let(:configuration) { Configuration.new }
8
+
9
+ describe 'Default settings' do
10
+ it 'sets the default valid estimates' do
11
+ expect(configuration.valid_estimates).to eql(Configuration::DEFAULT_VALID_ESTIMATES)
12
+ end
13
+ end
14
+
15
+ describe "#valid_estimates" do
16
+ it "can set the value" do
17
+ configuration.valid_estimates = [1, 2]
18
+ expect(configuration.valid_estimates).to eql([1, 2])
19
+ end
20
+ end
21
+
22
+ describe "#load_configuration" do
23
+ let(:git) { double(Startling::GitLocal) }
24
+ let(:config_file) { "startling_pivotal_file.rb" }
25
+
26
+ before do
27
+ allow(Startling::GitLocal).to receive(:new) { git }
28
+ allow(git).to receive(:project_root) { Dir.pwd }
29
+ end
30
+
31
+ after do
32
+ delete_config_file(config_file)
33
+ end
34
+
35
+ context "when no configuration file exists" do
36
+ it "uses default configuration" do
37
+ expect(Configuration.load_configuration).to eql(nil)
38
+ end
39
+ end
40
+
41
+ context "when a configuration file exists" do
42
+ it "loads configuration from startling_pivotal_file.rb" do
43
+ create_config_file(config_file)
44
+ expect(Configuration.load_configuration).to eql(config_file)
45
+ end
46
+ end
47
+ end
48
+
49
+ def create_config_file(config_file)
50
+ File.open(config_file, "w")
51
+ end
52
+
53
+ def delete_config_file(config_file)
54
+ File.delete(config_file) if File.exists? config_file
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,2 @@
1
+ require 'dotenv'
2
+ Dotenv.load
@@ -0,0 +1,5 @@
1
+ module Tokens
2
+ def self.pivotal_tracker
3
+ ENV.fetch("TEST_PIVOTAL_TRACKER_API_TOKEN") { raise "Copy startling .env from LastPass into .env" }
4
+ end
5
+ end
@@ -0,0 +1,13 @@
1
+ require 'vcr'
2
+
3
+ VCR.configure do |config|
4
+ config.cassette_library_dir = 'spec/vcr_cassettes'
5
+ config.hook_into :webmock
6
+ config.default_cassette_options = {
7
+ allow_unused_http_interactions: false
8
+ }
9
+ config.filter_sensitive_data '<PIVOTAL_API_TOKEN>' do
10
+ ENV.fetch "TEST_PIVOTAL_TRACKER_API_TOKEN"
11
+ end
12
+ config.configure_rspec_metadata!
13
+ end
@@ -0,0 +1,77 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://aaron%2Btchtesting%40substantial.com:asdfasdf@www.pivotaltracker.com/services/v5/me
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.0
12
+ Accept-Encoding:
13
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
+ Accept:
15
+ - '*/*'
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Content-Type:
22
+ - application/json; charset=utf-8
23
+ Transfer-Encoding:
24
+ - chunked
25
+ Status:
26
+ - '200'
27
+ X-Powered-By:
28
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.14
29
+ X-Runtime:
30
+ - '124'
31
+ Cache-Control:
32
+ - private, max-age=0, must-revalidate
33
+ Etag:
34
+ - '"6fe95f24a6cf270b0dba00df7f0cf5ea"'
35
+ Server:
36
+ - nginx/1.2.2 + Phusion Passenger 3.0.14 (mod_rails/mod_rack)
37
+ Access-Control-Allow-Origin:
38
+ - '*'
39
+ Access-Control-Allow-Credentials:
40
+ - 'false'
41
+ Access-Control-Allow-Methods:
42
+ - GET, POST, PUT, DELETE, OPTIONS
43
+ Access-Control-Allow-Headers:
44
+ - X-TrackerToken,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-Tracker-Warn-Unless-Project-Version-Is
45
+ body:
46
+ encoding: UTF-8
47
+ string: |-
48
+ {
49
+ "projects": [
50
+ {
51
+ "role": "owner",
52
+ "project_name": "Tch Start Testing",
53
+ "project_color": "e46642",
54
+ "last_viewed_at": "2014-02-04T16:39:33Z",
55
+ "id": 3907566,
56
+ "project_id": 1007746,
57
+ "kind": "membership_summary"
58
+ }
59
+ ],
60
+ "has_google_identity": false,
61
+ "email": "aaron+tchtesting@substantial.com",
62
+ "initials": "TT",
63
+ "name": "Tch Testing",
64
+ "time_zone": {
65
+ "offset": "-07:00",
66
+ "olson_name": "America/Los_Angeles",
67
+ "kind": "time_zone"
68
+ },
69
+ "id": 1240260,
70
+ "kind": "me",
71
+ "username": "tcht",
72
+ "api_token": "<PIVOTAL_API_TOKEN>",
73
+ "receives_in_app_notifications": true
74
+ }
75
+ http_version:
76
+ recorded_at: Fri, 11 Apr 2014 17:17:43 GMT
77
+ recorded_with: VCR 2.8.0
@@ -0,0 +1,73 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://www.pivotaltracker.com/services/v5/stories/65069954
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.0
12
+ X-Trackertoken:
13
+ - <PIVOTAL_API_TOKEN>
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - '*/*'
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Content-Type:
24
+ - application/json; charset=utf-8
25
+ Transfer-Encoding:
26
+ - chunked
27
+ Status:
28
+ - '200'
29
+ X-Powered-By:
30
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.14
31
+ Etag:
32
+ - '"a1996719dbe87ce81ea8d62c3bebc10e"'
33
+ X-Runtime:
34
+ - '50'
35
+ Cache-Control:
36
+ - private, max-age=0, must-revalidate
37
+ X-Tracker-Project-Version:
38
+ - '31'
39
+ Server:
40
+ - nginx/1.2.2 + Phusion Passenger 3.0.14 (mod_rails/mod_rack)
41
+ Access-Control-Allow-Origin:
42
+ - '*'
43
+ Access-Control-Allow-Credentials:
44
+ - 'false'
45
+ Access-Control-Allow-Methods:
46
+ - GET, POST, PUT, DELETE, OPTIONS
47
+ Access-Control-Allow-Headers:
48
+ - X-TrackerToken,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-Tracker-Warn-Unless-Project-Version-Is
49
+ body:
50
+ encoding: UTF-8
51
+ string: |-
52
+ {
53
+ "kind": "story",
54
+ "requested_by_id": 1240260,
55
+ "estimate": 4,
56
+ "labels": [
57
+
58
+ ],
59
+ "owner_ids": [
60
+
61
+ ],
62
+ "id": 65069954,
63
+ "created_at": "2014-02-04T01:02:39Z",
64
+ "updated_at": "2014-02-04T01:54:20Z",
65
+ "url": "http://www.pivotaltracker.com/story/show/65069954",
66
+ "story_type": "feature",
67
+ "project_id": 1007746,
68
+ "name": "TEST: pivotal_tracker_api_story",
69
+ "current_state": "unscheduled"
70
+ }
71
+ http_version:
72
+ recorded_at: Fri, 11 Apr 2014 17:17:43 GMT
73
+ recorded_with: VCR 2.8.0
@@ -0,0 +1,217 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://www.pivotaltracker.com/services/v5/stories/65072638
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.0
12
+ X-Trackertoken:
13
+ - <PIVOTAL_API_TOKEN>
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - '*/*'
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Content-Type:
24
+ - application/json; charset=utf-8
25
+ Transfer-Encoding:
26
+ - chunked
27
+ Status:
28
+ - '200'
29
+ X-Powered-By:
30
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.14
31
+ Etag:
32
+ - '"520723207a9ac25967e0eedd67886bce"'
33
+ X-Runtime:
34
+ - '60'
35
+ Cache-Control:
36
+ - private, max-age=0, must-revalidate
37
+ X-Tracker-Project-Version:
38
+ - '30'
39
+ Server:
40
+ - nginx/1.2.2 + Phusion Passenger 3.0.14 (mod_rails/mod_rack)
41
+ Access-Control-Allow-Origin:
42
+ - '*'
43
+ Access-Control-Allow-Credentials:
44
+ - 'false'
45
+ Access-Control-Allow-Methods:
46
+ - GET, POST, PUT, DELETE, OPTIONS
47
+ Access-Control-Allow-Headers:
48
+ - X-TrackerToken,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-Tracker-Warn-Unless-Project-Version-Is
49
+ body:
50
+ encoding: UTF-8
51
+ string: |-
52
+ {
53
+ "kind": "story",
54
+ "requested_by_id": 1240260,
55
+ "description": "This story should have no estimate in it to properly test the update.",
56
+ "labels": [
57
+
58
+ ],
59
+ "owner_ids": [
60
+
61
+ ],
62
+ "id": 65072638,
63
+ "created_at": "2014-02-04T01:55:49Z",
64
+ "updated_at": "2014-02-04T02:51:52Z",
65
+ "url": "http://www.pivotaltracker.com/story/show/65072638",
66
+ "story_type": "feature",
67
+ "project_id": 1007746,
68
+ "name": "TEST: pivotal_tracker_api_update_story *(estimate should not be set)*",
69
+ "current_state": "unscheduled"
70
+ }
71
+ http_version:
72
+ recorded_at: Fri, 11 Apr 2014 17:17:41 GMT
73
+ - request:
74
+ method: put
75
+ uri: https://www.pivotaltracker.com/services/v5/stories/65072638
76
+ body:
77
+ encoding: UTF-8
78
+ string: '{"estimate":8}'
79
+ headers:
80
+ User-Agent:
81
+ - Faraday v0.9.0
82
+ Content-Type:
83
+ - application/json
84
+ X-Trackertoken:
85
+ - <PIVOTAL_API_TOKEN>
86
+ Accept-Encoding:
87
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
88
+ Accept:
89
+ - '*/*'
90
+ response:
91
+ status:
92
+ code: 200
93
+ message: OK
94
+ headers:
95
+ Content-Type:
96
+ - application/json; charset=utf-8
97
+ Content-Length:
98
+ - '530'
99
+ Status:
100
+ - '200'
101
+ X-Powered-By:
102
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.14
103
+ Etag:
104
+ - '"9e3b83e5b6ec14028bb7c34fb3910cae"'
105
+ X-Runtime:
106
+ - '208'
107
+ Cache-Control:
108
+ - private, max-age=0, must-revalidate
109
+ X-Tracker-Project-Version:
110
+ - '31'
111
+ Server:
112
+ - nginx/1.2.2 + Phusion Passenger 3.0.14 (mod_rails/mod_rack)
113
+ Access-Control-Allow-Origin:
114
+ - '*'
115
+ Access-Control-Allow-Credentials:
116
+ - 'false'
117
+ Access-Control-Allow-Methods:
118
+ - GET, POST, PUT, DELETE, OPTIONS
119
+ Access-Control-Allow-Headers:
120
+ - X-TrackerToken,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-Tracker-Warn-Unless-Project-Version-Is
121
+ body:
122
+ encoding: UTF-8
123
+ string: |-
124
+ {
125
+ "kind": "story",
126
+ "requested_by_id": 1240260,
127
+ "description": "This story should have no estimate in it to properly test the update.",
128
+ "estimate": 8,
129
+ "labels": [
130
+
131
+ ],
132
+ "owner_ids": [
133
+
134
+ ],
135
+ "id": 65072638,
136
+ "created_at": "2014-02-04T01:55:49Z",
137
+ "updated_at": "2014-04-11T17:17:39Z",
138
+ "url": "http://www.pivotaltracker.com/story/show/65072638",
139
+ "story_type": "feature",
140
+ "project_id": 1007746,
141
+ "name": "TEST: pivotal_tracker_api_update_story *(estimate should not be set)*",
142
+ "current_state": "unscheduled"
143
+ }
144
+ http_version:
145
+ recorded_at: Fri, 11 Apr 2014 17:17:42 GMT
146
+ - request:
147
+ method: get
148
+ uri: https://www.pivotaltracker.com/services/v5/stories/65072638
149
+ body:
150
+ encoding: US-ASCII
151
+ string: ''
152
+ headers:
153
+ User-Agent:
154
+ - Faraday v0.9.0
155
+ X-Trackertoken:
156
+ - <PIVOTAL_API_TOKEN>
157
+ Accept-Encoding:
158
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
159
+ Accept:
160
+ - '*/*'
161
+ response:
162
+ status:
163
+ code: 200
164
+ message: OK
165
+ headers:
166
+ Content-Type:
167
+ - application/json; charset=utf-8
168
+ Transfer-Encoding:
169
+ - chunked
170
+ Status:
171
+ - '200'
172
+ X-Powered-By:
173
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.14
174
+ Etag:
175
+ - '"9e3b83e5b6ec14028bb7c34fb3910cae"'
176
+ X-Runtime:
177
+ - '56'
178
+ Cache-Control:
179
+ - private, max-age=0, must-revalidate
180
+ X-Tracker-Project-Version:
181
+ - '31'
182
+ Server:
183
+ - nginx/1.2.2 + Phusion Passenger 3.0.14 (mod_rails/mod_rack)
184
+ Access-Control-Allow-Origin:
185
+ - '*'
186
+ Access-Control-Allow-Credentials:
187
+ - 'false'
188
+ Access-Control-Allow-Methods:
189
+ - GET, POST, PUT, DELETE, OPTIONS
190
+ Access-Control-Allow-Headers:
191
+ - X-TrackerToken,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-Tracker-Warn-Unless-Project-Version-Is
192
+ body:
193
+ encoding: UTF-8
194
+ string: |-
195
+ {
196
+ "kind": "story",
197
+ "requested_by_id": 1240260,
198
+ "description": "This story should have no estimate in it to properly test the update.",
199
+ "estimate": 8,
200
+ "labels": [
201
+
202
+ ],
203
+ "owner_ids": [
204
+
205
+ ],
206
+ "id": 65072638,
207
+ "created_at": "2014-02-04T01:55:49Z",
208
+ "updated_at": "2014-04-11T17:17:39Z",
209
+ "url": "http://www.pivotaltracker.com/story/show/65072638",
210
+ "story_type": "feature",
211
+ "project_id": 1007746,
212
+ "name": "TEST: pivotal_tracker_api_update_story *(estimate should not be set)*",
213
+ "current_state": "unscheduled"
214
+ }
215
+ http_version:
216
+ recorded_at: Fri, 11 Apr 2014 17:17:42 GMT
217
+ recorded_with: VCR 2.8.0
@@ -0,0 +1,79 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://www.pivotaltracker.com/services/v5/me
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.0
12
+ X-Trackertoken:
13
+ - <PIVOTAL_API_TOKEN>
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - '*/*'
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Content-Type:
24
+ - application/json; charset=utf-8
25
+ Transfer-Encoding:
26
+ - chunked
27
+ Status:
28
+ - '200'
29
+ X-Powered-By:
30
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.14
31
+ Etag:
32
+ - '"99739549742ff0cda850a10841def930"'
33
+ X-Runtime:
34
+ - '26'
35
+ Cache-Control:
36
+ - private, max-age=0, must-revalidate
37
+ Server:
38
+ - nginx/1.2.2 + Phusion Passenger 3.0.14 (mod_rails/mod_rack)
39
+ Access-Control-Allow-Origin:
40
+ - '*'
41
+ Access-Control-Allow-Credentials:
42
+ - 'false'
43
+ Access-Control-Allow-Methods:
44
+ - GET, POST, PUT, DELETE, OPTIONS
45
+ Access-Control-Allow-Headers:
46
+ - X-TrackerToken,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-Tracker-Warn-Unless-Project-Version-Is
47
+ body:
48
+ encoding: UTF-8
49
+ string: |-
50
+ {
51
+ "api_token": "<PIVOTAL_API_TOKEN>",
52
+ "kind": "me",
53
+ "has_google_identity": false,
54
+ "email": "aaron+tchtesting@substantial.com",
55
+ "username": "tcht",
56
+ "receives_in_app_notifications": true,
57
+ "initials": "TT",
58
+ "time_zone": {
59
+ "kind": "time_zone",
60
+ "olson_name": "America/Los_Angeles",
61
+ "offset": "-07:00"
62
+ },
63
+ "id": 1240260,
64
+ "name": "Tch Testing",
65
+ "projects": [
66
+ {
67
+ "project_name": "Tch Start Testing",
68
+ "kind": "membership_summary",
69
+ "role": "owner",
70
+ "id": 3907566,
71
+ "last_viewed_at": "2014-02-04T16:39:33Z",
72
+ "project_color": "e46642",
73
+ "project_id": 1007746
74
+ }
75
+ ]
76
+ }
77
+ http_version:
78
+ recorded_at: Fri, 11 Apr 2014 17:17:44 GMT
79
+ recorded_with: VCR 2.8.0
@@ -0,0 +1,31 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'startling_pivotal/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "startling_pivotal"
8
+ spec.version = StartlingPivotal::VERSION
9
+ spec.authors = ["Jeff Forde", "Cassie Koomjian"]
10
+ spec.email = ["tchdevs@substantial.com"]
11
+ spec.description = %q{Startling Pivotal Api}
12
+ spec.summary = %q{Startling Pivotal Api}
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
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_development_dependency "bundler"
22
+ spec.add_development_dependency "rake"
23
+ spec.add_development_dependency "rspec", "~> 3.2"
24
+ spec.add_development_dependency "pry"
25
+ spec.add_development_dependency "webmock", "~> 1.20"
26
+ spec.add_development_dependency "excon"
27
+ spec.add_development_dependency "dotenv"
28
+ spec.add_development_dependency "vcr", "~> 2.9"
29
+ spec.add_dependency "startling"
30
+ spec.add_dependency "faraday", "~> 0.9"
31
+ end
metadata ADDED
@@ -0,0 +1,221 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: startling_pivotal
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Jeff Forde
8
+ - Cassie Koomjian
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2016-02-23 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: bundler
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ">="
19
+ - !ruby/object:Gem::Version
20
+ version: '0'
21
+ type: :development
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ version: '0'
28
+ - !ruby/object:Gem::Dependency
29
+ name: rake
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ - !ruby/object:Gem::Dependency
43
+ name: rspec
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: '3.2'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "~>"
54
+ - !ruby/object:Gem::Version
55
+ version: '3.2'
56
+ - !ruby/object:Gem::Dependency
57
+ name: pry
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ - !ruby/object:Gem::Dependency
71
+ name: webmock
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - "~>"
75
+ - !ruby/object:Gem::Version
76
+ version: '1.20'
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - "~>"
82
+ - !ruby/object:Gem::Version
83
+ version: '1.20'
84
+ - !ruby/object:Gem::Dependency
85
+ name: excon
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ type: :development
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ - !ruby/object:Gem::Dependency
99
+ name: dotenv
100
+ requirement: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ type: :development
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ - !ruby/object:Gem::Dependency
113
+ name: vcr
114
+ requirement: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - "~>"
117
+ - !ruby/object:Gem::Version
118
+ version: '2.9'
119
+ type: :development
120
+ prerelease: false
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - "~>"
124
+ - !ruby/object:Gem::Version
125
+ version: '2.9'
126
+ - !ruby/object:Gem::Dependency
127
+ name: startling
128
+ requirement: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ version: '0'
133
+ type: :runtime
134
+ prerelease: false
135
+ version_requirements: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - ">="
138
+ - !ruby/object:Gem::Version
139
+ version: '0'
140
+ - !ruby/object:Gem::Dependency
141
+ name: faraday
142
+ requirement: !ruby/object:Gem::Requirement
143
+ requirements:
144
+ - - "~>"
145
+ - !ruby/object:Gem::Version
146
+ version: '0.9'
147
+ type: :runtime
148
+ prerelease: false
149
+ version_requirements: !ruby/object:Gem::Requirement
150
+ requirements:
151
+ - - "~>"
152
+ - !ruby/object:Gem::Version
153
+ version: '0.9'
154
+ description: Startling Pivotal Api
155
+ email:
156
+ - tchdevs@substantial.com
157
+ executables:
158
+ - story_status
159
+ extensions: []
160
+ extra_rdoc_files: []
161
+ files:
162
+ - ".ruby-gemset"
163
+ - Gemfile
164
+ - LICENSE.txt
165
+ - README.md
166
+ - Rakefile
167
+ - bin/story_status
168
+ - lib/generators/startling_pivotal/configuration_generator.rb
169
+ - lib/startling_pivotal.rb
170
+ - lib/startling_pivotal/api.rb
171
+ - lib/startling_pivotal/commands/pivotal_start.rb
172
+ - lib/startling_pivotal/configuration.rb
173
+ - lib/startling_pivotal/helper.rb
174
+ - lib/startling_pivotal/story.rb
175
+ - lib/startling_pivotal/version.rb
176
+ - spec/spec_helper.rb
177
+ - spec/startling_pivotal/api_spec.rb
178
+ - spec/startling_pivotal/configuration_spec.rb
179
+ - spec/support/dotenv.rb
180
+ - spec/support/tokens.rb
181
+ - spec/support/vcr.rb
182
+ - spec/vcr_cassettes/pivotal_tracker_api_api_token.yml
183
+ - spec/vcr_cassettes/pivotal_tracker_api_story.yml
184
+ - spec/vcr_cassettes/pivotal_tracker_api_update_story.yml
185
+ - spec/vcr_cassettes/pivotal_tracker_api_user_id.yml
186
+ - startling_pivotal.gemspec
187
+ homepage: ''
188
+ licenses:
189
+ - MIT
190
+ metadata: {}
191
+ post_install_message:
192
+ rdoc_options: []
193
+ require_paths:
194
+ - lib
195
+ required_ruby_version: !ruby/object:Gem::Requirement
196
+ requirements:
197
+ - - ">="
198
+ - !ruby/object:Gem::Version
199
+ version: '0'
200
+ required_rubygems_version: !ruby/object:Gem::Requirement
201
+ requirements:
202
+ - - ">="
203
+ - !ruby/object:Gem::Version
204
+ version: '0'
205
+ requirements: []
206
+ rubyforge_project:
207
+ rubygems_version: 2.5.1
208
+ signing_key:
209
+ specification_version: 4
210
+ summary: Startling Pivotal Api
211
+ test_files:
212
+ - spec/spec_helper.rb
213
+ - spec/startling_pivotal/api_spec.rb
214
+ - spec/startling_pivotal/configuration_spec.rb
215
+ - spec/support/dotenv.rb
216
+ - spec/support/tokens.rb
217
+ - spec/support/vcr.rb
218
+ - spec/vcr_cassettes/pivotal_tracker_api_api_token.yml
219
+ - spec/vcr_cassettes/pivotal_tracker_api_story.yml
220
+ - spec/vcr_cassettes/pivotal_tracker_api_update_story.yml
221
+ - spec/vcr_cassettes/pivotal_tracker_api_user_id.yml