business_date_calculator 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e542cbd6069fa1423aea911ff424413a90d3a3df
4
- data.tar.gz: 1dad0a2475c603db0f8e127ece8d329b80824c71
3
+ metadata.gz: 76736416593db5462eed799dc6f31ef5522b7f30
4
+ data.tar.gz: 20a36007d246e1b449e66e456b3a0242dcdfddcb
5
5
  SHA512:
6
- metadata.gz: e525f6d2669c84308734da0ce7c3ae67d75401fb181a1a4f48757a96319593b0e8551e31c22ec7ad0bedcdae060f63cf4c1787604a6bfdc8bc274370963bf89d
7
- data.tar.gz: 8e5331844329f0bba7396da1e5b0c46cbe327a41ed73ff6bd9c0e9fda02f65ee96953f5219751d296f2009391fc592cdf1241cb3d5266c8bc41f4bcc2b4c4a57
6
+ metadata.gz: af830900695fbaa8c0f27b15062cd49c0199e993ddae8c1a08faef4cfc6851c18e3e0d36c70ed8c3a141cdee3a1ba76e905ae17fc18b7db9dfc2ea23e9ad1be0
7
+ data.tar.gz: ebd51df76d57938987f1cea71d415dbac1e71929e9fd7c944b951b388444b6a68fa0b3d4be6778c3fed3a1e01dfd594f544d299138a0b7215082900e2da2c9f0
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
1
  source 'https://rubygems.org'
2
- # ruby '2.2.5'
2
+ ruby '2.4.0'
3
3
  # Specify your gem's dependencies in business_date_calculator.gemspec
4
4
  gemspec
@@ -42,12 +42,13 @@ module BusinessDateCalculator
42
42
  end
43
43
  end
44
44
 
45
- def advance(date, n, convention = :following)
45
+ def advance(date, n, convention = :following, margin = 30)
46
46
  date = date.to_date
47
47
  range_check(date)
48
48
  index = adjusted_date_index(date, convention) + n
49
49
  if index < 0
50
- build(date + (index - 3).days, @end_date, @holidays)
50
+ build(date + (index - margin).days, @end_date, @holidays)
51
+ return advance(date, n, convention, margin + 30)
51
52
  end
52
53
  @business_dates[adjusted_date_index(date, convention) + n]
53
54
  end
@@ -1,3 +1,3 @@
1
1
  module BusinessDateCalculator
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: business_date_calculator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lucas Pérez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-26 00:00:00.000000000 Z
11
+ date: 2018-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -120,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
120
  version: '0'
121
121
  requirements: []
122
122
  rubyforge_project:
123
- rubygems_version: 2.4.8
123
+ rubygems_version: 2.6.8
124
124
  signing_key:
125
125
  specification_version: 4
126
126
  summary: A Ruby Library for dealing with business calendar.