update_status 0.2.2 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -11,5 +11,4 @@ group :development do
11
11
  gem "rdoc", "~> 3.12"
12
12
  gem "bundler", ">= 1.2.1"
13
13
  gem "jeweler", "~> 1.8.4"
14
- gem "rcov", ">= 0"
15
14
  end
@@ -0,0 +1,99 @@
1
+ # status [![Build Status](https://travis-ci.org/dougdroper/update_status.png?branch=master)](https://travis-ci.org/dougdroper/update_status)
2
+
3
+ Updates pull requests on github using the statuses api (http://developer.github.com/v3/repos/statuses/), with latest build from Jenkins and QA status
4
+
5
+ ## Usage
6
+
7
+
8
+ <tt>gem install update_status</tt>
9
+
10
+
11
+ on your branch run
12
+
13
+ $: <tt>status</tt>
14
+
15
+ This will generate a .status.yml file in the current directory, you will need to edit this file with your credentials.
16
+
17
+ .status.yml:
18
+
19
+ ```ruby
20
+ :username: Jenkins username
21
+ :password: Jenkins password
22
+ :token: Githubs API token (http://developer.github.com/v3/oauth/)
23
+ :owner: Owner of the repository eg. dougdroper
24
+ :repo: eg. status
25
+ :ci_url: eg. http://ci.jenkins.com
26
+ :qa_required: true
27
+ ```
28
+
29
+ add .status.yml to .gitignore
30
+
31
+ ##
32
+
33
+ When your branch has passed QA
34
+
35
+ $: <tt>status -q pass</tt>
36
+
37
+ You can pass a different branch
38
+
39
+ $: <tt>status -b other_feature_branch</tt>
40
+
41
+ or
42
+
43
+ $: <tt>status -b other_feature_branch -q pass</tt>
44
+
45
+ You can also pass based on the SHA
46
+
47
+ $: <tt>status -s SHA -q pass</tt>
48
+
49
+ When qa_required is false then there is no need to pass in a qa option
50
+
51
+ help
52
+
53
+ $: <tt>status -h</tt>
54
+
55
+ ## Github oauth
56
+
57
+ You need an API token to interact with githubs api
58
+
59
+ $: curl -u "YOUR GITHUB USERNAME" -d '{"add_scopes":["repo"]}' https://api.github.com/authorizations
60
+
61
+ ```javascript
62
+ {
63
+ "id": 1,
64
+ "url": "https://api.github.com/authorizations/1",
65
+ "app": {
66
+ "name": "GitHub API",
67
+ "url": "http://developer.github.com/v3/oauth/#oauth-authorizations-api"
68
+ },
69
+ "token": "NEW TOKEN",
70
+ "note": null,
71
+ "note_url": null,
72
+ "created_at": "2013-02-11T17:02:36Z",
73
+ "updated_at": "2013-02-11T17:02:36Z",
74
+ "scopes": [
75
+ ]
76
+ }
77
+ ```
78
+
79
+ This generates a new token, now you need to add_scopes to the id of the returned token
80
+
81
+ $: curl -u "YOUR GITHUB USERNAME" -d '{"add_scopes":["repo"]}' https://api.github.com/authorizations/1
82
+
83
+ Then add this token in the .status.yml file
84
+
85
+ ## Contributing to status
86
+
87
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
88
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
89
+ * Fork the project.
90
+ * Start a feature/bugfix branch.
91
+ * Commit and push until you are happy with your contribution.
92
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
93
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
94
+
95
+ ## Copyright
96
+
97
+ Copyright (c) 2012 Douglas Roper. See LICENSE.txt for
98
+ further details.
99
+
data/Rakefile CHANGED
@@ -32,22 +32,11 @@ Rake::TestTask.new(:test) do |test|
32
32
  test.verbose = true
33
33
  end
34
34
 
35
- require 'rcov/rcovtask'
36
- Rcov::RcovTask.new do |test|
37
- test.libs << 'test'
38
- test.pattern = 'test/**/test_*.rb'
39
- test.verbose = true
40
- test.rcov_opts << '--exclude "gems/*"'
41
- end
42
35
 
43
36
  task :default => :test
44
37
 
45
- require 'rdoc/task'
46
- Rake::RDocTask.new do |rdoc|
47
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
38
+ require 'rspec/core/rake_task'
48
39
 
49
- rdoc.rdoc_dir = 'rdoc'
50
- rdoc.title = "status #{version}"
51
- rdoc.rdoc_files.include('README*')
52
- rdoc.rdoc_files.include('lib/**/*.rb')
53
- end
40
+ RSpec::Core::RakeTask.new(:spec)
41
+
42
+ task :default => :spec
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.2
1
+ 0.3.0
data/bin/status CHANGED
@@ -6,11 +6,18 @@ $:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
6
6
  require 'status'
7
7
  require 'optparse'
8
8
 
9
+ options ={
10
+ :qa_status => :pending,
11
+ :branch => nil,
12
+ :sha => nil
13
+ }
14
+
9
15
  OptionParser.new do |o|
10
- o.on("-s STATE", "--state", "Status of QA (default pending) [pending/pass]") {|s| $state = s }
11
- o.on("-b BRANCH", "--branch BRANCH", "Branch name") {|b| $branch = b }
16
+ o.on("-q STATE", "--qa STATE", "Status of QA (default pending) [pending/pass/'n/a']") {|s| options[:state] = s }
17
+ o.on("-b BRANCH", "--branch BRANCH", "Branch name") {|b| options[:branch] = b }
12
18
  o.on("-h", "--help", "Display this screen") {puts o; exit }
19
+ o.on("-s SHA", "--sha SHA") {|sha| options[:sha]=sha || nil}
13
20
  o.parse!
14
21
  end
15
22
 
16
- Status::Base.new({:state => $state, :branch => $branch}).update
23
+ Status::Base.new(options).update
@@ -50,4 +50,15 @@ module Status
50
50
  Status.config.parsed[:password]
51
51
  end
52
52
 
53
+ def qa_required?
54
+ Status.config.parsed[:qa_required].nil? ? true : Status.config.parsed[:qa_required]
55
+ end
56
+
57
+ def system_call(cmd)
58
+ `#{cmd}`
59
+ end
60
+
61
+ def system_warn(cmd)
62
+ Kernel.warn cmd
63
+ end
53
64
  end
@@ -7,9 +7,10 @@ module Status
7
7
  attr_reader :qa_status
8
8
 
9
9
  def initialize(options)
10
- @qa_status = options[:state] || "pending"
10
+ @qa_status = options[:state] || qa_required
11
11
  @branch = options[:branch] || branch
12
- @statuses = Status::Github::Statuses.new(@qa_status, @branch)
12
+ @sha = options[:sha] || nil
13
+ @statuses = Status::Github::Statuses.new(@qa_status, @branch, @sha)
13
14
  end
14
15
 
15
16
  def branch
@@ -23,5 +24,9 @@ module Status
23
24
  @statuses.request
24
25
  puts "Done."
25
26
  end
27
+
28
+ def qa_required
29
+ Status.qa_required? ? "pending" : "pass"
30
+ end
26
31
  end
27
32
  end
@@ -49,7 +49,9 @@ module Status
49
49
  :ci_url => "eg. http://ci.jenkins.com",
50
50
  :owner => "eg. dougdroper",
51
51
  :repo => "eg. status",
52
- :token => "Githubs API token (http://developer.github.com/v3/oauth/)"}
52
+ :token => "Githubs API token (http://developer.github.com/v3/oauth/)",
53
+ :qa_required => "true"
54
+ }
53
55
  File.open(FILE, 'w') {|f| f.write(data.to_yaml)}
