circleci_notify 0.0.1

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6f696b87d2b03ca6c5bf4cd4bdd0c51707b62183
4
+ data.tar.gz: a012ad9768c414afe7a2ed798e170d0a8ad0e3fd
5
+ SHA512:
6
+ metadata.gz: 3219540fc24686b0b6e6aaccb87daf6886529c8a7043c41dff2ba6adb46a741be98c3906f136047e485515a677f76599bed28dbe976cda38c8f6268077b9ddf9
7
+ data.tar.gz: c164aa595d24de90bfd15bcc8864ca60811449d716f25b3fa2bbc8f7713b6dabd2bc879d327371710ee40a9d79d1f3f51800a15df4230c262ffa943c6e255859
@@ -0,0 +1,14 @@
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
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in circleci_notify.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Tomohiko Himura
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.
@@ -0,0 +1,31 @@
1
+ # CircleciNotify
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 'circleci_notify'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install circleci_notify
20
+
21
+ ## Usage
22
+
23
+ TODO: Write usage instructions here
24
+
25
+ ## Contributing
26
+
27
+ 1. Fork it ( https://github.com/[my-github-username]/circleci_notify/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
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+ $: << File.join(File.dirname(__FILE__), "..","lib")
3
+ require "circleci_notify"
4
+
5
+ CircleciNotify.run
@@ -0,0 +1,14 @@
1
+ machine:
2
+ ruby:
3
+ version: 2.1.2
4
+ test:
5
+ override:
6
+ - gem install chatwork
7
+ post:
8
+ - bin/circleci_notify Ended
9
+ deployment:
10
+ production:
11
+ branch: master
12
+ commands:
13
+ - echo deploy
14
+ - bin/circleci_notify Deploy Ended
@@ -0,0 +1,24 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'circleci_notify/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "circleci_notify"
8
+ spec.version = CircleciNotify::VERSION
9
+ spec.authors = ["Tomohiko Himura"]
10
+ spec.email = ["eiel.hal@gmail.com"]
11
+ spec.summary = %q{Notification when finished Build on CircleCI}
12
+ spec.description = %q{Notification when finished Build on CircleCI}
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_development_dependency "bundler", "> 1.6"
22
+ spec.add_development_dependency "rake", "~> 10.0"
23
+ spec.add_runtime_dependency "chatwork", "~> 0.0.5"
24
+ end
@@ -0,0 +1,9 @@
1
+ require "circleci_notify/version"
2
+ require "circleci_notify/notifier"
3
+
4
+ module CircleciNotify
5
+ def self.run
6
+ notifier = CircleciNotify::Notifier.new(ARGV.first)
7
+ notifier.notify
8
+ end
9
+ end
@@ -0,0 +1,56 @@
1
+ require "chatwork"
2
+
3
+ module CircleciNotify
4
+ class Notifier
5
+ attr_reader :message
6
+
7
+ def initialize(message)
8
+ @api = ENV["CHATWORK_API"]
9
+ @room_id = ENV["CHATWORK_ROOM_ID"].to_i
10
+ @message = message
11
+ end
12
+
13
+ def notify
14
+ ChatWork.api_key = @api
15
+ ChatWork::Message.create(room_id: @room_id, body: body)
16
+ end
17
+
18
+ def body
19
+ <<-MESSAGE
20
+ [info][title]CircleCI Builds #{message}[/title]
21
+ build report: #{build_report}
22
+ compare: #{compare}
23
+ commits: #{github}/commit/#{sha}
24
+ [/info]
25
+ MESSAGE
26
+ end
27
+
28
+ def compare
29
+ ENV["CIRCLE_COMPARE_URL"]
30
+ end
31
+
32
+ def build_report
33
+ "https://circleci.com/gh/#{username}/#{reponame}/number"
34
+ end
35
+
36
+ def number
37
+ ENV["CIRCLE_BUILD_NUM"]
38
+ end
39
+
40
+ def reponame
41
+ ENV["CIRCLE_PROJECT_REPONAME"]
42
+ end
43
+
44
+ def username
45
+ ENV["CIRCLE_PROJECT_USERNAME"]
46
+ end
47
+
48
+ def sha
49
+ ENV["CIRCLE_SHA1"]
50
+ end
51
+
52
+ def github
53
+ "https://github.com/#{username}/#{reponame}"
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,3 @@
1
+ module CircleciNotify
2
+ VERSION = "0.0.1"
3
+ end
metadata ADDED
@@ -0,0 +1,99 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: circleci_notify
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Tomohiko Himura
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-10-10 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.6'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.6'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: chatwork
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 0.0.5
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 0.0.5
55
+ description: Notification when finished Build on CircleCI
56
+ email:
57
+ - eiel.hal@gmail.com
58
+ executables:
59
+ - circleci_notify
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - ".gitignore"
64
+ - Gemfile
65
+ - LICENSE.txt
66
+ - README.md
67
+ - Rakefile
68
+ - bin/circleci_notify
69
+ - circle.yml
70
+ - circleci_notify.gemspec
71
+ - lib/circleci_notify.rb
72
+ - lib/circleci_notify/notifier.rb
73
+ - lib/circleci_notify/version.rb
74
+ homepage: ''
75
+ licenses:
76
+ - MIT
77
+ metadata: {}
78
+ post_install_message:
79
+ rdoc_options: []
80
+ require_paths:
81
+ - lib
82
+ required_ruby_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ requirements: []
93
+ rubyforge_project:
94
+ rubygems_version: 2.2.2
95
+ signing_key:
96
+ specification_version: 4
97
+ summary: Notification when finished Build on CircleCI
98
+ test_files: []
99
+ has_rdoc: