git2pdf 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/VERSION +1 -1
  4. data/git2pdf.gemspec +4 -5
  5. data/lib/git2pdf.rb +58 -26
  6. metadata +20 -20
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fb4c99c3f9d560ab517e0bb4212add92aa14a48e
4
- data.tar.gz: 68468d80a474af6898b66fd29d311d51077d619d
3
+ metadata.gz: 1cc2313ada374007aa0ae9dc382e91e5d5d4e0ca
4
+ data.tar.gz: 914bc60f17a2ca3776aea4bacd4e250c9cc376ba
5
5
  SHA512:
6
- metadata.gz: c27b06031473474843b3afd6c9acd84ea1ac3a5c71f6496df5059293f05143c36633e0901204ec90d18152977c4af7eaf868570f676a495a9edfc76a5a2670ab
7
- data.tar.gz: 353f8a5052bd4d8ee74a1c95f3c796ffd687298efc3df276cf34e267ba47be2e0c89d7ae1090b54df4de67c588a2f31fd86ecf2de063e84c76076268659c2d64
6
+ metadata.gz: ccb6a1d2cbeca72e090b9824e8dad9735e76a42b8e469377291df97c23f2b24b942ec00fb442b0ee2028f4dbcff42680f452d8c338ff8f6a0285f0fb52d51eb1
7
+ data.tar.gz: f0fd9b34975ed68cd11ab9fe2abdc989008da8ef7427b2c9754d7db3702ba53033d1ad8a6c486392afc34262355fb1d8c14c92549ee35e98ceed7c630960aee2
data/README.md CHANGED
@@ -40,7 +40,7 @@ TODO:
40
40
 
41
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
42
  * Include multiple repositories
43
- *
43
+ * Designed to use minimal printer ink
44
44
 
45
45
  # What's our workflow?
46
46
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
data/git2pdf.gemspec CHANGED
@@ -2,16 +2,14 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: git2pdf 0.1.0 ruby lib
6
5
 
7
6
  Gem::Specification.new do |s|
8
7
  s.name = "git2pdf"
9
- s.version = "0.1.0"
8
+ s.version = "0.1.1"
10
9
 
11
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
- s.require_paths = ["lib"]
13
11
  s.authors = ["Tobin Harris"]
14
- s.date = "2014-06-30"
12
+ s.date = "2014-07-01"
15
13
  s.description = "For those that use Kanban or Scrum and want to print their cards so they can stick em on the wall"
16
14
  s.email = "tobin@pocketworks.co.uk"
17
15
  s.executables = ["git2pdf"]
@@ -47,7 +45,8 @@ Gem::Specification.new do |s|
47
45
  ]
48
46
  s.homepage = "http://github.com/pocketworks/git2pdf"
49
47
  s.licenses = ["MIT"]
50
- s.rubygems_version = "2.2.2"
48
+ s.require_paths = ["lib"]
49
+ s.rubygems_version = "2.0.3"
51
50
  s.summary = "Bash util to print sexy cards from your github issues"
52
51
 
53
52
  if s.respond_to? :specification_version then
data/lib/git2pdf.rb CHANGED
@@ -34,10 +34,11 @@ class Git2Pdf
34
34
  hash.each do |val|
35
35
  labels = val["labels"].collect { |l| l["name"].upcase }.join(', ')
36
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
37
+ type = "BUG" if labels =~ /bug/i #not billable
38
+ type = "FEATURE" if labels =~ /feature/i #billable
39
+ type = "ENHANCEMENT" if labels =~ /enhancement/i #billable
40
+ type = "AMEND" if labels =~ /amend/i #not billable
41
+ type = "TASK" if labels =~ /task/i #not billable
41
42
 
42
43
  milestone = val["milestone"] ? val["milestone"]["title"] : ""
43
44
 
@@ -54,6 +55,7 @@ class Git2Pdf
54
55
  require 'prawn'
55
56
  row = 0
56
57
  col = 0
58
+ margin = 20
57
59
  Prawn::Document.generate("issues.pdf", :page_size => "A7", :margin => 0, :page_layout => :landscape) do
58
60
  dir = File.dirname(__FILE__)
59
61
  font_families.update(
@@ -62,7 +64,8 @@ class Git2Pdf
62
64
  :bold_italic => "#{dir}/assets/fonts/Lato-BoldItalic.ttf",
63
65
  :normal => "#{dir}/assets/fonts/Lato-Light.ttf"})
64
66
  font 'Lato'
65
- batch = batch.sort { |a, b| a["ref"]<=>b["ref"] and a["project"]<=>b["project"]}
67
+ batch = batch.sort { |a, b| a["ref"]<=>b["ref"] and a["project"]<=>b["project"] }
68
+ logo = open("http://www.pocketworks.co.uk/images/logo.png")
66
69
  batch.each do |issue|
67
70
 
68
71
  ##
@@ -83,38 +86,67 @@ class Git2Pdf
83
86
  #
84
87
  #puts issue
85
88
  #grid(row,col).bounding_box do
86
- transparent(0.1) { stroke_bounds }
89
+ #transparent(0.1) { stroke_bounds }
90
+
91
+ y_offset = 195
87
92
 
