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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc281e102694d30f33ad072debe9f5006848f60d
|
4
|
+
data.tar.gz: 1f674f603b9f93b90af10c53ac29b3c6d0f53a56
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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])
|
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
|
+
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-
|
11
|
+
date: 2015-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: locomotive_plugins
|