rubocop_challenger 1.0.0.pre → 1.0.0.pre2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +1 -3
- data/.rubocop_todo.yml +1 -1
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/rubocop_challenger/git/command.rb +1 -1
- data/lib/rubocop_challenger/github/pr_creater.rb +8 -3
- data/lib/rubocop_challenger/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f9701abf6328e9334c2880ad0583f405c770b364a5b00d1e651e39d7518bbd1
|
4
|
+
data.tar.gz: ab3a7266b6e803a624d58994ac9261011de5d4580136ffe56124fe59483c3ca8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ad342a14f5a57cb096a701f4861937350af646b705038fcdb00d756bc09c25f3067daf73e0f2bca7ca94e4774eda19b67cf09b871930f4887b2cd11f2cb9493
|
7
|
+
data.tar.gz: 4da482b7bbcb9f87a6f867179230ffc382d6e535b1bda83940f0a703a902f8d7904ca1910d12624617447b022f3b045e396900137f5d7e174e5d06d2fd5df9af
|
data/.circleci/config.yml
CHANGED
@@ -108,7 +108,6 @@ jobs:
|
|
108
108
|
--name=ryz310 \
|
109
109
|
--mode=random \
|
110
110
|
--labels='rubocop challenge' 'in progress' \
|
111
|
-
--regenerate-rubocop-todo \
|
112
111
|
--no-commit
|
113
112
|
|
114
113
|
rubocop_challenge:
|
@@ -125,8 +124,7 @@ jobs:
|
|
125
124
|
--email=ryz310@gmail.com \
|
126
125
|
--name=ryz310 \
|
127
126
|
--template=./lib/templates/checklist.md.erb \
|
128
|
-
--labels='rubocop challenge' 'in progress'
|
129
|
-
--regenerate-rubocop-todo
|
127
|
+
--labels='rubocop challenge' 'in progress'
|
130
128
|
|
131
129
|
release:
|
132
130
|
docker:
|
data/.rubocop_todo.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on 2018-11-
|
3
|
+
# on 2018-11-15 18:29:11 +0900 using RuboCop version 0.60.0.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -12,6 +12,7 @@ module RubocopChallenger
|
|
12
12
|
# @param user_name [String] The username to use for committer and author
|
13
13
|
# @param user_email [String] The email to use for committer and author
|
14
14
|
def initialize(access_token:, branch:, user_name: nil, user_email: nil)
|
15
|
+
@access_token = access_token
|
15
16
|
@topic_branch = branch
|
16
17
|
@git = Git::Command.new(user_name: user_name, user_email: user_email)
|
17
18
|
@github = Github::Client.new(access_token, git.remote_url('origin'))
|
@@ -44,17 +45,17 @@ module RubocopChallenger
|
|
44
45
|
def create_pr(title:, body:, base:, labels: nil)
|
45
46
|
return false unless git_condition_valid?
|
46
47
|
|
47
|
-
git.push(
|
48
|
+
git.push(github_token_url, topic_branch)
|
48
49
|
pr_number = github.create_pull_request(
|
49
50
|
base: base, head: topic_branch, title: title, body: body
|
50
51
|
)
|
51
|
-
github.add_labels(pr_number, labels) unless labels.nil?
|
52
|
+
github.add_labels(pr_number, *labels) unless labels.nil?
|
52
53
|
true
|
53
54
|
end
|
54
55
|
|
55
56
|
private
|
56
57
|
|
57
|
-
attr_reader :git, :github, :topic_branch, :initial_sha1
|
58
|
+
attr_reader :access_token, :git, :github, :topic_branch, :initial_sha1
|
58
59
|
|
59
60
|
def git_condition_valid?
|
60
61
|
!git.current_sha1?(initial_sha1) && git.current_branch?(topic_branch)
|
@@ -65,6 +66,10 @@ module RubocopChallenger
|
|
65
66
|
|
66
67
|
yield
|
67
68
|
end
|
69
|
+
|
70
|
+
def github_token_url
|
71
|
+
"https://#{access_token}@github.com/#{github.repository}"
|
72
|
+
end
|
68
73
|
end
|
69
74
|
end
|
70
75
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop_challenger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.pre2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ryosuke_sato
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11-
|
11
|
+
date: 2018-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: octokit
|