54
56
  puts "Please update #{FILE} and then run status"
55
57
  abort("exit")
@@ -46,4 +46,4 @@ module Status
46
46
  end
47
47
  end
48
48
  end
49
- end
49
+ end
@@ -3,10 +3,11 @@
3
3
  module Status
4
4
  module Github
5
5
  class Statuses
6
- def initialize(qa_status, branch)
6
+ def initialize(qa_status, branch, user_sha=nil)
7
7
  @qa_status = qa_status
8
8
  @branch = branch
9
- @jenkins = Jenkins.new(branch)
9
+ @user_sha = user_sha
10
+ @jenkins = Jenkins.new(branch, sha)
10
11
  end
11
12
 
12
13
  def request
@@ -20,6 +21,10 @@ module Status
20
21
  end
21
22
 
22
23
  def description
24
+ description_text.tap {|d| puts d}
25
+ end
26
+
27
+ def description_text
23
28
  "Build status: #{@jenkins.state}, QA #{@qa_status}"
24
29
  end
25
30
 
@@ -28,13 +33,14 @@ module Status
28
33
  end
29
34
 
30
35
  def target_url
31
- "#{Status.ci_url}/job/#{@branch}"
36
+ @jenkins.target_url
32
37
  end
33
38
 
39
+ # The only states github's API acccepts are "success", "failure", "pending", and "error".
34
40
  def state
35
- return "success" if @jenkins.pass? && @qa_status == "pass"
41
+ return "success" if @jenkins.pass? && qa_pass_state?
36
42
  return "pending" if @jenkins.pass? && @qa_status != "pass"
37
- return "pending" if @jenkins.state == "pending" && @qa_status != "pass"
43
+ return "pending" if @jenkins.state == "pending"
38
44
  git_state
39
45
  end
40
46
 
@@ -47,8 +53,14 @@ module Status
47
53
  end
48
54
 
49
55
  def sha
50
- `git log #{@branch} -1 --pretty=format:'%H'`
56
+ @user_sha || Status.system_call("git log #{@branch} -1 --pretty=format:'%H'")
57
+ end
58
+
59
+ private
60
+
61
+ def qa_pass_state?
62
+ @qa_status == "pass" || @qa_status == "n/a"
51
63
  end
52
64
  end
53
65
  end
54
- end
66
+ end
@@ -2,33 +2,99 @@
2
2
 
3
3
  module Status
4
4
  class Jenkins
5
- def initialize(branch)
5
+
6
+ def initialize(branch, sha=nil)
6
7
  @branch = branch.gsub(/\//, "_")
8
+ @sha = sha
9
+ end
10
+
11
+ def target_url
12
+ build_url || "#{Status.ci_url}/job/#{@branch}"
7
13
  end
8
14
 
9
15
  def state
10
- return "success" if pass?
11
- @status
16
+ status
12
17
  end
13
18
 
14
19
  def pass?
15
- @status ||= get_ci_status
16
- return false unless @status == "success"
17
- true
20
+ status == "success"
18
21
  end
19
22
 
20
- def get_ci_status
21
- response = Request.new(:ci).get(path)
22
- return "pending" if response == "not found"
23
- return "pending" if response["building"] == true
24
- return "failure" unless response["result"].downcase == "success"
25
- "success"
26
- end
23
+ private
27
24
 
28
25
  def path
29
- "/job/#{@branch}/lastBuild/api/json"
26
+ "/job/#{@branch}/#{build}/api/json"
27
+ end
28
+
29
+ def status
30
+ @status ||= ci_status
31
+ end
32
+
33
+ def ci_status
34
+ return "pending" if any_pending_reasons?
35
+ return "failure" if result_is_failure?
36
+ "success"
37
+ end
38
+
39
+ def build
40
+ return last_build["number"] if last_build
41
+ "lastBuild"
42
+ end
43
+
44
+ def result_is_failure?
45
+ response["result"].downcase != "success"
46
+ end
47
+
48
+ def build_url
49
+ if last_build.nil?
50
+ return
51
+ end
52
+ last_build["url"]
30
53
  end
31
- end
32
- end
33
54
 
55
+ def last_build
56
+ @last_build ||= get_build_for_sha
57
+ end
58
+
59
+ def get_build_for_sha
60
+ return unless @sha
61
+ ci_response["builds"].each do |build|
62
+ return build if last_build_contails_sha?(build)
63
+ return build if build_is_in_change_set?(build)
64
+ end
65
+ nil
66
+ end
67
+
68
+ def any_pending_reasons?
69
+ response == "not found" || queued? || response["building"] == true
70
+ end
71
+
72
+ def response
73
+ @response ||= Request.new(:ci).get(path)
74
+ end
75
+
76
+ def ci_response
77
+ @ci_response ||= Request.new(:ci).get("/job/#{@branch}/api/json?depth=1")
78
+ end
79
+
80
+ def queued?
81
+ (!!ci_response["queueItem"]).tap do |queued|
82
+ if queued
83
+ Status.system_warn "Your build (#{@branch}) is in a queue."
84
+ end
85
+ end
86
+ end
87
+
88
+ def last_build_contails_sha?(build)
89
+ return false if build["actions"].nil? || build["actions"][1].nil?
90
+ build["actions"][1]["lastBuiltRevision"]["SHA1"] =~ /^#{@sha}/
91
+ end
34
92
 
93
+ def build_is_in_change_set?(build)
94
+ return false if build["changeSet"].nil?
95
+ build["changeSet"]["items"].any? do |item|
96
+ item["commitId"] =~ /^#{@sha}/
97
+ end
98
+ end
99
+ end
100
+ end
@@ -1,21 +1,23 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Status::Github::Statuses do
4
+ subject { Status::Github::Statuses }
5
+
4
6
  before do
5
7
  @jenkins = stub
6
8
  stub_const("Status::Jenkins", @jenkins)
9
+ Status.stub(:system_call)
7
10
  end
8
11
 
9
- subject { Status::Github::Statuses }
10
12
  it "has a payload target URL of the ci server URL and the branch name" do
11
- @jenkins.stub(:new => stub(:state => "success", :pass? => true))
13
+ @jenkins.stub(:new => stub(:state => "success", :pass? => true, :target_url => :a_url))
12
14
  Status.stub(:ci_url => "http://jenkins-ci.org", :branch => "feature_branch")
13
- subject.new("pending", "feature_branch").send(:target_url).should == "http://jenkins-ci.org/job/feature_branch"
15
+ subject.new("pending", "feature_branch").send(:target_url).should == :a_url
14
16
  end
15
17
 
16
18
  it "has a payload description of the ci state and qa status" do
17
19
  @jenkins.stub(:new => stub(:state => "success"))
18
- subject.new("pending", "feature_branch").send(:description).should == "Build status: success, QA pending"
20
+ subject.new("pending", "feature_branch").send(:description_text).should == "Build status: success, QA pending"
19
21
  end
20
22
 
21
23
  it "has a payload pending state when ci is passing but qa hasn't passed" do
@@ -33,6 +35,11 @@ describe Status::Github::Statuses do
33
35
  subject.new("pass", "feature_branch").send(:state).should == "success"
34
36
  end
35
37
 
38
+ it "has a payloads success state when ci is n/a and qa has passed" do
39
+ @jenkins.stub(:new => stub(:state => "success", :pass? => true))
40
+ subject.new("n/a", "feature_branch").send(:state).should == "success"
41
+ end
42
+
36
43
  it "has a payload error state when ci has an error" do
37
44
  @jenkins.stub(:new => stub(:state => "nothing", :pass? => false))
38
45
  subject.new("pass", "feature_branch").send(:state).should == "error"
@@ -5,14 +5,14 @@ describe Status::Jenkins do
5
5
  subject {Status::Jenkins.new("")}
6
6
 
7
7
  before do
8
- Status.stub(:config => stub(:attrs => {}))
9
-
10
- stub(Status::Request)
8
+ Status.stub(:config => stub(:attrs => {}, :parsed => {}))
9
+ Status::Request.any_instance.stub(:get)
10
+ Status.stub(:system_warn)
11
11
  end
12
12
 
13
13
  context "#state" do
14
- it "has a path with underscores" do
15
- Status::Jenkins.new("dr/feature").path.should == "/job/dr_feature/lastBuild/api/json"
14
+ it "changes slashes to underscores" do
15
+ Status::Jenkins.new("dr/feature").send(:path).should == "/job/dr_feature/lastBuild/api/json"
16
16
  end
17
17
 
18
18
  it "is success when ci result is success" do
@@ -20,19 +20,43 @@ describe Status::Jenkins do
20
20
  subject.state.should == "success"
21
21
  end
22
22
 
23
- it "is Building when ci result is building" do
23
+ it "is pending when ci result is building" do
24
24
  Status::Request.stub(:new => stub(:get => {"building" => true, "result" => "success"}))
25
25
  subject.state.should == "pending"
26
26
  end
27
27
 
28
- it "is Building when ci result is in any other state" do
28
+ it "is pending when ci result is in any other state" do
29
29
  Status::Request.stub(:new => stub(:get => {"building" => true, "result" => "failed"}))
30
30
  subject.state.should == "pending"
31
31
  end
32
32
 
33
- it "is Building when ci result is not found" do
33
+ it "is pending when ci result is not found" do
34
34
  Status::Request.stub(:new => stub(:get => "not found"))
35
35
  subject.state.should == "pending"
36
36
  end
37
+
38
+ it "is failure when ci result is failure" do
39
+ Status::Request.stub(:new => stub(:get => {"building" => false, "result" => "failure"}))
40
+ subject.state.should == "failure"
41
+ end
42
+ end
43
+
44
+ context "#target_url" do
45
+ it "has the last build in the path as default" do
46
+ Status::Request.stub(:new => stub(:get => {"builds" => []}))
47
+ Status::Jenkins.new("dr/feature", '481002a').target_url.should == "/job/dr_feature"
48
+ end
49
+
50
+ it "has the last build number in the path as when last build contains sha" do
51
+ build = {"number" => 12, "actions" => [{},{"lastBuiltRevision" => {"SHA1" => "481002a"}}], "url" => "/job/dr_feature/12/api/json"}
52
+ Status::Request.stub(:new => stub(:get => {"builds" => [build]}))
53
+ Status::Jenkins.new("dr/feature", '481002a').target_url.should == "/job/dr_feature/12/api/json"
54
+ end
55
+
56
+ it "has he last build number when the build is in the change set" do
57
+ build = {"number" => 12, "changeSet" => {"items" => [{"commitId" => "481002a"}]}, "actions" => [], "url" => "/job/dr_feature/12/api/json"}
58
+ Status::Request.stub(:new => stub(:get => {"builds" => [build]}))
59
+ Status::Jenkins.new("dr/feature", '481002a').target_url.should == "/job/dr_feature/12/api/json"
60
+ end
37
61
  end
38
- end
62
+ end
@@ -5,25 +5,24 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "update_status"
8
- s.version = "0.2.2"
8
+ s.version = "0.3.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Douglas Roper"]
12
- s.date = "2012-12-18"
12
+ s.date = "2013-02-13"
13
13
  s.description = "Updates pull requests on github, with latest build from Jenkins and QA status"
