rresume 0.0.3 → 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.
@@ -0,0 +1,80 @@
1
+ %PDF-1.3
2
+ %����
3
+
4
+ 1 0 obj
5
+ << /Type /Catalog
6
+ /Outlines 2 0 R
7
+ /Pages 3 0 R>>
8
+ endobj
9
+ 2 0 obj
10
+ << /Type /Outlines >>
11
+ endobj
12
+ 3 0 obj
13
+ << /Type /Pages
14
+ /Kids [6 0 R
15
+ ]
16
+ /Count 1
17
+ /Resources <<
18
+ /ProcSet 4 0 R
19
+ /Font <<
20
+ /F1 8 0 R >>
21
+ >>
22
+ /MediaBox [0 0 612.0 792.0]
23
+ >>
24
+ endobj
25
+ 4 0 obj
26
+ [/PDF /Text ]
27
+ endobj
28
+ 5 0 obj
29
+ <<
30
+ /CreationDate (D:200608091959)
31
+ /Creator (thomas.rb)
32
+ /Producer (PDF::Writer for Ruby)
33
+ >>
34
+ endobj
35
+ 6 0 obj
36
+ << /Type /Page
37
+ /Parent 3 0 R
38
+ /Contents 7 0 R
39
+ >>
40
+ endobj
41
+ 7 0 obj
42
+ <<
43
+ /Length 167 >>
44
+ stream
45
+
46
+ 0.000 0.000 0.000 rg
47
+ 0.000 0.000 0.000 RG
48
+ BT 120.996 675.648 Td /F1 72.0 Tf 0 Tr (Hello, Ruby.) Tj ET
49
+ BT 36.000 653.328 Td /F1 20.0 Tf 0 Tr (Thomas Preymesser ) Tj ET
50
+ endstream
51
+ endobj
52
+
53
+ 8 0 obj
54
+ << /Type /Font
55
+ /Subtype /Type1
56
+ /Name /F1
57
+ /BaseFont /Times-Roman
58
+ /Encoding /WinAnsiEncoding
59
+ >>
60
+ endobj
61
+ xref
62
+ 0 9
63
+ 0000000000 65535 f
64
+ 0000000015 00000 n
65
+ 0000000079 00000 n
66
+ 0000000116 00000 n
67
+ 0000000258 00000 n
68
+ 0000000287 00000 n
69
+ 0000000393 00000 n
70
+ 0000000456 00000 n
71
+ 0000000675 00000 n
72
+
73
+ trailer
74
+ << /Size 9
75
+ /Root 1 0 R
76
+ /Info 5 0 R
77
+ >>
78
+ startxref
79
+ 784
80
+ %%EOF
@@ -0,0 +1,6 @@
1
+ module OutputPersonal
2
+ def output_personal(*args)
3
+ 42
4
+ end
5
+
6
+ end
@@ -1,3 +1,4 @@
1
+
1
2
  class Person
2
3
 
3
4
  attr_reader :firstname, :lastname
@@ -7,6 +8,338 @@ class Person
7
8
  def initialize(firstname="",lastname="")
8
9
  @firstname = firstname
9
10
  @lastname = lastname
