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 CHANGED
@@ -3,7 +3,7 @@ require 'echoe'
3
3
 
4
4
  # PACKAGING ============================================================
5
5
 
6
- Echoe.new('rtt', '0.0.0.13') do |p|
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
@@ -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
- @data[:fixed_fields].keys + @different_fixed.keys.reject { |key| @different_fixed[key].length > 1 }
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| result = FORMATS_ACCEPTED.include?(key); options.delete(key) if result;result; }.first
97
- path = options[extension]
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
@@ -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.13"
5
+ s.version = "0.0.0.14"
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: 85
4
+ hash: 83
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
9
  - 0
10
- - 13
11
- version: 0.0.0.13
10
+ - 14
11
+ version: 0.0.0.14
12
12
  platform: ruby
13
13
  authors:
14
14
  - Marcelo Giorgi