14
14
  s.email = "douglasroper@notonthehighstreet.com"
15
15
  s.executables = ["status"]
16
16
  s.extra_rdoc_files = [
17
17
  "LICENSE.txt",
18
- "README.rdoc"
18
+ "README.md"
19
19
  ]
20
20
  s.files = [
21
21
  ".document",
22
22
  ".travis.yml",
23
23
  "Gemfile",
24
- "Gemfile.lock",
25
24
  "LICENSE.txt",
26
- "README.rdoc",
25
+ "README.md",
27
26
  "Rakefile",
28
27
  "VERSION",
29
28
  "bin/status",
@@ -38,13 +37,12 @@ Gem::Specification.new do |s|
38
37
  "spec/status/github/pull_request_spec.rb",
39
38
  "spec/status/github/statuses_spec.rb",
40
39
  "spec/status/jenkins_spec.rb",
41
- "status.gemspec",
42
40
  "update_status.gemspec"
43
41
  ]
44
42
  s.homepage = "http://github.com/dougdroper/status"
45
43
  s.licenses = ["MIT"]
46
44
  s.require_paths = ["lib"]
47
- s.rubygems_version = "1.8.24"
45
+ s.rubygems_version = "1.8.25"
48
46
  s.summary = "Status update for pull requests"
49
47
 
