rtt 0.0.0.13 → 0.0.0.14
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/db/rtt.sqlite3 +0 -0
- data/lib/rtt/report_generator.rb +8 -4
- data/rtt.gemspec +1 -1
- metadata +3 -3
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.14') 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/db/rtt.sqlite3
CHANGED
Binary file
|
data/lib/rtt/report_generator.rb
CHANGED
@@ -61,7 +61,10 @@ module Rtt
|
|
61
61
|
def fixed_fields_for_current_data
|
62
62
|
@fixed_fields_for_current_data ||= begin
|
63
63
|
calculate_fixed_fields_based_on_data
|
64
|
-
@
|
64
|
+
@different_fixed.keys.reject { |key| @different_fixed[key].length > 1 }.inject(@data[:fixed_fields].keys) do |keys, new_key_based_on_data|
|
65
|
+
keys<<(new_key_based_on_data) unless keys.include?(new_key_based_on_data)
|
66
|
+
keys
|
67
|
+
end
|
65
68
|
end
|
66
69
|
end
|
67
70
|
|
@@ -93,8 +96,8 @@ module Rtt
|
|
93
96
|
def report options = {}
|
94
97
|
raise 'Argument must be a valid Hash. Checkout: rtt usage' unless options.is_a?(Hash) || options.keys.empty?
|
95
98
|
@different_fixed ||= FIXED_FIELDS.inject({}) { |result, key| result[key] = []; result }
|
96
|
-
extension = options.keys.select { |key|
|
97
|
-
path = options
|
99
|
+
extension = options.keys.select { |key| FORMATS_ACCEPTED.include?(key) }.first
|
100
|
+
path = options.delete(extension)
|
98
101
|
fixed_fields = extract_fixed_fields(options)
|
99
102
|
fixed_fields_and_values = fixed_fields.inject({}) { |hash, key| hash[key] = options[key.downcase.to_sym]; hash }
|
100
103
|
filter_options = options.merge({ :order => [:date.desc] })
|
@@ -151,6 +154,7 @@ module Rtt
|
|
151
154
|
columns = REPORT_FIELDS - fixed_fields_for_current_data
|
152
155
|
data = @data[:rows].map { |task| task_row_for_fields(task, columns) }
|
153
156
|
title = ENV['title'] || ENV['TITLE'] || "RTT Report"
|
157
|
+
|
154
158
|
total_amount, total_h, total_m = calculate_total_amount_hours_and_minutes(data)
|
155
159
|
report_generator = self
|
156
160
|
|
@@ -202,7 +206,7 @@ module Rtt
|
|
202
206
|
font_size 14
|
203
207
|
number_pages "Page <page> / <total>", [bounds.right - 80, -10]
|
204
208
|
say "Report saved at #{output_path}"
|
205
|
-
|
209
|
+
|
206
210
|
render_file output_path
|
207
211
|
end
|
208
212
|
rescue LoadError
|
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: 83
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
9
|
- 0
|
10
|
-
-
|
11
|
-
version: 0.0.0.
|
10
|
+
- 14
|
11
|
+
version: 0.0.0.14
|
12
12
|
platform: ruby
|
13
13
|
authors:
|
14
14
|
- Marcelo Giorgi
|