rtt 0.0.0.14 → 0.0.0.15

Sign up to get free protection for your applications and to get access to all the features.
data/Manifest CHANGED
@@ -6,6 +6,7 @@ USAGE.txt
6
6
  bin/rtt
7
7
  db/rtt.sqlite3
8
8
  lib/rtt.rb
9
+ lib/rtt/array_extensions.rb
9
10
  lib/rtt/client.rb
10
11
  lib/rtt/cmd_line_parser.rb
11
12
  lib/rtt/hash_extensions.rb
data/Rakefile CHANGED
@@ -3,7 +3,7 @@ require 'echoe'
3
3
 
4
4
  # PACKAGING ============================================================
5
5
 
6
- Echoe.new('rtt', '0.0.0.14') do |p|
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'
@@ -18,14 +18,13 @@ module Rtt
18
18
  }
19
19
 
20
20
  def column_widths(fixed_fields)
21
- case fixed_fields
22
- when ['Date', 'Client', 'Project']
23
- { 0 => 430, 1 => 50, 2 => 60 } # total = 540 px
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
- when ['Project', '']
25
+ elsif fixed_fields.same(['Project']) || fixed_fields.same(['Client'])
27
26
  { 0 => 80, 1 => 290, 2 => 60, 3 => 50, 4 => 60 }
28
- when []
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 => report_generator.column_widths(fixed_fields),
196
+ :column_widths => column_widths,
195
197
  :font_size => 12,
196
198
  :padding => 5,
197
199
  :align => :left)
data/rtt.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{rtt}
5
- s.version = "0.0.0.14"
5
+ s.version = "0.0.0.15"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Marcelo Giorgi"]
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: 83
4
+ hash: 81
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
9
  - 0
10
- - 14
11
- version: 0.0.0.14
10
+ - 15
11
+ version: 0.0.0.15
12
12
  platform: ruby
13
13
  authors:
14
14
  - Marcelo Giorgi