50
48
  if s.respond_to? :specification_version then
@@ -57,7 +55,6 @@ Gem::Specification.new do |s|
57
55
  s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
58
56
  s.add_development_dependency(%q<bundler>, [">= 1.2.1"])
59
57
  s.add_development_dependency(%q<jeweler>, ["~> 1.8.4"])
60
- s.add_development_dependency(%q<rcov>, [">= 0"])
61
58
  else
62
59
  s.add_dependency(%q<multi_json>, [">= 1.0.3"])
63
60
  s.add_dependency(%q<rest-client>, [">= 1.6.2"])
@@ -65,7 +62,6 @@ Gem::Specification.new do |s|
65
62
  s.add_dependency(%q<rdoc>, ["~> 3.12"])
66
63
  s.add_dependency(%q<bundler>, [">= 1.2.1"])
67
64
  s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
68
- s.add_dependency(%q<rcov>, [">= 0"])
69
65
  end
70
66
  else
71
67
  s.add_dependency(%q<multi_json>, [">= 1.0.3"])
@@ -74,7 +70,6 @@ Gem::Specification.new do |s|
74
70
  s.add_dependency(%q<rdoc>, ["~> 3.12"])
75
71
  s.add_dependency(%q<bundler>, [">= 1.2.1"])
76
72
  s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
77
- s.add_dependency(%q<rcov>, [">= 0"])
78
73
  end
79
74
  end
80
75
 
metadata CHANGED
@@ -1,147 +1,127 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: update_status
3
- version: !ruby/object:Gem::Version
4
- hash: 19
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.0
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 2
9
- - 2
10
- version: 0.2.2
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Douglas Roper
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2012-12-18 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2013-02-13 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: multi_json
22
- version_requirements: &id001 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
23
17
  none: false
24
- requirements:
25
- - - ">="
26
- - !ruby/object:Gem::Version
27
- hash: 17
28
- segments:
29
- - 1
30
- - 0
31
- - 3
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
32
21
  version: 1.0.3
33
22
  type: :runtime
34
- requirement: *id001
35
23
  prerelease: false
36
- - !ruby/object:Gem::Dependency
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 1.0.3
30
+ - !ruby/object:Gem::Dependency
37
31
  name: rest-client
38
- version_requirements: &id002 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
39
33
  none: false
40
- requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- hash: 11
44
- segments:
45
- - 1
46
- - 6
47
- - 2
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
48
37
  version: 1.6.2
49
38
  type: :runtime
50
- requirement: *id002
51
39
  prerelease: false
52
- - !ruby/object:Gem::Dependency
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: 1.6.2
46
+ - !ruby/object:Gem::Dependency
53
47
  name: rspec
54
- version_requirements: &id003 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
55
49
  none: false
56
- requirements:
57
- - - ">="
58
- - !ruby/object:Gem::Version
59
- hash: 35
60
- segments:
61
- - 2
62
- - 11
63
- - 0
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
64
53
  version: 2.11.0
65
54
  type: :development
66
- requirement: *id003
67
55
  prerelease: false
68
- - !ruby/object:Gem::Dependency
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: 2.11.0
62
+ - !ruby/object:Gem::Dependency
69
63
  name: rdoc
70
- version_requirements: &id004 !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
71
65
  none: false
72
- requirements:
66
+ requirements:
73
67
  - - ~>
74
- - !ruby/object:Gem::Version
75
- hash: 31
76
- segments:
77
- - 3
78
- - 12
79
- version: "3.12"
68
+ - !ruby/object:Gem::Version
69
+ version: '3.12'
80
70
  type: :development
81
- requirement: *id004
82
71
  prerelease: false
83
- - !ruby/object:Gem::Dependency
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: '3.12'
78
+ - !ruby/object:Gem::Dependency
84
79
  name: bundler
85
- version_requirements: &id005 !ruby/object:Gem::Requirement
80
+ requirement: !ruby/object:Gem::Requirement
86
81
  none: false
87
- requirements:
88
- - - ">="
89
- - !ruby/object:Gem::Version
90
- hash: 29
91
- segments:
92
- - 1
93
- - 2
94
- - 1
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
95
85
  version: 1.2.1
96
86
  type: :development
97
- requirement: *id005
98
87
  prerelease: false
99
- - !ruby/object:Gem::Dependency
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: 1.2.1
94
+ - !ruby/object:Gem::Dependency
100
95
  name: jeweler
101
- version_requirements: &id006 !ruby/object:Gem::Requirement
96
+ requirement: !ruby/object:Gem::Requirement
102
97
  none: false
103
- requirements:
98
+ requirements:
104
99
  - - ~>
105
- - !ruby/object:Gem::Version
106
- hash: 63
107
- segments:
108
- - 1
109
- - 8
110
- - 4
100
+ - !ruby/object:Gem::Version
111
101
  version: 1.8.4
112
102
  type: :development
113
- requirement: *id006
114
103
  prerelease: false
115
- - !ruby/object:Gem::Dependency
116
- name: rcov
117
- version_requirements: &id007 !ruby/object:Gem::Requirement
104
+ version_requirements: !ruby/object:Gem::Requirement
118
105
  none: false
119
- requirements:
120
- - - ">="
121
- - !ruby/object:Gem::Version
122
- hash: 3
123
- segments:
124
- - 0
125
- version: "0"
126
- type: :development
127
- requirement: *id007
128
- prerelease: false
129
- description: Updates pull requests on github, with latest build from Jenkins and QA status
106
+ requirements:
107
+ - - ~>
108
+ - !ruby/object:Gem::Version
109
+ version: 1.8.4
110
+ description: Updates pull requests on github, with latest build from Jenkins and QA
111
+ status
130
112
  email: douglasroper@notonthehighstreet.com
131
- executables:
113
+ executables:
132
114
  - status
133
115
  extensions: []