88
93
  #Ref
89
94
  font 'Lato', :style => :normal, size: 28
90
- text_box issue[:ref] || "", :at => [185, 195], :width => 100, :overflow => :shrink_to_fit, :align => :right
95
+ text_box issue[:ref] || "", :at => [185, y_offset], :width => 100, :overflow => :shrink_to_fit, :align => :right
96
+
91
97
 
92
98
  #Short title
99
+ short_title = issue[:short_title]
100
+ short_title = short_title.split('/')[1] if short_title =~ /\//
93
101
  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
-
102
+ text_box short_title, :at => [margin, y_offset], :width => 210-margin, :overflow => :shrink_to_fit
103
+
104
+ if issue[:milestone] and issue[:milestone] != ""
105
+ y_offset = y_offset - 30
106
+ # Milestone
107
+ font 'Lato', :style => :normal, size: 13
108
+ text_box issue[:milestone].upcase, :at => [margin, y_offset], :width => 280, :overflow => :shrink_to_fit
109
+ #text_box fields["due"] || "", :at=>[120,20], :width=>60, :overflow=>:shrink_to_fit
110
+ end
111
+
112
+ y_offset = y_offset - 10
113
+
114
+ if issue[:type] and issue[:type] != ""
115
+ if issue[:type]
116
+
117
+ fill_color "CE1852" #default, assume everything a bug
118
+ fill_color "CCCCCC" if issue[:type] == "TASK"
119
+ fill_color "FBF937" if issue[:type] == "FEATURE"
120
+ fill_color "F5B383" if issue[:type] == "AMEND"
121
+ fill_color "FBF937" if issue[:type] == "ENHANCEMENT"
122
+
123
+ fill{rectangle([0,220], margin-10, 220)}
124
+ fill_color "000000"
125
+ end
126
+
127
+ y_offset = y_offset - 20
128
+ # Type
129
+ font 'Lato', :style => :bold, size: 16, :color => '888888'
130
+ text_box issue[:type], :at => [margin, y_offset], :width => 280-margin, :overflow => :shrink_to_fit
131
+ end
132
+
133
+ if issue[:long_title]
134
+ y_offset = y_offset - 20
135
+ # Long title
136
+ font 'Lato', :style => :normal, size: 16
137
+ text_box issue[:long_title] ? issue[:long_title][0..120] : "NO DESCRIPTION", :at => [margin, y_offset], :width => 280-margin, :overflow => :shrink_to_fit
138
+ end
111
139
 
112
140
  # Labels
113
- font 'Lato', :style => :normal, size: 11
114
- text_box issue[:labels] || "", :at => [10, 20], :width => 280, :overflow => :shrink_to_fit
141
+ font 'Lato', :style => :normal, size: 13
142
+ text_box issue[:labels] || "", :at => [margin, 20], :width => 280-margin, :overflow => :shrink_to_fit
115
143
  #text_box fields[:due] || "", :at=>[120,20], :width=>60, :overflow=>:shrink_to_fit
116
144
  #end
117
145
 
146
+ # image
147
+
148
+ image logo, :at=>[220,23], :width=>65
149
+
118
150
  #if col == 1
119
151
  # row = row + 1
120
152
  # col = 0
metadata CHANGED
@@ -1,111 +1,111 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git2pdf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobin Harris
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-30 00:00:00.000000000 Z
11
+ date: 2014-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: prawn
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: thor
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: shoulda
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rdoc
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ~>
60
60
  - !ruby/object:Gem::Version
61
61
  version: '3.12'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ~>
67
67
  - !ruby/object:Gem::Version
68
68
  version: '3.12'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: bundler
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ~>
74
74
  - !ruby/object:Gem::Version
75
75
  version: '1.0'
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
82
  version: '1.0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: jeweler
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ~>
88
88
  - !ruby/object:Gem::Version
89
89
  version: 2.0.1
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - ~>
95
95
  - !ruby/object:Gem::Version
96
96
  version: 2.0.1
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: simplecov
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - '>='
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ">="
108
+ - - '>='
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  description: For those that use Kanban or Scrum and want to print their cards so they
@@ -119,7 +119,7 @@ extra_rdoc_files:
119
119
  - README.md
120
120
  - README.rdoc
121
121
  files:
122
- - ".document"
122
+ - .document
123
123
  - Gemfile
124
124
  - Gemfile.lock
125
125
  - LICENSE.txt
@@ -152,17 +152,17 @@ require_paths:
152
152
  - lib
153
153
  required_ruby_version: !ruby/object:Gem::Requirement
154
154
  requirements:
155
- - - ">="
155
+ - - '>='
156
156
  - !ruby/object:Gem::Version
157
157
  version: '0'
158
158
  required_rubygems_version: !ruby/object:Gem::Requirement
159
159
  requirements:
160
- - - ">="
160
+ - - '>='
161
161
  - !ruby/object:Gem::Version
162
162
  version: '0'
163
163
  requirements: []
164
164
  rubyforge_project:
165
- rubygems_version: 2.2.2
165
+ rubygems_version: 2.0.3
166
166
  signing_key:
167
167
  specification_version: 4
168
168
  summary: Bash util to print sexy cards from your github issues