rtt 0.0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/lib/rtt/user.rb ADDED
@@ -0,0 +1,54 @@
1
+ #!/usr/bin/ruby -w
2
+ module Rtt
3
+ class User
4
+ include DataMapper::Resource
5
+
6
+ BLANK_FIELD = ''
7
+ DEFAULT_NICK = 'admin'
8
+
9
+ property :id, Serial
10
+ property :nickname, String, :required => true, :unique => true, :default => DEFAULT_NICK
11
+ property :first_name, String, :default => BLANK_FIELD
12
+ property :last_name, String, :default => BLANK_FIELD
13
+ property :company, String, :default => BLANK_FIELD
14
+ property :address, String, :default => BLANK_FIELD
15
+ property :city, String, :default => BLANK_FIELD
16
+ property :country, String, :default => BLANK_FIELD
17
+ property :email, String, :default => BLANK_FIELD
18
+ property :phone, String, :default => BLANK_FIELD
19
+ property :zip, String, :default => BLANK_FIELD
20
+ property :site, String, :default => BLANK_FIELD
21
+ property :active, Boolean, :default => false
22
+
23
+ has n, :tasks #, :through => Resource
24
+ has n, :projects, :through => :tasks
25
+
26
+ def self.default
27
+ first_or_create :active => true
28
+ end
29
+
30
+ def activate
31
+ self.active = true
32
+ self.save
33
+ self
34
+ end
35
+
36
+ def deactivate
37
+ self.active = false
38
+ self.save
39
+ self
40
+ end
41
+
42
+ def full_name
43
+ "#{first_name.present? ? first_name : ''} #{last_name.present? ? last_name : ''}".strip
44
+ end
45
+
46
+ def full_name_and_nickname
47
+ "#{full_name.present? ? full_name : ''} #{full_name.present? ? "(#{nickname})" : nickname }".strip
48
+ end
49
+
50
+ def location
51
+ "#{self.city}#{self.city.present? && self.country.present? ? ', ' : ''}#{self.country}".strip
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/ruby -w
2
+ module Rtt
3
+ module UserConfigurator
4
+
5
+ def configure_user(nickname = nil)
6
+ say "Please fill in your personal information"
7
+ say "========================================"
8
+ unless nickname.present?
9
+ nickname = ask('Nickname (Required):') { |q| q.validate = /^\w+$/ }
10
+ end
11
+ first_name = ask('First name:')
12
+ last_name = ask('Last name:')
13
+ company = ask('Company:')
14
+ country = ask('Country:')
15
+ city = ask('City:')
16
+ address = ask('Address:')
17
+ phone = ask('Phone:')
18
+ email = ask('Email:')
19
+ site = ask('Site:')
20
+ User.first_or_create :nickname => nickname, :first_name => first_name, :last_name => last_name, :company => company, :email => email, :address => address, :country => country, :city => city, :phone => phone, :site => site, :active => true
21
+ end
22
+ end
23
+ end
24
+
data/rtt.gemspec ADDED
@@ -0,0 +1,50 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{rtt}
5
+ s.version = "0.0.0.1"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["Marcelo Giorgi"]
9
+ s.date = %q{2010-06-19}
10
+ s.default_executable = %q{rtt}
11
+ s.description = %q{RTT is a tool for tracking time}
12
+ s.email = %q{marklazz.uy@gmail.com}
13
+ s.executables = ["rtt"]
14
+ s.extra_rdoc_files = ["LICENSE", "README.rdoc", "bin/rtt", "lib/rtt.rb", "lib/rtt/client.rb", "lib/rtt/cmd_line_interpreter.rb", "lib/rtt/hash_extensions.rb", "lib/rtt/project.rb", "lib/rtt/query_builder.rb", "lib/rtt/report_generator.rb", "lib/rtt/storage.rb", "lib/rtt/task.rb", "lib/rtt/user.rb", "lib/rtt/user_configurator.rb", "tasks/rtt.rake"]
15
+ s.files = ["LICENSE", "Manifest", "README.rdoc", "Rakefile", "USAGE.txt", "bin/rtt", "db/rtt.sqlite3", "db/test.sqlite3", "init.sh", "lib/rtt.rb", "lib/rtt/client.rb", "lib/rtt/cmd_line_interpreter.rb", "lib/rtt/hash_extensions.rb", "lib/rtt/project.rb", "lib/rtt/query_builder.rb", "lib/rtt/report_generator.rb", "lib/rtt/storage.rb", "lib/rtt/task.rb", "lib/rtt/user.rb", "lib/rtt/user_configurator.rb", "rtt.gemspec", "rtt_report", "spec/datamapper_spec_helper.rb", "spec/lib/rtt/task_spec.rb", "spec/lib/rtt_spec.rb", "tasks/rtt.rake", "todo.txt"]
16
+ s.homepage = %q{http://www.marklazz.com}
17
+ s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Rtt", "--main", "README.rdoc"]
18
+ s.require_paths = ["lib"]
19
+ s.rubyforge_project = %q{rtt}
20
+ s.rubygems_version = %q{1.3.7}
21
+ s.summary = %q{RTT is a tool for tracking time}
22
+
23
+ if s.respond_to? :specification_version then
24
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
25
+ s.specification_version = 3
26
+
27
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
28
+ s.add_runtime_dependency(%q<highline>, [">= 1.5.2"])
29
+ s.add_runtime_dependency(%q<activesupport>, [">= 2.3.0"])
30
+ s.add_runtime_dependency(%q<prawn>, [">= 0.8.0"])
31
+ s.add_runtime_dependency(%q<dm-core>, [">= 1.0.0"])
32
+ s.add_runtime_dependency(%q<dm-migrations>, [">= 1.0.0"])
33
+ s.add_development_dependency(%q<spec>, [">= 0"])
34
+ else
35
+ s.add_dependency(%q<highline>, [">= 1.5.2"])
36
+ s.add_dependency(%q<activesupport>, [">= 2.3.0"])
37
+ s.add_dependency(%q<prawn>, [">= 0.8.0"])
38
+ s.add_dependency(%q<dm-core>, [">= 1.0.0"])
39
+ s.add_dependency(%q<dm-migrations>, [">= 1.0.0"])
40
+ s.add_dependency(%q<spec>, [">= 0"])
41
+ end
42
+ else
43
+ s.add_dependency(%q<highline>, [">= 1.5.2"])
44
+ s.add_dependency(%q<activesupport>, [">= 2.3.0"])
45
+ s.add_dependency(%q<prawn>, [">= 0.8.0"])
46
+ s.add_dependency(%q<dm-core>, [">= 1.0.0"])
47
+ s.add_dependency(%q<dm-migrations>, [">= 1.0.0"])
48
+ s.add_dependency(%q<spec>, [">= 0"])
49
+ end
50
+ end
data/rtt_report ADDED
@@ -0,0 +1,401 @@
1
+ %PDF-1.3
2
+ %����
3
+ 1 0 obj
4
+ << /Producer (Prawn)
5
+ /Creator (Prawn)
6
+ >>
7
+ endobj
8
+ 2 0 obj
9
+ << /Type /Pages
10
+ /Count 1
11
+ /Kids [5 0 R]
12
+ >>
13
+ endobj
14
+ 3 0 obj
15
+ << /Pages 2 0 R
16
+ /Type /Catalog
17
+ >>
18
+ endobj
19
+ 4 0 obj
20
+ << /Length 4667
21
+ >>
22
+ stream
23
+ /DeviceRGB cs
24
+ 0.000 0.000 0.000 scn
25
+ /DeviceRGB CS
26
+ 0.000 0.000 0.000 SCN
27
+ q
28
+
29
+ BT
30
+ 525.166456692913 797.102456692913 Td
31
+ /F1.0 12 Tf
32
+ [<6d6172> -15 <6b6c617a7a>] TJ
33
+ ET
34
+
35
+ 0.000 0.000 0.000 scn
36
+ 0.000 0.000 0.000 scn
37
+ 0.000 0.000 0.000 scn
38
+ 0.000 0.000 0.000 scn
39
+ 0.000 0.000 0.000 scn
40
+ 0.000 0.000 0.000 scn
41
+ 0.000 0.000 0.000 scn
42
+
43
+ BT
44
+ 28.3464566929134 806.858456692913 Td
45
+ /F1.0 16 Tf
46
+ [<52> 30 <5454205265706f72> -40 <74>] TJ
47
+ ET
48
+
49
+
50
+ BT
51
+ 28.3464566929134 788.362456692913 Td
52
+ /F1.0 16 Tf
53
+ [<3d3d3d3d3d3d3d3d3d3d>] TJ
54
+ ET
55
+
56
+
57
+ BT
58
+ 28.3464566929134 729.866456692913 Td
59
+ /F1.0 16 Tf
60
+ [<436c69656e743a> 50 <20456d65> 30 <78>] TJ
61
+ ET
62
+
63
+
64
+ BT
65
+ 28.3464566929134 711.370456692913 Td
66
+ /F1.0 16 Tf
67
+ [<50726f6a6563743a> 50 <20456d65> 30 <78>] TJ
68
+ ET
69
+
70
+ 0.980 0.980 0.980 scn
71
+ 28.346 631.490 74.000 22.872 re
72
+ f
73
+ 0.000 0.000 0.000 scn
74
+ 1 w
75
+ 28.346 654.862 m
76
+ 28.346 629.990 l
77
+ S
78
+ 102.346 654.862 m
79
+ 102.346 629.990 l
80
+ S
81
+ 28.346 654.362 m
82
+ 102.346 654.362 l
83
+ S
84
+ 28.346 630.490 m
85
+ 102.346 630.490 l
86
+ S
87
+ 0.000 0.000 0.000 SCN
88
+ 1 w
89
+
90
+ BT
91
+ 33.3464566929134 638.118456692913 Td
92
+ /F1.0 12 Tf
93
+ [<4e616d65>] TJ
94
+ ET
95
+
96
+ 0.000 0.000 0.000 scn
97
+ 0.980 0.980 0.980 scn
98
+ 102.346 631.490 59.000 22.872 re
99
+ f
100
+ 0.000 0.000 0.000 scn
101
+ 1 w
102
+ 102.346 654.862 m
103
+ 102.346 629.990 l
104
+ S
105
+ 161.346 654.862 m
106
+ 161.346 629.990 l
107
+ S
108
+ 102.346 654.362 m
109
+ 161.346 654.362 l
110
+ S
111
+ 102.346 630.490 m
112
+ 161.346 630.490 l
113
+ S
114
+ 0.000 0.000 0.000 SCN
115
+ 1 w
116
+
117
+ BT
118
+ 107.346456692913 638.118456692913 Td
119
+ /F1.0 12 Tf
120
+ [<44617465>] TJ
121
+ ET
122
+
123
+ 0.000 0.000 0.000 scn
124
+ 0.980 0.980 0.980 scn
125
+ 161.346 631.490 56.000 22.872 re
126
+ f
127
+ 0.000 0.000 0.000 scn
128
+ 1 w
129
+ 161.346 654.862 m
130
+ 161.346 629.990 l
131
+ S
132
+ 217.346 654.862 m
133
+ 217.346 629.990 l
134
+ S
135
+ 161.346 654.362 m
136
+ 217.346 654.362 l
137
+ S
138
+ 161.346 630.490 m
139
+ 217.346 630.490 l
140
+ S
141
+ 0.000 0.000 0.000 SCN
142
+ 1 w
143
+
144
+ BT
145
+ 166.346456692913 638.118456692913 Td
146
+ /F1.0 12 Tf
147
+ [<447572> 10 <6174696f6e>] TJ
148
+ ET
149
+
150
+ 0.000 0.000 0.000 scn
151
+ 0.941 0.941 0.941 scn
152
+ 28.346 606.118 74.000 24.372 re
153
+ f
154
+ 0.000 0.000 0.000 scn
155
+ 1 w
156
+ 28.346 630.990 m
157
+ 28.346 606.118 l
158
+ S
159
+ 102.346 630.990 m
160
+ 102.346 606.118 l
161
+ S
162
+ 0.000 0.000 0.000 SCN
163
+ 1 w
164
+
165
+ BT
166
+ 33.3464566929134 614.246456692913 Td
167
+ /F1.0 12 Tf
168
+ [<6d6f6e6f6c6f636f>] TJ
169
+ ET
170
+
171
+ 0.000 0.000 0.000 scn
172
+ 0.941 0.941 0.941 scn
173
+ 102.346 606.118 59.000 24.372 re
174
+ f
175
+ 0.000 0.000 0.000 scn
176
+ 1 w
177
+ 102.346 630.990 m
178
+ 102.346 606.118 l
179
+ S
180
+ 161.346 630.990 m
181
+ 161.346 606.118 l
182
+ S
183
+ 0.000 0.000 0.000 SCN
184
+ 1 w
185
+
186
+ BT
187
+ 107.346456692913 614.246456692913 Td
188
+ /F1.0 12 Tf
189
+ [<30362d31392d3130>] TJ
190
+ ET
191
+
192
+ 0.000 0.000 0.000 scn
193
+ 0.941 0.941 0.941 scn
194
+ 161.346 606.118 56.000 24.372 re
195
+ f
196
+ 0.000 0.000 0.000 scn
197
+ 1 w
198
+ 161.346 630.990 m
199
+ 161.346 606.118 l
200
+ S
201
+ 217.346 630.990 m
202
+ 217.346 606.118 l
203
+ S
204
+ 0.000 0.000 0.000 SCN
205
+ 1 w
206
+
207
+ BT
208
+ 166.346456692913 614.246456692913 Td
209
+ /F1.0 12 Tf
210
+ [<3268316d>] TJ
211
+ ET
212
+
213
+ 0.000 0.000 0.000 scn
214
+ 0.980 0.980 0.980 scn
215
+ 28.346 582.246 74.000 24.372 re
216
+ f
217
+ 0.000 0.000 0.000 scn
218
+ 1 w
219
+ 28.346 607.118 m
220
+ 28.346 582.246 l
221
+ S
222
+ 102.346 607.118 m
223
+ 102.346 582.246 l
224
+ S
225
+ 0.000 0.000 0.000 SCN
226
+ 1 w
227
+
228
+ BT
229
+ 33.3464566929134 590.374456692913 Td
230
+ /F1.0 12 Tf
231
+ [<446566> 30 <61756c74207461736b>] TJ
232
+ ET
233
+
234
+ 0.000 0.000 0.000 scn
235
+ 0.980 0.980 0.980 scn
236
+ 102.346 582.246 59.000 24.372 re
237
+ f
238
+ 0.000 0.000 0.000 scn
239
+ 1 w
240
+ 102.346 607.118 m
241
+ 102.346 582.246 l
242
+ S
243
+ 161.346 607.118 m
244
+ 161.346 582.246 l
245
+ S
246
+ 0.000 0.000 0.000 SCN
247
+ 1 w
248
+
249
+ BT
250
+ 107.346456692913 590.374456692913 Td
251
+ /F1.0 12 Tf
252
+ [<30362d31392d3130>] TJ
253
+ ET
254
+
255
+ 0.000 0.000 0.000 scn
256
+ 0.980 0.980 0.980 scn
257
+ 161.346 582.246 56.000 24.372 re
258
+ f
259
+ 0.000 0.000 0.000 scn
260
+ 1 w
261
+ 161.346 607.118 m
262
+ 161.346 582.246 l
263
+ S
264
+ 217.346 607.118 m
265
+ 217.346 582.246 l
266
+ S
267
+ 0.000 0.000 0.000 SCN
268
+ 1 w
269
+
270
+ BT
271
+ 166.346456692913 590.374456692913 Td
272
+ /F1.0 12 Tf
273
+ [<3068316d>] TJ
274
+ ET
275
+
276
+ 0.000 0.000 0.000 scn
277
+ 0.941 0.941 0.941 scn
278
+ 28.346 559.874 74.000 22.872 re
279
+ f
280
+ 0.000 0.000 0.000 scn
281
+ 1 w
282
+ 28.346 583.246 m
283
+ 28.346 558.374 l
284
+ S
285
+ 102.346 583.246 m
286
+ 102.346 558.374 l
287
+ S
288
+ 28.346 558.874 m
289
+ 102.346 558.874 l
290
+ S
291
+ 0.000 0.000 0.000 SCN
292
+ 1 w
293
+
294
+ BT
295
+ 33.3464566929134 566.502456692913 Td
296
+ /F1.0 12 Tf
297
+ [<67> 10 <72> 10 <616e20706f6c6f>] TJ
298
+ ET
299
+
300
+ 0.000 0.000 0.000 scn
301
+ 0.941 0.941 0.941 scn
302
+ 102.346 559.874 59.000 22.872 re
303
+ f
304
+ 0.000 0.000 0.000 scn
305
+ 1 w
306
+ 102.346 583.246 m
307
+ 102.346 558.374 l
308
+ S
309
+ 161.346 583.246 m
310
+ 161.346 558.374 l
311
+ S
312
+ 102.346 558.874 m
313
+ 161.346 558.874 l
314
+ S
315
+ 0.000 0.000 0.000 SCN
316
+ 1 w
317
+
318
+ BT
319
+ 107.346456692913 566.502456692913 Td
320
+ /F1.0 12 Tf
321
+ [<30362d31392d3130>] TJ
322
+ ET
323
+
324
+ 0.000 0.000 0.000 scn
325
+ 0.941 0.941 0.941 scn
326
+ 161.346 559.874 56.000 22.872 re
327
+ f
328
+ 0.000 0.000 0.000 scn
329
+ 1 w
330
+ 161.346 583.246 m
331
+ 161.346 558.374 l
332
+ S
333
+ 217.346 583.246 m
334
+ 217.346 558.374 l
335
+ S
336
+ 161.346 558.874 m
337
+ 217.346 558.874 l
338
+ S
339
+ 0.000 0.000 0.000 SCN
340
+ 1 w
341
+
342
+ BT
343
+ 166.346456692913 566.502456692913 Td
344
+ /F1.0 12 Tf
345
+ [<2d>] TJ
346
+ ET
347
+
348
+ 0.000 0.000 0.000 scn
349
+
350
+ BT
351
+ 28.3464566929134 527.386456692913 Td
352
+ /F1.0 16 Tf
353
+ [<54> 120 <6f74616c3a> 50 <203268326d>] TJ
354
+ ET
355
+
356
+
357
+ BT
358
+ 486.933543307087 28.3464566929133 Td
359
+ /F1.0 16 Tf
360
+ [<50> 40 <6167652031202f2031>] TJ
361
+ ET
362
+
363
+ Q
364
+
365
+ endstream
366
+ endobj
367
+ 5 0 obj
368
+ << /Parent 2 0 R
369
+ /Type /Page
370
+ /MediaBox [0 0 595.28 841.89]
371
+ /Resources << /Font << /F1.0 6 0 R
372
+ >>
373
+ /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
374
+ >>
375
+ /Contents 4 0 R
376
+ >>
377
+ endobj
378
+ 6 0 obj
379
+ << /BaseFont /Helvetica
380
+ /Encoding /WinAnsiEncoding
381
+ /Subtype /Type1
382
+ /Type /Font
383
+ >>
384
+ endobj
385
+ xref
386
+ 0 7
387
+ 0000000000 65535 f
388
+ 0000000015 00000 n
389
+ 0000000071 00000 n
390
+ 0000000128 00000 n
391
+ 0000000177 00000 n
392
+ 0000004896 00000 n
393
+ 0000005076 00000 n
394
+ trailer
395
+ << /Size 7
396
+ /Root 3 0 R
397
+ /Info 1 0 R
398
+ >>
399
+ startxref
400
+ 5173
401
+ %%EOF