tachikoma 4.0.3 → 4.0.4

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: 5746c103a46826dd181c6f50858a3ce5badce2fb
4
- data.tar.gz: 8c80c9dd4c8b4972210a82b0cb2fc3f71f2a6286
3
+ metadata.gz: 16bbdce06551410acc472853a69b6a62de2f9e5f
4
+ data.tar.gz: 05eae7c7b73dd711f069e85cdf0cee8d48f14ff1
5
5
  SHA512:
6
- metadata.gz: 999cd4d63592d622f4787a3461de54f8548fe522906cd06dc1048390f1bd2167799e0d2657dc78fe610e21d202d62ce7252801a51d8534e4e3732a0c59be9492
7
- data.tar.gz: aff163726e8d97294c200bffdb0d0eb3716ee273c0181bd7a13c106dbc5da3aefd465bea08a7be610a1c1401058ef592cff80fb372cb6b4b501b2dee8e8c19b6
6
+ metadata.gz: feb7d6faf309534f3827684787d4feb6b00206a88667c18ce5c3b31512cf71dd41fbb4ec4e7633ae6149896c97f303583622a5855044785bcde3c2b32cbbe2f8
7
+ data.tar.gz: a151074585663d206366b43b5fb0d7963c336657d3b8bccbd1fe44e5ebadb6c2affcc779e582db9107ac074537d8828a5fd63265449f094fed57a0642986ac60
data/.travis.yml CHANGED
@@ -2,10 +2,9 @@ language: ruby
2
2
  rvm:
3
3
  - 1.9.3
4
4
  - 2.0.0
5
- - 2.1.0-rc1
5
+ - 2.1.0
6
6
  before_install:
7
7
  - gem update bundler
8
- - gem install json
9
8
  notifications:
10
9
  email:
11
10
  - ogataken@gmail.com
