tachikoma 3.0.6 → 3.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +12 -0
- data/Rakefile +3 -3
- data/data/default.yaml +2 -0
- data/lib/tachikoma/settings.rb +1 -0
- data/lib/tachikoma/version.rb +2 -1
- data/lib/tachikoma.rb +2 -1
- data/lib/tasks/app.rake +15 -4
- data/rubocop-todo.yml +9 -0
- data/spec/tachikoma/settings_spec.rb +2 -2
- data/spec/tasks/app_task_spec.rb +19 -0
- data/tachikoma.gemspec +8 -8
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d898f5519776809aee4550fa6b6b3fd082bc462c
|
4
|
+
data.tar.gz: d97e0a5d5890bce4c757138f379834f65cb45a4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11f7561e54d1e802cd0540d31fcf90670ffa2e6900adb8d80ceff801cdb008cb62e554f3c3a4eeb1f2e3402aa53a2143864893319486791fd1028214c9328a61
|
7
|
+
data.tar.gz: a0ad36ab832c04e60bc1da55918ffc1631fc3ca990da15e00cae401142c2563c51f9d37cb96ff36f34e87ccc6643e80e19464e156eeaf0fd56ecea496bc4d2dd
|
data/.rubocop.yml
ADDED
data/Rakefile
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
require 'bundler/setup'
|
2
|
-
require
|
3
|
-
require
|
2
|
+
require 'bundler/gem_tasks'
|
3
|
+
require 'bundler/gem_helper'
|
4
4
|
require 'rspec/core/rake_task'
|
5
5
|
|
6
6
|
# http://qiita.com/kyanny/items/2de40ca0b5127a0f5c2a
|
7
|
-
#Rake::Task[:release].clear
|
7
|
+
# Rake::Task[:release].clear
|
8
8
|
|
9
9
|
# http://qiita.com/kyanny/items/d3111ea76b2941d71ef5
|
10
10
|
t = Bundler::GemHelper.new
|
data/data/default.yaml
CHANGED
data/lib/tachikoma/settings.rb
CHANGED
data/lib/tachikoma/version.rb
CHANGED
data/lib/tachikoma.rb
CHANGED
data/lib/tasks/app.rake
CHANGED
@@ -44,13 +44,20 @@ namespace :tachikoma do
|
|
44
44
|
%r!((?:[^/]*?)/(?:[^/]*?))(?:\.git)?$!.match(url)[1]
|
45
45
|
end
|
46
46
|
|
47
|
+
def bundler_parallel_option(bundler_version, parallel_number)
|
48
|
+
# bundler 1.4.0.pre.1 gets parallel number option
|
49
|
+
if Gem::Version.create(bundler_version) >= Gem::Version.create('1.4.0.pre.1') && parallel_number > 1
|
50
|
+
"--jobs=#{parallel_number}"
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
47
54
|
task :load do
|
48
55
|
@build_for = ENV['BUILD_FOR']
|
49
56
|
@github_token = ENV[github_token_key(@build_for)]
|
50
57
|
|
51
58
|
base_config_path = File.join(Tachikoma.original_data_path, 'default.yaml')
|
52
59
|
base_config = YAML.safe_load_file(base_config_path) || {}
|
53
|
-
user_config_path = File.join(Tachikoma.data_path,
|
60
|
+
user_config_path = File.join(Tachikoma.data_path, '__user_config__.yaml')
|
54
61
|
user_config = YAML.safe_load_file(user_config_path) if File.exist?(user_config_path)
|
55
62
|
user_config ||= {}
|
56
63
|
each_config_path = File.join(Tachikoma.data_path, "#{@build_for}.yaml")
|
@@ -70,6 +77,7 @@ namespace :tachikoma do
|
|
70
77
|
@authorized_url = authorized_url_with_type(@url, @type, @github_token, @github_account)
|
71
78
|
@timestamp_format = @configure['timestamp_format'] || @default_timestamp_format
|
72
79
|
@readable_time = Time.now.utc.strftime(@timestamp_format)
|
80
|
+
@parallel_option = bundler_parallel_option(Bundler::VERSION, @configure['bundler_parallel_number'])
|
73
81
|
|
74
82
|
@target_head = target_repository_user(@type, @url, @github_account)
|
75
83
|
@pull_request_url = repository_identity(@url)
|
@@ -101,7 +109,7 @@ namespace :tachikoma do
|
|
101
109
|
sh "git config user.name #{@commiter_name}"
|
102
110
|
sh "git config user.email #{@commiter_email}"
|
103
111
|
sh "git checkout -b feature/bundle-#{@readable_time} #{@base_remote_branch}"
|
104
|
-
sh
|
112
|
+
sh "bundle --gemfile Gemfile --no-deployment --without nothing #{@parallel_option}"
|
105
113
|
sh 'bundle update'
|
106
114
|
sh 'git add Gemfile.lock'
|
107
115
|
sh %Q!git commit -m "Bundle update #{@readable_time}"! do; end # ignore exitstatus
|
@@ -112,7 +120,10 @@ namespace :tachikoma do
|
|
112
120
|
|
113
121
|
desc 'pull_request'
|
114
122
|
task :pull_request do
|
115
|
-
|
116
|
-
|
123
|
+
begin
|
124
|
+
@client = Octokit::Client.new(login: @github_account, oauth_token: @github_token)
|
125
|
+
@client.create_pull_request(@pull_request_url, @pull_request_base, @pull_request_head, @pull_request_title, @pull_request_body)
|
126
|
+
rescue Octokit::UnprocessableEntity
|
127
|
+
end
|
117
128
|
end
|
118
129
|
end
|
data/rubocop-todo.yml
ADDED
@@ -2,8 +2,8 @@ require 'tachikoma/settings'
|
|
2
2
|
describe Tachikoma do
|
3
3
|
describe '.root_path' do
|
4
4
|
let(:somewhere) { '/path/to/somewhere' }
|
5
|
-
let(:datapath) { somewhere + '/data'}
|
6
|
-
let(:repospath) { somewhere + '/repos'}
|
5
|
+
let(:datapath) { somewhere + '/data' }
|
6
|
+
let(:repospath) { somewhere + '/repos' }
|
7
7
|
|
8
8
|
before :each do
|
9
9
|
Dir.stub(:pwd).and_return(somewhere)
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'rake'
|
3
|
+
require 'tachikoma/tasks'
|
4
|
+
|
5
|
+
describe 'app.rake' do
|
6
|
+
describe 'tachikoma:pull_request' do
|
7
|
+
context 'when github returns 422 UnprocessableEntity' do
|
8
|
+
before do
|
9
|
+
Octokit::Client.stub_chain(:new, :create_pull_request).and_raise(Octokit::UnprocessableEntity)
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'should not raise Octokit::UnprocessableEntity error' do
|
13
|
+
expect {
|
14
|
+
Rake::Task['tachikoma:pull_request'].invoke
|
15
|
+
}.to_not raise_error
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/tachikoma.gemspec
CHANGED
@@ -4,26 +4,26 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require 'tachikoma/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
7
|
+
spec.name = 'tachikoma'
|
8
8
|
spec.version = Tachikoma::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
9
|
+
spec.authors = ['sanemat']
|
10
|
+
spec.email = ['o.gata.ken@gmail.com']
|
11
11
|
spec.description = %q{Interval pull requester with bundle update.}
|
12
12
|
spec.summary = %q{Update gem frequently gets less pain. Let's doing bundle update as a habit!}
|
13
|
-
spec.homepage =
|
14
|
-
spec.license =
|
13
|
+
spec.homepage = 'https://github.com/sanemat/tachikoma'
|
14
|
+
spec.license = 'MIT'
|
15
15
|
|
16
|
-
spec.files = `git ls-files`.split(
|
16
|
+
spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
17
17
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
-
spec.require_paths = [
|
19
|
+
spec.require_paths = ['lib']
|
20
20
|
|
21
21
|
spec.add_dependency 'safe_yaml'
|
22
22
|
spec.add_dependency 'rake'
|
23
23
|
spec.add_dependency 'octokit'
|
24
24
|
spec.add_dependency 'json'
|
25
25
|
|
26
|
-
spec.add_development_dependency
|
26
|
+
spec.add_development_dependency 'bundler', '~> 1.3'
|
27
27
|
spec.add_development_dependency 'dotenv'
|
28
28
|
spec.add_development_dependency 'rspec', '>= 2.14.0.rc'
|
29
29
|
end
|
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: 3.0.
|
4
|
+
version: 3.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sanemat
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-08-
|
11
|
+
date: 2013-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: safe_yaml
|
@@ -119,6 +119,7 @@ files:
|
|
119
119
|
- .env.example
|
120
120
|
- .gitignore
|
121
121
|
- .rspec
|
122
|
+
- .rubocop.yml
|
122
123
|
- .travis.yml
|
123
124
|
- Gemfile
|
124
125
|
- LICENSE.txt
|
@@ -132,8 +133,10 @@ files:
|
|
132
133
|
- lib/tachikoma/tasks.rb
|
133
134
|
- lib/tachikoma/version.rb
|
134
135
|
- lib/tasks/app.rake
|
136
|
+
- rubocop-todo.yml
|
135
137
|
- spec/spec_helper.rb
|
136
138
|
- spec/tachikoma/settings_spec.rb
|
139
|
+
- spec/tasks/app_task_spec.rb
|
137
140
|
- tachikoma.gemspec
|
138
141
|
homepage: https://github.com/sanemat/tachikoma
|
139
142
|
licenses:
|
@@ -162,3 +165,4 @@ summary: Update gem frequently gets less pain. Let's doing bundle update as a ha
|
|
162
165
|
test_files:
|
163
166
|
- spec/spec_helper.rb
|
164
167
|
- spec/tachikoma/settings_spec.rb
|
168
|
+
- spec/tasks/app_task_spec.rb
|