ruboty-check_pr_please 0.0.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 42d047565858dec9dc3a9e7e5168bba3ab18a26c39b382cdef1c691d910bd9e5
4
+ data.tar.gz: 4bbcf915ed31d9fe580caca1beb88b10cd7ac2bf62031ea37717964169fed09f
5
+ SHA512:
6
+ metadata.gz: 4f3db6e83989d1da014bbad1e109d1336fd948616565ca719bc6ce0e50cdb09b0f96e058f44a3a10f6dfbad1e12288c4c52294b9a2337b143bdd3ae349b5b3cc
7
+ data.tar.gz: 70c0eff91bae4e3afbcfdf21037467005676a6f0b2317b539f9df2d24b92994e4aa06468d243fbdefb6bd50f780f6dab9e3f958e33e668a94a8579f7a7ecb0fa
data/.gitignore ADDED
@@ -0,0 +1,16 @@
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
15
+
16
+ /vendor/bundle/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in ruboty-check_pr_please.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 森井ゴンザレス
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,41 @@
1
+ # Ruboty::CheckPrPlease
2
+
3
+ ruboty plugin that demand you to review labeled Pull Requests on GitHub repository.
4
+
5
+ ![](http://resources.portalshit.net/ruboty-check_pr_please_1.png)
6
+ ![](http://resources.portalshit.net/ruboty-check_pr_please_2.png)
7
+
8
+ Blog entry introduces this gem (in Japanese).
9
+
10
+ [Pull Request のレビューを促す ruboty プラグイン - portal shit!](http://portalshit.net/2015/03/25/ruboty-check-pr-please)
11
+
12
+ ## Installation
13
+
14
+ Add this line to your application's Gemfile:
15
+
16
+ ```ruby
17
+ gem 'ruboty-check_pr_please'
18
+ ```
19
+
20
+ And then execute:
21
+
22
+ $ bundle
23
+
24
+ Or install it yourself as:
25
+
26
+ $ gem install ruboty-check_pr_please
27
+
28
+ ## Usage
29
+
30
+ 1. Write just just like `gem 'ruboty-check_pr_please', github: 'morygonzalez/ruboty-check_pr_please'` in your ruboty bot's Gemfile.
31
+ - You need to install ruboty-cron.gem if you want this gem to work periodically.
32
+ 2. Write `GITHUB_ACCESS_TOKEN='yourtokengoeshere'` and `GITHUB_REPOSITORY='owner/repo'` to your ruboty bot's .env file.
33
+ 3. Deploy ruboty bot.
34
+
35
+ ## Contributing
36
+
37
+ 1. Fork it ( https://github.com/[my-github-username]/ruboty-check_pr_please/fork )
38
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
39
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
40
+ 4. Push to the branch (`git push origin my-new-feature`)
41
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,40 @@
1
+ module Ruboty
2
+ module Actions
3
+ class CheckPrPlease < Base
4
+ def call
5
+ message.reply(begging_message)
6
+ end
7
+
8
+ private
9
+
10
+ def client
11
+ @client ||= ::Octokit::Client.new(access_token: access_token)
12
+ end
13
+
14
+ def access_token
15
+ @access_token ||= ENV['GITHUB_ACCESS_TOKEN']
16
+ end
17
+
18
+ def repository
19
+ @repository ||= (message[:repo] || ENV['GITHUB_REPOSITORY']).strip
20
+ end
21
+
22
+ def label
23
+ @label ||= message[:label].strip
24
+ end
25
+
26
+ def begging_message
27
+ return unless unchecked.present?
28
+ str = "#{label} の Pull Request が #{unchecked.count} 件あります!!、!\n>>> "
29
+ unchecked.each do |pr|
30
+ str << "#{pr.title} #{pr.pull_request.html_url}\n"
31
+ end
32
+ str.chomp
33
+ end
34
+
35
+ def unchecked
36
+ client.issues(repository, labels: label)
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,6 @@
1
+ require "ruboty"
2
+ require "active_support/all"
3
+ require "octokit"
4
+ require "ruboty/check_pr_please/version"
5
+ require "ruboty/actions/check_pr_please"
6
+ require "ruboty/handlers/check_pr_please"
@@ -0,0 +1,5 @@
1
+ module Ruboty
2
+ module CheckPrPlease
3
+ VERSION = "0.0.2"
4
+ end
5
+ end
@@ -0,0 +1,23 @@
1
+ module Ruboty
2
+ module Handlers
3
+ class CheckPrPlease < Base
4
+ on(
5
+ /(?<label>.+)の\s?(?:Pull Request|PR|プルリク|プルリクエスト)/,
6
+ name: 'check_pr_please',
7
+ description: 'label の Pull Request 一覧を返します'
8
+ )
9
+
10
+ on(
11
+ /((?<repo>.*)\s?にある)?\s?(?<label>.+)の\s?(?:Pull Request|PR|プルリク|プルリクエスト)/,
12
+ name: 'check_pr_please',
13
+ description: 'repo にある label の Pull Request 一覧を返します'
14
+ )
15
+
16
+ def check_pr_please(message)
17
+ Ruboty::Actions::CheckPrPlease.new(message).call
18
+ rescue Exception => e
19
+ Ruboty.logger.info "#{e.class}: #{e.message}"
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'ruboty/check_pr_please/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "ruboty-check_pr_please"
8
+ spec.version = Ruboty::CheckPrPlease::VERSION
9
+ spec.authors = ["森井ゴンザレス"]
10
+ spec.email = ["morygonzalez@gmail.com"]
11
+ spec.summary = %q{Pull Request のチェックをおねだりします。}
12
+ spec.description = %q{Pull Request のチェックをおねだりします。}
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_dependency "activesupport"
22
+ spec.add_dependency "ruboty"
23
+ spec.add_dependency "octokit"
24
+ spec.add_development_dependency "bundler", "~> 1.7"
25
+ spec.add_development_dependency "rake", "~> 10.0"
26
+ end
metadata ADDED
@@ -0,0 +1,124 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ruboty-check_pr_please
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - 森井ゴンザレス
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-04-06 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activesupport
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: ruboty
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
+ - !ruby/object:Gem::Dependency
42
+ name: octokit
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: bundler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.7'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.7'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '10.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '10.0'
83
+ description: Pull Request のチェックをおねだりします。
84
+ email:
85
+ - morygonzalez@gmail.com
86
+ executables: []
87
+ extensions: []
88
+ extra_rdoc_files: []
89
+ files:
90
+ - ".gitignore"
91
+ - Gemfile
92
+ - LICENSE.txt
93
+ - README.md
94
+ - Rakefile
95
+ - lib/ruboty/actions/check_pr_please.rb
96
+ - lib/ruboty/check_pr_please.rb
97
+ - lib/ruboty/check_pr_please/version.rb
98
+ - lib/ruboty/handlers/check_pr_please.rb
99
+ - ruboty-check_pr_please.gemspec
100
+ homepage: ''
101
+ licenses:
102
+ - MIT
103
+ metadata: {}
104
+ post_install_message:
105
+ rdoc_options: []
106
+ require_paths:
107
+ - lib
108
+ required_ruby_version: !ruby/object:Gem::Requirement
109
+ requirements:
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ version: '0'
113
+ required_rubygems_version: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ requirements: []
119
+ rubyforge_project:
120
+ rubygems_version: 2.7.2
121
+ signing_key:
122
+ specification_version: 4
123
+ summary: Pull Request のチェックをおねだりします。
124
+ test_files: []