134
-
135
- extra_rdoc_files:
116
+ extra_rdoc_files:
136
117
  - LICENSE.txt
137
- - README.rdoc
138
- files:
118
+ - README.md
119
+ files:
139
120
  - .document
140
121
  - .travis.yml
141
122
  - Gemfile
142
- - Gemfile.lock
143
123
  - LICENSE.txt
144
- - README.rdoc
124
+ - README.md
145
125
  - Rakefile
146
126
  - VERSION
147
127
  - bin/status
@@ -156,40 +136,33 @@ files:
156
136
  - spec/status/github/pull_request_spec.rb
157
137
  - spec/status/github/statuses_spec.rb
158
138
  - spec/status/jenkins_spec.rb
159
- - status.gemspec
160
139
  - update_status.gemspec
161
140
  homepage: http://github.com/dougdroper/status
162
- licenses:
141
+ licenses:
163
142
  - MIT
164
143
  post_install_message:
165
144
  rdoc_options: []
166
-
167
- require_paths:
145
+ require_paths:
168
146
  - lib
169
- required_ruby_version: !ruby/object:Gem::Requirement
147
+ required_ruby_version: !ruby/object:Gem::Requirement
170
148
  none: false
171
- requirements:
172
- - - ">="
173
- - !ruby/object:Gem::Version
174
- hash: 3
175
- segments:
149
+ requirements:
150
+ - - ! '>='
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ segments:
176
154
  - 0
177
- version: "0"
178
- required_rubygems_version: !ruby/object:Gem::Requirement
155
+ hash: -1513231269087181306
156
+ required_rubygems_version: !ruby/object:Gem::Requirement
179
157
  none: false
180
- requirements:
181
- - - ">="
182
- - !ruby/object:Gem::Version
183
- hash: 3
184
- segments:
185
- - 0
186
- version: "0"
158
+ requirements:
159
+ - - ! '>='
160
+ - !ruby/object:Gem::Version
161
+ version: '0'
187
162
  requirements: []
188
-
189
163
  rubyforge_project:
190
- rubygems_version: 1.8.24
164
+ rubygems_version: 1.8.25
191
165
  signing_key:
192
166
  specification_version: 3
193
167
  summary: Status update for pull requests
194
168
  test_files: []
