tachikoma 2.1.1.beta → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 207833f5f325f2f24d37a7e07e1b1b0967b8fd3d
4
- data.tar.gz: 08bd9e78449024411fad5928ce16b12959d9df1c
3
+ metadata.gz: e7bf70eb21d6132533a10a96c65b182b724def6f
4
+ data.tar.gz: 8f868753cae80e5a3a145ca59a5643d7ee10f8c0
5
5
  SHA512:
6
- metadata.gz: 1beeacf63416547742143286a2ac247909ab53e575a33d6a979b619a2ceeb353fae1f1d4ca15956daf2c79e1a6fb8f440444c6eddbf0813dfe2fba435d9613cb
7
- data.tar.gz: 7458d786f533a7106972c9f6a07bb63118c355d7e71936272672604e586a05154dd20b80a89fa3222f2e1ddbcac368819a445ea6da960a8418b9aff5a5a52ee5
6
+ metadata.gz: 043e9a2546dae5b92ebd9d6b6d933abb556f7714937bab934e77c00233cc16df17b4660f87bf01b06a460d846aee852f98e3c78263b3f54d2febe3a723bc7d6d
7
+ data.tar.gz: 8276a8e8b779882fd6ba1a836c3b62c035dc9dd401d0a4d6b8736e4c7067d25d9390d7bac10b6aa5d4b5308302365d72454f2251f385bcf3aa93806b0b9427ad
data/Gemfile.lock CHANGED
@@ -1,9 +1,10 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tachikoma (2.1.1.beta)
4
+ tachikoma (2.1.2)
5
5
  httparty
6
6
  multi_json
7
+ rake
7
8
  safe_yaml
8
9
 
9
10
  GEM
@@ -34,5 +35,4 @@ DEPENDENCIES
34
35
  dotenv
35
36
  oj
36
37
  pry
37
- rake
38
38
  tachikoma!
data/README.md CHANGED
@@ -2,6 +2,42 @@
2
2
 
3
3
  Daily Pull Requester with bundle update
4
4
 
5
+ ## How to run at your local machine
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
+
5
41
  ## Contributing
6
42
 
7
43
  1. Fork it
@@ -0,0 +1 @@
1
+ Dir[File.expand_path(File.join(File.dirname(__FILE__), '..', '..')) + '/lib/tasks/*.rake'].each { |task| load(task) }
@@ -1,3 +1,3 @@
1
1
  module Tachikoma
2
- VERSION = "2.1.1.beta"
2
+ VERSION = "2.1.2"
3
3
  end
data/lib/tasks/app.rake CHANGED
@@ -4,7 +4,7 @@ require 'safe_yaml'
4
4
  require 'uri'
5
5
 
6
6
  namespace :tachikoma do
7
- @readable_time = Time.now.utc.strftime('%Y%m%d%H%M%S')
7
+ @default_timestamp_format = '%Y%m%d%H%M%S'
8
8
  @root_path = File.expand_path(File.join(__FILE__, '..', '..', '..'))
9
9
  @data_path = File.join(@root_path, 'data')
10
10
  @repos_path = File.join(@root_path, 'repos')
@@ -45,6 +45,20 @@ namespace :tachikoma do
45
45
  end
46
46
  end
47
47
 
48
+ desc 'fetch another `/data` directory from another location'
49
+ task :fetch_data do
50
+ if ENV['LOCAL_DATA_PATH'] && ENV['LOCAL_DATA_REMOTE_URL']
51
+ raise "local data path is empty" if ENV['LOCAL_DATA_PATH'] == ''
52
+ raise "remote git repository of local data is empty" if ENV['LOCAL_DATA_REMOTE_URL'] == ''
53
+ @data_path = File.absolute_path(ENV['LOCAL_DATA_PATH'])
54
+ rm_rf(@data_path) if Dir.exists?(@data_path)
55
+ sh "git clone #{ENV['LOCAL_DATA_REMOTE_URL']} #{@data_path}"
56
+ raise "failed to clone remote repo: perhaps wrong git clone URL? #{ENV['LOCAL_DATA_REMOTE_URL']}" unless $?.success?
57
+ else
58
+ warn "`fetch_data` task requires LOCAL_DATA_PATH and LOCAL_DATA_REMOTE_URL environment variables"
59
+ end
60
+ end
61
+
48
62
  task :load do
49
63
  @build_for = ENV['BUILD_FOR']
50
64
  @github_token = ENV[github_token_key(@build_for)]
@@ -55,6 +69,9 @@ namespace :tachikoma do
55
69
  @fetch_url = @configure['url']
56
70
  @base_remote_branch = 'origin/master'
57
71
  @authorized_url = authorized_url_with_type(@fetch_url, @configure['type'], @github_token, @git_name)
72
+ timestamp_format = @configure['timestamp_format'] || @default_timestamp_format # nil guard
73
+ timestamp_format = @default_timestamp_format if timestamp_format.empty? # empty string: ""
74
+ @readable_time = Time.now.utc.strftime(timestamp_format)
58
75
 
59
76
  @target_url = target_url(@fetch_url)
60
77
  @headers = {
@@ -78,6 +95,7 @@ namespace :tachikoma do
78
95
 
79
96
  desc 'fetch'
80
97
  task fetch: :clean do
98
+ mkdir_p('repos')
81
99
  sh "git clone #{@fetch_url} repos/#{@build_for}"
82
100
  end
83
101
 
data/tachikoma.gemspec CHANGED
@@ -21,8 +21,8 @@ Gem::Specification.new do |spec|
21
21
  spec.add_dependency 'httparty'
22
22
  spec.add_dependency 'multi_json'
23
23
  spec.add_dependency 'safe_yaml'
24
+ spec.add_dependency 'rake'
24
25
 
25
26
  spec.add_development_dependency "bundler", "~> 1.3"
26
- spec.add_development_dependency "rake"
27
27
  spec.add_development_dependency 'dotenv'
28
28
  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: 2.1.1.beta
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - sanemat
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-06-25 00:00:00.000000000 Z
11
+ date: 2013-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -53,33 +53,33 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: bundler
56
+ name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - '>='
60
60
  - !ruby/object:Gem::Version
61
- version: '1.3'
62
- type: :development
61
+ version: '0'
62
+ type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - '>='
67
67
  - !ruby/object:Gem::Version
68
- version: '1.3'
68
+ version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: rake
70
+ name: bundler
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ~>
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: '1.3'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ~>
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: '1.3'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: dotenv
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -111,6 +111,7 @@ files:
111
111
  - Rakefile
112
112
  - lib/tachikoma.rb
113
113
  - lib/tachikoma/settings.rb
114
+ - lib/tachikoma/tasks.rb
114
115
  - lib/tachikoma/version.rb
115
116
  - lib/tasks/app.rake
116
117
  - tachikoma.gemspec
@@ -129,9 +130,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
129
130
  version: '0'
130
131
  required_rubygems_version: !ruby/object:Gem::Requirement
131
132
  requirements:
132
- - - '>'
133
+ - - '>='
133
134
  - !ruby/object:Gem::Version
134
- version: 1.3.1
135
+ version: '0'
135
136
  requirements: []
136
137
  rubyforge_project:
137
138
  rubygems_version: 2.0.2