tachikoma 2.1.3 → 3.0.0

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: a32e1d702b5baafdfecf917ea7cdfd0fc293118f
4
- data.tar.gz: acf32ce8b0590fd9e699297431925bd643b42aac
3
+ metadata.gz: 959855b32d57d8fc65b695bbe828aebdb721d7dd
4
+ data.tar.gz: d87489d289f3f15d46865ce921654fc932269a65
5
5
  SHA512:
6
- metadata.gz: 1abdac5ca5fbc25b42225ded13513cb4e2aafdd1371991442b2cce67ebefa1ed80445202b400845547c97c9c4db680dc2f8ee557ea5a88277b86071074a44b16
7
- data.tar.gz: 8d2ca9119ea4e617a7fc38d97f28b471b120b25472883b92a64d1ba9df6c06c2c1d3bcd8890a98bbdeeb205288bcf92b3837a08cc1af28663e44fde4024fa373
6
+ metadata.gz: 2db323e982a2e86c168eeaaf854f28d942ff0c61a1f18bb0fb2cbe03b7468ef73fbfd4183984b653e68003b5e97fd0b495b369f82cf9aa9c909ef1f17e9931bc
7
+ data.tar.gz: 4b5d8134ff072bbb2019f79746abbc3c5b671faf3aaa29b0a853296257e499704668008a34d36889ac91a6cfda0744410bca968597408297fc802775196497e9
data/.gitignore CHANGED
@@ -3,8 +3,7 @@
3
3
  .bundle
4
4
  .config
5
5
  .yardoc
6
- # For heroku deploy
7
- # Gemfile.lock
6
+ /Gemfile.lock
8
7
  InstalledFiles
9
8
  _yardoc
10
9
  coverage
@@ -17,8 +16,5 @@ test/tmp
17
16
  test/version_tmp
18
17
  tmp
19
18
 
20
- # Ignore checkout repos
21
- /repos/
22
-
23
19
  $ Ignore dotenv setting
24
20
  /.env
data/NOTE.txt CHANGED
@@ -1,6 +1,5 @@
1
1
  #TODO
2
2
  - heroku build pack (sqlite)
3
- - Gem-ish usage (load tasks)
4
3
 
5
4
  ## Feature Request
6
5
  - Notify if fail
data/README.md CHANGED
@@ -2,47 +2,9 @@
2
2
 
3
3
  Daily Pull Requester with bundle update
4
4
 
5
- ## How to run at your local machine
5
+ ## Usage as gem
6
6
 
