sync_issues 0.0.1a1
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/LICENSE.txt +23 -0
- data/README.md +44 -0
- data/bin/sync_issues +3 -0
- data/lib/sync_issues/command.rb +47 -0
- data/lib/sync_issues/error.rb +4 -0
- data/lib/sync_issues/sync_issues_module.rb +15 -0
- data/lib/sync_issues/synchronizer.rb +23 -0
- data/lib/sync_issues/version.rb +4 -0
- data/lib/sync_issues.rb +3 -0
- metadata +69 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 0b6a0252d1b5582610e2b01359cf5841bd606d53
|
4
|
+
data.tar.gz: e2231679897dca717069ffa4f99a4b89711e8b70
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: fb399b702215518077d1ef0cadc442785ae33e30d2b7658857019befa57a3a473ecf7216a5bdaceb3c2cb9cc69bb9c6f6b29a14882970c81f578da6b427ea21f
|
7
|
+
data.tar.gz: 0264b355338743058a3b017da78ba9b8122f9371880ba14650ed7569bf28ff78f481ed800f2b25554915fccfffb21f42f812659128f9b60a9f29649af62155d2
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
Copyright (c) 2016, AppFolio, Inc.
|
2
|
+
Copyright (c) 2016, Bryce Boe
|
3
|
+
All rights reserved.
|
4
|
+
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
6
|
+
modification, are permitted provided that the following conditions are met:
|
7
|
+
|
8
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
9
|
+
list of conditions and the following disclaimer.
|
10
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
11
|
+
this list of conditions and the following disclaimer in the documentation
|
12
|
+
and/or other materials provided with the distribution.
|
13
|
+
|
14
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
15
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
16
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
17
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
18
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
19
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
20
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
21
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
22
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
23
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
data/README.md
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
# Sync Issues for GitHub
|
2
|
+
|
3
|
+
sync_issues is a ruby gem to that allows the easy creation and synchronization
|
4
|
+
of issues on GitHub with structured local data.
|
5
|
+
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
To install sync_issues run:
|
10
|
+
|
11
|
+
gem install sync_issues
|
12
|
+
|
13
|
+
## Running sync_issues
|
14
|
+
|
15
|
+
Run sync_issues via:
|
16
|
+
|
17
|
+
sync_tasks /path/to/tasks/directory bboe/repo1 appfolio/repo2
|
18
|
+
|
19
|
+
|
20
|
+
## Local Issue Directory
|
21
|
+
|
22
|
+
Locally you will want to have a directory of markdown files each of which will
|
23
|
+
represent a single issue on GitHub. When syncing new issues will be created
|
24
|
+
according to lexicographic filename order if an issue doesn't already exist
|
25
|
+
with a matching title as specified in the file's frontmatter. Existing issues
|
26
|
+
will be updated if necessary.
|
27
|
+
|
28
|
+
## Issue File
|
29
|
+
|
30
|
+
Each issue file is a markdown file with a `yaml` frontmatter (a format used by
|
31
|
+
[jeykll](http://jekyllrb.com/docs/frontmatter/)).
|
32
|
+
|
33
|
+
### Task Frontmatter
|
34
|
+
|
35
|
+
The frontmatter of an issue file can contain the following attributes:
|
36
|
+
|
37
|
+
* __title__: (required) Used as the title of the issue on GitHub. The title is
|
38
|
+
used as the unique key when syncing updated tasks with existing issues.
|
39
|
+
* __assignee__: (optional) Assign or reassign the issue to the github username
|
40
|
+
specified. Existing assignee will not be removed on sync if the field is not
|
41
|
+
provided.
|
42
|
+
* __label__: (optional) Set the labels of the issue to this comma-separated
|
43
|
+
string of issues. Existing labels will not be cleared on sync when the field
|
44
|
+
is not provided.
|
data/bin/sync_issues
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'docopt'
|
2
|
+
require_relative 'error'
|
3
|
+
require_relative 'synchronizer'
|
4
|
+
require_relative 'version'
|
5
|
+
|
6
|
+
module SyncIssues
|
7
|
+
# Provides the command line interface to SyncIssues
|
8
|
+
class Command
|
9
|
+
DOC = <<-DOC
|
10
|
+
sync_issues: A tool that synchronizes a local directory with GitHub issues.
|
11
|
+
|
12
|
+
Usage:
|
13
|
+
sync_issues DIRECTORY REPOSITORY...
|
14
|
+
sync_issues -h | --help
|
15
|
+
sync_issues --version
|
16
|
+
|
17
|
+
Options:
|
18
|
+
-h --help Output this help information.
|
19
|
+
--version Output the sync_issues version (#{VERSION}).
|
20
|
+
DOC
|
21
|
+
|
22
|
+
def initialize
|
23
|
+
@exit_status = 0
|
24
|
+
end
|
25
|
+
|
26
|
+
def run
|
27
|
+
handle_args(Docopt.docopt(DOC, version: VERSION))
|
28
|
+
rescue Docopt::Exit => exc
|
29
|
+
exit_with_status(exc.message, exc.class.usage != '')
|
30
|
+
rescue Error => exc
|
31
|
+
exit_with_status(exc.message)
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
|
36
|
+
def exit_with_status(msg, condition = true)
|
37
|
+
puts msg
|
38
|
+
@exit_status == 0 && condition ? 1 : @exit_status
|
39
|
+
end
|
40
|
+
|
41
|
+
def handle_args(options)
|
42
|
+
SyncIssues.synchronizer(options['DIRECTORY'],
|
43
|
+
options['REPOSITORY']).run
|
44
|
+
@exit_status
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require_relative 'command'
|
2
|
+
require_relative 'synchronizer'
|
3
|
+
|
4
|
+
# SyncIssues
|
5
|
+
module SyncIssues
|
6
|
+
class << self
|
7
|
+
def command
|
8
|
+
@command ||= SyncIssues::Command.new
|
9
|
+
end
|
10
|
+
|
11
|
+
def synchronizer(directory, repositories)
|
12
|
+
SyncIssues::Synchronizer.new(directory, repositories)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module SyncIssues
|
2
|
+
# Synchronizer is responsible for the actual synchronization.
|
3
|
+
class Synchronizer
|
4
|
+
def initialize(directory, repositories)
|
5
|
+
@directory = check_directory(directory)
|
6
|
+
@repositories = check_repositories(repositories)
|
7
|
+
end
|
8
|
+
|
9
|
+
def run
|
10
|
+
puts "Sync #{@directory} to #{@repositories.inspect}."
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def check_directory(directory)
|
16
|
+
directory
|
17
|
+
end
|
18
|
+
|
19
|
+
def check_repositories(repositories)
|
20
|
+
repositories
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/sync_issues.rb
ADDED
metadata
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sync_issues
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1a1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Bryce Boe
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-01-28 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: docopt
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.5'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.5'
|
27
|
+
description: |2
|
28
|
+
sync_issues is a ruby gem to that allows the easy creation and
|
29
|
+
synchronization of issues on GitHub with structured local data.
|
30
|
+
email: bryce.boe@appfolio.com
|
31
|
+
executables:
|
32
|
+
- sync_issues
|
33
|
+
extensions: []
|
34
|
+
extra_rdoc_files: []
|
35
|
+
files:
|
36
|
+
- LICENSE.txt
|
37
|
+
- README.md
|
38
|
+
- bin/sync_issues
|
39
|
+
- lib/sync_issues.rb
|
40
|
+
- lib/sync_issues/command.rb
|
41
|
+
- lib/sync_issues/error.rb
|
42
|
+
- lib/sync_issues/sync_issues_module.rb
|
43
|
+
- lib/sync_issues/synchronizer.rb
|
44
|
+
- lib/sync_issues/version.rb
|
45
|
+
homepage: https://github.com/bboe/sync_issues
|
46
|
+
licenses:
|
47
|
+
- Simplified BSD
|
48
|
+
metadata: {}
|
49
|
+
post_install_message: Happy syncing!
|
50
|
+
rdoc_options: []
|
51
|
+
require_paths:
|
52
|
+
- lib
|
53
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '0'
|
58
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ">"
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: 1.3.1
|
63
|
+
requirements: []
|
64
|
+
rubyforge_project:
|
65
|
+
rubygems_version: 2.4.8
|
66
|
+
signing_key:
|
67
|
+
specification_version: 4
|
68
|
+
summary: A tool that synchronizes a local directory with GitHub issues.
|
69
|
+
test_files: []
|