increments-schedule 0.8.0 → 0.9.0

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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f13ed5fd026db1faec2d393c864ece53137b5a78
4
- data.tar.gz: 4ba62e8a04fcc48e5aea04a6a882d8250d92e1c2
3
+ metadata.gz: 553ac09e770c776c84b069f61c6ede408ac12b12
4
+ data.tar.gz: 1cac7a0f9ae21ce10545a60b33ce7c1d13300c4b
5
5
  SHA512:
6
- metadata.gz: 56e40597aef88f79d7dff1788d433f2e2e08c905aabc4b98b69d9c062050838201cab436a1881bde6fc13c7b66136993e341e79cfe759661581d3a8064584a34
7
- data.tar.gz: 91755ebd876d4a341815cd6e937314ed596e9759757ff4d6bd0ad525b57335a54d5310339dfb582f579a39f9e01bf0b97bed34d96f1f6526ab0fb679bd93779a
6
+ metadata.gz: 47d2ccd9b3db19c912f42c2e2d0e4887606d0857868acc29f74a237a77ceb0cafc9ef623007ec3c340ad3d4c6cd1b750d593546345dc0150dd78f3fdae332899
7
+ data.tar.gz: bcdc9e77961dd73e6200714660f38d1ad0ae48a2bce3c6b62e42de4efb95a630190698e2d4d9ddaa4078ca3ab2f1c8db40a80612644ab736c2cbf3ebf4ad3564
data/.rubocop.yml CHANGED
@@ -13,6 +13,12 @@ Style/EmptyElse:
13
13
  Style/GuardClause:
14
14
  Enabled: false
15
15
 
16
+ Style/IndentArray:
17
+ Enabled: false
18
+
19
+ Style/MutableConstant:
20
+ Enabled: false
21
+
16
22
  Style/RegexpLiteral:
17
23
  Exclude:
18
24
  - '*.gemspec'
data/.travis.yml CHANGED
@@ -1,5 +1,7 @@
1
1
  language: ruby
2
- rvm: 2.2
2
+ rvm:
3
+ - 2.2
4
+ - 2.3.0
3
5
  script: bundle exec rake ci
4
6
  sudo: false
5
7
  cache: bundler
data/README.md CHANGED
@@ -55,7 +55,6 @@ $ gem install increments-schedule
55
55
  * `Increments::Schedule.each_weekend(max_date = Date.today + 365)`
56
56
  * `Increments::Schedule.each_holiday(max_date = Date.today + 365)`
57
57
  * `Increments::Schedule.each_winter_vacation(max_date = Date.today + 365)`
58
- * `Increments::Schedule.each_work_time_range(max_date = Date.today + 365)`
59
58
 
60
59
  ## Development
61
60
 
data/Rakefile CHANGED
@@ -41,4 +41,7 @@ def generate_readme
41
41
  erb.result(binding)
42
42
  end
43
43
 
44
- task ci: %w(spec rubocop readme:validate)
44
+ ci_tasks = %w(spec rubocop)
45
+ # For some reason MRI 2.3 returns the method list with different order.
46
+ ci_tasks << 'readme:validate' if RUBY_VERSION.start_with?('2.2.')
47
+ task ci: ci_tasks
@@ -1,5 +1,5 @@
1
1
  module Increments
2
2
  module Schedule
3
- VERSION = '0.8.0'
3
+ VERSION = '0.9.0'
4
4
  end
5
5
  end
@@ -81,26 +81,10 @@ module Increments
81
81
  end
82
82
  end
83
83
 
84
- def each_work_time_range(max_date = nil)
85
- return to_enum(__method__, max_date) unless block_given?
86
-
87
- each_work_day(max_date) do |work_day|
88
- yield opening_time_of_date(work_day)..closing_time_of_date(work_day)
89
- end
90
- end
91
-
92
84
  private
93
85
 
94
86
  def normal_office_work_day?(date = Date.today)
95
- !rest_day?(date) && !normal_remote_work_day?(date)
96
- end
97
-
98
- def opening_time_of_date(date)
99
- date.to_time + 10 * 60 * 60
100
- end
101
-
102
- def closing_time_of_date(date)
103
- date.to_time + 19 * 60 * 60
87
+ work_day?(date) && !normal_remote_work_day?(date)
104
88
  end
105
89
 
106
90
  def find_date(date, direction)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: increments-schedule
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuji Nakayama
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-12-28 00:00:00.000000000 Z
11
+ date: 2016-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: holiday_japan