github-commit-status-updater 1.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: 5465cad5577e63422895508c7d07582581dae637
4
+ data.tar.gz: 4f2d8640afca442b15e992426c819f2bcf21241a
5
+ SHA512:
6
+ metadata.gz: e70beb451cb172aa34d9693e22c3505bf629a536235883501d85c4758d5d33dc283ec8d84c30f044e677ffa7b73c8928ed04e028964c88235be0b879aca9168d
7
+ data.tar.gz: 3b4dbcde48afaeeabcd454a3c0a8c898184937ff3800e2e33c02a28cecf18f26b256cdf70b2bb3f98aee98a2e3206ad0901707eda16088f233a35692088ce82f
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in github-commit-status-updater.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 joker1007
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,44 @@
1
+ # Github::Commit::Status::Updater
2
+ Simple CLI Tools for GitHub commit status.
3
+
4
+ ## Installation
5
+
6
+ $ gem install github-commit-status-updater
7
+
8
+ Or, add this line to your application's Gemfile:
9
+
10
+ gem 'github-commit-status-updater', github: 'joker1007/github-commit-status-updater'
11
+
12
+ And then execute:
13
+
14
+ $ bundle
15
+
16
+ ## Usage
17
+
18
+ ```
19
+ Commands:
20
+ github-commit-status-updater error -r, --repo=REPO -s, --sha1=SHA1 # commit status error
21
+ github-commit-status-updater failure -r, --repo=REPO -s, --sha1=SHA1 # commit status failure
22
+ github-commit-status-updater help [COMMAND] # Describe available commands or one specific command
23
+ github-commit-status-updater pending -r, --repo=REPO -s, --sha1=SHA1 # commit status pending
24
+ github-commit-status-updater success -r, --repo=REPO -s, --sha1=SHA1 # commit status success
25
+ ```
26
+
27
+ - format for `repo` is like 'joker1007/github-commit-status-updater' (owner/repo)
28
+ - `sha` must be a 40 character SHA1
29
+
30
+ And options for credential:
31
+
32
+ - `-u username`
33
+ - `-p password`
34
+ - `--oauth-token token`
35
+ - `--target-url URL`
36
+ - `--description description`
37
+
38
+ ## Contributing
39
+
40
+ 1. Fork it
41
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
42
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
43
+ 4. Push to the branch (`git push origin my-new-feature`)
44
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,42 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "octokit"
5
+ require "thor"
6
+
7
+ class GithubCommitStatusUpdater < Thor
8
+ STATUSES = %w(pending success failure error)
9
+
10
+ STATUSES.each do |method|
11
+ method_option :repo, :type => :string, :required => true, :aliases => "-r"
12
+ method_option :sha1, :type => :string, :required => true, :aliases => "-s"
13
+ method_option :username, :type => :string, :aliases => "-u"
14
+ method_option :password, :type => :string, :aliases => "-p"
15
+ method_option :oauth_token, :type => :string
16
+ method_option :target_url, :type => :string
17
+ method_option :description, :type => :string
18
+
19
+ desc "#{method}", "commit status #{method}"
20
+ define_method "#{method}" do
21
+ begin
22
+ client.create_status(options.repo, options.sha1, method, {target_url: options.target_url, description: options.description})
23
+ puts "Changed status as #{method}"
24
+ rescue Octokit::Error => e
25
+ $stderr.puts "Update error: #{e.message}"
26
+ end
27
+ end
28
+ end
29
+
30
+ private
31
+ def client
32
+ if options.username && options.password
33
+ Octokit::Client.new(:login => options.username, :password => options.password)
34
+ elsif options.username && options.oauth_token
35
+ Octokit::Client.new(:login => options.username, :oauth_token => options.oauth_token)
36
+ else
37
+ Octokit::Client.new
38
+ end
39
+ end
40
+ end
41
+
42
+ GithubCommitStatusUpdater.start
@@ -0,0 +1,22 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'github-commit-status-updater/version'
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = "github-commit-status-updater"
8
+ gem.version = Github::Commit::Status::Updater::VERSION
9
+ gem.authors = ["joker1007"]
10
+ gem.email = ["kakyoin.hierophant@gmail.com"]
11
+ gem.description = %q{Github commit status api helper}
12
+ gem.summary = %q{Github commit status api helper}
13
+ gem.homepage = "https://github.com/joker1007/github-commit-status-updater"
14
+
15
+ gem.files = `git ls-files`.split($/)
16
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
+ gem.require_paths = ["lib"]
19
+
20
+ gem.add_dependency 'octokit'
21
+ gem.add_dependency 'thor'
22
+ end
@@ -0,0 +1,11 @@
1
+ require "github-commit-status-updater/version"
2
+
3
+ module Github
4
+ module Commit
5
+ module Status
6
+ module Updater
7
+ # Your code goes here...
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,9 @@
1
+ module Github
2
+ module Commit
3
+ module Status
4
+ module Updater
5
+ VERSION = "1.0.1"
6
+ end
7
+ end
8
+ end
9
+ end
metadata ADDED
@@ -0,0 +1,82 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: github-commit-status-updater
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.1
5
+ platform: ruby
6
+ authors:
7
+ - joker1007
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-05-29 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: octokit
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: thor
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: Github commit status api helper
42
+ email:
43
+ - kakyoin.hierophant@gmail.com
44
+ executables:
45
+ - github-commit-status-updater
46
+ extensions: []
47
+ extra_rdoc_files: []
48
+ files:
49
+ - .gitignore
50
+ - Gemfile
51
+ - LICENSE.txt
52
+ - README.md
53
+ - Rakefile
54
+ - bin/github-commit-status-updater
55
+ - github-commit-status-updater.gemspec
56
+ - lib/github-commit-status-updater.rb
57
+ - lib/github-commit-status-updater/version.rb
58
+ homepage: https://github.com/joker1007/github-commit-status-updater
59
+ licenses: []
60
+ metadata: {}
61
+ post_install_message:
62
+ rdoc_options: []
63
+ require_paths:
64
+ - lib
65
+ required_ruby_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ required_rubygems_version: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - '>='
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ requirements: []
76
+ rubyforge_project:
77
+ rubygems_version: 2.0.2
78
+ signing_key:
79
+ specification_version: 4
80
+ summary: Github commit status api helper
81
+ test_files: []
82
+ has_rdoc: