git2pdf 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/.document +5 -0
- data/Gemfile +18 -0
- data/Gemfile.lock +94 -0
- data/LICENSE.txt +20 -0
- data/README.md +72 -0
- data/README.rdoc +19 -0
- data/Rakefile +52 -0
- data/VERSION +1 -0
- data/bin/git2pdf +36 -0
- data/git2pdf.gemspec +83 -0
- data/lib/assets/fonts/Lato-Black.ttf +0 -0
- data/lib/assets/fonts/Lato-BlackItalic.ttf +0 -0
- data/lib/assets/fonts/Lato-Bold.ttf +0 -0
- data/lib/assets/fonts/Lato-BoldItalic.ttf +0 -0
- data/lib/assets/fonts/Lato-Hairline.ttf +0 -0
- data/lib/assets/fonts/Lato-HairlineItalic.ttf +0 -0
- data/lib/assets/fonts/Lato-Italic.ttf +0 -0
- data/lib/assets/fonts/Lato-Light.ttf +0 -0
- data/lib/assets/fonts/Lato-LightItalic.ttf +0 -0
- data/lib/assets/fonts/Lato-Regular.ttf +0 -0
- data/lib/git2pdf.rb +129 -0
- data/test/helper.rb +34 -0
- data/test/test_git2pdf.rb +7 -0
- metadata +169 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: fb4c99c3f9d560ab517e0bb4212add92aa14a48e
|
4
|
+
data.tar.gz: 68468d80a474af6898b66fd29d311d51077d619d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c27b06031473474843b3afd6c9acd84ea1ac3a5c71f6496df5059293f05143c36633e0901204ec90d18152977c4af7eaf868570f676a495a9edfc76a5a2670ab
|
7
|
+
data.tar.gz: 353f8a5052bd4d8ee74a1c95f3c796ffd687298efc3df276cf34e267ba47be2e0c89d7ae1090b54df4de67c588a2f31fd86ecf2de063e84c76076268659c2d64
|
data/.document
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
# Add dependencies required to use your gem here.
|
3
|
+
# Example:
|
4
|
+
# gem "activesupport", ">= 2.3.5"
|
5
|
+
|
6
|
+
gem "prawn"
|
7
|
+
gem "thor"
|
8
|
+
|
9
|
+
|
10
|
+
# Add dependencies to develop your gem here.
|
11
|
+
# Include everything needed to run rake, tests, features, etc.
|
12
|
+
group :development do
|
13
|
+
gem "shoulda", ">= 0"
|
14
|
+
gem "rdoc", "~> 3.12"
|
15
|
+
gem "bundler", "~> 1.0"
|
16
|
+
gem "jeweler", "~> 2.0.1"
|
17
|
+
gem "simplecov", ">= 0"
|
18
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,94 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
activesupport (4.1.1)
|
5
|
+
i18n (~> 0.6, >= 0.6.9)
|
6
|
+
json (~> 1.7, >= 1.7.7)
|
7
|
+
minitest (~> 5.1)
|
8
|
+
thread_safe (~> 0.1)
|
9
|
+
tzinfo (~> 1.1)
|
10
|
+
addressable (2.3.6)
|
11
|
+
bourne (1.5.0)
|
12
|
+
mocha (>= 0.13.2, < 0.15)
|
13
|
+
builder (3.2.2)
|
14
|
+
descendants_tracker (0.0.4)
|
15
|
+
thread_safe (~> 0.3, >= 0.3.1)
|
16
|
+
docile (1.1.3)
|
17
|
+
faraday (0.9.0)
|
18
|
+
multipart-post (>= 1.2, < 3)
|
19
|
+
git (1.2.7)
|
20
|
+
github_api (0.11.3)
|
21
|
+
addressable (~> 2.3)
|
22
|
+
descendants_tracker (~> 0.0.1)
|
23
|
+
faraday (~> 0.8, < 0.10)
|
24
|
+
hashie (>= 1.2)
|
25
|
+
multi_json (>= 1.7.5, < 2.0)
|
26
|
+
nokogiri (~> 1.6.0)
|
27
|
+
oauth2
|
28
|
+
hashie (3.0.0)
|
29
|
+
highline (1.6.20)
|
30
|
+
i18n (0.6.9)
|
31
|
+
jeweler (2.0.1)
|
32
|
+
builder
|
33
|
+
bundler (>= 1.0)
|
34
|
+
git (>= 1.2.5)
|
35
|
+
github_api
|
36
|
+
highline (>= 1.6.15)
|
37
|
+
nokogiri (>= 1.5.10)
|
38
|
+
rake
|
39
|
+
rdoc
|
40
|
+
json (1.8.1)
|
41
|
+
jwt (1.0.0)
|
42
|
+
metaclass (0.0.2)
|
43
|
+
mini_portile (0.6.0)
|
44
|
+
minitest (5.3.4)
|
45
|
+
mocha (0.14.0)
|
46
|
+
metaclass (~> 0.0.1)
|
47
|
+
multi_json (1.10.1)
|
48
|
+
multi_xml (0.5.5)
|
49
|
+
multipart-post (2.0.0)
|
50
|
+
nokogiri (1.6.2.1)
|
51
|
+
mini_portile (= 0.6.0)
|
52
|
+
oauth2 (0.9.4)
|
53
|
+
faraday (>= 0.8, < 0.10)
|
54
|
+
jwt (~> 1.0)
|
55
|
+
multi_json (~> 1.3)
|
56
|
+
multi_xml (~> 0.5)
|
57
|
+
rack (~> 1.2)
|
58
|
+
pdf-core (0.2.5)
|
59
|
+
prawn (1.0.0)
|
60
|
+
pdf-core (~> 0.2.2)
|
61
|
+
ttfunk (~> 1.1.1)
|
62
|
+
rack (1.5.2)
|
63
|
+
rake (10.3.2)
|
64
|
+
rdoc (3.12.2)
|
65
|
+
json (~> 1.4)
|
66
|
+
shoulda (3.4.0)
|
67
|
+
shoulda-context (~> 1.0, >= 1.0.1)
|
68
|
+
shoulda-matchers (~> 1.0, >= 1.4.1)
|
69
|
+
shoulda-context (1.1.6)
|
70
|
+
shoulda-matchers (1.5.6)
|
71
|
+
activesupport (>= 3.0.0)
|
72
|
+
bourne (~> 1.3)
|
73
|
+
simplecov (0.8.2)
|
74
|
+
docile (~> 1.1.0)
|
75
|
+
multi_json
|
76
|
+
simplecov-html (~> 0.8.0)
|
77
|
+
simplecov-html (0.8.0)
|
78
|
+
thor (0.19.1)
|
79
|
+
thread_safe (0.3.3)
|
80
|
+
ttfunk (1.1.1)
|
81
|
+
tzinfo (1.1.0)
|
82
|
+
thread_safe (~> 0.1)
|
83
|
+
|
84
|
+
PLATFORMS
|
85
|
+
ruby
|
86
|
+
|
87
|
+
DEPENDENCIES
|
88
|
+
bundler (~> 1.0)
|
89
|
+
jeweler (~> 2.0.1)
|
90
|
+
prawn
|
91
|
+
rdoc (~> 3.12)
|
92
|
+
shoulda
|
93
|
+
simplecov
|
94
|
+
thor
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2014 Tobin Harris
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+

|
2
|
+
|
3
|
+
# Git2Pdf
|
4
|
+
|
5
|
+
**Print physical Kanban cards from your GitHub issues, and stick that sweet stuff on your office wall**
|
6
|
+
|
7
|
+
## Install
|
8
|
+
|
9
|
+
gem install git2pdf
|
10
|
+
|
11
|
+
## Use
|
12
|
+
|
13
|
+
### Single Repo
|
14
|
+
|
15
|
+
# E.g. for this repo: https://github.com/uranusjr/macdown/issues
|
16
|
+
$ git2pdf gen uranusjr/macdown -u tobinharris -p
|
17
|
+
$ open issues.pdf
|
18
|
+
|
19
|
+

|
20
|
+
|
21
|
+
### More repos
|
22
|
+
|
23
|
+
$ git2pdf gen "uranusjr/macdown, pocketworks/git2rb" -u tobinharris -p
|
24
|
+
$ open issues.pdf
|
25
|
+
|
26
|
+
### Alternative 1
|
27
|
+
|
28
|
+
$ git2pdf gen -u tobinharris -p xxx -r "my-project, come-cool-repo, another-repo" -o my-organisation
|
29
|
+
$ open issues.pdf
|
30
|
+
|
31
|
+
### Alternative 2
|
32
|
+
|
33
|
+
$ git2pdf gen -u tobinharris -p xxx -r "pocketworks/my-project, pocketworks/come-cool-repo, pocketworks/another-repo"
|
34
|
+
|
35
|
+
TODO:
|
36
|
+
|
37
|
+
* Improve CLI syntax, it's a bit shite
|
38
|
+
|
39
|
+
## Features
|
40
|
+
|
41
|
+
* Generates a PDF of GitHub issues, so you can print them out and stick em' on your kanban board or scrum board or whatever.
|
42
|
+
* Include multiple repositories
|
43
|
+
*
|
44
|
+
|
45
|
+
# What's our workflow?
|
46
|
+
|
47
|
+
* We have a physical kanban board
|
48
|
+
* We get bored of duplicating your effort writing on index cards or post-it notes
|
49
|
+
* We manage all our features, business analysis, requirements and bugs in Github issues
|
50
|
+
* We tag our issues with a _class of service_ such as Bug, Feature, Task.
|
51
|
+
* We use waffle.io for different swim lanes on Github, and mirror these on our physical card wall
|
52
|
+
* Every Monday we print out our cards to `issues.pdf`
|
53
|
+
* We open it in Mac Finder, hit Cmd-Shift-2 to bring up the thumbs. Then select and delete any cards we've already printed, or that we don't want on the wall right now
|
54
|
+
* We chose print, A4, select 9 pages per sheet, and landscape
|
55
|
+
* We print it, grab some scissors, chop up the pages, and pin the cards on the wall
|
56
|
+
* Bosh!
|
57
|
+
|
58
|
+
## Contributing to github_issue_printer
|
59
|
+
|
60
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
61
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
|
62
|
+
* Fork the project.
|
63
|
+
* Start a feature/bugfix branch.
|
64
|
+
* Commit and push until you are happy with your contribution.
|
65
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
66
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
67
|
+
|
68
|
+
## Copyright
|
69
|
+
|
70
|
+
Copyright (c) 2014 Tobin Harris. See LICENSE.txt for
|
71
|
+
further details.
|
72
|
+
|
data/README.rdoc
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
= github_issue_printer
|
2
|
+
|
3
|
+
Description goes here.
|
4
|
+
|
5
|
+
== Contributing to github_issue_printer
|
6
|
+
|
7
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
8
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
|
9
|
+
* Fork the project.
|
10
|
+
* Start a feature/bugfix branch.
|
11
|
+
* Commit and push until you are happy with your contribution.
|
12
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
13
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
14
|
+
|
15
|
+
== Copyright
|
16
|
+
|
17
|
+
Copyright (c) 2014 Tobin Harris. See LICENSE.txt for
|
18
|
+
further details.
|
19
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler'
|
5
|
+
begin
|
6
|
+
Bundler.setup(:default, :development)
|
7
|
+
rescue Bundler::BundlerError => e
|
8
|
+
$stderr.puts e.message
|
9
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
+
exit e.status_code
|
11
|
+
end
|
12
|
+
require 'rake'
|
13
|
+
|
14
|
+
require 'jeweler'
|
15
|
+
Jeweler::Tasks.new do |gem|
|
16
|
+
# gem is a Gem::Specification... see http://guides.rubygems.org/specification-reference/ for more options
|
17
|
+
gem.name = "git2pdf"
|
18
|
+
gem.homepage = "http://github.com/pocketworks/git2pdf"
|
19
|
+
gem.license = "MIT"
|
20
|
+
gem.summary = %Q{Bash util to print sexy cards from your github issues}
|
21
|
+
gem.description = %Q{For those that use Kanban or Scrum and want to print their cards so they can stick em on the wall}
|
22
|
+
gem.email = "tobin@pocketworks.co.uk"
|
23
|
+
gem.authors = ["Tobin Harris"]
|
24
|
+
gem.executables = ['git2pdf'] # note, it's the file name relative to `bin/`, not the project root
|
25
|
+
# dependencies defined in Gemfile
|
26
|
+
end
|
27
|
+
Jeweler::RubygemsDotOrgTasks.new
|
28
|
+
|
29
|
+
require 'rake/testtask'
|
30
|
+
Rake::TestTask.new(:test) do |test|
|
31
|
+
test.libs << 'lib' << 'test'
|
32
|
+
test.pattern = 'test/**/test_*.rb'
|
33
|
+
test.verbose = true
|
34
|
+
end
|
35
|
+
|
36
|
+
desc "Code coverage detail"
|
37
|
+
task :simplecov do
|
38
|
+
ENV['COVERAGE'] = "true"
|
39
|
+
Rake::Task['test'].execute
|
40
|
+
end
|
41
|
+
|
42
|
+
task :default => :test
|
43
|
+
|
44
|
+
require 'rdoc/task'
|
45
|
+
Rake::RDocTask.new do |rdoc|
|
46
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
47
|
+
|
48
|
+
rdoc.rdoc_dir = 'rdoc'
|
49
|
+
rdoc.title = "github_issue_printer #{version}"
|
50
|
+
rdoc.rdoc_files.include('README*')
|
51
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
52
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.0
|
data/bin/git2pdf
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
#! /usr/bin/ruby
|
2
|
+
require 'thor'
|
3
|
+
require './lib/git2pdf'
|
4
|
+
#require 'password'
|
5
|
+
|
6
|
+
class Git2PdfBash < Thor
|
7
|
+
desc "gen <repository1,repository2>", "Create a PDF for the open issues in a given repository."
|
8
|
+
option :repos, :default => "", aliases: :r
|
9
|
+
option :user, aliases: :u
|
10
|
+
option :password, aliases: :p, :default=>nil
|
11
|
+
option :organisation, aliases: :o
|
12
|
+
|
13
|
+
def gen(repositories="")
|
14
|
+
repos = repositories.split(',').collect { |r| r.strip }
|
15
|
+
if repos.empty?
|
16
|
+
repos = options[:repos].split(',').collect { |r| r.strip } unless options[:repos] == "repos"
|
17
|
+
end
|
18
|
+
puts "Creating a PDF of GitHub issues for repos: #{repos.join(', ')}"
|
19
|
+
puts "Using organisation #{options[:organisation]}" if options[:organisation]
|
20
|
+
pass = options[:password]
|
21
|
+
if options[:password] == "password" or options[:password].nil? or options[:password].strip.length == 0
|
22
|
+
#option[:password] = Password.get("GitHub Password:")
|
23
|
+
puts "Password: "
|
24
|
+
pass = STDIN.noecho(&:gets)
|
25
|
+
pass = pass.strip.gsub(/\n/,'')
|
26
|
+
end
|
27
|
+
|
28
|
+
g = Git2Pdf.new repos: repos, basic_auth: [options[:user],pass], org: options[:organisation], user: options[:user]
|
29
|
+
done = g.execute
|
30
|
+
puts "\n#{done} cards output to issues.pdf"
|
31
|
+
end
|
32
|
+
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
Git2PdfBash.start(ARGV)
|
data/git2pdf.gemspec
ADDED
@@ -0,0 +1,83 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
# stub: git2pdf 0.1.0 ruby lib
|
6
|
+
|
7
|
+
Gem::Specification.new do |s|
|
8
|
+
s.name = "git2pdf"
|
9
|
+
s.version = "0.1.0"
|
10
|
+
|
11
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
|
+
s.require_paths = ["lib"]
|
13
|
+
s.authors = ["Tobin Harris"]
|
14
|
+
s.date = "2014-06-30"
|
15
|
+
s.description = "For those that use Kanban or Scrum and want to print their cards so they can stick em on the wall"
|
16
|
+
s.email = "tobin@pocketworks.co.uk"
|
17
|
+
s.executables = ["git2pdf"]
|
18
|
+
s.extra_rdoc_files = [
|
19
|
+
"LICENSE.txt",
|
20
|
+
"README.md",
|
21
|
+
"README.rdoc"
|
22
|
+
]
|
23
|
+
s.files = [
|
24
|
+
".document",
|
25
|
+
"Gemfile",
|
26
|
+
"Gemfile.lock",
|
27
|
+
"LICENSE.txt",
|
28
|
+
"README.md",
|
29
|
+
"README.rdoc",
|
30
|
+
"Rakefile",
|
31
|
+
"VERSION",
|
32
|
+
"bin/git2pdf",
|
33
|
+
"git2pdf.gemspec",
|
34
|
+
"lib/assets/fonts/Lato-Black.ttf",
|
35
|
+
"lib/assets/fonts/Lato-BlackItalic.ttf",
|
36
|
+
"lib/assets/fonts/Lato-Bold.ttf",
|
37
|
+
"lib/assets/fonts/Lato-BoldItalic.ttf",
|
38
|
+
"lib/assets/fonts/Lato-Hairline.ttf",
|
39
|
+
"lib/assets/fonts/Lato-HairlineItalic.ttf",
|
40
|
+
"lib/assets/fonts/Lato-Italic.ttf",
|
41
|
+
"lib/assets/fonts/Lato-Light.ttf",
|
42
|
+
"lib/assets/fonts/Lato-LightItalic.ttf",
|
43
|
+
"lib/assets/fonts/Lato-Regular.ttf",
|
44
|
+
"lib/git2pdf.rb",
|
45
|
+
"test/helper.rb",
|
46
|
+
"test/test_git2pdf.rb"
|
47
|
+
]
|
48
|
+
s.homepage = "http://github.com/pocketworks/git2pdf"
|
49
|
+
s.licenses = ["MIT"]
|
50
|
+
s.rubygems_version = "2.2.2"
|
51
|
+
s.summary = "Bash util to print sexy cards from your github issues"
|
52
|
+
|
53
|
+
if s.respond_to? :specification_version then
|
54
|
+
s.specification_version = 4
|
55
|
+
|
56
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
57
|
+
s.add_runtime_dependency(%q<prawn>, [">= 0"])
|
58
|
+
s.add_runtime_dependency(%q<thor>, [">= 0"])
|
59
|
+
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
60
|
+
s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
|
61
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0"])
|
62
|
+
s.add_development_dependency(%q<jeweler>, ["~> 2.0.1"])
|
63
|
+
s.add_development_dependency(%q<simplecov>, [">= 0"])
|
64
|
+
else
|
65
|
+
s.add_dependency(%q<prawn>, [">= 0"])
|
66
|
+
s.add_dependency(%q<thor>, [">= 0"])
|
67
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
68
|
+
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
69
|
+
s.add_dependency(%q<bundler>, ["~> 1.0"])
|
70
|
+
s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
|
71
|
+
s.add_dependency(%q<simplecov>, [">= 0"])
|
72
|
+
end
|
73
|
+
else
|
74
|
+
s.add_dependency(%q<prawn>, [">= 0"])
|
75
|
+
s.add_dependency(%q<thor>, [">= 0"])
|
76
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
77
|
+
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
78
|
+
s.add_dependency(%q<bundler>, ["~> 1.0"])
|
79
|
+
s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
|
80
|
+
s.add_dependency(%q<simplecov>, [">= 0"])
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/lib/git2pdf.rb
ADDED
@@ -0,0 +1,129 @@
|
|
1
|
+
#require 'bundler/setup'
|
2
|
+
require 'open-uri'
|
3
|
+
require 'json'
|
4
|
+
|
5
|
+
class Git2Pdf
|
6
|
+
attr_accessor :repos
|
7
|
+
attr_accessor :basic_auth
|
8
|
+
|
9
|
+
def initialize(options={})
|
10
|
+
@repos = options[:repos] || []
|
11
|
+
@basic_auth = options[:basic_auth] || nil
|
12
|
+
@org = options[:org] || nil
|
13
|
+
end
|
14
|
+
|
15
|
+
def execute
|
16
|
+
batch = get_issues
|
17
|
+
pdf(batch)
|
18
|
+
end
|
19
|
+
|
20
|
+
def get_issues
|
21
|
+
batch = []
|
22
|
+
self.repos.each do |repo|
|
23
|
+
#json = `curl -u#{auth} https://api.github.com/repos/pocketworks/repo/issues?per_page=100 | jq '.[] | {state: .state, milestone: .milestone.title, created_at: .created_at, title: .title, number: .number, labels: [.labels[].name]}'`
|
24
|
+
json = ""
|
25
|
+
if @org
|
26
|
+
json = open("https://api.github.com/repos/#{@org}/#{repo}/issues?per_page=200&state=open", :http_basic_authentication => basic_auth).read
|
27
|
+
else
|
28
|
+
# for stuff like bob/stuff
|
29
|
+
json = open("https://api.github.com/repos/#{repo}/issues?per_page=200&state=open", :http_basic_authentication => basic_auth).read
|
30
|
+
end
|
31
|
+
|
32
|
+
hash = JSON.parse(json)
|
33
|
+
|
34
|
+
hash.each do |val|
|
35
|
+
labels = val["labels"].collect { |l| l["name"].upcase }.join(', ')
|
36
|
+
type = ""
|
37
|
+
type = "BUG" if labels =~ /bug/i
|
38
|
+
type = "FEATURE" if labels =~ /feature/i
|
39
|
+
type = "FEATURE" if labels =~ /enhancement/i
|
40
|
+
type = "TASK" if labels =~ /task/i
|
41
|
+
|
42
|
+
milestone = val["milestone"] ? val["milestone"]["title"] : ""
|
43
|
+
|
44
|
+
#labels.include?(['BUG','FEATURE','ENHANCEMENT','QUESTION'])
|
45
|
+
hash = {short_title: repo, ref: "#{val["number"]}", long_title: "#{val["title"]}", type: type, due: "", labels: labels, milestone: "#{milestone}"}
|
46
|
+
batch << hash
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
batch
|
51
|
+
end
|
52
|
+
|
53
|
+
def pdf(batch)
|
54
|
+
require 'prawn'
|
55
|
+
row = 0
|
56
|
+
col = 0
|
57
|
+
Prawn::Document.generate("issues.pdf", :page_size => "A7", :margin => 0, :page_layout => :landscape) do
|
58
|
+
dir = File.dirname(__FILE__)
|
59
|
+
font_families.update(
|
60
|
+
"Lato" => {:bold => "#{dir}/assets/fonts/Lato-Bold.ttf",
|
61
|
+
:italic => "#{dir}/assets/fonts/Lato-LightItalic.ttf",
|
62
|
+
:bold_italic => "#{dir}/assets/fonts/Lato-BoldItalic.ttf",
|
63
|
+
:normal => "#{dir}/assets/fonts/Lato-Light.ttf"})
|
64
|
+
font 'Lato'
|
65
|
+
batch = batch.sort { |a, b| a["ref"]<=>b["ref"] and a["project"]<=>b["project"]}
|
66
|
+
batch.each do |issue|
|
67
|
+
|
68
|
+
##
|
69
|
+
## If needed, define a new grid
|
70
|
+
##
|
71
|
+
#if row >= 5
|
72
|
+
# start_new_page
|
73
|
+
# row = 0
|
74
|
+
# col = 0
|
75
|
+
#end
|
76
|
+
#
|
77
|
+
#if row == 0
|
78
|
+
# define_grid(:columns => 2, :rows => 4, :gutter => 0)
|
79
|
+
#end
|
80
|
+
|
81
|
+
#
|
82
|
+
# Load json to use on the first card
|
83
|
+
#
|
84
|
+
#puts issue
|
85
|
+
#grid(row,col).bounding_box do
|
86
|
+
transparent(0.1) { stroke_bounds }
|
87
|
+
|
88
|
+
#Ref
|
89
|
+
font 'Lato', :style => :normal, size: 28
|
90
|
+
text_box issue[:ref] || "", :at => [185, 195], :width => 100, :overflow => :shrink_to_fit, :align => :right
|
91
|
+
|
92
|
+
#Short title
|
93
|
+
font 'Lato', :style => :bold, size: 20
|
94
|
+
text_box issue[:short_title] || "", :at => [10, 190], :width => 210, :overflow => :shrink_to_fit
|
95
|
+
|
96
|
+
# Milestone
|
97
|
+
font 'Lato', :style => :normal, size: 12
|
98
|
+
text_box issue[:milestone] ? issue[:milestone].upcase : "", :at => [10, 165], :width => 280, :overflow => :shrink_to_fit
|
99
|
+
#text_box fields["due"] || "", :at=>[120,20], :width=>60, :overflow=>:shrink_to_fit
|
100
|
+
#end
|
101
|
+
|
102
|
+
# Type
|
103
|
+
font 'Lato', :style => :bold, size: 16, :color => '#666'
|
104
|
+
text_box issue[:type] || "UNKNOWN", :at => [10, 135], :width => 280, :overflow => :shrink_to_fit
|
105
|
+
|
106
|
+
# Long title
|
107
|
+
font 'Lato', :style => :normal, size: 16
|
108
|
+
text_box issue[:long_title] ? issue[:long_title][0..120] : "NO DESCRIPTION", :at => [10, 115], :width => 280, :overflow => :shrink_to_fit
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
# Labels
|
113
|
+
font 'Lato', :style => :normal, size: 11
|
114
|
+
text_box issue[:labels] || "", :at => [10, 20], :width => 280, :overflow => :shrink_to_fit
|
115
|
+
#text_box fields[:due] || "", :at=>[120,20], :width=>60, :overflow=>:shrink_to_fit
|
116
|
+
#end
|
117
|
+
|
118
|
+
#if col == 1
|
119
|
+
# row = row + 1
|
120
|
+
# col = 0
|
121
|
+
#else
|
122
|
+
# col = col + 1
|
123
|
+
#end
|
124
|
+
start_new_page unless issue == batch[batch.length-1]
|
125
|
+
end
|
126
|
+
end
|
127
|
+
batch.length
|
128
|
+
end
|
129
|
+
end
|
data/test/helper.rb
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'simplecov'
|
2
|
+
|
3
|
+
module SimpleCov::Configuration
|
4
|
+
def clean_filters
|
5
|
+
@filters = []
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
SimpleCov.configure do
|
10
|
+
clean_filters
|
11
|
+
load_adapter 'test_frameworks'
|
12
|
+
end
|
13
|
+
|
14
|
+
ENV["COVERAGE"] && SimpleCov.start do
|
15
|
+
add_filter "/.rvm/"
|
16
|
+
end
|
17
|
+
require 'rubygems'
|
18
|
+
require 'bundler'
|
19
|
+
begin
|
20
|
+
Bundler.setup(:default, :development)
|
21
|
+
rescue Bundler::BundlerError => e
|
22
|
+
$stderr.puts e.message
|
23
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
24
|
+
exit e.status_code
|
25
|
+
end
|
26
|
+
require 'test/unit'
|
27
|
+
require 'shoulda'
|
28
|
+
|
29
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
30
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
31
|
+
require 'github_issue_printer'
|
32
|
+
|
33
|
+
class Test::Unit::TestCase
|
34
|
+
end
|
metadata
ADDED
@@ -0,0 +1,169 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: git2pdf
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Tobin Harris
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-06-30 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: prawn
|
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: thor
|
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: shoulda
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rdoc
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3.12'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3.12'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: bundler
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '1.0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '1.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: jeweler
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 2.0.1
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 2.0.1
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: simplecov
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
description: For those that use Kanban or Scrum and want to print their cards so they
|
112
|
+
can stick em on the wall
|
113
|
+
email: tobin@pocketworks.co.uk
|
114
|
+
executables:
|
115
|
+
- git2pdf
|
116
|
+
extensions: []
|
117
|
+
extra_rdoc_files:
|
118
|
+
- LICENSE.txt
|
119
|
+
- README.md
|
120
|
+
- README.rdoc
|
121
|
+
files:
|
122
|
+
- ".document"
|
123
|
+
- Gemfile
|
124
|
+
- Gemfile.lock
|
125
|
+
- LICENSE.txt
|
126
|
+
- README.md
|
127
|
+
- README.rdoc
|
128
|
+
- Rakefile
|
129
|
+
- VERSION
|
130
|
+
- bin/git2pdf
|
131
|
+
- git2pdf.gemspec
|
132
|
+
- lib/assets/fonts/Lato-Black.ttf
|
133
|
+
- lib/assets/fonts/Lato-BlackItalic.ttf
|
134
|
+
- lib/assets/fonts/Lato-Bold.ttf
|
135
|
+
- lib/assets/fonts/Lato-BoldItalic.ttf
|
136
|
+
- lib/assets/fonts/Lato-Hairline.ttf
|
137
|
+
- lib/assets/fonts/Lato-HairlineItalic.ttf
|
138
|
+
- lib/assets/fonts/Lato-Italic.ttf
|
139
|
+
- lib/assets/fonts/Lato-Light.ttf
|
140
|
+
- lib/assets/fonts/Lato-LightItalic.ttf
|
141
|
+
- lib/assets/fonts/Lato-Regular.ttf
|
142
|
+
- lib/git2pdf.rb
|
143
|
+
- test/helper.rb
|
144
|
+
- test/test_git2pdf.rb
|
145
|
+
homepage: http://github.com/pocketworks/git2pdf
|
146
|
+
licenses:
|
147
|
+
- MIT
|
148
|
+
metadata: {}
|
149
|
+
post_install_message:
|
150
|
+
rdoc_options: []
|
151
|
+
require_paths:
|
152
|
+
- lib
|
153
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
154
|
+
requirements:
|
155
|
+
- - ">="
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: '0'
|
158
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
159
|
+
requirements:
|
160
|
+
- - ">="
|
161
|
+
- !ruby/object:Gem::Version
|
162
|
+
version: '0'
|
163
|
+
requirements: []
|
164
|
+
rubyforge_project:
|
165
|
+
rubygems_version: 2.2.2
|
166
|
+
signing_key:
|
167
|
+
specification_version: 4
|
168
|
+
summary: Bash util to print sexy cards from your github issues
|
169
|
+
test_files: []
|