11
+ # @projectlist = Array.new
12
+ @projectlist = ProjectList.new
13
+ @categories = Hash.new
14
+ end
15
+
16
+ def <<(what)
17
+ if what.class == ProjectList
18
+ @projectlist = what
19
+ else
20
+ @categories = what
21
+ end
22
+ end
23
+
24
+
25
+ def write(mode=:html, order=:newest_first, verfuegbarkeit=nil)
26
+ output_personal(mode,verfuegbarkeit)
27
+ output_projects(mode, order)
28
+ @categories.each {|output_category|
29
+ output_category(output_category, mode)
30
+ }
31
+ output_werbung(:html)
32
+ end
33
+
34
+ def output_werbung(mode)
35
+ if mode == :html
36
+ puts <<END
37
+ <br>generated with <a href="http://www.thopre.de/rresume/">rresume</a>
38
+ END
39
+ else
40
+ puts <<END
41
+ \ngenerated with Ruby rresume (see: http://www.thopre.de/rresume/)
42
+ END
43
+ end
44
+ end
45
+
46
+
47
+ # output personal data like schools, universities, diplomas, etc.
48
+ def output_personal(mode=:html,p_verfuegbarkeit=nil)
49
+ verfuegbarkeit=<<END
50
+ Verf&uuml;gbarkeit: In den als frei gekennzeichneten Monaten bin ich aktuell
51
+ noch verf&uuml;gbar. In den anderen bin ich ganz oder teilweise
52
+ gebucht. Ggf. gibt es aber auch da M&ouml;glichkeiten einer Zusammenarbeit,
53
+ falls es sich um kleinere Aufgaben handelt.
54
+ <p>
55
+ <table border="1" width="100%">
56
+ <tr>
57
+ <td><b>Verf&uuml;gbarkeit</b> </td>
58
+ <td>01 </td>
59
+ <td>02 </td>
60
+ <td>03 </td>
61
+ <td>04 </td>
62
+ <td>05 </td>
63
+ <td>06 </td>
64
+ <td>07 </td>
65
+ <td>08 </td>
66
+ <td>09 </td>
67
+ <td>10 </td>
68
+ <td>11 </td>
69
+ <td>12 </td>
70
+ </tr>
71
+ <tr>
72
+ <td>2006</td>
73
+ <!-- 01 --> <td bgcolor="lightgreen">frei </td>
74
+ <!-- 02 --> <td bgcolor="lightgreen">frei </td>
75
+ <!-- 03 --> <td bgcolor="lightgreen">frei </td>
76
+ <!-- 04 --> <td bgcolor="lightgreen">frei </td>
77
+ <!-- 05 --> <td bgcolor="lightgreen">frei </td>
78
+ <!-- 06 --> <td bgcolor="black"><font color="white">gebucht</font></td>
79
+ <!-- 07 --> <td bgcolor="black"><font color="white">gebucht</font></td>
80
+ <!-- 08 --> <td bgcolor="black"><font color="white">gebucht</font></td>
81
+ <!-- 09 --> <td bgcolor="lightgreen">frei </td>
82
+ <!-- 10 --> <td bgcolor="lightgreen">frei </td>
83
+ <!-- 11 --> <td bgcolor="lightgreen">frei </td>
84
+ <!-- 12 --> <td bgcolor="lightgreen">frei </td>
85
+ </tr>
86
+ <tr>
87
+ <td>2007</td>
88
+ <!-- 01 --> <td bgcolor="lightgreen">frei </td>
89
+ <!-- 02 --> <td bgcolor="lightgreen">frei </td>
90
+ <!-- 03 --> <td bgcolor="lightgreen">frei </td>
91
+ <!-- 04 --> <td bgcolor="lightgreen">frei </td>
92
+ <!-- 05 --> <td bgcolor="lightgreen">frei </td>
93
+ <!-- 06 --> <td bgcolor="lightgreen">frei </td>
94
+ <!-- 07 --> <td bgcolor="lightgreen">frei </td>
95
+ <!-- 08 --> <td bgcolor="lightgreen">frei </td>
96
+ <!-- 09 --> <td bgcolor="lightgreen">frei </td>
97
+ <!-- 10 --> <td bgcolor="lightgreen">frei </td>
98
+ <!-- 11 --> <td bgcolor="lightgreen">frei </td>
99
+ <!-- 12 --> <td bgcolor="lightgreen">frei </td>
100
+ </tr>
101
+ </table>
102
+ END
103
+
104
+ if p_verfuegbarkeit!=:mit_verfuegbarkeit
105
+ verfuegbarkeit=""
106
+ end
107
+
108
+ dokument_source=<<__END__
109
+ Dokument: <code>
110
+ <a href="http://www.thopre.de/profil.html">
111
+ http://www.thopre.de/profil.html
112
+ </a>
113
+ </code>
114
+ __END__
115
+ #!!!
116
+ dokument_source=<<__END__
117
+ __END__
118
+
119
+ tmpl = TemplateText.new <<END
120
+
121
+ <HTML>
122
+
123
+ <HEAD>
124
+ <TITLE>Profil #{@firstname} #{@lastname}</TITLE>
125
+ </HEAD>
126
+
127
+ <BODY BACKGROUND="" BGCOLOR="#ffffff" TEXT="#000000" LINK="#0000ff" VLINK="#800080" ALINK="#ff0000">
128
+
129
+ #{dokument_source}
130
+
131
+ <p>
132
+ <TABLE BORDER="1" WIDTH="100%" cellpadding="5">
133
+ <TR>
134
+ <TD valign="top">
135
+ <B>Profil</B> von<BR>
136
+ #{@firstname} #{@lastname}<br>
137
+ Stand: #{DateTime.now.to_s[0,10]}<br>
138
+ </TD>
139
+ <TD>
140
+ #{@adresse}<br>
141
+ #{@plz} #{@ort}<br>
142
+ Tel.: #{@telefon}<BR>
143
+ </TD>
144
+ <TD valign="top">
145
+ mobile: #{@mobil}<BR>
146
+ email: <a href="mailto:#{@email}">#{@email}</a><BR>
147
+
148
+ </TD>
149
+ </TR>
150
+ </TABLE>
151
+
152
+
153
+ <ol>
154
+ <li><a href="#hw">Hardware</a>
155
+ <li><a href="#bs">Betriebssysteme</a>
156
+ <li><a href="#db">Datenbanken</a>
157
+ <li><a href="#to">Tools / Sonstiges</a>
158
+ <li><a href="#la">Programmiersprachen</a>
159
+ <li><a href="#pr">Projekte</a>
160
+ </ol>
161
+ <hr>
162
+
163
+ <H1>Aktuelles</H1>
164
+
165
+ #{verfuegbarkeit}
166
+
167
+ <p>
168
+
169
+ <TABLE border="1" cellspacing="0" cellpadding="4">
170
+ <TR>
171
+ <TD >
172
+ <B>
173
+ bevorzugter Einsatzort:
174
+ </B>
175
+ </TD>
176
+ <TD >
177
+ Raum Berlin.
178
+ </TD>
179
+ </TR>
180
+ <TR>
181
+ <TD >
182
+ <B>
183
+ Stundensatz:
184
+ </B>
185
+ </TD>
186
+ <TD >
187
+ <!-- 70 &#8364;/h zuz&uuml;gl. MwSt.
188
+ -->
189
+ nach Vereinbarung
190
+ </TD>
191
+
192
+ </TR>
193
+ </TABLE>
194
+
195
+ <A NAME="link"><H1>Pers&ouml;nliche Daten</H1></A>
196
+ <TABLE width="95%" border="0" cellspacing="0" cellpadding="4">
197
+ <TR>
198
+ <!-- Row 1 Column 1 -->
199
+ <TD >
200
+ <B>
201
+ Geburtsdatum:
202
+ </B>
203
+ </TD>
204
+ <!-- Row 1 Column 2 -->
205
+ <TD >
206
+ 1961-11-21
207
+ </TD>
208
+ </TR>
209
+ <TR>
210
+ <!-- Row 2 Column 1 -->
211
+ <TD valign="top">
212
+ <B>
213
+ Ausbildung:
214
+ </B>
215
+ </TD>
216
+ <!-- Row 2 Column 2 -->
217
+ <TD >
218
+ <div id="educations"></div>
219
+ </TD>
220
+ </TR>
221
+ <TR>
222
+ <TD >
223
+ <B>
224
+ Fortbildung:
225
+ </B>
226
+ </TD>
227
+ <TD >
228
+ <div id="weiterbildungen"></div>
229
+ </TD>
230
+ </TR>
231
+ <TR>
232
+ <TD valign="top">
233
+ <B>
234
+ Fremdsprachen:
235
+ </B>
236
+ </TD>
237
+ <TD >
238
+ <div id="fremdsprachen"></div>
239
+ </TD>
240
+ </TR>
241
+ </TABLE>
242
+
243
+ END
244
+ puts "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2//EN\">"
245
+ array1 = @education_list
246
+ array2 = @weiterbildungen
247
+ array3 = @fremdsprachen
248
+ data = {
249
+ :educations => array1,
250
+ :weiterbildungen => array2,
251
+ :fremdsprachen => array3,
252
+ }
253
+
254
+ tmpl.prettyprint = true
255
+ #tmpl.expand(STDOUT, data)
256
+ tmpl.expand($stdout, data)
257
+ end
258
+
259
+
260
+ def output_projects (mode,order)
261
+ puts "<h1>" if mode == :html
262
+ puts "Projekte"
263
+ puts "</h1>" if mode == :html
264
+ puts "<table border=\"1\" width=\"100%\" cellpadding=\"5\">" if mode == :html
265
+ if mode == :html
266
+ puts "<td width=\"10%\"><b>Branche</b></td>"
267
+ puts "<td width=\"70%\"><b>Beschreibung</b></td>"
268
+ puts "<td width=\"10%\"><b>Dauer</b></td>"
269
+ puts "<td width=\"10%\"><b>zuletzt</b></td>"
270
+ end
271
+ if order == :newest_first
272
+ @projectlist.sort.reverse.each {|project|
273
+ puts "<tr>" if mode == :html
274
+ project.output(mode)
275
+ puts "</tr>" if mode == :html
276
+ }
277
+ else
278
+ @projectlist.sort.each {|project|
279
+ puts "<tr>" if mode == :html
280
+ project.output(mode)
281
+ puts "</tr>" if mode == :html
282
+ }
283
+ end
284
+ puts "</table>" if mode == :html
285
+ end
286
+
287
+
288
+ def output_category (category, mode)
289
+ array1 = []
290
+ category[1].sort.each {|tool|
291
+ #monate = total_for(tool)
292
+ monate = tool.total_for
293
+ #print "ingesamt #{tool.name}: "+monate.to_s+" Monate"
294
+ #if monate > 12
295
+ #print "\t(> "+jahre(monate).to_s+" Jahre)"
296
+ #end
297
+ #puts " zuletzt "+projectlist.last_used(tool)
298
+ #array1 << { :name=>tool.name, :dauer=>human_months(monate), :zuletzt=>last_used(tool) }
299
+ array1 << { :name=>tool.name, :dauer=>human_months(monate), :zuletzt=>tool.last_used }
300
+ }
301
+ #######################################
302
+ tmpl = TemplateText.new <<END
303
+ <h1>#{category[0]}</h1>
304
+ <table border="1" width="100%" cellpadding="5">
305
+ <tr>
306
+ <th>Name</th>
307
+ <th>Dauer</th>
308
+ <th>zuletzt</th>
309
+ </tr>
310
+ <tr id=table1>
311
+ <td id="name">
312
+ <td id="dauer">
313
+ <td id="zuletzt" align="right">
314
+ </tr>
315
+ </table>
316
+ END
317
+
318
+ data = {
319
+ :table1=>array1
320
+ }
321
+ tmpl.prettyprint = true
322
+ #tmpl.expand(STDOUT, data)
323
+ tmpl.expand($stdout, data)
324
+ #f = File.open("hula#{cate[0]}.html","w")
325
+ end
326
+
327
+ private
328
+
329
+ def human_months(months)
330
+ if months > 12
331
+ mehrzahl=""
332
+ mehrzahl="e" if months > 24-1
333
+ "> "+jahre(months).to_s+" Jahr"+mehrzahl
334
+ else
335
+ mehrzahl=""
336
+ mehrzahl="e" if months > 1
337
+ months.to_s+" Monat"+mehrzahl
338
+ end
339
+ end
340
+
341
+ def jahre(monate)
342
+ monate/12.0.round
10
343
  end
11
344
 
12
345
  end
@@ -39,7 +39,11 @@ class Project
39
39
  "#{monatsbezeichnung(@bis_jahr,@bis_monat)}\n"
40
40
  end
41
41
 
42
- def output(mode=nil)
42
+ def output(*args)
43
+ if args.include?(:html)
44
+ mode = :html
45
+ end
46
+
43
47
  if mode == :html
44
48
  puts "<td valign=\"top\">"+html(@branche)+"</td>"
45
49
  puts "<td valign=\"top\">"+html(@beschreibung)+"<br>"
@@ -93,6 +97,10 @@ class Project
93
97
 
94
98
  def used_tool(tool)
95
99
  @tools << tool
100
+ # Zeiten im Tool aktualisieren
101
+ last_day = Date.new(@bis_jahr,@bis_monat,1)
102
+ last_day = (last_day >> 1)-1 # + 1 Monat und 1 Tag zur�ck
103
+ tool.update(monate,last_day)
96
104
  end
97
105
 
98
106
  def tools