vng 1.4.0 → 1.4.2

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
  SHA256:
3
- metadata.gz: 7d0e9b73d6daf01fecd5b989986337da1a29c1d95980d6f13fcb67f1a63b0511
4
- data.tar.gz: f08205f3dbb85321b59811724f7795e85896e89b5f6709c1570b5ec80aeec591
3
+ metadata.gz: '0781c7c52c5481bf8199382df9e8567571e04e101ebefe00d313827009967954'
4
+ data.tar.gz: 9379c31ceff7d05ead68cbcd844c04ef5b44f6543c16852dbf0412f417c46812
5
5
  SHA512:
6
- metadata.gz: d60605d76c893a885144b8f17fbd69078f88134ec3603dca89aedeca9821a09a9defaebf7698835676e641054e9f694d0801d4042178c26b1dbb7d2bf2f48882
7
- data.tar.gz: b3d5d51fe500345f85d449c6794d3e59ea8cbf4a8d5d54d77a1ff612ae76772acf96ab042d4837a2c586c3244103b244243c43740634eecbc4baa56e78f051f1
6
+ metadata.gz: aa6f6680041cd012ae6c6994c12e4b112ec6263cd3afad29efc64e5df40efa7c64a380ad745a7ec07150b02d7f62786f6ee3548df2ead54d5e9ce60f33024f53
7
+ data.tar.gz: 675eec6b8705c5516db5e8c140e5149f233a5114bf19d3639f4f5c3e129ce491b8e68ab80b2605adbed9d7a38806e1654bfa34a957ab817b1f3060c6efa96378
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  ## [Unreleased] -
2
2
 
3
+ ## [1.4.2] - 2024-12-03
4
+
5
+ - Fix MockRequest for no availability
6
+
7
+ ## [1.4.1] - 2024-11-22
8
+
9
+ - Return more routes and availabilities in MockRequest
10
+
3
11
  ## [1.4] - 2024-11-22
4
12
 
5
13
  - Change Availability#route_id from string to integer
data/README.md CHANGED
@@ -62,6 +62,14 @@ Vng.configure do |config|
62
62
  end
63
63
  ```
64
64
 
65
+ Mocking the Vonigo API
66
+ ======================
67
+
68
+ Sometimes you want to mock the API requests to Vonigo and obtain results that
69
+ are equivalent to the original API calls. This can be useful to test your flow
70
+ without hitting the API.
71
+
72
+
65
73
  Configuring with environment variables
66
74
  --------------------------------------
67
75
 
@@ -23,7 +23,7 @@ module Vng
23
23
  @query = options.fetch :query, {}
24
24
  end
25
25
 
26
- ROUTE_ID = 1630
26
+ AVAILABLE_ROUTE_ID = 1630
27
27
  @@logged_out = false
28
28
 
29
29
  # Sends the request and returns the body parsed from the JSON response.
@@ -65,10 +65,12 @@ module Vng
65
65
  { "Ids"=>{ "franchiseID"=>"172" } }
66
66
  elsif @body[:method] == '2'
67
67
  { "Ids"=>{ "lockID"=>"1406328" } }
68
+ elsif @body[:dateStart] == 2110060800 # 11/12/2036
69
+ { "Availability"=> [] }
68
70
  else
69
71
  { "Availability"=> [
70
- { "dayID"=>"20281119", "routeID"=>"#{ROUTE_ID}", "startTime"=>"1080" },
71
- { "dayID"=>"20281119", "routeID"=>"#{ROUTE_ID}", "startTime"=>"1110" },
72
+ { "dayID"=>"20281119", "routeID"=>"#{AVAILABLE_ROUTE_ID}", "startTime"=>"1080" },
73
+ { "dayID"=>"20281119", "routeID"=>"#{AVAILABLE_ROUTE_ID}", "startTime"=>"1110" },
72
74
  ] }
73
75
  end
74
76
  when '/api/v1/resources/breeds/'
@@ -113,8 +115,9 @@ module Vng
113
115
  end
114
116
  when '/api/v1/resources/Routes/'
115
117
  {"Routes" => [
116
- {"routeID" => ROUTE_ID, "routeName" => "Route 1", "isActive" => true},
117
- {"routeID" => 2, "routeName" => "Inactive", "isActive" => false},
118
+ {"routeID" => AVAILABLE_ROUTE_ID, "routeName" => "Route 1", "isActive" => true},
119
+ {"routeID" => 2, "routeName" => "Route 2", "isActive" => true},
120
+ {"routeID" => 3, "routeName" => "Route 3 (Inactive)", "isActive" => false},
118
121
  ]}
119
122
  when '/api/v1/data/WorkOrders/'
120
123
  { "WorkOrder"=>{ "objectID"=>"4138030" } }
data/lib/vng/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Vng
2
- VERSION = '1.4.0'
2
+ VERSION = '1.4.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vng
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - claudiob
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-11-22 00:00:00.000000000 Z
11
+ date: 2024-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simplecov
@@ -111,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
111
111
  - !ruby/object:Gem::Version
112
112
  version: '0'
113
113
  requirements: []
114
- rubygems_version: 3.5.16
114
+ rubygems_version: 3.5.23
115
115
  signing_key:
116
116
  specification_version: 4
117
117
  summary: A Ruby client for the Vonigo API.