quandl_operation 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,6 +8,8 @@ class Date
|
|
8
8
|
when :quarterly then self.beginning_of_quarter
|
9
9
|
when :annual then self.beginning_of_year
|
10
10
|
when :annually then self.beginning_of_year
|
11
|
+
else
|
12
|
+
self
|
11
13
|
end
|
12
14
|
end
|
13
15
|
|
@@ -19,6 +21,8 @@ class Date
|
|
19
21
|
when :quarterly then self.end_of_quarter
|
20
22
|
when :annual then self.end_of_year
|
21
23
|
when :annually then self.end_of_year
|
24
|
+
else
|
25
|
+
self
|
22
26
|
end
|
23
27
|
end
|
24
28
|
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe Date do
|
5
|
+
|
6
|
+
subject { Date.today }
|
7
|
+
|
8
|
+
describe "#start_of_frequency" do
|
9
|
+
|
10
|
+
context "given valid input" do
|
11
|
+
it "should return the beginning of the month" do
|
12
|
+
subject.start_of_frequency(:monthly).should eq Date.today.beginning_of_month
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
context "given invalid input" do
|
17
|
+
it "should return the date" do
|
18
|
+
subject.start_of_frequency(:hippo).should eq Date.today
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
describe "#end_of_frequency" do
|
25
|
+
|
26
|
+
context "given valid input" do
|
27
|
+
it "should return the beginning of the month" do
|
28
|
+
subject.end_of_frequency(:monthly).should eq Date.today.end_of_month
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
context "given invalid input" do
|
33
|
+
it "should return the date" do
|
34
|
+
subject.end_of_frequency(:hippo).should eq Date.today
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quandl_operation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
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-08-
|
12
|
+
date: 2013-08-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -120,6 +120,7 @@ files:
|
|
120
120
|
- lib/quandl/operation/version.rb
|
121
121
|
- quandl_operation.gemspec
|
122
122
|
- spec/quandl/operation/collapse_spec.rb
|
123
|
+
- spec/quandl/operation/date_spec.rb
|
123
124
|
- spec/quandl/operation/transform_spec.rb
|
124
125
|
- spec/spec_helper.rb
|
125
126
|
homepage: http://blake.hilscher.ca/
|
@@ -149,5 +150,6 @@ specification_version: 3
|
|
149
150
|
summary: For altering data
|
150
151
|
test_files:
|
151
152
|
- spec/quandl/operation/collapse_spec.rb
|
153
|
+
- spec/quandl/operation/date_spec.rb
|
152
154
|
- spec/quandl/operation/transform_spec.rb
|
153
155
|
- spec/spec_helper.rb
|