github_status_notifier 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b0fc8a546451c9fe69cc6fd17d98a21a5ee9e0ed
4
- data.tar.gz: d026f96c690d4633eba50be50410e9e5999e794b
3
+ metadata.gz: f8bd28382e75520a746c5b981c8e5b75145dceac
4
+ data.tar.gz: dad2ff156b7adf68868abd723c07428c3c549af5
5
5
  SHA512:
6
- metadata.gz: 231c867ad4f0f81116a665ed5185345eec1f3d210a7ccf650c932924dc045a2cae9f818760704f605174b24a82ee3d86e998f6e88967351116df51513d767c9f
7
- data.tar.gz: d7b7af9cd8e888ff66b399e571a62409552fab768cc6bf239688386ff36350f343569d7196321b82c66131265f4cae554d605cd4dad1446cfbd2341a95c2a337
6
+ metadata.gz: 363f7ba3f7ce56c26804aab438575c700992eab01eb07c492455a228bc54c02fc604f67c9abcf29f285a4e00f0413bd3b318c96e176b28f9940b4ca403516863
7
+ data.tar.gz: 1d97c744f596d3285323d394854d8bb905f4c3d1f72e289a2d229be826c8f03bc2a843b66e0305349a456422c8be7355575ecb1c236f01325aa52f096e8470df
data/README.md CHANGED
@@ -22,7 +22,7 @@ $ github-status-notifier notify --exit-status $?
22
22
  ```
23
23
  Commands:
24
24
  github-status-notifier help [COMMAND] # Describe available commands or one specific command
25
- github-status-notifier notify # Notify current status to GitHub status
25
+ github-status-notifier notify # Notify current state to GitHub status
26
26
  github-status-notifier version # Show the GithubStatusNotifier version
27
27
 
28
28
  Usage:
@@ -38,8 +38,9 @@ Options:
38
38
  [--target-url=TARGET_URL]
39
39
  [--description=DESCRIPTION]
40
40
  [--context=CONTEXT]
41
+ # Default: github_status_notifier
41
42
 
42
- Notify current status to GitHub status
43
+ Notify current state to GitHub status
43
44
  ```
44
45
 
45
46
  see also: [Statuses | GitHub API](https://developer.github.com/v3/repos/statuses/)
@@ -14,7 +14,17 @@ Gem::Specification.new do |spec|
14
14
  spec.homepage = 'https://github.com/packsaddle/ruby-github_status_notifier'
15
15
  spec.license = 'MIT'
16
16
 
17
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
+ spec.files = \
18
+ `git ls-files -z`
19
+ .split("\x0")
20
+ .reject { |f| f.match(%r{^(test|spec|features)/}) }
21
+ .reject do |f|
22
+ [
23
+ '.travis.yml',
24
+ 'circle.yml',
25
+ '.tachikoma.yml'
26
+ ].include?(f)
27
+ end
18
28
  spec.bindir = 'exe'
19
29
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
30
  spec.require_paths = ['lib']
@@ -13,15 +13,15 @@ module GithubStatusNotifier
13
13
  puts "GithubStatusNotifier version #{::GithubStatusNotifier::VERSION}"
14
14
  end
15
15
 
16
- desc 'notify', 'Notify current status to GitHub status'
16
+ desc 'notify', 'Notify current state to GitHub status'
17
17
  option :exit_status, type: :numeric
18
18
  option :keep_exit_status, type: :boolean, default: false
19
19
  option :debug, type: :boolean, default: false
20
20
  option :verbose, type: :boolean, default: false
21
- option :state, type: :string, enum: %w(pending success error failure)
21
+ option :state, type: :string, enum: Notifier::ALLOWED_STATUS
22
22
  option :target_url, type: :string
23
23
  option :description, type: :string
24
- option :context, type: :string
24
+ option :context, type: :string, default: Notifier::CONTEXT
25
25
  def notify
26
26
  if options[:debug]
27
27
  logger.level = Logger::DEBUG
@@ -30,8 +30,7 @@ module GithubStatusNotifier
30
30
  end
31
31
  logger.debug(options.inspect)
32
32
  if options[:keep_exit_status] && !options[:exit_status]
33
- logger.error 'keep-exit-status requires exit-status'
34
- abort
33
+ fail ArgumentError, 'keep-exit-status requires exit-status'
35
34
  end
36
35
 
37
36
  params = {
@@ -47,6 +46,10 @@ module GithubStatusNotifier
47
46
  if options[:keep_exit_status]
48
47
  exit options[:exit_status]
49
48
  end
49
+ rescue StandardError => e
50
+ logger.error 'options:'
51
+ logger.error options
52
+ raise e
50
53
  end
51
54
 
52
55
  no_commands do
@@ -19,8 +19,11 @@ module GithubStatusNotifier
19
19
  }
20
20
  client.create_status(state, pass_params)
21
21
  rescue StandardError => e
22
- logger.error e.message
23
- logger.error e.backtrace
22
+ logger.error 'state:'
23
+ logger.error state
24
+ logger.error 'pass_params:'
25
+ logger.error pass_params
26
+ raise e
24
27
  end
25
28
 
26
29
  def decide_target_url(url)
@@ -1,3 +1,3 @@
1
1
  module GithubStatusNotifier
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github_status_notifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - sanemat
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-02-28 00:00:00.000000000 Z
11
+ date: 2015-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -91,8 +91,6 @@ extra_rdoc_files: []
91
91
  files:
92
92
  - ".gitignore"
93
93
  - ".rubocop.yml"
94
- - ".tachikoma.yml"
95
- - ".travis.yml"
96
94
  - CODE_OF_CONDUCT.md
97
95
  - Gemfile
98
96
  - LICENSE.txt
data/.tachikoma.yml DELETED
@@ -1 +0,0 @@
1
- strategy: 'none'
data/.travis.yml DELETED
@@ -1,15 +0,0 @@
1
- language: ruby
2
- sudo: false
3
- rvm:
4
- - 1.9
5
- - 2.0
6
- - 2.1
7
- - 2.2
8
- before_install:
9
- - gem update bundler
10
- notifications:
11
- email:
12
- - ogataken@gmail.com
13
- branches:
14
- only:
15
- - master