locomotive_wubook_plugin 1.0.4 → 1.0.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: e4dac8d7aed03f526e6f45b17bfa71232d4121b1
4
- data.tar.gz: beb278c5e7b754d4c3f46eb72a94671b675010a4
3
+ metadata.gz: dc281e102694d30f33ad072debe9f5006848f60d
4
+ data.tar.gz: 1f674f603b9f93b90af10c53ac29b3c6d0f53a56
5
5
  SHA512:
6
- metadata.gz: 4d157b21ccd2e649ad1663b81bd40c692c44f5ce0579c64737bc7378758e65a9c6e872ef12fe961e1a784cda2ddbb69e9d61ad6f705ccebc898934ccfba05ec2
7
- data.tar.gz: be214d84b9c0f07396f7bfdd1e9a87f8d7789fdc46dedac9c442547d08da396dc9795809294e10f8d410901559ea546a5d9d2ce7b685478040d317bab71b7387
6
+ metadata.gz: cecfe83d65f34c462c72a9b50a1c0ddccc76857148f28df1f7e32f1720bd8e952e2a03e5dd0c21ea9e7da7949e56d14817a6e16dfaec1e1879c922ff3a59e95a
7
+ data.tar.gz: b24a8e1adf09d397dbf1220d804ead6a522a2951f4a4cb9c4401d7a1b12982d5dd9b62debd759d856e7a8c4084d297327a5b38d559c8920c528ad4cd1689e0a9
@@ -43,21 +43,15 @@ module Locomotive
43
43
  last_day = @options[:date_end]
44
44
  ::Locomotive.log "**> CheckIntervalTag: Date Interval: #{start_day} - #{last_day}"
45
45
 
46
+ # Last day is the day of departure. It will not be marked/handled as booked
47
+ last_day -= 1
48
+ ::Locomotive.log "**> Effective end-day: #{last_day} "
49
+
46
50
  wired = Wired.new(config)
47
51
  wired.aquire_token
48
52
  room_data = request_room_data(wired, config['lcode'], @options[:room_ident], start_day, last_day)
49
53
  wired.release_token
50
54
 
51
- # Check whether first day is available. If this is _not_ the case we have to add one day (vacation == departure is allowed)
52
- is_first_available = room_data[0]['avail'] === 1
53
-
54
- # Check wheter the last day is not available. If this is _not_ the case we have to reduce one day (vacation == departure is allowed)
55
- is_last_available = room_data[last_day.mjd - start_day.mjd]['avail'] === 1
56
-
57
- # Remove the first or last day from the array.
58
- room_data.shift unless is_first_available # Remove first element
59
- room_data[0..-1] unless is_last_available # Remove last element
60
-
61
55
  # Now check the (modified) interval regarding availability
62
56
  is_available = true
63
57
  room_data.each do |data|
@@ -43,6 +43,10 @@ module Locomotive
43
43
  last_day = @options[:date_end]
44
44
  ::Locomotive.log "**> SetAsBookedTag: Date Interval: #{start_day} - #{last_day}"
45
45
 
46
+ # Last day is the day of departure. It will not be marked as booked
47
+ last_day -= 1
48
+ ::Locomotive.log "**> Effective end-day: #{last_day} "
49
+
46
50
  wired = Wired.new(config)
47
51
  wired.aquire_token
48
52
  room_id = fetch_room_id(wired, config['lcode'], @options[:room_ident])
@@ -1,6 +1,6 @@
1
1
 
2
2
  module Locomotive
3
3
  module WuBook
4
- VERSION = '1.0.4'
4
+ VERSION = '1.0.5'
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: locomotive_wubook_plugin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Eilers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-10 00:00:00.000000000 Z
11
+ date: 2015-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: locomotive_plugins