fight_club 0.0.9 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fight_club.rb +1 -5
- data/lib/fight_club/commenter.rb +2 -2
- data/lib/fight_club/config.rb +4 -1
- data/lib/fight_club/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e8c3a9ffbe09800fa3501bc2b0f9cfca4b617b6
|
4
|
+
data.tar.gz: 7c69a31fef40e7c319278041e2020369031909f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9348925d56d4e876477f2b871f439217f88ee957cc818db81be3144180d9836d1209f48c85cb86ed00248d4be12f070622a03a75c7d90b3806ddd82770ad5b9b
|
7
|
+
data.tar.gz: 870326a4b2488db4d82d7c40d2d8e806ca166ef4827c95b62917808b4ea2a98529c01e1356091273536404df0c5a0eec1a6709f5e69e23179a5763bd00f960c1
|
data/lib/fight_club.rb
CHANGED
@@ -5,7 +5,7 @@ require_relative "fight_club/config"
|
|
5
5
|
|
6
6
|
module FightClub
|
7
7
|
class << self
|
8
|
-
attr_writer :config
|
8
|
+
attr_writer :config
|
9
9
|
end
|
10
10
|
|
11
11
|
def self.begin(pull_request)
|
@@ -16,10 +16,6 @@ module FightClub
|
|
16
16
|
@config ||= Config.new
|
17
17
|
end
|
18
18
|
|
19
|
-
def self.log
|
20
|
-
@log ||= Hash.new { |hsh, key| hsh[key] = [] }
|
21
|
-
end
|
22
|
-
|
23
19
|
def self.configure
|
24
20
|
yield(config)
|
25
21
|
end
|
data/lib/fight_club/commenter.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module FightClub
|
2
2
|
class Commenter
|
3
3
|
def self.comment(pr, message)
|
4
|
-
unless FightClub.
|
4
|
+
unless FightClub.comment_check.call(pr, message)
|
5
5
|
HTTParty.post(
|
6
6
|
pr["_links"]["comments"]["href"],
|
7
7
|
body: {
|
@@ -14,7 +14,7 @@ module FightClub
|
|
14
14
|
}
|
15
15
|
)
|
16
16
|
|
17
|
-
FightClub.
|
17
|
+
FightClub.save_comment(pr, message)
|
18
18
|
Logger.new(STDOUT).info "Left a comment on #{pr["number"]} with message: #{message}"
|
19
19
|
end
|
20
20
|
end
|
data/lib/fight_club/config.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
module FightClub
|
2
2
|
class Config
|
3
3
|
attr_accessor :repo, :oauth, :repo_name,
|
4
|
-
:uri, :master_branch, :repos_directory
|
4
|
+
:uri, :master_branch, :repos_directory,
|
5
|
+
:comment_check, :save_comment
|
5
6
|
|
6
7
|
def initialize
|
7
8
|
@repo = 'baxterthehacker/public-repo'
|
@@ -10,6 +11,8 @@ module FightClub
|
|
10
11
|
@uri = 'git@github.com:baxterthehacker/public-repo.git'
|
11
12
|
@master_branch = 'master'
|
12
13
|
@repos_directory = '/tmp'
|
14
|
+
@comment_check = Proc.new { |pr, comment| false }
|
15
|
+
@save_comment = Proc.new { |pr, comment| false }
|
13
16
|
end
|
14
17
|
end
|
15
18
|
end
|
data/lib/fight_club/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fight_club
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Minkov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|