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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: be161f42b0b71a8b844def77b8bf6804e509b2031e8c36414cca774e7a2c9d52
4
- data.tar.gz: d25cc54a5fe1b7c790a777be33f588ee077c5e2e7bdda3859036b0cfdb6f8f09
3
+ metadata.gz: 3f9701abf6328e9334c2880ad0583f405c770b364a5b00d1e651e39d7518bbd1
4
+ data.tar.gz: ab3a7266b6e803a624d58994ac9261011de5d4580136ffe56124fe59483c3ca8
5
5
  SHA512:
6
- metadata.gz: cc662bd2602a49e01778f9d7cce01a1c9b1355ce34d0a787bb2069bbb047b91dfd781831991eb7948aa767a74466ccb33cab46954ae67eb723e6347d24347b43
7
- data.tar.gz: 6ba85d28bd29051e39398edb5ef81737bf3181fc99d05140b541d13d92e299a4964822f25c9e72536958d357c6c8170f3e080760c4800c40786782a4fb630163
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-13 10:11:54 +0900 using RuboCop version 0.60.0.
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rubocop_challenger (1.0.0.pre)
4
+ rubocop_challenger (1.0.0.pre2)
5
5
  octokit
6
6
  rubocop
7
7
  rubocop-rspec
data/README.md CHANGED
@@ -56,7 +56,7 @@ jobs:
56
56
  bundle install
57
57
  bundle exec rubocop_challenger go \
58
58
  --email=rubocop-challenger@example.com \
59
- --name="'Rubocop Challenger'"
59
+ --name="Rubocop Challenger"
60
60
 
61
61
  workflows:
62
62
  version: 2
@@ -58,7 +58,7 @@ module RubocopChallenger
58
58
  end
59
59
 
60
60
  def remote_url(remote)
61
- run('remote', 'get-url', '--push', remote)
61
+ config("--get remote.#{remote}.url")
62
62
  end
63
63
 
64
64
  private
@@ -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('origin', topic_branch)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubocopChallenger
4
- VERSION = '1.0.0.pre'
4
+ VERSION = '1.0.0.pre2'
5
5
  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.pre
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-13 00:00:00.000000000 Z
11
+ date: 2018-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octokit