rtt 0.0.0.14 → 0.0.0.15
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.
- data/Manifest +1 -0
- data/Rakefile +1 -1
- data/lib/rtt/report_generator.rb +10 -8
- data/rtt.gemspec +1 -1
- metadata +3 -3
data/Manifest
CHANGED
data/Rakefile
CHANGED
@@ -3,7 +3,7 @@ require 'echoe'
|
|
3
3
|
|
4
4
|
# PACKAGING ============================================================
|
5
5
|
|
6
|
-
Echoe.new('rtt', '0.0.0.
|
6
|
+
Echoe.new('rtt', '0.0.0.15') do |p|
|
7
7
|
p.description = 'RTT is a tool for tracking time'
|
8
8
|
p.url = 'http://github.com/marklazz/rtt'
|
9
9
|
p.author = 'Marcelo Giorgi'
|
data/lib/rtt/report_generator.rb
CHANGED
@@ -18,14 +18,13 @@ module Rtt
|
|
18
18
|
}
|
19
19
|
|
20
20
|
def column_widths(fixed_fields)
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
when ['Client', 'Project']
|
21
|
+
if fixed_fields.same(['Date', 'Client', 'Project'])
|
22
|
+
{ 0 => 430, 1 => 50, 2 => 60 }
|
23
|
+
elsif fixed_fields.same(['Client', 'Project'])
|
25
24
|
{ 0 => 360, 1 => 60, 2 => 60, 3 => 60 }
|
26
|
-
|
25
|
+
elsif fixed_fields.same(['Project']) || fixed_fields.same(['Client'])
|
27
26
|
{ 0 => 80, 1 => 290, 2 => 60, 3 => 50, 4 => 60 }
|
28
|
-
|
27
|
+
else
|
29
28
|
{ 0 => 80, 1 => 80, 2 => 210, 3 => 60, 4 => 50, 5 => 60 }
|
30
29
|
end
|
31
30
|
end
|
@@ -154,7 +153,7 @@ module Rtt
|
|
154
153
|
columns = REPORT_FIELDS - fixed_fields_for_current_data
|
155
154
|
data = @data[:rows].map { |task| task_row_for_fields(task, columns) }
|
156
155
|
title = ENV['title'] || ENV['TITLE'] || "RTT Report"
|
157
|
-
|
156
|
+
|
158
157
|
total_amount, total_h, total_m = calculate_total_amount_hours_and_minutes(data)
|
159
158
|
report_generator = self
|
160
159
|
|
@@ -182,8 +181,11 @@ module Rtt
|
|
182
181
|
fixed_fields.each do |field|
|
183
182
|
text("#{field}: #{report_generator.fixed_value(field)}") unless report_generator.has_default_value?(field)
|
184
183
|
end
|
184
|
+
|
185
185
|
|
186
186
|
move_down(report_generator.custom_user_is_defined? ? 50 : 0)
|
187
|
+
|
188
|
+
column_widths = report_generator.column_widths(fixed_fields)
|
187
189
|
|
188
190
|
if data.present?
|
189
191
|
table(data,
|
@@ -191,7 +193,7 @@ module Rtt
|
|
191
193
|
:position => :left,
|
192
194
|
:border_width => 1,
|
193
195
|
:row_colors => [ 'fafafa', 'f0f0f0' ],
|
194
|
-
:column_widths =>
|
196
|
+
:column_widths => column_widths,
|
195
197
|
:font_size => 12,
|
196
198
|
:padding => 5,
|
197
199
|
:align => :left)
|
data/rtt.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rtt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 81
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
9
|
- 0
|
10
|
-
-
|
11
|
-
version: 0.0.0.
|
10
|
+
- 15
|
11
|
+
version: 0.0.0.15
|
12
12
|
platform: ruby
|
13
13
|
authors:
|
14
14
|
- Marcelo Giorgi
|