7
- 1. Get GitHub OAuth2 token: See [Creating an OAuth token for command-line use](https://help.github.com/articles/creating-an-oauth-token-for-command-line-use)
8
- 2. Add YAML of repository you want to build by Tachikoma: Copy `data/fenix-knight.yaml` then edit `url` and `type`. Change `url` to clone URL of your repository. Change `type` to `shared`.
9
- 3. Run below command in your shell:
10
-
11
- ```
12
- $ mkdir -p repos
13
- $ export BUILD_FOR=<your-repository-name-that-is-same-to-yaml-filename>
14
- $ export TOKEN_YOUR_REPOSITORY_NAME_THAT_IS_SAME_TO_YAML_FILENAME=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
15
- $ bundle exec rake tachikoma:load tachikoma:fetch tachikoma:bundle tachikoma:pull_request
16
- ```
17
-
18
- ## Collaborate with private YAML data
19
-
20
- Tachikoma uses `./data` as a default data directory that stores YAML setting files.
21
-
22
- To locate other data directory, set `LOCAL_DATA_PATH` and `LOCAL_DATA_REMOTE_URL` environment variables.
23
-
24
- * `LOCAL_DATA_PATH`: data directory/location of YAML files. relative/absolute path also ok.
25
- * `LOCAL_DATA_REMOTE_URL`: git clone URL of your data repository. typically HTTPS for public repo, SSH for private repo.
26
-
27
- ```
28
- $ export LOCAL_DATA_PATH=<local-data-path>
29
- $ export LOCAL_DATA_REMOTE_URL=<git-clone-url-of-your-public-or-private-data-repository>
30
- $ bundle exec rake tachikoma:fetch_data
31
- ```
32
-
33
- To work with other tasks, just put other tasks after `tachikoma:fetch_data`.
34
-
35
- NOTE: other environment variables such as `BUILD_FOR` are also required
36
-
37
- ```
38
- $ bundle exec rake tachikoma:fetch_data tachikoma:load tachikoma:fetch tachikoma:bundle tachikoma:pull_request
39
- ```
40
-
41
- ## Usage as gem (experimental)
42
-
43
- Above description is _inside_ tachikoma, below is usage not _inside_ but _outside_ tachikoma, as gem.
44
-
45
- https://github.com/sanemat/bot-motoko-tachikoma
7
+ see: https://github.com/sanemat/bot-motoko-tachikoma
46
8
 
47
9
  ```
48
10
  $ mkdir -p my-tachikoma
@@ -52,6 +14,17 @@ $ echo "gem 'tachikoma'" >> Gemfile
52
14
  $ bundle
53
15
  $ bundle exec tachikoma init
54
16
  ```
17
+ ### Write repository information
18
+
19
+ 1. Get GitHub OAuth2 token: See [Creating an OAuth token for command-line use](https://help.github.com/articles/creating-an-oauth-token-for-command-line-use)
20
+ 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.
21
+ 3. Run below command in your shell:
22
+
23
+ ```
24
+ $ export BUILD_FOR=<your-repository-name-that-is-same-to-yaml-filename>
25
+ $ export TOKEN_YOUR_REPOSITORY_NAME_THAT_IS_SAME_TO_YAML_FILENAME=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
26
+ $ bundle exec rake tachikoma:load tachikoma:fetch tachikoma:bundle tachikoma:pull_request
27
+ ```
55
28
 
56
29
  ## Contributing
57
30
 
data/bin/tachikoma CHANGED
@@ -11,12 +11,11 @@ when 'init'
11
11
  File.open('Rakefile', 'a') do |f|
12
12
  f << <<-EOS
13
13
  require 'bundler/setup'
14
- require 'tachikoma'
15
14
  require 'tachikoma/tasks'
16
15
  EOS
17
16
  end
18
17
  FileUtils.mkdir_p('data')
19
- File.open(File.join('data', '__example__.yaml'), 'w') do |f|
18
+ File.open(File.join('data', 'bot-motoko-tachikoma.yaml'), 'w') do |f|
20
19
  f << <<-EOS
21
20
  url:
22
21
  'https://github.com/sanemat/bot-motoko-tachikoma.git'
@@ -1,24 +1,27 @@
1
1
  require 'pathname'
2
2
 
3
3
  module Tachikoma
4
+ # ~/users-tachikoma-dir
4
5
  def self.root_path
5
- @root_path ||= Pathname.new(File.dirname(File.dirname(File.dirname(__FILE__))))
6
+ @root_path ||= Pathname.new(Dir.pwd)
6
7
  end
7
8
 
8
9
  def self.root_path=(root_path)
9
10
  @root_path = Pathname.new File.expand_path(root_path)
10
11
  end
11
12
 
13
+ # ~/users-tachikoma-dir/data
12
14
  def self.data_path
13
- @data_path ||= root_path.parent.join('data')
15
+ @data_path ||= root_path.join('data')
14
16
  end
15
17
 
16
18
  def self.data_path=(data_path)
17
19
  @data_path = Pathname.new File.expand_path(data_path)
18
20
  end
19
21
 
22
+ # ~/users-tachikoma-dir/repos
20
23
  def self.repos_path
21
- @repos_path ||= root_path.parent.join('repos')
24
+ @repos_path ||= root_path.join('repos')
22
25
  end
23
26
 
24
27
  def self.repos_path=(repos_path)
@@ -1,3 +1,3 @@
1
1
  module Tachikoma
2
- VERSION = "2.1.3"
2
+ VERSION = "3.0.0"
3
3
  end
data/lib/tasks/app.rake CHANGED
@@ -43,27 +43,13 @@ namespace :tachikoma do
43
43
  end
44
44
  end
45
45
 
46
- desc 'fetch another `/data` directory from another location'
47
- task :fetch_data do
48
- if ENV['LOCAL_DATA_PATH'] && ENV['LOCAL_DATA_REMOTE_URL']
49
- raise "local data path is empty" if ENV['LOCAL_DATA_PATH'] == ''
50
- raise "remote git repository of local data is empty" if ENV['LOCAL_DATA_REMOTE_URL'] == ''
51
- Tachikoma.data_path = File.absolute_path(ENV['LOCAL_DATA_PATH'])
52
- rm_rf(Tachikoma.data_path) if Dir.exists?(Tachikoma.data_path)
53
- sh "git clone #{ENV['LOCAL_DATA_REMOTE_URL']} #{Tachikoma.data_path}"
54
- raise "failed to clone remote repo: perhaps wrong git clone URL? #{ENV['LOCAL_DATA_REMOTE_URL']}" unless $?.success?
55
- else
56
- warn "`fetch_data` task requires LOCAL_DATA_PATH and LOCAL_DATA_REMOTE_URL environment variables"
57
- end
58
- end
59
-
60
46
  task :load do
61
47
  @build_for = ENV['BUILD_FOR']
62
48
  @github_token = ENV[github_token_key(@build_for)]
63
49
  @git_name = 'bot-motoko'
64
50
  @git_email = 'bot-motoko@al.sane.jp'
65
51
  @configure =
66
- YAML.load_file(File.join(Tachikoma.data_path, "#{@build_for}.yaml"))
52
+ YAML.safe_load_file(File.join(Tachikoma.data_path, "#{@build_for}.yaml"))
67
53
  @fetch_url = @configure['url']
68
54
  @base_remote_branch = 'origin/master'
69
55
  @authorized_url = authorized_url_with_type(@fetch_url, @configure['type'], @github_token, @git_name)
data/tachikoma.gemspec CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
13
13
  spec.homepage = "https://github.com/sanemat/tachikoma"
14
14
  spec.license = "MIT"
15
15
 
16
- spec.files = `git ls-files|grep -v 'data/.*'`.split($/)
16
+ spec.files = `git ls-files`.split($/)
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
19
  spec.require_paths = ["lib"]
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: 2.1.3
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - sanemat
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-01 00:00:00.000000000 Z
11
+ date: 2013-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -105,7 +105,6 @@ files:
105
105
  - .env.example
106
106
  - .gitignore
107
107
  - Gemfile
108
- - Gemfile.lock
109
108
  - LICENSE.txt
110
109
  - NOTE.txt
111
110
  - README.md
data/Gemfile.lock DELETED
@@ -1,38 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- tachikoma (2.1.3)
5
- httparty
6
- multi_json
7
- rake
8
- safe_yaml
9
-
10
- GEM
11
- remote: https://rubygems.org/
12
- specs:
13
- coderay (1.0.9)
14
- dotenv (0.8.0)
15
- httparty (0.11.0)
16
- multi_json (~> 1.0)
17
- multi_xml (>= 0.5.2)
18
- method_source (0.8.1)
19
- multi_json (1.7.7)
20
- multi_xml (0.5.4)
21
- oj (2.1.2)
22
- pry (0.9.12.2)
23
- coderay (~> 1.0.5)
24
- method_source (~> 0.8)
25
- slop (~> 3.4)
26
- rake (10.1.0)
27
- safe_yaml (0.9.3)
28
- slop (3.4.5)
29
-
30
- PLATFORMS
31
- ruby
32
-
33
- DEPENDENCIES
34
- bundler (~> 1.3)
35
- dotenv
36
- oj
37
- pry
38
- tachikoma!