195
-
@@ -1,39 +0,0 @@
1
- GEM
2
- remote: http://rubygems.org/
3
- specs:
4
- diff-lcs (1.1.3)
5
- git (1.2.5)
6
- jeweler (1.8.4)
7
- bundler (~> 1.0)
8
- git (>= 1.2.5)
9
- rake
10
- rdoc
11
- json (1.7.5)
12
- mime-types (1.19)
13
- multi_json (1.3.6)
14
- rake (0.9.2.2)
15
- rcov (0.9.9)
16
- rdoc (3.12)
17
- json (~> 1.4)
18
- rest-client (1.6.7)
19
- mime-types (>= 1.16)
20
- rspec (2.11.0)
21
- rspec-core (~> 2.11.0)
22
- rspec-expectations (~> 2.11.0)
23
- rspec-mocks (~> 2.11.0)
24
- rspec-core (2.11.1)
25
- rspec-expectations (2.11.3)
26
- diff-lcs (~> 1.1.3)
27
- rspec-mocks (2.11.3)
28
-
29
- PLATFORMS
30
- ruby
31
-
32
- DEPENDENCIES
33
- bundler (>= 1.2.1)
34
- jeweler (~> 1.8.4)
35
- multi_json (>= 1.0.3)
36
- rcov
37
- rdoc (~> 3.12)
38
- rest-client (>= 1.6.2)
39
- rspec (>= 2.11.0)
@@ -1,65 +0,0 @@
1
- = status
2
-
3
- {<img src="https://secure.travis-ci.org/dougdroper/status.png?branch=master" alt="Build Status" />}[https://travis-ci.org/dougdroper/status]
4
-
5
- Updates pull requests on github using the statuses api (http://developer.github.com/v3/repos/statuses/), with latest build from Jenkins and QA status
6
-
7
- = Usage
8
-
9
- <tt>gem install update_status</tt>
10
-
11
-
12
- on your branch run
13
-
14
- $: <tt>status</tt>
15
-
16
- This will generate a .status.yml file in the current directory, you will need to edit this file with your credentials.
17
-
18
- .status.yml:
19
-
20
- ---
21
- :username: Jenkins username
22
-
23
- :token: Githubs API token (http://developer.github.com/v3/oauth/)
24
-
25
- :owner: eg. dougdroper
26
-
27
- :password: Jenkins password
28
-
29
- :repo: eg. status
30
-
31
- :ci_url: eg. http://ci.jenkins.com
32
-
33
- add .status.yml to .gitignore
34
-
35
- When your branch has passed QA
36
-
37
- $: <tt>status -s pass</tt>
38
-
39
- You can pass a different branch
40
-
41
- $: <tt>status -b other_feature_branch</tt>
42
-
43
- or
44
-
45
- $: <tt>status -b other_feature_branch -s pass</tt>
46
-
47
- help
48
-
49
- $: <tt>status -h</tt>
50
-
51
- == Contributing to status
52
-
53
- * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
54
- * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
55
- * Fork the project.
56
- * Start a feature/bugfix branch.
57
- * Commit and push until you are happy with your contribution.
58
- * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
59
- * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
60
-
61
- == Copyright
62
-
63
- Copyright (c) 2012 Douglas Roper. See LICENSE.txt for
64
- further details.
65
-
@@ -1,79 +0,0 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
- # -*- encoding: utf-8 -*-
5
-
6
- Gem::Specification.new do |s|
7
- s.name = "status"
8
- s.version = "0.1.0"
9
-
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Douglas Roper"]
12
- s.date = "2012-10-25"
13
- s.description = "Updates pull requests on github, with latest build from Jenkins and QA status"
14
- s.email = "douglasroper@notonthehighstreet.com"
15
- s.executables = ["status"]
16
- s.extra_rdoc_files = [
17
- "LICENSE.txt",
18
- "README.rdoc"
19
- ]
20
- s.files = [
21
- ".document",
22
- "Gemfile",
23
- "Gemfile.lock",
24
- "LICENSE.txt",
25
- "README.rdoc",
26
- "Rakefile",
27
- "VERSION",
28
- "bin/status",
29
- "lib/status.rb",
30
- "lib/status/base.rb",
31
- "lib/status/config.rb",
32
- "lib/status/github/pull_request.rb",
33
- "lib/status/github/statuses.rb",
34
- "lib/status/jenkins.rb",
35
- "lib/status/request.rb",
36
- "spec/spec_helper.rb",
37
- "spec/status/github/pull_request_spec.rb",
38
- "spec/status/jenkins_spec.rb",
39
- "status.gemspec",
40
- "test/helper.rb",
41
- "test/test_status.rb"
42
- ]
43
- s.homepage = "http://github.com/dougdroper/status"
44
- s.licenses = ["MIT"]
45
- s.require_paths = ["lib"]
46
- s.rubygems_version = "1.8.24"
47
- s.summary = "Status update for pull requests"
48
-
49
- if s.respond_to? :specification_version then
50
- s.specification_version = 3
51
-
52
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
53
- s.add_runtime_dependency(%q<multi_json>, [">= 1.0.3"])
54
- s.add_runtime_dependency(%q<rest-client>, [">= 1.6.7"])
55
- s.add_development_dependency(%q<rspec>, [">= 0"])
56
- s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
57
- s.add_development_dependency(%q<bundler>, [">= 1.2.1"])
58
- s.add_development_dependency(%q<jeweler>, ["~> 1.8.4"])
59
- s.add_development_dependency(%q<rcov>, [">= 0"])
60
- else
61
- s.add_dependency(%q<multi_json>, [">= 1.0.3"])
62
- s.add_dependency(%q<rest-client>, [">= 1.6.7"])
63
- s.add_dependency(%q<rspec>, [">= 0"])
64
- s.add_dependency(%q<rdoc>, ["~> 3.12"])
65
- s.add_dependency(%q<bundler>, [">= 1.2.1"])
66
- s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
67
- s.add_dependency(%q<rcov>, [">= 0"])
68
- end
69
- else
70
- s.add_dependency(%q<multi_json>, [">= 1.0.3"])
71
- s.add_dependency(%q<rest-client>, [">= 1.6.7"])
72
- s.add_dependency(%q<rspec>, [">= 0"])
73
- s.add_dependency(%q<rdoc>, ["~> 3.12"])
74
- s.add_dependency(%q<bundler>, [">= 1.2.1"])
75
- s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
76
- s.add_dependency(%q<rcov>, [">= 0"])
77
- end
78
- end
79
-