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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d66c63e994700ac9b67781047a7a904668fbd787
4
- data.tar.gz: 62f13ea6ec6e371e7af46ae2cb978d9f55a8c53f
3
+ metadata.gz: d898f5519776809aee4550fa6b6b3fd082bc462c
4
+ data.tar.gz: d97e0a5d5890bce4c757138f379834f65cb45a4b
5
5
  SHA512:
6
- metadata.gz: c0deb38fc3ae392decac56f5e24897970e699dab4070eccd52dbd88b90f70e1d642279970de81ea1aae18faef5dc37cf56eaf5220caac108dd96142d8ce5dc47
7
- data.tar.gz: f647ce3700198d3ce2cc07ab1d0f5319345fb625317aa4d8247182c9c7b654d7e613dd34cbf13c2eea85328c29f258a86c73caab5e626e4acac8b4e6071667e7
6
+ metadata.gz: 11f7561e54d1e802cd0540d31fcf90670ffa2e6900adb8d80ceff801cdb008cb62e554f3c3a4eeb1f2e3402aa53a2143864893319486791fd1028214c9328a61
7
+ data.tar.gz: a0ad36ab832c04e60bc1da55918ffc1631fc3ca990da15e00cae401142c2563c51f9d37cb96ff36f34e87ccc6643e80e19464e156eeaf0fd56ecea496bc4d2dd
data/.rubocop.yml ADDED
@@ -0,0 +1,12 @@
1
+ inherit_from: rubocop-todo.yml
2
+ AllCops:
3
+ Includes:
4
+ - Rakefile
5
+ - Gemfile
6
+ - tachikoma.gemspec
7
+ - bin/**
8
+ - lib/**/*.rake
9
+ Excludes:
10
+ - pkg/**
11
+ - repos/**
12
+ - vendor/**
data/Rakefile CHANGED
@@ -1,10 +1,10 @@
1
1
  require 'bundler/setup'
2
- require "bundler/gem_tasks"
3
- require "bundler/gem_helper"
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
@@ -12,3 +12,5 @@ pull_request_body:
12
12
  ':hamster::hamster::hamster:'
13
13
  pull_request_base:
14
14
  'master'
15
+ bundler_parallel_number:
16
+ 4
@@ -1,5 +1,6 @@
1
1
  require 'pathname'
2
2
 
3
+ # Settings of Tachikoma
3
4
  module Tachikoma
4
5
  class << self
5
6
  # ~/users-tachikoma-dir
@@ -1,3 +1,4 @@
1
+ # Version of tachikoma
1
2
  module Tachikoma
2
- VERSION = "3.0.6"
3
+ VERSION = '3.0.7'
3
4
  end
data/lib/tachikoma.rb CHANGED
@@ -1,6 +1,7 @@
1
- require "tachikoma/version"
1
+ require 'tachikoma/version'
2
2
  require 'tachikoma/settings'
3
3
 
4
+ # Namespace of tachikoma
4
5
  module Tachikoma
5
6
  # Your code goes here...
6
7
  end
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, "__user_config__.yaml")
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 'bundle --gemfile Gemfile --no-deployment --without nothing'
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
- @client = Octokit::Client.new(login: @github_account, oauth_token: @github_token)
116
- @client.create_pull_request(@pull_request_url, @pull_request_base, @pull_request_head, @pull_request_title, @pull_request_body)
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
@@ -0,0 +1,9 @@
1
+ # This configuration was generated by `rubocop --auto-gen-config`.
2
+ # The point is for the user to remove these configuration records
3
+ # one by one as the offences are removed from the code base.
4
+
5
+ Blocks:
6
+ Enabled: false
7
+
8
+ LineLength:
9
+ Enabled: false
@@ -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 = "tachikoma"
7
+ spec.name = 'tachikoma'
8
8
  spec.version = Tachikoma::VERSION
9
- spec.authors = ["sanemat"]
10
- spec.email = ["o.gata.ken@gmail.com"]
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 = "https://github.com/sanemat/tachikoma"
14
- spec.license = "MIT"
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 = ["lib"]
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 "bundler", "~> 1.3"
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.6
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-02 00:00:00.000000000 Z
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