fitgem 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/fitgem/time_range.rb +2 -2
- data/lib/fitgem/version.rb +1 -1
- data/spec/fitgem_helper_spec.rb +7 -0
- metadata +4 -4
data/lib/fitgem/time_range.rb
CHANGED
@@ -73,9 +73,9 @@ module Fitgem
|
|
73
73
|
def construct_date_range_fragment(options)
|
74
74
|
range_str = "date/"
|
75
75
|
if options[:base_date] && options[:period]
|
76
|
-
range_str += "#{options[:base_date]}/#{options[:period]}"
|
76
|
+
range_str += "#{format_date(options[:base_date])}/#{options[:period]}"
|
77
77
|
elsif options[:base_date] && options[:end_date]
|
78
|
-
range_str += "#{options[:base_date]}/#{options[:end_date]}"
|
78
|
+
range_str += "#{format_date(options[:base_date])}/#{format_date(options[:end_date])}"
|
79
79
|
else
|
80
80
|
raise Fitgem::InvalidTimeRange, "Must supply either base_date and period OR base_date and end_date"
|
81
81
|
end
|
data/lib/fitgem/version.rb
CHANGED
data/spec/fitgem_helper_spec.rb
CHANGED
@@ -32,6 +32,13 @@ describe Fitgem::Client do
|
|
32
32
|
@client.construct_date_range_fragment({:end_date => '2011-03-07', :period => '7d'})
|
33
33
|
}.to raise_error(Fitgem::InvalidTimeRange)
|
34
34
|
end
|
35
|
+
|
36
|
+
it 'formats DateTime objects to the required date format' do
|
37
|
+
span_start = DateTime.new(1997, 4, 18, 9, 30, 30)
|
38
|
+
span_end = DateTime.new(1999, 10, 3, 15, 30, 30)
|
39
|
+
frag = @client.construct_date_range_fragment base_date: span_start, end_date: span_end
|
40
|
+
frag.should eq('date/1997-04-18/1999-10-03')
|
41
|
+
end
|
35
42
|
end
|
36
43
|
|
37
44
|
describe "#format_date" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fitgem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-02-
|
12
|
+
date: 2013-02-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: oauth
|
@@ -149,7 +149,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
149
149
|
version: '0'
|
150
150
|
segments:
|
151
151
|
- 0
|
152
|
-
hash:
|
152
|
+
hash: 3756517255535395412
|
153
153
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
154
154
|
none: false
|
155
155
|
requirements:
|
@@ -158,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
158
158
|
version: '0'
|
159
159
|
segments:
|
160
160
|
- 0
|
161
|
-
hash:
|
161
|
+
hash: 3756517255535395412
|
162
162
|
requirements: []
|
163
163
|
rubyforge_project: fitgem
|
164
164
|
rubygems_version: 1.8.24
|