rtt 0.0.0.10 → 0.0.0.11
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/query_builder.rb +1 -1
- data/lib/rtt/report_generator.rb +3 -2
- 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.11') 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/query_builder.rb
CHANGED
@@ -11,7 +11,7 @@ module Rtt
|
|
11
11
|
private
|
12
12
|
|
13
13
|
def rtt_build_conditions options
|
14
|
-
conditions =
|
14
|
+
conditions = options
|
15
15
|
conditions[:date.gte] = Date.parse(options[:from]) if options[:from]
|
16
16
|
conditions[:date.lte] = Date.parse(options[:to]) if options[:to]
|
17
17
|
conditions[:date] = Date.parse(options[:date]) if options[:date]
|
data/lib/rtt/report_generator.rb
CHANGED
@@ -90,11 +90,12 @@ module Rtt
|
|
90
90
|
def report options = {}
|
91
91
|
raise 'Argument must be a valid Hash. Checkout: rtt usage' unless options.is_a?(Hash) || options.keys.empty?
|
92
92
|
@different_fixed ||= FIXED_FIELDS.inject({}) { |result, key| result[key] = []; result }
|
93
|
-
extension = options.keys.select { |key| FORMATS_ACCEPTED.include?(key) }.first
|
93
|
+
extension = options.keys.select { |key| result = FORMATS_ACCEPTED.include?(key); options.delete(key) if result;result; }.first
|
94
94
|
path = options[extension]
|
95
95
|
fixed_fields = extract_fixed_fields(options)
|
96
96
|
fixed_fields_and_values = fixed_fields.inject({}) { |hash, key| hash[key] = options[key.downcase.to_sym]; hash }
|
97
|
-
|
97
|
+
filter_options = options.merge({ :order => [:date.desc] })
|
98
|
+
@data = { :fixed_fields => fixed_fields_and_values, :rows => query(filter_options) }
|
98
99
|
filename_path = full_path(path)
|
99
100
|
case extension
|
100
101
|
when :pdf
|
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: 89
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
9
|
- 0
|
10
|
-
-
|
11
|
-
version: 0.0.0.
|
10
|
+
- 11
|
11
|
+
version: 0.0.0.11
|
12
12
|
platform: ruby
|
13
13
|
authors:
|
14
14
|
- Marcelo Giorgi
|