tachikoma 3.0.9 → 4.0.0.rc.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +64 -3
- data/lib/tachikoma/application.rb +154 -0
- data/lib/tachikoma/version.rb +1 -1
- data/lib/tasks/app.rake +9 -124
- data/spec/tachikoma/application_spec.rb +48 -0
- data/tachikoma.gemspec +1 -1
- metadata +8 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 375f94bff68ee9047e05548e60d560fa03d6b1ac
|
4
|
+
data.tar.gz: ce691da02a80091a3f347e5cdc8f2e6ad014a6b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a3174bbe78ccc371cba4cfa1d683f46dc871e4f5d900d0f2f5dc8cbee753994e522358ebc024fa4edb79e82737ae9438e16462a81b4885484a89b58bd782839
|
7
|
+
data.tar.gz: 0a24c3ed371fcc85567b92601dac71362712fee337b8bc1850b1268814eba6da972a196bd3a4d43aab010f30d669e5c01a51fea5292403138e1dbb9a55f64907
|
data/README.md
CHANGED
@@ -6,8 +6,8 @@
|
|
6
6
|
|
7
7
|
Daily Pull Requester with bundle/carton update. [Actual pull request](https://github.com/mrtaddy/fenix-knight/pull/25)
|
8
8
|
|
9
|
-
|
10
|
-
|
9
|
+
![tachikoma](https://gist.github.com/sanemat/6605029/raw/ztachikoma-demo5.gif 'tachikoma')
|
10
|
+
![tachikoma](https://gist.github.com/sanemat/6605029/raw/ztachikoma-demo6.gif 'tachikoma')
|
11
11
|
|
12
12
|
## Usage as gem
|
13
13
|
|
@@ -27,15 +27,52 @@ $ bundle exec tachikoma init
|
|
27
27
|
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.
|
28
28
|
3. Run below command in your shell:
|
29
29
|
|
30
|
+
Above v4.0.0.beta
|
31
|
+
|
32
|
+
```
|
33
|
+
$ export BUILD_FOR=<your-repository-name-that-is-same-to-yaml-filename>
|
34
|
+
$ export TOKEN_YOUR_REPOSITORY_NAME_THAT_IS_SAME_TO_YAML_FILENAME=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
35
|
+
$ bundle exec rake tachikoma:run_bundle
|
36
|
+
```
|
37
|
+
|
38
|
+
If you use carton, then you use `tachikoma:run_carton` instead of `tachikoma:run_bundle`.
|
39
|
+
|
40
|
+
__Breaking backward compatibility__
|
41
|
+
|
42
|
+
Below v3.1 Old API
|
43
|
+
|
30
44
|
```
|
31
45
|
$ export BUILD_FOR=<your-repository-name-that-is-same-to-yaml-filename>
|
32
46
|
$ export TOKEN_YOUR_REPOSITORY_NAME_THAT_IS_SAME_TO_YAML_FILENAME=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
33
47
|
$ bundle exec rake tachikoma:load tachikoma:fetch tachikoma:bundle tachikoma:pull_request
|
34
48
|
```
|
35
49
|
|
50
|
+
If you use carton, then you use `tachikoma:carton` instead of `tachikoma:bundle`. (Require version >= 3.0.9)
|
51
|
+
|
52
|
+
### Setting example
|
53
|
+
[gist-mail setting (data/gist-mail.yaml)](https://github.com/sanemat/bot-motoko-tachikoma/blob/a47ceb8b88f8b6da8028e5c0b641b8a84c9c3505/data/gist-mail.yaml)
|
54
|
+
|
55
|
+
```yaml
|
56
|
+
url:
|
57
|
+
'https://github.com/sanemat/gist-mail.git'
|
58
|
+
frequency:
|
59
|
+
"every 1.day, :at => '6:30 am'"
|
60
|
+
type:
|
61
|
+
'fork'
|
62
|
+
language:
|
63
|
+
'ruby'
|
64
|
+
version:
|
65
|
+
'2.0.0'
|
66
|
+
pull_request_body:
|
67
|
+
':ideograph_advantage::ideograph_advantage::ideograph_advantage:'
|
68
|
+
```
|
69
|
+
|
36
70
|
### Build script example
|
71
|
+
- [cloudbees.com dev@cloud: Above v4.0.0.beta](https://gist.github.com/sanemat/5859031/aa1966a46a7c00ed975b487f423c36b8ae5b976d)
|
37
72
|
|
38
|
-
|
73
|
+
__Breaking backward compatibility__
|
74
|
+
|
75
|
+
- [cloudbees.com dev@cloud: Below v3.1 Old API](https://gist.github.com/sanemat/5859031/31ac68266f89bc12760180d024874bd778f6946a)
|
39
76
|
|
40
77
|
## Versioning
|
41
78
|
|
@@ -58,3 +95,27 @@ For more information on SemVer, please visit http://semver.org.
|
|
58
95
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
59
96
|
4. Push to the branch (`git push origin my-new-feature`)
|
60
97
|
5. Create new Pull Request
|
98
|
+
|
99
|
+
## Resources
|
100
|
+
|
101
|
+
### Concept
|
102
|
+
- [Continuous gem dependency updating with Jenkins and Pull Request](http://rubykaigi.org/2013/talk/S72)
|
103
|
+
at Rubykaigi2013 Talk
|
104
|
+
by @kyanny
|
105
|
+
[movie](http://vimeo.com/68300423) _Japanese_
|
106
|
+
[slide](https://speakerdeck.com/kyanny/continuous-gem-dependency-updating-with-jenkins-and-pull-request) _English/Japanese_
|
107
|
+
|
108
|
+
### Screencast
|
109
|
+
- Tachikoma 10min (Below v3.1 - Old API) _Silent_
|
110
|
+
[![screen shot 2013-07-22 at 8 09 29 am](https://f.cloud.github.com/assets/75448/832475/b0ce829a-f25a-11e2-8984-521dbe7d838e.png)](https://vimeo.com/70733613)
|
111
|
+
|
112
|
+
### Talk
|
113
|
+
- [Updating Library Dependencies Off and On with Tachikoma](http://yapcasia.org/2013/talk/show/f7fe8ed4-1bcd-11e3-93a2-f74c6aeab6a4)
|
114
|
+
at YAPC::Asia Tokyo 2013 Lightning Talk
|
115
|
+
by @sanemat
|
116
|
+
[slide](https://gist.github.com/sanemat/6605029) _Japanese_
|
117
|
+
[video](http://www.youtube.com/watch?v=IAoJzxBzOok) _Japanese_
|
118
|
+
|
119
|
+
### Article
|
120
|
+
- [tachikoma を使って毎日自動で bundle update - willnet.in](http://willnet.in/111)
|
121
|
+
by @willnet (Below v3.1 - Old API) _Japanese_
|
@@ -0,0 +1,154 @@
|
|
1
|
+
require 'safe_yaml'
|
2
|
+
require 'uri'
|
3
|
+
require 'tachikoma'
|
4
|
+
require 'octokit'
|
5
|
+
require 'fileutils'
|
6
|
+
|
7
|
+
module Tachikoma
|
8
|
+
class Application
|
9
|
+
include FileUtils
|
10
|
+
|
11
|
+
def self.run(strategy)
|
12
|
+
new.run(strategy)
|
13
|
+
end
|
14
|
+
|
15
|
+
def run(strategy)
|
16
|
+
load
|
17
|
+
fetch
|
18
|
+
send(strategy) if respond_to?(strategy)
|
19
|
+
pull_request
|
20
|
+
end
|
21
|
+
|
22
|
+
def load
|
23
|
+
@build_for = ENV['BUILD_FOR']
|
24
|
+
@github_token = ENV[github_token_key(@build_for)]
|
25
|
+
|
26
|
+
base_config_path = File.join(Tachikoma.original_data_path, 'default.yaml')
|
27
|
+
base_config = YAML.safe_load_file(base_config_path) || {}
|
28
|
+
user_config_path = File.join(Tachikoma.data_path, '__user_config__.yaml')
|
29
|
+
user_config = YAML.safe_load_file(user_config_path) if File.exist?(user_config_path)
|
30
|
+
user_config ||= {}
|
31
|
+
each_config_path = File.join(Tachikoma.data_path, "#{@build_for}.yaml")
|
32
|
+
each_config = YAML.safe_load_file(each_config_path) if File.exist?(each_config_path)
|
33
|
+
unless each_config
|
34
|
+
fail %Q!Something wrong, BUILD_FOR: #{@build_for}, your config_path: #{each_config_path}!
|
35
|
+
end
|
36
|
+
|
37
|
+
@configure = base_config.merge(user_config).merge(each_config)
|
38
|
+
|
39
|
+
@commiter_name = @configure['commiter_name']
|
40
|
+
@commiter_email = @configure['commiter_email']
|
41
|
+
@github_account = @configure['github_account']
|
42
|
+
@url = @configure['url']
|
43
|
+
@type = @configure['type']
|
44
|
+
@base_remote_branch = @configure['base_remote_branch']
|
45
|
+
@authorized_url = authorized_url_with_type(@url, @type, @github_token, @github_account)
|
46
|
+
@timestamp_format = @configure['timestamp_format']
|
47
|
+
@readable_time = Time.now.utc.strftime(@timestamp_format)
|
48
|
+
@parallel_option = bundler_parallel_option(Bundler::VERSION, @configure['bundler_parallel_number'])
|
49
|
+
|
50
|
+
@target_head = target_repository_user(@type, @url, @github_account)
|
51
|
+
@pull_request_url = repository_identity(@url)
|
52
|
+
@pull_request_body = @configure['pull_request_body']
|
53
|
+
@pull_request_base = @configure['pull_request_base']
|
54
|
+
@pull_request_head = "#{@target_head}:feature/bundle-#{@readable_time}"
|
55
|
+
@pull_request_title = "Bundle update #{@readable_time}"
|
56
|
+
end
|
57
|
+
|
58
|
+
def clean
|
59
|
+
mkdir_p(Tachikoma.repos_path)
|
60
|
+
rm_rf(Dir.glob(File.join(Tachikoma.repos_path, '*')))
|
61
|
+
end
|
62
|
+
|
63
|
+
def fetch
|
64
|
+
clean
|
65
|
+
if @type == 'private'
|
66
|
+
sh "git clone #{@authorized_url} #{Tachikoma.repos_path.to_s}/#{@build_for}"
|
67
|
+
else
|
68
|
+
sh "git clone #{@url} #{Tachikoma.repos_path.to_s}/#{@build_for}"
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
def bundle
|
73
|
+
Dir.chdir("#{Tachikoma.repos_path.to_s}/#{@build_for}") do
|
74
|
+
Bundler.with_clean_env do
|
75
|
+
sh %Q|ruby -i -pe '$_.gsub! /^ruby/, "#ruby"' Gemfile|
|
76
|
+
sh "git config user.name #{@commiter_name}"
|
77
|
+
sh "git config user.email #{@commiter_email}"
|
78
|
+
sh "git checkout -b feature/bundle-#{@readable_time} #{@base_remote_branch}"
|
79
|
+
sh "bundle --gemfile Gemfile --no-deployment --without nothing #{@parallel_option}"
|
80
|
+
sh 'bundle update'
|
81
|
+
sh 'git add Gemfile.lock'
|
82
|
+
sh %Q!git commit -m "Bundle update #{@readable_time}"! do; end # ignore exitstatus
|
83
|
+
sh "git push #{@authorized_url} feature/bundle-#{@readable_time}"
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
def carton
|
89
|
+
Dir.chdir("#{Tachikoma.repos_path.to_s}/#{@build_for}") do
|
90
|
+
sh "git config user.name #{@commiter_name}"
|
91
|
+
sh "git config user.email #{@commiter_email}"
|
92
|
+
sh "git checkout -b feature/carton-#{@readable_time} #{@base_remote_branch}"
|
93
|
+
sh 'carton install'
|
94
|
+
sh 'carton update'
|
95
|
+
sh 'git add carton.lock' if File.exist?('carton.lock')
|
96
|
+
sh 'git add cpanfile.snapshot' if File.exist?('cpanfile.snapshot')
|
97
|
+
sh %Q!git commit -m "Carton update #{@readable_time}"! do; end # ignore exitstatus
|
98
|
+
sh "git push #{@authorized_url} feature/carton-#{@readable_time}"
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
def pull_request
|
103
|
+
begin
|
104
|
+
@client = Octokit::Client.new access_token: @github_token
|
105
|
+
@client.create_pull_request(@pull_request_url, @pull_request_base, @pull_request_head, @pull_request_title, @pull_request_body)
|
106
|
+
rescue Octokit::UnprocessableEntity
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
# build_for = fenix-knight, github_token_key = TOKEN_FENIX_KNIGHT
|
111
|
+
def github_token_key(build_for)
|
112
|
+
"TOKEN_#{build_for}".gsub(/-/, '_').upcase
|
113
|
+
end
|
114
|
+
|
115
|
+
def authorized_url_with_type(fetch_url, type, github_token, github_account)
|
116
|
+
uri = URI.parse(fetch_url)
|
117
|
+
case type
|
118
|
+
when 'fork'
|
119
|
+
%Q!#{uri.scheme}://#{github_token}@#{uri.host}#{path_for_fork(uri.path, github_account)}!
|
120
|
+
when 'shared', 'private'
|
121
|
+
"#{uri.scheme}://#{github_token}@#{uri.host}#{uri.path}"
|
122
|
+
else
|
123
|
+
raise "Invalid type #{type}"
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
def path_for_fork(path, github_account)
|
128
|
+
path.sub(%r!^/[^/]+!) { '/' + github_account }
|
129
|
+
end
|
130
|
+
|
131
|
+
def target_repository_user(type, fetch_url, github_account)
|
132
|
+
case type
|
133
|
+
when 'fork'
|
134
|
+
github_account
|
135
|
+
when 'shared', 'private'
|
136
|
+
uri = URI.parse(fetch_url)
|
137
|
+
uri.path.sub(%r!/([^/]+)/.*!) { $1 }
|
138
|
+
else
|
139
|
+
raise "Invalid type #{type}"
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
def repository_identity(url)
|
144
|
+
%r!((?:[^/]*?)/(?:[^/]*?))(?:\.git)?$!.match(url)[1]
|
145
|
+
end
|
146
|
+
|
147
|
+
def bundler_parallel_option(bundler_version, parallel_number)
|
148
|
+
# bundler 1.4.0.pre.1 gets parallel number option
|
149
|
+
if Gem::Version.create(bundler_version) >= Gem::Version.create('1.4.0.pre.1') && parallel_number > 1
|
150
|
+
"--jobs=#{parallel_number}"
|
151
|
+
end
|
152
|
+
end
|
153
|
+
end
|
154
|
+
end
|
data/lib/tachikoma/version.rb
CHANGED
data/lib/tasks/app.rake
CHANGED
@@ -1,144 +1,29 @@
|
|
1
|
-
require '
|
2
|
-
require 'uri'
|
3
|
-
require 'tachikoma'
|
4
|
-
require 'octokit'
|
1
|
+
require 'tachikoma/application'
|
5
2
|
|
6
3
|
namespace :tachikoma do
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
# build_for = fenix-knight, github_token_key = TOKEN_FENIX_KNIGHT
|
11
|
-
def github_token_key(build_for)
|
12
|
-
"TOKEN_#{build_for}".gsub(/-/, '_').upcase
|
13
|
-
end
|
14
|
-
|
15
|
-
def authorized_url_with_type(fetch_url, type, github_token, github_account)
|
16
|
-
uri = URI.parse(fetch_url)
|
17
|
-
case type
|
18
|
-
when 'fork'
|
19
|
-
%Q!#{uri.scheme}://#{github_token}@#{uri.host}#{path_for_fork(uri.path, github_account)}!
|
20
|
-
when 'shared', 'private'
|
21
|
-
"#{uri.scheme}://#{github_token}@#{uri.host}#{uri.path}"
|
22
|
-
else
|
23
|
-
raise "Invalid type #{type}"
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
def path_for_fork(path, github_account)
|
28
|
-
path.sub(%r!^/[^/]+!) { '/' + github_account }
|
29
|
-
end
|
30
|
-
|
31
|
-
def target_repository_user(type, fetch_url, github_account)
|
32
|
-
case type
|
33
|
-
when 'fork'
|
34
|
-
github_account
|
35
|
-
when 'shared', 'private'
|
36
|
-
uri = URI.parse(fetch_url)
|
37
|
-
uri.path.sub(%r!/([^/]+)/.*!) { $1 }
|
38
|
-
else
|
39
|
-
raise "Invalid type #{type}"
|
40
|
-
end
|
4
|
+
desc 'run tachikoma'
|
5
|
+
task :run_bundle do
|
6
|
+
Tachikoma::Application.run 'bundle'
|
41
7
|
end
|
42
8
|
|
43
|
-
|
44
|
-
|
45
|
-
end
|
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
|
9
|
+
task :run_carton do
|
10
|
+
Tachikoma::Application.run 'carton'
|
52
11
|
end
|
53
12
|
|
54
13
|
task :load do
|
55
|
-
@build_for = ENV['BUILD_FOR']
|
56
|
-
@github_token = ENV[github_token_key(@build_for)]
|
57
|
-
|
58
|
-
base_config_path = File.join(Tachikoma.original_data_path, 'default.yaml')
|
59
|
-
base_config = YAML.safe_load_file(base_config_path) || {}
|
60
|
-
user_config_path = File.join(Tachikoma.data_path, '__user_config__.yaml')
|
61
|
-
user_config = YAML.safe_load_file(user_config_path) if File.exist?(user_config_path)
|
62
|
-
user_config ||= {}
|
63
|
-
each_config_path = File.join(Tachikoma.data_path, "#{@build_for}.yaml")
|
64
|
-
each_config = YAML.safe_load_file(each_config_path) if File.exist?(each_config_path)
|
65
|
-
unless each_config
|
66
|
-
fail %Q!Something wrong, BUILD_FOR: #{@build_for}, your config_path: #{each_config_path}!
|
67
|
-
end
|
68
|
-
|
69
|
-
@configure = base_config.merge(user_config).merge(each_config)
|
70
|
-
|
71
|
-
@commiter_name = @configure['commiter_name']
|
72
|
-
@commiter_email = @configure['commiter_email']
|
73
|
-
@github_account = @configure['github_account']
|
74
|
-
@url = @configure['url']
|
75
|
-
@type = @configure['type']
|
76
|
-
@base_remote_branch = @configure['base_remote_branch']
|
77
|
-
@authorized_url = authorized_url_with_type(@url, @type, @github_token, @github_account)
|
78
|
-
@timestamp_format = @configure['timestamp_format'] || @default_timestamp_format
|
79
|
-
@readable_time = Time.now.utc.strftime(@timestamp_format)
|
80
|
-
@parallel_option = bundler_parallel_option(Bundler::VERSION, @configure['bundler_parallel_number'])
|
81
|
-
|
82
|
-
@target_head = target_repository_user(@type, @url, @github_account)
|
83
|
-
@pull_request_url = repository_identity(@url)
|
84
|
-
@pull_request_body = @configure['pull_request_body']
|
85
|
-
@pull_request_base = @configure['pull_request_base']
|
86
|
-
@pull_request_head = "#{@target_head}:feature/bundle-#{@readable_time}"
|
87
|
-
@pull_request_title = "Bundle update #{@readable_time}"
|
88
|
-
end
|
89
|
-
|
90
|
-
task :clean do
|
91
|
-
mkdir_p(Tachikoma.repos_path)
|
92
|
-
rm_rf(Dir.glob(File.join(Tachikoma.repos_path, '*')))
|
93
14
|
end
|
94
15
|
|
95
|
-
|
96
|
-
task fetch: :clean do
|
97
|
-
if @type == 'private'
|
98
|
-
sh "git clone #{@authorized_url} #{Tachikoma.repos_path.to_s}/#{@build_for}"
|
99
|
-
else
|
100
|
-
sh "git clone #{@url} #{Tachikoma.repos_path.to_s}/#{@build_for}"
|
101
|
-
end
|
16
|
+
task :fetch do
|
102
17
|
end
|
103
18
|
|
104
|
-
desc 'bundle'
|
105
19
|
task :bundle do
|
106
|
-
|
107
|
-
Bundler.with_clean_env do
|
108
|
-
sh %Q|ruby -i -pe '$_.gsub! /^ruby/, "#ruby"' Gemfile|
|
109
|
-
sh "git config user.name #{@commiter_name}"
|
110
|
-
sh "git config user.email #{@commiter_email}"
|
111
|
-
sh "git checkout -b feature/bundle-#{@readable_time} #{@base_remote_branch}"
|
112
|
-
sh "bundle --gemfile Gemfile --no-deployment --without nothing #{@parallel_option}"
|
113
|
-
sh 'bundle update'
|
114
|
-
sh 'git add Gemfile.lock'
|
115
|
-
sh %Q!git commit -m "Bundle update #{@readable_time}"! do; end # ignore exitstatus
|
116
|
-
sh "git push #{@authorized_url} feature/bundle-#{@readable_time}"
|
117
|
-
end
|
118
|
-
end
|
20
|
+
Tachikoma::Application.run 'bundle'
|
119
21
|
end
|
120
22
|
|
121
|
-
desc 'carton'
|
122
23
|
task :carton do
|
123
|
-
|
124
|
-
sh "git config user.name #{@commiter_name}"
|
125
|
-
sh "git config user.email #{@commiter_email}"
|
126
|
-
sh "git checkout -b feature/carton-#{@readable_time} #{@base_remote_branch}"
|
127
|
-
sh 'carton install'
|
128
|
-
sh 'carton update'
|
129
|
-
sh 'git add carton.lock' if File.exist?('carton.lock')
|
130
|
-
sh 'git add cpanfile.snapshot' if File.exist?('cpanfile.snapshot')
|
131
|
-
sh %Q!git commit -m "Carton update #{@readable_time}"! do; end # ignore exitstatus
|
132
|
-
sh "git push #{@authorized_url} feature/carton-#{@readable_time}"
|
133
|
-
end
|
24
|
+
Tachikoma::Application.run 'carton'
|
134
25
|
end
|
135
26
|
|
136
|
-
desc 'pull_request'
|
137
27
|
task :pull_request do
|
138
|
-
begin
|
139
|
-
@client = Octokit::Client.new access_token: @github_token
|
140
|
-
@client.create_pull_request(@pull_request_url, @pull_request_base, @pull_request_head, @pull_request_title, @pull_request_body)
|
141
|
-
rescue Octokit::UnprocessableEntity
|
142
|
-
end
|
143
28
|
end
|
144
29
|
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require 'tachikoma'
|
2
|
+
require 'tachikoma/application'
|
3
|
+
require 'fileutils'
|
4
|
+
|
5
|
+
describe Tachikoma::Application do
|
6
|
+
before :all do
|
7
|
+
ENV.update({ 'BUILD_FOR' => 'test' })
|
8
|
+
open(File.join(File.dirname(__FILE__), '..', '..', 'data', 'test.yaml'), 'w') { |f|
|
9
|
+
f.puts <<YAML
|
10
|
+
url:
|
11
|
+
'https://github.com/sanemat/bot-motoko-tachikoma.git'
|
12
|
+
type:
|
13
|
+
'fork'
|
14
|
+
YAML
|
15
|
+
}
|
16
|
+
end
|
17
|
+
|
18
|
+
after :all do
|
19
|
+
ENV.update({ 'BUILD_FOR' => nil })
|
20
|
+
FileUtils.rm_f File.join(File.dirname(__FILE__), '..', '..', 'data', 'test.yaml')
|
21
|
+
end
|
22
|
+
|
23
|
+
context 'if strategy is `bundle`' do
|
24
|
+
before do
|
25
|
+
Tachikoma::Application.any_instance.stub(:load)
|
26
|
+
Tachikoma::Application.any_instance.stub(:fetch)
|
27
|
+
Tachikoma::Application.any_instance.stub(:pull_request)
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'should be called `bundle` method' do
|
31
|
+
Tachikoma::Application.any_instance.should_receive(:bundle)
|
32
|
+
Tachikoma::Application.run 'bundle'
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
context 'if strategy is `carton`' do
|
37
|
+
before do
|
38
|
+
Tachikoma::Application.any_instance.stub(:load)
|
39
|
+
Tachikoma::Application.any_instance.stub(:fetch)
|
40
|
+
Tachikoma::Application.any_instance.stub(:pull_request)
|
41
|
+
end
|
42
|
+
|
43
|
+
it 'should be called `carton` method' do
|
44
|
+
Tachikoma::Application.any_instance.should_receive(:carton)
|
45
|
+
Tachikoma::Application.run 'carton'
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
data/tachikoma.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = Tachikoma::VERSION
|
9
9
|
spec.authors = ['sanemat']
|
10
10
|
spec.email = ['o.gata.ken@gmail.com']
|
11
|
-
spec.description = %q{Interval pull requester with bundle update.}
|
11
|
+
spec.description = %q{Interval pull requester with bundle/carton update.}
|
12
12
|
spec.summary = %q{Update gem frequently gets less pain. Let's doing bundle update as a habit!}
|
13
13
|
spec.homepage = 'https://github.com/sanemat/tachikoma'
|
14
14
|
spec.license = 'MIT'
|
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
|
+
version: 4.0.0.rc.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sanemat
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: safe_yaml
|
@@ -114,7 +114,7 @@ dependencies:
|
|
114
114
|
- - '>='
|
115
115
|
- !ruby/object:Gem::Version
|
116
116
|
version: 2.14.0.rc
|
117
|
-
description: Interval pull requester with bundle update.
|
117
|
+
description: Interval pull requester with bundle/carton update.
|
118
118
|
email:
|
119
119
|
- o.gata.ken@gmail.com
|
120
120
|
executables:
|
@@ -135,12 +135,14 @@ files:
|
|
135
135
|
- bin/tachikoma
|
136
136
|
- data/default.yaml
|
137
137
|
- lib/tachikoma.rb
|
138
|
+
- lib/tachikoma/application.rb
|
138
139
|
- lib/tachikoma/settings.rb
|
139
140
|
- lib/tachikoma/tasks.rb
|
140
141
|
- lib/tachikoma/version.rb
|
141
142
|
- lib/tasks/app.rake
|
142
143
|
- rubocop-todo.yml
|
143
144
|
- spec/spec_helper.rb
|
145
|
+
- spec/tachikoma/application_spec.rb
|
144
146
|
- spec/tachikoma/settings_spec.rb
|
145
147
|
- spec/tasks/app_task_spec.rb
|
146
148
|
- tachikoma.gemspec
|
@@ -159,9 +161,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
159
161
|
version: '0'
|
160
162
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
161
163
|
requirements:
|
162
|
-
- - '
|
164
|
+
- - '>'
|
163
165
|
- !ruby/object:Gem::Version
|
164
|
-
version:
|
166
|
+
version: 1.3.1
|
165
167
|
requirements: []
|
166
168
|
rubyforge_project:
|
167
169
|
rubygems_version: 2.0.8
|
@@ -170,5 +172,6 @@ specification_version: 4
|
|
170
172
|
summary: Update gem frequently gets less pain. Let's doing bundle update as a habit!
|
171
173
|
test_files:
|
172
174
|
- spec/spec_helper.rb
|
175
|
+
- spec/tachikoma/application_spec.rb
|
173
176
|
- spec/tachikoma/settings_spec.rb
|
174
177
|
- spec/tasks/app_task_spec.rb
|