data/CHANGELOG.md CHANGED
@@ -1,4 +1,9 @@
1
- ## 4.0.3
1
+ ## 4.0.4 (2014-04-14)
2
+
3
+ Features:
4
+ - Add :none strategy (#85, @sanemat)
5
+
6
+ ## 4.0.3 (2013-12-27)
2
7
 
3
8
  Features:
4
9
 
data/Gemfile CHANGED
@@ -4,10 +4,6 @@ gemspec
4
4
 
5
5
  group :development, :test do
6
6
  gem 'pry'
7
- # https://github.com/rspec/rspec-rails/issues/878#issuecomment-30575316
8
- gem 'rspec-core', git: 'https://github.com/rspec/rspec-core.git', branch: 'master'
9
- # https://github.com/rspec/rspec-mocks/pull/467
10
- gem 'rspec-mocks', git: 'https://github.com/rspec/rspec-mocks.git', branch: 'master'
11
7
  gem 'coveralls', require: false
12
8
  end
13
9
 
data/README.md CHANGED
@@ -28,8 +28,6 @@ $ bundle exec tachikoma init
28
28
  2. Add YAML of repository you want to build by Tachikoma: Copy `data/bot-motoko-tachikoma.yaml` then edit `url` and `type`. to clone URL of your repository. Change `type` to `shared`, if you use shared repository model.
29
29
  3. Run below command in your shell:
30
30
 
31
- Above v4.0.0.beta
32
-
33
31
  ```
34
32
  $ export BUILD_FOR=<your-repository-name-that-is-same-to-yaml-filename>
35
33
  $ export TOKEN_YOUR_REPOSITORY_NAME_THAT_IS_SAME_TO_YAML_FILENAME=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
@@ -38,18 +36,6 @@ $ bundle exec rake tachikoma:run_bundle
38
36
 
39
37
  If you use carton, then you use `tachikoma:run_carton` instead of `tachikoma:run_bundle`.
40
38
 
41
- __Breaking backward compatibility__
42
-
43
- Below v3.1 Old API
44
-
45
- ```
46
- $ export BUILD_FOR=<your-repository-name-that-is-same-to-yaml-filename>
47
- $ export TOKEN_YOUR_REPOSITORY_NAME_THAT_IS_SAME_TO_YAML_FILENAME=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
48
- $ bundle exec rake tachikoma:load tachikoma:fetch tachikoma:bundle tachikoma:pull_request
49
- ```
50
-
51
- If you use carton, then you use `tachikoma:carton` instead of `tachikoma:bundle`. (Require version >= 3.0.9)
52
-
53
39
  ### Setting example
54
40
  [gist-mail setting (data/gist-mail.yaml)](https://github.com/sanemat/bot-motoko-tachikoma/blob/a47ceb8b88f8b6da8028e5c0b641b8a84c9c3505/data/gist-mail.yaml)
55
41
 
@@ -71,10 +57,6 @@ pull_request_body:
71
57
  ### Build script example
72
58
  - [cloudbees.com dev@cloud: Above v4.0.0.beta](https://gist.github.com/sanemat/5859031/aa1966a46a7c00ed975b487f423c36b8ae5b976d)
73
59
 
74
- __Breaking backward compatibility__
75
-
76
- - [cloudbees.com dev@cloud: Below v3.1 Old API](https://gist.github.com/sanemat/5859031/31ac68266f89bc12760180d024874bd778f6946a)
77
-
78
60
  ## Versioning
79
61
 
80
62
  Tachikoma will be maintained under the Semantic Versioning guidelines as much as possible. Releases will be numbered with the following format:
@@ -120,6 +102,7 @@ by @sanemat
120
102
  at RubyConf 2013 Lightning Talk
121
103
  by @sanemat
122
104
  [slide](https://gist.github.com/sanemat/7374944) _English_
105
+ [video](http://www.youtube.com/watch?v=gJOkpP__dY4#t=5393) _English_
123
106
 
124
107
  ### Article
125
108
  - [tachikoma を使って毎日自動で bundle update - willnet.in](http://willnet.in/111)
@@ -5,6 +5,7 @@ require 'octokit'
5
5
  require 'fileutils'
6
6
 
7
7
  module Tachikoma
8
+ # Main logic of Tachikoma
8
9
  class Application
9
10
  include FileUtils
10
11
 
@@ -96,14 +97,22 @@ module Tachikoma
96
97
  end
97
98
  end
98
99
 
99
- def pull_request
100
- begin
101
- @client = Octokit::Client.new access_token: @github_token
102
- @client.create_pull_request(@pull_request_url, @pull_request_base, @pull_request_head, @pull_request_title, @pull_request_body)
103
- rescue Octokit::UnprocessableEntity
100
+ def none
101
+ Dir.chdir("#{Tachikoma.repos_path.to_s}/#{@build_for}") do
102
+ sh "git config user.name #{@commiter_name}"
103
+ sh "git config user.email #{@commiter_email}"
104
+ sh "git checkout -b feature/none-#{@readable_time} #{@base_remote_branch}"
105
+ sh %Q!git commit --allow-empty -m "None update #{@readable_time}"! do; end # ignore exitstatus
106
+ sh "git push #{@authorized_compare_url} feature/none-#{@readable_time}"
104
107
  end
105
108
  end
106
109
 
110
+ def pull_request
111
+ @client = Octokit::Client.new access_token: @github_token
112
+ @client.create_pull_request(@pull_request_url, @pull_request_base, @pull_request_head, @pull_request_title, @pull_request_body)
113
+ rescue Octokit::UnprocessableEntity
114
+ end
115
+
107
116
  # build_for = fenix-knight, github_token_key = TOKEN_FENIX_KNIGHT
108
117
  def github_token_key(build_for)
109
118
  "TOKEN_#{build_for}".gsub(/-/, '_').upcase
@@ -120,7 +129,7 @@ module Tachikoma
120
129
  warn '[DEPRECATION] `type: private` is deprecated. Please use `type: fork` or `type: shared` instead.'
121
130
  "#{uri.scheme}://#{github_token}:x-oauth-basic@#{uri.host}#{uri.path}"
122
131
  else
123
- raise InvalidType, "Invalid type #{type}"
132
+ fail InvalidType, "Invalid type #{type}"
124
133
  end
125
134
  end
126
135
 
@@ -133,7 +142,7 @@ module Tachikoma
133
142
  warn '[DEPRECATION] `type: private` is deprecated. Please use `type: fork` or `type: shared` instead.'
134
143
  "#{uri.scheme}://#{github_token}:x-oauth-basic@#{uri.host}#{uri.path}"
135
144
  else
136
- raise InvalidType, "Invalid type #{type}"
145
+ fail InvalidType, "Invalid type #{type}"
137
146
  end
138
147
  end
139
148
 
@@ -151,7 +160,7 @@ module Tachikoma
151
160
  warn '[DEPRECATION] `type: private` is deprecated. Please use `type: fork` or `type: shared` instead.'
152
161
  URI.parse(fetch_url).path.split('/', 3)[1]
153
162
  else
154
- raise InvalidType, "Invalid type: #{type}"
163
+ fail InvalidType, "Invalid type: #{type}"
155
164
  end
156
165
  end
157
166
 
data/lib/tachikoma/cli.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require 'thor'
2
2
 
3
3
  module Tachikoma
4
+ # Command for Tachikoma
4
5
  class CLI < Thor
5
6
  include Thor::Actions
6
7
 
@@ -1,4 +1,4 @@
1
1
  # Version of tachikoma
2
2
  module Tachikoma
3
- VERSION = '4.0.3'
3
+ VERSION = '4.0.4'
4
4
  end
@@ -4,7 +4,7 @@ require 'fileutils'
4
4
 
5
5
  describe Tachikoma::Application do
6
6
  before :all do
7
- ENV.update({ 'BUILD_FOR' => 'test' })
7
+ ENV.update('BUILD_FOR' => 'test')
8
8
  open(File.join(File.dirname(__FILE__), '..', '..', 'data', 'test.yaml'), 'w') { |f|
9
9
  f.puts <<YAML
10
10
  url:
@@ -16,7 +16,7 @@ YAML
16
16
  end
17
17
 
18
18
  after :all do
19
- ENV.update({ 'BUILD_FOR' => nil })
19
+ ENV.update('BUILD_FOR' => nil)
20
20
  FileUtils.rm_f File.join(File.dirname(__FILE__), '..', '..', 'data', 'test.yaml')
21
21
  end
22
22
 
@@ -46,6 +46,19 @@ YAML
46
46
  end
47
47
  end
48
48
 
49
+ context 'if strategy is `none`' do
50
+ before do
51
+ allow_any_instance_of(Tachikoma::Application).to receive(:load)
52
+ allow_any_instance_of(Tachikoma::Application).to receive(:fetch)
53
+ allow_any_instance_of(Tachikoma::Application).to receive(:pull_request)
54
+ end
55
+
56
+ it 'should be called `none` method' do
57
+ expect_any_instance_of(Tachikoma::Application).to receive(:none)
58
+ Tachikoma::Application.run 'none'
59
+ end
60
+ end
61
+
49
62
  describe '#bundler_parallel_option' do
50
63
  subject { described_class.new }
51
64
 
data/tachikoma.gemspec CHANGED
@@ -20,11 +20,11 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_dependency 'safe_yaml'
22
22
  spec.add_dependency 'rake'
23
- spec.add_dependency 'octokit', '>= 2', '< 3'
23
+ spec.add_dependency 'octokit', '~> 3.0.0'
24
24
  spec.add_dependency 'json'
25
25
  spec.add_dependency 'thor'
26
26
 
27
- spec.add_development_dependency 'bundler', '~> 1.3'
27
+ spec.add_development_dependency 'bundler', '>= 1.3', '< 1.7'
28
28
  spec.add_development_dependency 'dotenv'
29
- spec.add_development_dependency 'rspec', '>= 3.0.0.beta'
29
+ spec.add_development_dependency 'rspec', '>= 3.0.0.beta2'
30
30
  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: 4.0.3
4
+ version: 4.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - sanemat
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-27 00:00:00.000000000 Z
11
+ date: 2014-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: safe_yaml
@@ -42,22 +42,16 @@ dependencies:
42
42
  name: octokit
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '2'
48
- - - "<"
45
+ - - "~>"
49
46
  - !ruby/object:Gem::Version
50
- version: '3'
47
+ version: 3.0.0
51
48
  type: :runtime
52
49
  prerelease: false
53
50
  version_requirements: !ruby/object:Gem::Requirement
54
51
  requirements:
55
- - - ">="
56
- - !ruby/object:Gem::Version
57
- version: '2'
58
- - - "<"
52
+ - - "~>"
59
53
  - !ruby/object:Gem::Version
60
- version: '3'
54
+ version: 3.0.0
61
55
  - !ruby/object:Gem::Dependency
62
56
  name: json
63
57
  requirement: !ruby/object:Gem::Requirement
@@ -90,16 +84,22 @@ dependencies:
90
84
  name: bundler
91
85
  requirement: !ruby/object:Gem::Requirement
92
86
  requirements:
93
- - - "~>"
87
+ - - ">="
94
88
  - !ruby/object:Gem::Version
95
89
  version: '1.3'
90
+ - - "<"
91
+ - !ruby/object:Gem::Version
92
+ version: '1.7'
96
93
  type: :development
97
94
  prerelease: false
98
95
  version_requirements: !ruby/object:Gem::Requirement
99
96
  requirements:
100
- - - "~>"
97
+ - - ">="
101
98
  - !ruby/object:Gem::Version
102
99
  version: '1.3'
100
+ - - "<"
101
+ - !ruby/object:Gem::Version
102
+ version: '1.7'
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: dotenv
105
105
  requirement: !ruby/object:Gem::Requirement
@@ -120,14 +120,14 @@ dependencies:
120
120
  requirements:
121
121
  - - ">="
122
122
  - !ruby/object:Gem::Version
123
- version: 3.0.0.beta
123
+ version: 3.0.0.beta2
124
124
  type: :development
125
125
  prerelease: false
126
126
  version_requirements: !ruby/object:Gem::Requirement
127
127
  requirements:
128
128
  - - ">="
129
129
  - !ruby/object:Gem::Version
130
- version: 3.0.0.beta
130
+ version: 3.0.0.beta2
131
131
  description: Interval pull requester with bundle/carton update.
132
132
  email:
133
133
  - o.gata.ken@gmail.com
@@ -188,7 +188,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
188
188
  version: '0'
189
189
  requirements: []
190
190
  rubyforge_project:
191
- rubygems_version: 2.2.0
191
+ rubygems_version: 2.2.2
192
192
  signing_key:
193
193
  specification_version: 4
194
194
  summary: Update gem frequently gets less pain. Let's doing bundle update as a habit!