span 0.1.1 → 0.1.2

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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NjBiMWY4MTg4MzlhN2RlZWUxNGM1YmVmOGZiM2MzNjlkMjllZDI4MQ==
4
+ MmE4YjNiMzIxMTk3MzY0ZjY0YTIxMDM4MDQ4Yjk0NDFkMWRlZTMyOQ==
5
5
  data.tar.gz: !binary |-
6
- MTNjYTUwZmI3MGU5ZWQ5MDgzMDFkMmQ4MGVkMTAzYmNiYmEyMWU5NA==
6
+ Y2I0ZjM5YjBjODA2YjUxZjgwY2Y1NmJjNGExYzU0ZGI0ZDljNDAzNQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- YzY2NWQxZGQxNWEzODcxYzRiMzAwODY4Mzk4ZjU3MzMyOTI3YzQxNTY2MTVi
10
- OGRlZTFiZjdhNDMxYzQ1NDY0MjIzMmM0MWMyMTFmZGJjYTg0NmQ4MmFhNDhm
11
- NDc3MTE3ZGRiOWVhODU3NWY5ZTI1NzViOTA4ZTA4M2VlODExYjE=
9
+ ZTg1OTQ1MmVkNGFiN2IwMjViNGY3MzkzNmEwZDA1NTFhNDg2MDNlOGQ4MzNi
10
+ NTIyZjM3YzBiZWFlZjgzYjZkYWQ3OTcyZGE3ZmJlNzgzZjgwNGY3MjEwM2Rm
11
+ MTlmMDI5NDUyOGE5YjE1ZGQ5ZmJkNWU0OGY0ZWY0NWM0NzJmNmM=
12
12
  data.tar.gz: !binary |-
13
- NDk4Y2UzYjA2N2QwNzVkZDNkMjZjM2U2ZTEyYTA0NDFhZjhlMjBmYzZmM2Mz
14
- YjRmYWRhMWJmMjBkOTRlNWE1OWRkOWI4YzAyODJiMzQ0MzdlZWU1ZjQ3NWJk
15
- ZjFmNDk2NDdlMTNiOGQ5OTFjNjY3NTgzMWM3Mzk5NGU1MGZiNWU=
13
+ YWM1ZWQ5Y2I1M2RlM2I1YmRkYzY1YWQ2YTg0NGY4YTZhOWQzY2Y1MDczZjQ4
14
+ NGRhYTViYTNkYjE4ODcwNGFiOTRlNmFlZTQ4ZTFkZmRjYTZhNjQ4ZWJhMWUz
15
+ OWZlODVhYzI3YTc3OWU1N2ZlNzg3ZDBhMTMzNDlkYTI1MmE4NzE=
@@ -0,0 +1,4 @@
1
+ ---
2
+ language: ruby
3
+ rvm:
4
+ - 1.9.3
@@ -1,10 +1,14 @@
1
1
  # CHANGELOG
2
2
 
3
- ## v0.1.1
3
+ ## v0.1.2 February 2, 2014
4
+
5
+ * Bugfix -- off by one day error due to calculation of `weeks` diff
6
+
7
+ ## v0.1.1 January 15, 2014
4
8
 
5
9
  * Bugfix -- remove argument order dependence requirement when calling
6
10
  `Span::compute`
7
11
 
8
- ## v0.1.0
12
+ ## v0.1.0 January 13, 2014
9
13
 
10
14
  * Initial Release
data/Gemfile CHANGED
@@ -2,3 +2,6 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in span.gemspec
4
4
  gemspec
5
+
6
+ gem 'coveralls' , :require => false
7
+ gem 'pry' , :require => false
data/README.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Span
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/span.png)](http://badge.fury.io/rb/span)
4
+ [![Build Status](https://travis-ci.org/cookrn/span.png?branch=master)](https://travis-ci.org/cookrn/span)
5
+ [![Code Climate](https://codeclimate.com/github/cookrn/span.png)](https://codeclimate.com/github/cookrn/span)
6
+ [![Coverage Status](https://coveralls.io/repos/cookrn/span/badge.png)](https://coveralls.io/r/cookrn/span)
7
+
3
8
  Calculate the differences between two dates. A few notes:
4
9
 
5
10
  * It is calendar-correct, meaning that it respects non-30-day months
@@ -102,7 +102,6 @@ module Span
102
102
  num_of_part = 0
103
103
  part_singular = :week
104
104
  part_next_method = :next_day
105
- check_from = check_from.prev_day
106
105
 
107
106
  loop do
108
107
  check = check_from.send part_next_method
@@ -1,3 +1,3 @@
1
1
  module Span
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
@@ -8,8 +8,8 @@ describe Span do
8
8
  {
9
9
  :year => 1,
10
10
  :month => 11,
11
- :week => 1,
12
- :day => 0
11
+ :week => 0,
12
+ :day => 6
13
13
  }
14
14
  ],
15
15
  [
@@ -19,7 +19,7 @@ describe Span do
19
19
  :year => 0,
20
20
  :month => 10,
21
21
  :week => 2,
22
- :day => 2
22
+ :day => 1
23
23
  }
24
24
  ],
25
25
  [
@@ -28,8 +28,8 @@ describe Span do
28
28
  {
29
29
  :year => 0,
30
30
  :month => 10,
31
- :week => 2,
32
- :day => 0
31
+ :week => 1,
32
+ :day => 6
33
33
  }
34
34
  ],
35
35
  [
@@ -38,12 +38,12 @@ describe Span do
38
38
  {
39
39
  :year => 0,
40
40
  :month => 7,
41
- :week => 4,
42
- :day => 0
41
+ :week => 3,
42
+ :day => 6
43
43
  }
44
44
  ],
45
45
  [
46
- '25/03/2013', # March 25th
46
+ '26/03/2013', # March 25th
47
47
  '01/01/2012', # January 1st
48
48
  {
49
49
  :year => 1,
@@ -59,11 +59,21 @@ describe Span do
59
59
  :year => 50,
60
60
  :month => 11,
61
61
  :week => 2,
62
- :day => 5
62
+ :day => 4
63
+ }
64
+ ],
65
+ [
66
+ '27/01/1963', # January 27th
67
+ '27/02/1963', # February 27th
68
+ {
69
+ :year => 0,
70
+ :month => 1,
71
+ :week => 0,
72
+ :day => 0
63
73
  }
64
74
  ]
65
75
  ].each do | example |
66
- it "expected returns #{ example[ 1 ] }" do
76
+ it "diff #{ example[ 0 ] } #{ example[ 1 ] }" do
67
77
  check_date = Date.parse example[ 0 ]
68
78
  birth_date = Date.parse example[ 1 ]
69
79
  expected = example[ 2 ]
@@ -1,3 +1,6 @@
1
+ require 'coveralls'
2
+ Coveralls.wear!
3
+
1
4
  require 'rubygems'
2
5
  gem 'minitest'
3
6
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: span
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Cook
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-15 00:00:00.000000000 Z
11
+ date: 2014-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -60,6 +60,7 @@ extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
62
  - .gitignore
63
+ - .travis.yml
63
64
  - CHANGELOG.md
64
65
  - Gemfile
65
66
  - LICENSE.txt