tachikoma 4.2.3 → 4.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +4 -1
- data/.rubocop.yml +10 -5
- data/.travis.yml +1 -0
- data/CHANGELOG.md +5 -0
- data/README.md +2 -0
- data/data/default.yaml +2 -0
- data/lib/tachikoma/application.rb +92 -53
- data/lib/tachikoma/templates/data/bot-motoko-tachikoma.yaml +2 -0
- data/lib/tachikoma/version.rb +1 -1
- data/spec/tachikoma/application_spec.rb +19 -0
- data/spec/tasks/app_task_spec.rb +3 -1
- data/tachikoma.gemspec +2 -2
- metadata +3 -4
- data/rubocop-todo.yml +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 522b54b9884e1e63e68b6cf5f79fe0ce762357fc
|
4
|
+
data.tar.gz: 9aab06a2596c184e427f442771dc242c4e18fcf9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a92aa07095cc333cdc6f9d695b7c511e5a391bd11f14f27c0fa0f094a85b6acd6e7ef8c0394c6d1b733b41ce523e934f74713f0aea1fece5cf66c1c8dc5bbf73
|
7
|
+
data.tar.gz: 3134b45bfec31b93daa0aab3df1edba8e76bcdab4ca3079b7ad4c0c3c6981f667252887f9f84ae189edcf0ea0b6120afba96fed8f0eda40692f1ec1354a32b5c
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
@@ -1,14 +1,19 @@
|
|
1
|
-
inherit_from: rubocop-todo.yml
|
2
1
|
AllCops:
|
3
2
|
Include:
|
4
3
|
- '**/Rakefile'
|
5
4
|
- Gemfile
|
6
5
|
- tachikoma.gemspec
|
7
|
-
- bin
|
6
|
+
- bin/**/*
|
8
7
|
- lib/**/*.rake
|
9
8
|
Exclude:
|
10
|
-
- pkg
|
11
|
-
- repos
|
12
|
-
- vendor
|
9
|
+
- pkg/**/*
|
10
|
+
- repos/**/*
|
11
|
+
- vendor/**/*
|
13
12
|
StringLiterals:
|
14
13
|
EnforcedStyle: single_quotes
|
14
|
+
LineLength:
|
15
|
+
Max: 120
|
16
|
+
Blocks:
|
17
|
+
Enabled: false
|
18
|
+
Style/DotPosition:
|
19
|
+
Enabled: true
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
data/data/default.yaml
CHANGED
@@ -48,6 +48,7 @@ module Tachikoma
|
|
48
48
|
@timestamp_format = @configure['timestamp_format']
|
49
49
|
@readable_time = Time.now.utc.strftime(@timestamp_format)
|
50
50
|
@parallel_option = bundler_parallel_option(Bundler::VERSION, @configure['bundler_parallel_number'])
|
51
|
+
@depth_option = git_clone_depth_option(@configure['git_clone_depth'])
|
51
52
|
|
52
53
|
@target_head = target_repository_user(@type, @url, @github_account)
|
53
54
|
@pull_request_url = repository_identity(@url)
|
@@ -64,21 +65,35 @@ module Tachikoma
|
|
64
65
|
|
65
66
|
def fetch
|
66
67
|
clean
|
67
|
-
sh
|
68
|
+
sh(*([
|
69
|
+
'git', 'clone',
|
70
|
+
*@depth_option,
|
71
|
+
@authorized_base_url,
|
72
|
+
"#{Tachikoma.repos_path}/#{@build_for}"
|
73
|
+
].compact))
|
68
74
|
end
|
69
75
|
|
70
76
|
def bundler
|
71
77
|
Dir.chdir("#{Tachikoma.repos_path}/#{@build_for}") do
|
72
78
|
Bundler.with_clean_env do
|
73
|
-
sh
|
74
|
-
sh
|
75
|
-
sh
|
76
|
-
sh
|
77
|
-
sh
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
79
|
+
sh(*['ruby', '-i', '-pe', '$_.gsub! /^ruby/, "#ruby"', 'Gemfile'])
|
80
|
+
sh(*['git', 'config', 'user.name', @commiter_name])
|
81
|
+
sh(*['git', 'config', 'user.email', @commiter_email])
|
82
|
+
sh(*['git', 'checkout', '-b', "tachikoma/update-#{@readable_time}", @base_remote_branch])
|
83
|
+
sh(*([
|
84
|
+
'bundle',
|
85
|
+
'--gemfile', 'Gemfile',
|
86
|
+
'--no-deployment',
|
87
|
+
'--without', 'nothing',
|
88
|
+
'--path', 'vendor/bundle',
|
89
|
+
@parallel_option
|
90
|
+
].compact))
|
91
|
+
sh(*%w(bundle update))
|
92
|
+
sh(*['git', 'add', 'Gemfile.lock'])
|
93
|
+
sh(*['git', 'commit', '-m', "Bundle update #{@readable_time}"]) do
|
94
|
+
# ignore exitstatus
|
95
|
+
end
|
96
|
+
sh(*['git', 'push', @authorized_compare_url, "tachikoma/update-#{@readable_time}"])
|
82
97
|
end
|
83
98
|
end
|
84
99
|
end
|
@@ -90,71 +105,87 @@ module Tachikoma
|
|
90
105
|
|
91
106
|
def carton
|
92
107
|
Dir.chdir("#{Tachikoma.repos_path}/#{@build_for}") do
|
93
|
-
sh
|
94
|
-
sh
|
95
|
-
sh
|
96
|
-
sh
|
97
|
-
sh
|
98
|
-
sh
|
99
|
-
sh
|
100
|
-
sh
|
101
|
-
|
108
|
+
sh(*['git', 'config', 'user.name', @commiter_name])
|
109
|
+
sh(*['git', 'config', 'user.email', @commiter_email])
|
110
|
+
sh(*['git', 'checkout', '-b', "tachikoma/update-#{@readable_time}", @base_remote_branch])
|
111
|
+
sh(*%w(carton install))
|
112
|
+
sh(*%w(carton update))
|
113
|
+
sh(*['git', 'add', 'carton.lock']) if File.exist?('carton.lock')
|
114
|
+
sh(*['git', 'add', 'cpanfile.snapshot']) if File.exist?('cpanfile.snapshot')
|
115
|
+
sh(*['git', 'commit', '-m', "Carton update #{@readable_time}"]) do
|
116
|
+
# ignore exitstatus
|
117
|
+
end
|
118
|
+
sh(*['git', 'push', @authorized_compare_url, "tachikoma/update-#{@readable_time}"])
|
102
119
|
end
|
103
120
|
end
|
104
121
|
|
105
122
|
def none
|
106
123
|
Dir.chdir("#{Tachikoma.repos_path}/#{@build_for}") do
|
107
|
-
sh
|
108
|
-
sh
|
109
|
-
sh
|
110
|
-
sh
|
111
|
-
|
124
|
+
sh(*['git', 'config', 'user.name', @commiter_name])
|
125
|
+
sh(*['git', 'config', 'user.email', @commiter_email])
|
126
|
+
sh(*['git', 'checkout', '-b', "tachikoma/update-#{@readable_time}", @base_remote_branch])
|
127
|
+
sh(*['git', 'commit', '--allow-empty', '-m', "None update #{@readable_time}"]) do
|
128
|
+
# ignore exitstatus
|
129
|
+
end
|
130
|
+
sh(*['git', 'push', @authorized_compare_url, "tachikoma/update-#{@readable_time}"])
|
112
131
|
end
|
113
132
|
end
|
114
133
|
|
115
134
|
def david
|
116
135
|
Dir.chdir("#{Tachikoma.repos_path}/#{@build_for}") do
|
117
|
-
sh
|
118
|
-
sh
|
119
|
-
sh
|
120
|
-
sh
|
121
|
-
sh
|
122
|
-
sh
|
123
|
-
|
136
|
+
sh(*['git', 'config', 'user.name', @commiter_name])
|
137
|
+
sh(*['git', 'config', 'user.email', @commiter_email])
|
138
|
+
sh(*['git', 'checkout', '-b', "tachikoma/update-#{@readable_time}", @base_remote_branch])
|
139
|
+
sh(*['david', 'update', '--warn404'])
|
140
|
+
sh(*['git', 'add', 'package.json'])
|
141
|
+
sh(*['git', 'commit', '-m', "David update #{@readable_time}"]) do
|
142
|
+
# ignore exitstatus
|
143
|
+
end
|
144
|
+
sh(*['git', 'push', @authorized_compare_url, "tachikoma/update-#{@readable_time}"])
|
124
145
|
end
|
125
146
|
end
|
126
147
|
|
127
148
|
def composer
|
128
149
|
Dir.chdir("#{Tachikoma.repos_path}/#{@build_for}") do
|
129
|
-
sh
|
130
|
-
sh
|
131
|
-
sh
|
150
|
+
sh(*['git', 'config', 'user.name', @commiter_name])
|
151
|
+
sh(*['git', 'config', 'user.email', @commiter_email])
|
152
|
+
sh(*['git', 'checkout', '-b', "tachikoma/update-#{@readable_time}", @base_remote_branch])
|
132
153
|
# FIXME: Use Octokit.api_endpoint for GitHub Enterprise
|
133
|
-
sh
|
134
|
-
sh
|
135
|
-
sh
|
136
|
-
sh
|
137
|
-
sh
|
138
|
-
|
154
|
+
sh(*['composer', 'config', 'github-oauth.github.com', @github_token])
|
155
|
+
sh(*['composer', 'install', '--no-interaction'])
|
156
|
+
sh(*['composer', 'update', '--no-interaction'])
|
157
|
+
sh(*['git', 'add', 'composer.lock'])
|
158
|
+
sh(*['git', 'commit', '-m', "Composer update #{@readable_time}"]) do
|
159
|
+
# ignore exitstatus
|
160
|
+
end
|
161
|
+
sh(*['git', 'push', @authorized_compare_url, "tachikoma/update-#{@readable_time}"])
|
139
162
|
end
|
140
163
|
end
|
141
164
|
|
142
165
|
def cocoapods
|
143
166
|
Dir.chdir("#{Tachikoma.repos_path}/#{@build_for}") do
|
144
|
-
sh
|
145
|
-
sh
|
146
|
-
sh
|
147
|
-
sh
|
148
|
-
sh
|
149
|
-
sh
|
150
|
-
sh
|
151
|
-
|
167
|
+
sh(*['git', 'config', 'user.name', @commiter_name])
|
168
|
+
sh(*['git', 'config', 'user.email', @commiter_email])
|
169
|
+
sh(*['git', 'checkout', '-b', "tachikoma/update-#{@readable_time}", @base_remote_branch])
|
170
|
+
sh(*%w(pod install))
|
171
|
+
sh(*%w(pod update))
|
172
|
+
sh(*['git', 'add', 'Podfile.lock'])
|
173
|
+
sh(*['git', 'commit', '-m', "Cocoapods update #{@readable_time}"]) do
|
174
|
+
# ignore exitstatus
|
175
|
+
end
|
176
|
+
sh(*['git', 'push', @authorized_compare_url, "tachikoma/update-#{@readable_time}"])
|
152
177
|
end
|
153
178
|
end
|
154
179
|
|
155
180
|
def pull_request
|
156
181
|
@client = Octokit::Client.new access_token: @github_token
|
157
|
-
@client.create_pull_request(
|
182
|
+
@client.create_pull_request(
|
183
|
+
@pull_request_url,
|
184
|
+
@pull_request_base,
|
185
|
+
@pull_request_head,
|
186
|
+
@pull_request_title,
|
187
|
+
@pull_request_body
|
188
|
+
)
|
158
189
|
rescue Octokit::UnprocessableEntity
|
159
190
|
end
|
160
191
|
|
@@ -212,10 +243,18 @@ module Tachikoma
|
|
212
243
|
end
|
213
244
|
|
214
245
|
def bundler_parallel_option(bundler_version, parallel_number)
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
246
|
+
return if !bundler_parallel_available?(bundler_version) || parallel_number <= 1
|
247
|
+
"--jobs=#{parallel_number}"
|
248
|
+
end
|
249
|
+
|
250
|
+
def bundler_parallel_available?(bundler_version)
|
251
|
+
# bundler 1.4.0 gets parallel number option
|
252
|
+
Gem::Version.create(bundler_version) >= Gem::Version.create('1.4.0')
|
253
|
+
end
|
254
|
+
|
255
|
+
def git_clone_depth_option(depth)
|
256
|
+
return [nil] unless depth
|
257
|
+
['--depth', depth.to_s]
|
219
258
|
end
|
220
259
|
end
|
221
260
|
end
|
data/lib/tachikoma/version.rb
CHANGED
@@ -142,6 +142,25 @@ YAML
|
|
142
142
|
end
|
143
143
|
end
|
144
144
|
|
145
|
+
describe '#git_clone_depth_option' do
|
146
|
+
subject { described_class.new }
|
147
|
+
|
148
|
+
context 'depth is not provided' do
|
149
|
+
let(:nil_for_expand) { [nil] }
|
150
|
+
it 'returns nil' do
|
151
|
+
expect(subject.git_clone_depth_option(nil)).to eq nil_for_expand
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
155
|
+
context 'depth is provided' do
|
156
|
+
let(:depth) { 10 }
|
157
|
+
let(:depth_for_expand) { ['--depth', '10'] }
|
158
|
+
it 'returns depth' do
|
159
|
+
expect(subject.git_clone_depth_option(depth)).to eq depth_for_expand
|
160
|
+
end
|
161
|
+
end
|
162
|
+
end
|
163
|
+
|
145
164
|
describe '#repository_identity' do
|
146
165
|
subject { described_class.new }
|
147
166
|
let(:identity) { 'example1/example2' }
|
data/spec/tasks/app_task_spec.rb
CHANGED
@@ -7,7 +7,9 @@ describe 'Tachikoma::Aplication' do
|
|
7
7
|
describe '#pull_request' do
|
8
8
|
context 'when github returns 422 UnprocessableEntity' do
|
9
9
|
before do
|
10
|
-
allow(Octokit::Client).to
|
10
|
+
allow(Octokit::Client).to \
|
11
|
+
receive_message_chain(:new, :create_pull_request)
|
12
|
+
.and_raise(Octokit::UnprocessableEntity)
|
11
13
|
end
|
12
14
|
|
13
15
|
it 'should not raise Octokit::UnprocessableEntity error' do
|
data/tachikoma.gemspec
CHANGED
@@ -14,8 +14,8 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.license = 'MIT'
|
15
15
|
|
16
16
|
spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
17
|
-
spec.executables = spec.files.grep(
|
18
|
-
spec.test_files = spec.files.grep(
|
17
|
+
spec.executables = spec.files.grep(/^bin\//) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(/^(test|spec|features)\//)
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
|
21
21
|
spec.add_dependency 'safe_yaml'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tachikoma
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.2.
|
4
|
+
version: 4.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sanemat
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: safe_yaml
|
@@ -171,7 +171,6 @@ files:
|
|
171
171
|
- lib/tachikoma/templates/repos/.gitkeep
|
172
172
|
- lib/tachikoma/version.rb
|
173
173
|
- lib/tasks/app.rake
|
174
|
-
- rubocop-todo.yml
|
175
174
|
- spec/spec_helper.rb
|
176
175
|
- spec/tachikoma/application_spec.rb
|
177
176
|
- spec/tachikoma/settings_spec.rb
|
@@ -197,7 +196,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
197
196
|
version: '0'
|
198
197
|
requirements: []
|
199
198
|
rubyforge_project:
|
200
|
-
rubygems_version: 2.
|
199
|
+
rubygems_version: 2.4.5
|
201
200
|
signing_key:
|
202
201
|
specification_version: 4
|
203
202
|
summary: Update gem frequently gets less pain. Let's doing bundle update as a habit!
|
data/rubocop-todo.yml
DELETED