period_dates 0.0.2 → 0.0.3
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.
- checksums.yaml +4 -4
- data/lib/period_dates/core_ext.rb +1 -1
- data/lib/period_dates/version.rb +1 -1
- data/test/core_ext_test.rb +6 -0
- data/test/dummy/log/test.log +100 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 29c59d7d9ff79f03fe498e427d758b90a8247913
|
4
|
+
data.tar.gz: 3e02c2873c0297fbd74c894b737c4d9c4513ce51
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ae7c57317f8b2f632f02661d916f91f9fe13524e0e4a8892539521055ec79a9311ae37d7fa4d6fa81c303143c67e032ebdbe6e51ca6ab8220cc1b05e4dfeb56
|
7
|
+
data.tar.gz: 7d0e043229d67f4131f6ab7192a8b3e4358e5c3d6379e76fe0572038c22e992cdf9b354ac06ed36ca8858a9f800e8224f2900c831512befc866c1691b5c11cbe
|
@@ -84,7 +84,7 @@ module Calculations
|
|
84
84
|
end
|
85
85
|
|
86
86
|
def offset_period_dates(offset=0,period='monthly')
|
87
|
-
bound_dates = self.current_period_dates
|
87
|
+
bound_dates = self.current_period_dates(period)
|
88
88
|
|
89
89
|
if !available_periods.include?(period)
|
90
90
|
raise PeriodDatesIncorrectPeriod, "Period must be one of this: #{available_periods.join(', ')}."
|
data/lib/period_dates/version.rb
CHANGED
data/test/core_ext_test.rb
CHANGED
@@ -35,6 +35,12 @@ class CoreExtTest < ActiveSupport::TestCase
|
|
35
35
|
dates = date.prev_period_dates('biannually')
|
36
36
|
assert_equal dates[0], date_from
|
37
37
|
assert_equal dates[1], date_to
|
38
|
+
|
39
|
+
date_from = DateTime.new(2015,1,1)
|
40
|
+
date_to = DateTime.new(2015,6,1).at_end_of_month
|
41
|
+
dates = date.offset_period_dates(0,'biannually')
|
42
|
+
assert_equal dates[0], date_from
|
43
|
+
assert_equal dates[1], date_to
|
38
44
|
end
|
39
45
|
|
40
46
|
def test_date_time_last_period_dates_4
|
data/test/dummy/log/test.log
CHANGED
@@ -1808,3 +1808,103 @@ CoreExtTest: test_date_time_offset_period_dates_3
|
|
1808
1808
|
PeriodDatesTest: test_truth
|
1809
1809
|
---------------------------
|
1810
1810
|
[1m[35m (0.1ms)[0m rollback transaction
|
1811
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1812
|
+
------------------------------------------------
|
1813
|
+
CoreExtTest: test_date_time_current_period_dates
|
1814
|
+
------------------------------------------------
|
1815
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1816
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1817
|
+
---------------------------------------------
|
1818
|
+
CoreExtTest: test_date_time_last_period_dates
|
1819
|
+
---------------------------------------------
|
1820
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1821
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1822
|
+
-----------------------------------------------
|
1823
|
+
CoreExtTest: test_date_time_last_period_dates_2
|
1824
|
+
-----------------------------------------------
|
1825
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1826
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1827
|
+
-----------------------------------------------
|
1828
|
+
CoreExtTest: test_date_time_last_period_dates_3
|
1829
|
+
-----------------------------------------------
|
1830
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
1831
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1832
|
+
-----------------------------------------------
|
1833
|
+
CoreExtTest: test_date_time_last_period_dates_4
|
1834
|
+
-----------------------------------------------
|
1835
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1836
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1837
|
+
---------------------------------------------
|
1838
|
+
CoreExtTest: test_date_time_next_period_dates
|
1839
|
+
---------------------------------------------
|
1840
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1841
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1842
|
+
-----------------------------------------------
|
1843
|
+
CoreExtTest: test_date_time_offset_period_dates
|
1844
|
+
-----------------------------------------------
|
1845
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1846
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1847
|
+
-------------------------------------------------
|
1848
|
+
CoreExtTest: test_date_time_offset_period_dates_2
|
1849
|
+
-------------------------------------------------
|
1850
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1851
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1852
|
+
-------------------------------------------------
|
1853
|
+
CoreExtTest: test_date_time_offset_period_dates_3
|
1854
|
+
-------------------------------------------------
|
1855
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1856
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1857
|
+
---------------------------
|
1858
|
+
PeriodDatesTest: test_truth
|
1859
|
+
---------------------------
|
1860
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1861
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1862
|
+
---------------------------
|
1863
|
+
PeriodDatesTest: test_truth
|
1864
|
+
---------------------------
|
1865
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1866
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1867
|
+
------------------------------------------------
|
1868
|
+
CoreExtTest: test_date_time_current_period_dates
|
1869
|
+
------------------------------------------------
|
1870
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1871
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1872
|
+
---------------------------------------------
|
1873
|
+
CoreExtTest: test_date_time_last_period_dates
|
1874
|
+
---------------------------------------------
|
1875
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1876
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1877
|
+
-----------------------------------------------
|
1878
|
+
CoreExtTest: test_date_time_last_period_dates_2
|
1879
|
+
-----------------------------------------------
|
1880
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1881
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1882
|
+
-----------------------------------------------
|
1883
|
+
CoreExtTest: test_date_time_last_period_dates_3
|
1884
|
+
-----------------------------------------------
|
1885
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1886
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1887
|
+
-----------------------------------------------
|
1888
|
+
CoreExtTest: test_date_time_last_period_dates_4
|
1889
|
+
-----------------------------------------------
|
1890
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1891
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1892
|
+
---------------------------------------------
|
1893
|
+
CoreExtTest: test_date_time_next_period_dates
|
1894
|
+
---------------------------------------------
|
1895
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1896
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1897
|
+
-----------------------------------------------
|
1898
|
+
CoreExtTest: test_date_time_offset_period_dates
|
1899
|
+
-----------------------------------------------
|
1900
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1901
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1902
|
+
-------------------------------------------------
|
1903
|
+
CoreExtTest: test_date_time_offset_period_dates_2
|
1904
|
+
-------------------------------------------------
|
1905
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1906
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1907
|
+
-------------------------------------------------
|
1908
|
+
CoreExtTest: test_date_time_offset_period_dates_3
|
1909
|
+
-------------------------------------------------
|
1910
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: period_dates
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Javi Fernández
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: semester
|