zenhub2pivotal 0.1.0
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 +7 -0
- data/.gitignore +9 -0
- data/.rspec +2 -0
- data/.travis.yml +4 -0
- data/.zenhub2pivotal.yml.sample +7 -0
- data/CODE_OF_CONDUCT.md +49 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +51 -0
- data/LICENSE.txt +21 -0
- data/README.md +63 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/bin/zenhub2pivotal +5 -0
- data/lib/zenhub2pivotal.rb +36 -0
- data/lib/zenhub2pivotal/cli.rb +11 -0
- data/lib/zenhub2pivotal/config.rb +20 -0
- data/lib/zenhub2pivotal/github.rb +92 -0
- data/lib/zenhub2pivotal/issue.rb +87 -0
- data/lib/zenhub2pivotal/repository.rb +34 -0
- data/lib/zenhub2pivotal/version.rb +3 -0
- data/lib/zenhub2pivotal/zenhub.rb +29 -0
- data/zenhub2pivotal.gemspec +28 -0
- metadata +138 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 307aa6ea29ee6ee23260aca8b645e267c957ee92
|
4
|
+
data.tar.gz: ab4c8b969e8cc81e8421f3b02177b94b1aa63d6d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 56e17f9b974f754f6ac96864ddb5507fd69778be84bc20949f18a1100f65b7649cb231ca8e0c56d4257db39d89c19f644da78b9fd3e3a0b9ead291b5d1dd91c6
|
7
|
+
data.tar.gz: 8f439ae891574ad023ef4a20f74a5db89ed8af97d7a3bc1e9e89b07f8270a488f2f3b88d1918eaddc94bafe57f4fff029eec9763a5dbaae336a14b637074ae3e
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, and in the interest of
|
4
|
+
fostering an open and welcoming community, we pledge to respect all people who
|
5
|
+
contribute through reporting issues, posting feature requests, updating
|
6
|
+
documentation, submitting pull requests or patches, and other activities.
|
7
|
+
|
8
|
+
We are committed to making participation in this project a harassment-free
|
9
|
+
experience for everyone, regardless of level of experience, gender, gender
|
10
|
+
identity and expression, sexual orientation, disability, personal appearance,
|
11
|
+
body size, race, ethnicity, age, religion, or nationality.
|
12
|
+
|
13
|
+
Examples of unacceptable behavior by participants include:
|
14
|
+
|
15
|
+
* The use of sexualized language or imagery
|
16
|
+
* Personal attacks
|
17
|
+
* Trolling or insulting/derogatory comments
|
18
|
+
* Public or private harassment
|
19
|
+
* Publishing other's private information, such as physical or electronic
|
20
|
+
addresses, without explicit permission
|
21
|
+
* Other unethical or unprofessional conduct
|
22
|
+
|
23
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
24
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
25
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
26
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
27
|
+
threatening, offensive, or harmful.
|
28
|
+
|
29
|
+
By adopting this Code of Conduct, project maintainers commit themselves to
|
30
|
+
fairly and consistently applying these principles to every aspect of managing
|
31
|
+
this project. Project maintainers who do not follow or enforce the Code of
|
32
|
+
Conduct may be permanently removed from the project team.
|
33
|
+
|
34
|
+
This code of conduct applies both within project spaces and in public spaces
|
35
|
+
when an individual is representing the project or its community.
|
36
|
+
|
37
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
38
|
+
reported by contacting a project maintainer at irohiroki@gmail.com. All
|
39
|
+
complaints will be reviewed and investigated and will result in a response that
|
40
|
+
is deemed necessary and appropriate to the circumstances. Maintainers are
|
41
|
+
obligated to maintain confidentiality with regard to the reporter of an
|
42
|
+
incident.
|
43
|
+
|
44
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
45
|
+
version 1.3.0, available at
|
46
|
+
[http://contributor-covenant.org/version/1/3/0/][version]
|
47
|
+
|
48
|
+
[homepage]: http://contributor-covenant.org
|
49
|
+
[version]: http://contributor-covenant.org/version/1/3/0/
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
zenhub2pivotal (0.1.0)
|
5
|
+
octokit
|
6
|
+
zenhub_ruby
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
addressable (2.4.0)
|
12
|
+
diff-lcs (1.2.5)
|
13
|
+
faraday (0.9.2)
|
14
|
+
multipart-post (>= 1.2, < 3)
|
15
|
+
faraday_middleware (0.10.0)
|
16
|
+
faraday (>= 0.7.4, < 0.10)
|
17
|
+
multipart-post (2.0.0)
|
18
|
+
octokit (4.3.0)
|
19
|
+
sawyer (~> 0.7.0, >= 0.5.3)
|
20
|
+
rake (10.5.0)
|
21
|
+
rspec (3.4.0)
|
22
|
+
rspec-core (~> 3.4.0)
|
23
|
+
rspec-expectations (~> 3.4.0)
|
24
|
+
rspec-mocks (~> 3.4.0)
|
25
|
+
rspec-core (3.4.4)
|
26
|
+
rspec-support (~> 3.4.0)
|
27
|
+
rspec-expectations (3.4.0)
|
28
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
29
|
+
rspec-support (~> 3.4.0)
|
30
|
+
rspec-mocks (3.4.1)
|
31
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
32
|
+
rspec-support (~> 3.4.0)
|
33
|
+
rspec-support (3.4.1)
|
34
|
+
sawyer (0.7.0)
|
35
|
+
addressable (>= 2.3.5, < 2.5)
|
36
|
+
faraday (~> 0.8, < 0.10)
|
37
|
+
zenhub_ruby (0.1.1)
|
38
|
+
faraday
|
39
|
+
faraday_middleware
|
40
|
+
|
41
|
+
PLATFORMS
|
42
|
+
ruby
|
43
|
+
|
44
|
+
DEPENDENCIES
|
45
|
+
bundler (~> 1.12)
|
46
|
+
rake (~> 10.0)
|
47
|
+
rspec (~> 3.0)
|
48
|
+
zenhub2pivotal!
|
49
|
+
|
50
|
+
BUNDLED WITH
|
51
|
+
1.12.3
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Hiroki Yoshioka
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
# Zenhub2pivotal
|
2
|
+
|
3
|
+
A command line tool to generate CSV to migrate from ZenHub to Pivotal Tracker. Name all repo names in your ZenHub board and you get csv lines that suit to be imported to Pivotal Tracker.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Assuming you have Ruby installed:
|
8
|
+
|
9
|
+
$ gem install zenhub2pivotal
|
10
|
+
|
11
|
+
## Configuration
|
12
|
+
|
13
|
+
You need 3 things:
|
14
|
+
|
15
|
+
* GitHub Access Token
|
16
|
+
* ZenHub Access Token
|
17
|
+
* Pipeline-to-Panel mapping
|
18
|
+
|
19
|
+
All information should be in `.zenhub2pivotal.yml` in the working directory. Consult [.zenhub2pivotal.yml.sample](.zenhub2pivotal.yml.sample) regarding the format.
|
20
|
+
|
21
|
+
### GitHub Access Token
|
22
|
+
|
23
|
+
You can manage your access tokens in [Personal settings](https://github.com/settings/tokens) page in GitHub. [A detailed documentation](https://developer.github.com/v3/oauth/) is also available.
|
24
|
+
|
25
|
+
### ZenHub Access Token
|
26
|
+
|
27
|
+
Your ZenHub Access Token can be generated in [Settings](https://dashboard.zenhub.io/#/settings) page in ZenHub dashboard. See [the document](https://github.com/ZenHubIO/API#authentication) for more information.
|
28
|
+
|
29
|
+
### Pipeline-to-Panel mapping
|
30
|
+
|
31
|
+
In ZenHub you can create "Pipelines" and name them as you like, while Pivotal Tracker has 4 "Panels", whose names are fixed (Icebox, Backlog, Current, and Done). Zenhub2pivotal need to know which pipeline corresponds to which panel. The format looks like the following:
|
32
|
+
|
33
|
+
"Wish List": icebox
|
34
|
+
|
35
|
+
In which case, all issues in Wish List pipeline will go into the Icebox. 4 panel names (`icebox`, `backlog`, `current`, and `done`) are keyword and must be accurate.
|
36
|
+
|
37
|
+
Only pipelines named in the configuration file will be processed.
|
38
|
+
|
39
|
+
## Usage
|
40
|
+
|
41
|
+
Give repository names as arguments.
|
42
|
+
|
43
|
+
$ zenhub2pivotal your_org/repo1 [your_org/repo2 ...]
|
44
|
+
|
45
|
+
CSV lines should be out to the standard output.
|
46
|
+
|
47
|
+
## Limitation
|
48
|
+
|
49
|
+
### Comments
|
50
|
+
|
51
|
+
Issue comments are not supported.
|
52
|
+
|
53
|
+
### Issue order
|
54
|
+
|
55
|
+
Some issues might appear in a different position (order) in Pivotal Tracker. (The tool orders issues based on their position value fetched from ZenHub API.)
|
56
|
+
|
57
|
+
## Contributing
|
58
|
+
|
59
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/irohiroki/zenhub2pivotal. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
60
|
+
|
61
|
+
## License
|
62
|
+
|
63
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "zenhub2pivotal"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
data/bin/zenhub2pivotal
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'octokit'
|
2
|
+
require 'zenhub_ruby'
|
3
|
+
|
4
|
+
require_relative 'zenhub2pivotal/cli'
|
5
|
+
require_relative 'zenhub2pivotal/config'
|
6
|
+
require_relative 'zenhub2pivotal/github'
|
7
|
+
require_relative 'zenhub2pivotal/issue'
|
8
|
+
require_relative 'zenhub2pivotal/repository'
|
9
|
+
require_relative 'zenhub2pivotal/version'
|
10
|
+
require_relative 'zenhub2pivotal/zenhub'
|
11
|
+
|
12
|
+
module Zenhub2pivotal
|
13
|
+
class Main
|
14
|
+
def initialize(repo_names, out)
|
15
|
+
@repo_names = repo_names
|
16
|
+
@out = out
|
17
|
+
end
|
18
|
+
|
19
|
+
def perform
|
20
|
+
@out.puts 'Id,Title,Labels,Iteration,Iteration Start,Iteration End,Type,Estimate,Current State,Created at,Accepted at,Deadline,Requested By,Description,URL,Owned By,Comment'
|
21
|
+
Config.pipelines.each do |pipeline_name, panel|
|
22
|
+
repositories.flat_map {|repository|
|
23
|
+
repository.issues(pipeline: pipeline_name)
|
24
|
+
}.sort.each {|issue|
|
25
|
+
@out.puts(issue.csv(panel: panel))
|
26
|
+
}
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def repositories
|
31
|
+
@repositories ||= @repo_names.map do |repo_name|
|
32
|
+
Repository.new(repo_name)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
|
3
|
+
module Zenhub2pivotal
|
4
|
+
class Config
|
5
|
+
def self.all
|
6
|
+
YAML.load_file("#{Dir.pwd}/.zenhub2pivotal.yml")
|
7
|
+
rescue => e
|
8
|
+
$stderr.puts("Can't load configuration file: #{e.message}")
|
9
|
+
nil
|
10
|
+
end
|
11
|
+
|
12
|
+
class << self
|
13
|
+
%i[github_access_token zenhub_access_token pipelines].each do |method_name|
|
14
|
+
define_method method_name do
|
15
|
+
all[method_name.to_s]
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,92 @@
|
|
1
|
+
module Zenhub2pivotal
|
2
|
+
class GitHub
|
3
|
+
def self.client
|
4
|
+
@client ||= Octokit::Client.new(access_token: Config.github_access_token)
|
5
|
+
end
|
6
|
+
|
7
|
+
def self.repository(name)
|
8
|
+
@repositories ||= {}
|
9
|
+
@repositories[name] ||= Repository.new(name)
|
10
|
+
end
|
11
|
+
|
12
|
+
class IssueCache
|
13
|
+
def initialize(repository)
|
14
|
+
@repository = repository
|
15
|
+
@cache = []
|
16
|
+
end
|
17
|
+
|
18
|
+
def find_and_merge(zenhub_issue)
|
19
|
+
issues.lazy.find{|issue|
|
20
|
+
issue[:number] == zenhub_issue['issue_number']
|
21
|
+
}.to_attrs.merge(zenhub_issue)
|
22
|
+
end
|
23
|
+
|
24
|
+
def issues
|
25
|
+
Enumerator.new do |yielder|
|
26
|
+
@cache.each do |issue_datum|
|
27
|
+
yielder << issue_datum
|
28
|
+
end
|
29
|
+
|
30
|
+
loop do
|
31
|
+
issue_data = loader.next
|
32
|
+
break if issue_data.nil?
|
33
|
+
@cache += issue_data
|
34
|
+
issue_data.each do |issue_datum|
|
35
|
+
yielder << issue_datum
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def load
|
42
|
+
issues
|
43
|
+
end
|
44
|
+
|
45
|
+
def loader
|
46
|
+
@loader ||= IssueLoader.new(@repository)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
class IssueLoader
|
51
|
+
def initialize(repository)
|
52
|
+
@repository = repository
|
53
|
+
end
|
54
|
+
|
55
|
+
def next
|
56
|
+
if @response
|
57
|
+
rel_next = @response.rels[:next]
|
58
|
+
if rel_next
|
59
|
+
@response = rel_next.get
|
60
|
+
@response.data
|
61
|
+
else
|
62
|
+
nil
|
63
|
+
end
|
64
|
+
else
|
65
|
+
GitHub.client.issues(@repository.name)
|
66
|
+
@response = GitHub.client.last_response
|
67
|
+
@response.data
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
class Repository
|
73
|
+
attr_reader :name
|
74
|
+
|
75
|
+
def initialize(name)
|
76
|
+
@name = name
|
77
|
+
end
|
78
|
+
|
79
|
+
def data
|
80
|
+
@data ||= GitHub.client.repo(name)
|
81
|
+
end
|
82
|
+
|
83
|
+
def id
|
84
|
+
data[:id]
|
85
|
+
end
|
86
|
+
|
87
|
+
def issues
|
88
|
+
@issue_cache ||= IssueCache.new(self)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
@@ -0,0 +1,87 @@
|
|
1
|
+
require 'csv'
|
2
|
+
require 'ostruct'
|
3
|
+
|
4
|
+
module Zenhub2pivotal
|
5
|
+
class Issue
|
6
|
+
STATE = {
|
7
|
+
'done' => 'accepted',
|
8
|
+
'current' => 'started',
|
9
|
+
'backlog' => 'unstarted',
|
10
|
+
'icebox' => 'unscheduled',
|
11
|
+
}
|
12
|
+
|
13
|
+
def initialize(attrs)
|
14
|
+
@attrs = attrs
|
15
|
+
end
|
16
|
+
|
17
|
+
def <=>(other)
|
18
|
+
if position.nil?
|
19
|
+
other.position.nil? ? 0 : 1
|
20
|
+
else
|
21
|
+
other.position.nil? ? -1 : position - other.position
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def accepted_at
|
26
|
+
format_time(:closed_at)
|
27
|
+
end
|
28
|
+
|
29
|
+
def assignee
|
30
|
+
@attrs[:assignee][:login] if @attrs[:assignee]
|
31
|
+
end
|
32
|
+
|
33
|
+
def created_at
|
34
|
+
format_time(:created_at)
|
35
|
+
end
|
36
|
+
|
37
|
+
def csv(panel:)
|
38
|
+
CSV.generate do |csv|
|
39
|
+
# Id , Title, Labels, Iteration, Iteration Start, Iteration End, Type, Estimate, Current State, Created at, Accepted at, Deadline, Requested By, Description, URL, Owned By , Comment
|
40
|
+
csv << [nil, title, labels, nil , nil , nil , type, estimate, STATE[panel] , created_at, accepted_at, nil , user_login , body , nil, assignee, nil]
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def github_labels
|
45
|
+
@attrs[:labels].map{|label|
|
46
|
+
label[:name]
|
47
|
+
}
|
48
|
+
end
|
49
|
+
|
50
|
+
def labels
|
51
|
+
(github_labels - ['bug'] + [repo_name]).join(',')
|
52
|
+
end
|
53
|
+
|
54
|
+
def estimate
|
55
|
+
@attrs['estimate'] && @attrs['estimate']['value']
|
56
|
+
end
|
57
|
+
|
58
|
+
def position
|
59
|
+
@attrs['position']
|
60
|
+
end
|
61
|
+
|
62
|
+
def repo_name
|
63
|
+
@attrs[:repo_name][/(?<=\/).*/]
|
64
|
+
end
|
65
|
+
|
66
|
+
def type
|
67
|
+
github_labels.include?('bug') ? 'bug' : 'feature'
|
68
|
+
end
|
69
|
+
|
70
|
+
def user_login
|
71
|
+
@attrs[:user][:login]
|
72
|
+
end
|
73
|
+
|
74
|
+
def method_missing(symbol, *args)
|
75
|
+
if [:body, :title].include?(symbol)
|
76
|
+
@attrs[symbol]
|
77
|
+
else
|
78
|
+
super
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
private
|
83
|
+
def format_time(key)
|
84
|
+
@attrs[key].strftime('%b %-m, %Y') if @attrs[key]
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'forwardable'
|
2
|
+
|
3
|
+
module Zenhub2pivotal
|
4
|
+
class Repository
|
5
|
+
attr_reader :name
|
6
|
+
|
7
|
+
def initialize(name)
|
8
|
+
@name = name
|
9
|
+
end
|
10
|
+
|
11
|
+
def board
|
12
|
+
@board ||= ZenHub.new(id).board
|
13
|
+
end
|
14
|
+
|
15
|
+
def github_issues
|
16
|
+
GitHub.repository(name).issues
|
17
|
+
end
|
18
|
+
|
19
|
+
def id
|
20
|
+
GitHub.repository(name).id
|
21
|
+
end
|
22
|
+
|
23
|
+
def issues(pipeline:)
|
24
|
+
pipeline_data(pipeline)['issues'].map do |zenhub_issue|
|
25
|
+
Issue.new(github_issues.find_and_merge(zenhub_issue).merge(repo_name: name))
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
private
|
30
|
+
def pipeline_data(pipeline)
|
31
|
+
board.pipelines[pipeline] or raise "No such pipeline: #{pipeline}"
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module Zenhub2pivotal
|
2
|
+
class ZenHub
|
3
|
+
def initialize(id)
|
4
|
+
@id = id
|
5
|
+
end
|
6
|
+
|
7
|
+
def board
|
8
|
+
@board ||= Board.new(client.board_data(@id).body)
|
9
|
+
end
|
10
|
+
|
11
|
+
def client
|
12
|
+
@client ||= ZenhubRuby::Client.new(Config.zenhub_access_token)
|
13
|
+
end
|
14
|
+
|
15
|
+
class Board
|
16
|
+
def initialize(data)
|
17
|
+
@data = data
|
18
|
+
end
|
19
|
+
|
20
|
+
def pipelines
|
21
|
+
@pipelines ||= Hash[
|
22
|
+
@data['pipelines'].dup.map{|pipeline_data|
|
23
|
+
[pipeline_data.delete('name'), pipeline_data]
|
24
|
+
}
|
25
|
+
]
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'zenhub2pivotal/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "zenhub2pivotal"
|
8
|
+
spec.version = Zenhub2pivotal::VERSION
|
9
|
+
spec.authors = ["Hiroki Yoshioka"]
|
10
|
+
spec.email = ["irohiroki@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{ZenHub to Pivotal Tracker migration tool.}
|
13
|
+
spec.description = %q{Exports issues from ZenHub (GitHub) and makes csv that can be imported to Pivotal Tracker.}
|
14
|
+
spec.homepage = "https://github.com/irohiroki/zenhub2pivotal"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
+
spec.bindir = "bin"
|
19
|
+
spec.executables = "zenhub2pivotal"
|
20
|
+
spec.require_paths = ["lib"]
|
21
|
+
|
22
|
+
spec.add_dependency "octokit"
|
23
|
+
spec.add_dependency "zenhub_ruby"
|
24
|
+
|
25
|
+
spec.add_development_dependency "bundler", "~> 1.12"
|
26
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
27
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
28
|
+
end
|
metadata
ADDED
@@ -0,0 +1,138 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: zenhub2pivotal
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Hiroki Yoshioka
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-06-26 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: octokit
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: zenhub_ruby
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.12'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.12'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '10.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '10.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '3.0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '3.0'
|
83
|
+
description: Exports issues from ZenHub (GitHub) and makes csv that can be imported
|
84
|
+
to Pivotal Tracker.
|
85
|
+
email:
|
86
|
+
- irohiroki@gmail.com
|
87
|
+
executables:
|
88
|
+
- zenhub2pivotal
|
89
|
+
extensions: []
|
90
|
+
extra_rdoc_files: []
|
91
|
+
files:
|
92
|
+
- ".gitignore"
|
93
|
+
- ".rspec"
|
94
|
+
- ".travis.yml"
|
95
|
+
- ".zenhub2pivotal.yml.sample"
|
96
|
+
- CODE_OF_CONDUCT.md
|
97
|
+
- Gemfile
|
98
|
+
- Gemfile.lock
|
99
|
+
- LICENSE.txt
|
100
|
+
- README.md
|
101
|
+
- Rakefile
|
102
|
+
- bin/console
|
103
|
+
- bin/setup
|
104
|
+
- bin/zenhub2pivotal
|
105
|
+
- lib/zenhub2pivotal.rb
|
106
|
+
- lib/zenhub2pivotal/cli.rb
|
107
|
+
- lib/zenhub2pivotal/config.rb
|
108
|
+
- lib/zenhub2pivotal/github.rb
|
109
|
+
- lib/zenhub2pivotal/issue.rb
|
110
|
+
- lib/zenhub2pivotal/repository.rb
|
111
|
+
- lib/zenhub2pivotal/version.rb
|
112
|
+
- lib/zenhub2pivotal/zenhub.rb
|
113
|
+
- zenhub2pivotal.gemspec
|
114
|
+
homepage: https://github.com/irohiroki/zenhub2pivotal
|
115
|
+
licenses:
|
116
|
+
- MIT
|
117
|
+
metadata: {}
|
118
|
+
post_install_message:
|
119
|
+
rdoc_options: []
|
120
|
+
require_paths:
|
121
|
+
- lib
|
122
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
123
|
+
requirements:
|
124
|
+
- - ">="
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
version: '0'
|
127
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
requirements: []
|
133
|
+
rubyforge_project:
|
134
|
+
rubygems_version: 2.5.1
|
135
|
+
signing_key:
|
136
|
+
specification_version: 4
|
137
|
+
summary: ZenHub to Pivotal Tracker migration tool.
|
138
|
+
test_files: []
|