VIAJERO 0.1.73
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 +7 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +91 -0
- data/LICENSE +21 -0
- data/README.md +24 -0
- data/Rakefile +40 -0
- data/VIAJERO.gemspec +30 -0
- data/apiformat.txt +37 -0
- data/bin/flight +25 -0
- data/bin/googleplace +19 -0
- data/bin/rent +20 -0
- data/bin/traffic +22 -0
- data/config/credentials.yml +4 -0
- data/coverage/.last_run.json +5 -0
- data/coverage/.resultset.json +362 -0
- data/coverage/.resultset.json.lock +0 -0
- data/coverage/assets/0.10.0/application.css +799 -0
- data/coverage/assets/0.10.0/application.js +1707 -0
- data/coverage/assets/0.10.0/colorbox/border.png +0 -0
- data/coverage/assets/0.10.0/colorbox/controls.png +0 -0
- data/coverage/assets/0.10.0/colorbox/loading.gif +0 -0
- data/coverage/assets/0.10.0/colorbox/loading_background.png +0 -0
- data/coverage/assets/0.10.0/favicon_green.png +0 -0
- data/coverage/assets/0.10.0/favicon_red.png +0 -0
- data/coverage/assets/0.10.0/favicon_yellow.png +0 -0
- data/coverage/assets/0.10.0/loading.gif +0 -0
- data/coverage/assets/0.10.0/magnify.png +0 -0
- data/coverage/assets/0.10.0/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/coverage/assets/0.10.0/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/coverage/assets/0.10.0/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/coverage/assets/0.10.0/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/coverage/assets/0.10.0/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/coverage/assets/0.10.0/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/coverage/assets/0.10.0/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/coverage/assets/0.10.0/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/coverage/assets/0.10.0/smoothness/images/ui-icons_222222_256x240.png +0 -0
- data/coverage/assets/0.10.0/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- data/coverage/assets/0.10.0/smoothness/images/ui-icons_454545_256x240.png +0 -0
- data/coverage/assets/0.10.0/smoothness/images/ui-icons_888888_256x240.png +0 -0
- data/coverage/assets/0.10.0/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/coverage/index.html +2362 -0
- data/lib/VIAJERO.rb +2 -0
- data/lib/VIAJERO/airbnb_api.rb +31 -0
- data/lib/VIAJERO/flightInfo.rb +59 -0
- data/lib/VIAJERO/google_api.rb +37 -0
- data/lib/VIAJERO/google_api_inter.rb +37 -0
- data/lib/VIAJERO/internal.rb +43 -0
- data/lib/VIAJERO/rentInfo.rb +42 -0
- data/lib/VIAJERO/skyscanner_api.rb +28 -0
- data/lib/VIAJERO/trafficinfo.rb +53 -0
- data/lib/VIAJERO/version.rb +3 -0
- data/spec/.load_spec.rb.swp +0 -0
- data/spec/airbnbapi_spec.rb +25 -0
- data/spec/fixtures/cassettes/google_distances.yml +1087 -0
- data/spec/fixtures/cassettes/skyscanner_flights.yml +64 -0
- data/spec/googledistanceapi_spec.rb +39 -0
- data/spec/skyscanner_spec.rb +26 -0
- data/spec/spec_helper.rb +34 -0
- metadata +255 -0
@@ -0,0 +1,64 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://partners.api.skyscanner.net/apiservices/browseroutes/v1.0/TW/TWD/en-GB/TW/UK/anytime?apiKey=<SKYSCANNER_ID>
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Connection:
|
11
|
+
- close
|
12
|
+
Host:
|
13
|
+
- partners.api.skyscanner.net
|
14
|
+
User-Agent:
|
15
|
+
- http.rb/2.1.0
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Vary:
|
22
|
+
- Accept
|
23
|
+
Cache-Control:
|
24
|
+
- public,max-age=3600
|
25
|
+
Content-Type:
|
26
|
+
- application/json
|
27
|
+
Date:
|
28
|
+
- Sun, 18 Dec 2016 09:33:45 GMT
|
29
|
+
Connection:
|
30
|
+
- close
|
31
|
+
Content-Length:
|
32
|
+
- '10283'
|
33
|
+
body:
|
34
|
+
encoding: ASCII-8BIT
|
35
|
+
string: '{"Routes":[{"OriginId":1767,"DestinationId":40074,"QuoteIds":[1],"Price":54504.0,"QuoteDateTime":"2016-12-13T13:27:47"},{"OriginId":1767,"DestinationId":42644,"QuoteIds":[2],"Price":17103.0,"QuoteDateTime":"2016-12-13T17:17:38"},{"OriginId":1767,"DestinationId":42664,"QuoteIds":[3],"Price":13163.0,"QuoteDateTime":"2016-12-14T02:23:01"},{"OriginId":1767,"DestinationId":43139,"QuoteIds":[4],"Price":21250.0,"QuoteDateTime":"2016-12-16T18:56:16"},{"OriginId":1767,"DestinationId":45676,"QuoteIds":[5],"Price":24550.0,"QuoteDateTime":"2016-12-08T12:39:39"},{"OriginId":1767,"DestinationId":49369},{"OriginId":1767,"DestinationId":54353,"QuoteIds":[6],"Price":18371.0,"QuoteDateTime":"2016-12-15T23:15:02"},{"OriginId":1767,"DestinationId":57113},{"OriginId":1767,"DestinationId":59078},{"OriginId":1767,"DestinationId":65393},{"OriginId":1767,"DestinationId":65465,"QuoteIds":[7],"Price":14513.0,"QuoteDateTime":"2016-12-06T05:28:26"},{"OriginId":1767,"DestinationId":65655,"QuoteIds":[8],"Price":17409.0,"QuoteDateTime":"2016-12-08T05:07:15"},{"OriginId":1767,"DestinationId":65698,"QuoteIds":[9],"Price":10485.0,"QuoteDateTime":"2016-12-18T01:56:05"},{"OriginId":1767,"DestinationId":67662,"QuoteIds":[10],"Price":12880.0,"QuoteDateTime":"2016-12-08T08:21:49"},{"OriginId":1767,"DestinationId":68229},{"OriginId":1767,"DestinationId":70060,"QuoteIds":[11],"Price":23040.0,"QuoteDateTime":"2016-12-08T15:20:39"},{"OriginId":1767,"DestinationId":71017,"QuoteIds":[12],"Price":24751.0,"QuoteDateTime":"2016-12-08T12:38:37"},{"OriginId":1767,"DestinationId":82165,"QuoteIds":[13],"Price":26387.0,"QuoteDateTime":"2016-12-11T16:24:35"},{"OriginId":1767,"DestinationId":49793,"QuoteIds":[14],"Price":30611.0,"QuoteDateTime":"2016-12-06T09:38:54"},{"OriginId":1767,"DestinationId":82398,"QuoteIds":[15],"Price":27390.0,"QuoteDateTime":"2016-12-08T15:00:24"},{"OriginId":1767,"DestinationId":66076,"QuoteIds":[16],"Price":61090.0,"QuoteDateTime":"2016-12-13T20:12:29"},{"OriginId":1767,"DestinationId":47540,"QuoteIds":[17],"Price":29687.0,"QuoteDateTime":"2016-12-07T12:54:55"},{"OriginId":1767,"DestinationId":50340,"QuoteIds":[18],"Price":26299.0,"QuoteDateTime":"2016-12-12T05:26:47"}],"Quotes":[{"QuoteId":1,"MinPrice":54504.0,"Direct":false,"OutboundLeg":{"CarrierIds":[1324],"OriginId":84501,"DestinationId":40074,"DepartureDate":"2017-01-17T00:00:00"},"QuoteDateTime":"2016-12-13T13:27:47"},{"QuoteId":2,"MinPrice":17103.0,"Direct":false,"OutboundLeg":{"CarrierIds":[],"OriginId":84501,"DestinationId":42644,"DepartureDate":"2017-02-17T00:00:00"},"QuoteDateTime":"2016-12-13T17:17:38"},{"QuoteId":3,"MinPrice":13163.0,"Direct":false,"OutboundLeg":{"CarrierIds":[],"OriginId":84501,"DestinationId":42664,"DepartureDate":"2016-12-28T00:00:00"},"QuoteDateTime":"2016-12-14T02:23:01"},{"QuoteId":4,"MinPrice":21250.0,"Direct":false,"OutboundLeg":{"CarrierIds":[],"OriginId":84501,"DestinationId":43139,"DepartureDate":"2017-09-04T00:00:00"},"QuoteDateTime":"2016-12-16T18:56:16"},{"QuoteId":5,"MinPrice":24550.0,"Direct":false,"OutboundLeg":{"CarrierIds":[],"OriginId":84501,"DestinationId":45676,"DepartureDate":"2017-01-09T00:00:00"},"QuoteDateTime":"2016-12-08T12:39:39"},{"QuoteId":6,"MinPrice":18371.0,"Direct":false,"OutboundLeg":{"CarrierIds":[],"OriginId":84501,"DestinationId":54353,"DepartureDate":"2017-02-23T00:00:00"},"QuoteDateTime":"2016-12-15T23:15:02"},{"QuoteId":7,"MinPrice":14513.0,"Direct":false,"OutboundLeg":{"CarrierIds":[],"OriginId":84501,"DestinationId":65465,"DepartureDate":"2017-04-16T00:00:00"},"QuoteDateTime":"2016-12-06T05:28:26"},{"QuoteId":8,"MinPrice":17409.0,"Direct":false,"OutboundLeg":{"CarrierIds":[1755],"OriginId":84501,"DestinationId":65655,"DepartureDate":"2017-11-23T00:00:00"},"QuoteDateTime":"2016-12-08T05:07:15"},{"QuoteId":9,"MinPrice":10485.0,"Direct":false,"OutboundLeg":{"CarrierIds":[1429],"OriginId":84501,"DestinationId":65698,"DepartureDate":"2017-02-22T00:00:00"},"QuoteDateTime":"2016-12-18T01:56:05"},{"QuoteId":10,"MinPrice":12880.0,"Direct":false,"OutboundLeg":{"CarrierIds":[],"OriginId":84501,"DestinationId":67662,"DepartureDate":"2017-03-13T00:00:00"},"QuoteDateTime":"2016-12-08T08:21:49"},{"QuoteId":11,"MinPrice":23040.0,"Direct":false,"OutboundLeg":{"CarrierIds":[954],"OriginId":84501,"DestinationId":70060,"DepartureDate":"2017-01-31T00:00:00"},"QuoteDateTime":"2016-12-08T15:20:39"},{"QuoteId":12,"MinPrice":24751.0,"Direct":false,"OutboundLeg":{"CarrierIds":[],"OriginId":84501,"DestinationId":71017,"DepartureDate":"2017-01-11T00:00:00"},"QuoteDateTime":"2016-12-08T12:38:37"},{"QuoteId":13,"MinPrice":26387.0,"Direct":false,"OutboundLeg":{"CarrierIds":[],"OriginId":84501,"DestinationId":82165,"DepartureDate":"2017-09-21T00:00:00"},"QuoteDateTime":"2016-12-11T16:24:35"},{"QuoteId":14,"MinPrice":30611.0,"Direct":false,"OutboundLeg":{"CarrierIds":[],"OriginId":84501,"DestinationId":49793,"DepartureDate":"2017-01-13T00:00:00"},"QuoteDateTime":"2016-12-06T09:38:54"},{"QuoteId":15,"MinPrice":27390.0,"Direct":false,"OutboundLeg":{"CarrierIds":[],"OriginId":63384,"DestinationId":82398,"DepartureDate":"2017-01-24T00:00:00"},"QuoteDateTime":"2016-12-08T15:00:24"},{"QuoteId":16,"MinPrice":61090.0,"Direct":false,"OutboundLeg":{"CarrierIds":[],"OriginId":84501,"DestinationId":66076,"DepartureDate":"2017-01-23T00:00:00"},"QuoteDateTime":"2016-12-13T20:12:29"},{"QuoteId":17,"MinPrice":29687.0,"Direct":false,"OutboundLeg":{"CarrierIds":[],"OriginId":84501,"DestinationId":47540,"DepartureDate":"2017-02-01T00:00:00"},"QuoteDateTime":"2016-12-07T12:54:55"},{"QuoteId":18,"MinPrice":26299.0,"Direct":false,"OutboundLeg":{"CarrierIds":[],"OriginId":84501,"DestinationId":50340,"DepartureDate":"2017-05-20T00:00:00"},"QuoteDateTime":"2016-12-12T05:26:47"}],"Places":[{"PlaceId":1767,"Name":"Taiwan","Type":"Country","SkyscannerCode":"TW"},{"PlaceId":40074,"IataCode":"ABZ","Name":"Aberdeen","Type":"Station","SkyscannerCode":"ABZ","CityName":"Aberdeen","CityId":"ABER","CountryName":"United
|
36
|
+
Kingdom"},{"PlaceId":42644,"IataCode":"BHD","Name":"Belfast City","Type":"Station","SkyscannerCode":"BHD","CityName":"Belfast","CityId":"BELF","CountryName":"United
|
37
|
+
Kingdom"},{"PlaceId":42664,"IataCode":"BHX","Name":"Birmingham","Type":"Station","SkyscannerCode":"BHX","CityName":"Birmingham","CityId":"BIRM","CountryName":"United
|
38
|
+
Kingdom"},{"PlaceId":43139,"IataCode":"BRS","Name":"Bristol","Type":"Station","SkyscannerCode":"BRS","CityName":"Bristol","CityId":"BRIS","CountryName":"United
|
39
|
+
Kingdom"},{"PlaceId":45676,"IataCode":"CWL","Name":"Cardiff","Type":"Station","SkyscannerCode":"CWL","CityName":"Cardiff","CityId":"CARD","CountryName":"United
|
40
|
+
Kingdom"},{"PlaceId":47540,"IataCode":"DND","Name":"Dundee","Type":"Station","SkyscannerCode":"DND","CityName":"Dundee","CityId":"DUND","CountryName":"United
|
41
|
+
Kingdom"},{"PlaceId":49369,"IataCode":"EDI","Name":"Edinburgh","Type":"Station","SkyscannerCode":"EDI","CityName":"Edinburgh","CityId":"EDIN","CountryName":"United
|
42
|
+
Kingdom"},{"PlaceId":49793,"IataCode":"EMA","Name":"East Midlands","Type":"Station","SkyscannerCode":"EMA","CityName":"Nottingham","CityId":"NOTT","CountryName":"United
|
43
|
+
Kingdom"},{"PlaceId":50340,"IataCode":"EXT","Name":"Exeter","Type":"Station","SkyscannerCode":"EXT","CityName":"Exeter","CityId":"EXET","CountryName":"United
|
44
|
+
Kingdom"},{"PlaceId":54353,"IataCode":"GLA","Name":"Glasgow International","Type":"Station","SkyscannerCode":"GLA","CityName":"Glasgow","CityId":"GLAS","CountryName":"United
|
45
|
+
Kingdom"},{"PlaceId":57113,"IataCode":"HUY","Name":"Humberside","Type":"Station","SkyscannerCode":"HUY","CityName":"Humberside","CityId":"HUMB","CountryName":"United
|
46
|
+
Kingdom"},{"PlaceId":59078,"IataCode":"INV","Name":"Inverness","Type":"Station","SkyscannerCode":"INV","CityName":"Inverness","CityId":"INVE","CountryName":"United
|
47
|
+
Kingdom"},{"PlaceId":63384,"IataCode":"KHH","Name":"Kaohsiung","Type":"Station","SkyscannerCode":"KHH","CityName":"Kaohsiung","CityId":"KHHT","CountryName":"Taiwan"},{"PlaceId":65393,"IataCode":"LBA","Name":"Leeds
|
48
|
+
Bradford","Type":"Station","SkyscannerCode":"LBA","CityName":"Leeds","CityId":"LEED","CountryName":"United
|
49
|
+
Kingdom"},{"PlaceId":65465,"IataCode":"LCY","Name":"London City","Type":"Station","SkyscannerCode":"LCY","CityName":"London","CityId":"LOND","CountryName":"United
|
50
|
+
Kingdom"},{"PlaceId":65655,"IataCode":"LGW","Name":"London Gatwick","Type":"Station","SkyscannerCode":"LGW","CityName":"London","CityId":"LOND","CountryName":"United
|
51
|
+
Kingdom"},{"PlaceId":65698,"IataCode":"LHR","Name":"London Heathrow","Type":"Station","SkyscannerCode":"LHR","CityName":"London","CityId":"LOND","CountryName":"United
|
52
|
+
Kingdom"},{"PlaceId":66076,"IataCode":"LPL","Name":"Liverpool","Type":"Station","SkyscannerCode":"LPL","CityName":"Liverpool","CityId":"LIVE","CountryName":"United
|
53
|
+
Kingdom"},{"PlaceId":67662,"IataCode":"MAN","Name":"Manchester","Type":"Station","SkyscannerCode":"MAN","CityName":"Manchester","CityId":"MANC","CountryName":"United
|
54
|
+
Kingdom"},{"PlaceId":68229,"IataCode":"MME","Name":"Durham Tees Valley","Type":"Station","SkyscannerCode":"MME","CityName":"Durham","CityId":"MMEA","CountryName":"United
|
55
|
+
Kingdom"},{"PlaceId":70060,"IataCode":"NCL","Name":"Newcastle","Type":"Station","SkyscannerCode":"NCL","CityName":"Newcastle","CityId":"NEWC","CountryName":"United
|
56
|
+
Kingdom"},{"PlaceId":71017,"IataCode":"NWI","Name":"Norwich","Type":"Station","SkyscannerCode":"NWI","CityName":"Norwich","CityId":"NORW","CountryName":"United
|
57
|
+
Kingdom"},{"PlaceId":82165,"IataCode":"SOU","Name":"Southampton","Type":"Station","SkyscannerCode":"SOU","CityName":"Southampton","CityId":"SOUT","CountryName":"United
|
58
|
+
Kingdom"},{"PlaceId":82398,"IataCode":"STN","Name":"London Stansted","Type":"Station","SkyscannerCode":"STN","CityName":"London","CityId":"LOND","CountryName":"United
|
59
|
+
Kingdom"},{"PlaceId":84501,"IataCode":"TPE","Name":"Taipei Taiwan Taoyuan","Type":"Station","SkyscannerCode":"TPE","CityName":"Taipei","CityId":"TPET","CountryName":"Taiwan"}],"Carriers":[{"CarrierId":954,"Name":"China
|
60
|
+
Southern"},{"CarrierId":1324,"Name":"KLM"},{"CarrierId":1429,"Name":"China
|
61
|
+
Eastern"},{"CarrierId":1755,"Name":"Turkish Airlines"}],"Currencies":[{"Code":"TWD","Symbol":"NT$","ThousandsSeparator":",","DecimalSeparator":".","SymbolOnLeft":true,"SpaceBetweenAmountAndSymbol":false,"RoundingCoefficient":0,"DecimalDigits":2}]}'
|
62
|
+
http_version:
|
63
|
+
recorded_at: Sun, 18 Dec 2016 09:33:46 GMT
|
64
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require_relative 'spec_helper.rb'
|
2
|
+
|
3
|
+
describe 'Load specifications' do
|
4
|
+
VCR.configure do |c|
|
5
|
+
c.cassette_library_dir = CASSETTES_FOLDER
|
6
|
+
c.hook_into :webmock
|
7
|
+
|
8
|
+
c.filter_sensitive_data('<GOOGLEMAP_ID>') {ENV['GOOGLE_API'] }
|
9
|
+
end
|
10
|
+
|
11
|
+
before do
|
12
|
+
VCR.insert_cassette CASSETTE_FILE_GOOGLE, record: :new_episodes
|
13
|
+
end
|
14
|
+
|
15
|
+
after do
|
16
|
+
VCR.eject_cassette
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'should be able to get the data from Google' do
|
20
|
+
google_load = Google::TrafficInfo.find(
|
21
|
+
origins: "Taipei",
|
22
|
+
destinations: "Hsinchu",
|
23
|
+
mode: "Train"
|
24
|
+
)
|
25
|
+
|
26
|
+
distance =google_load.trafficAnaly
|
27
|
+
distance.length.must_be :>,0
|
28
|
+
end
|
29
|
+
|
30
|
+
#google internal api test
|
31
|
+
it 'should be able to get rating from placeapi' do
|
32
|
+
google_rating = Google::GooglePlaceRating.find(
|
33
|
+
query: "新竹 餐廳"
|
34
|
+
)
|
35
|
+
rating = google_rating.attracs
|
36
|
+
rating.length.must_be :>,0
|
37
|
+
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require_relative 'spec_helper.rb'
|
2
|
+
|
3
|
+
describe 'Load specifications' do
|
4
|
+
VCR.configure do |c|
|
5
|
+
c.cassette_library_dir = CASSETTES_FOLDER
|
6
|
+
c.hook_into :webmock
|
7
|
+
|
8
|
+
c.filter_sensitive_data('<SKYSCANNER_ID>') {ENV['SKYSCANNER_API'] }
|
9
|
+
end
|
10
|
+
|
11
|
+
before do
|
12
|
+
VCR.insert_cassette CASSETTE_FILE_SKYSCANNER, record: :new_episodes
|
13
|
+
end
|
14
|
+
|
15
|
+
after do
|
16
|
+
VCR.eject_cassette
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'should be able to get the data from Skyscanner' do
|
20
|
+
skyscanner_load = Skyscanner::FlightInfo.find(market: 'TW', currency: 'TWD', locale: 'en-GB', originPlace: 'TW', destinationPlace: 'UK', outboundPartialDate: 'anytime')
|
21
|
+
flightInfo = skyscanner_load.flightInfo
|
22
|
+
print skyscanner_load
|
23
|
+
flightInfo.length.must_be :>,0
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require 'simplecov'
|
3
|
+
SimpleCov.start
|
4
|
+
|
5
|
+
require 'minitest/autorun'
|
6
|
+
require 'minitest/rg'
|
7
|
+
require 'yaml'
|
8
|
+
require 'vcr'
|
9
|
+
require 'webmock'
|
10
|
+
|
11
|
+
# require './lib/airbnb_api.rb'
|
12
|
+
# require './lib/google_api.rb'
|
13
|
+
# require './lib/rentinfo.rb'
|
14
|
+
# require './lib/trafficinfo.rb'
|
15
|
+
require_relative '../lib/VIAJERO'
|
16
|
+
|
17
|
+
FIXTURES_FOLDER = 'spec/fixtures'
|
18
|
+
CASSETTES_FOLDER = "#{FIXTURES_FOLDER}/cassettes"
|
19
|
+
CASSETTE_FILE_GOOGLE = 'google_distances'
|
20
|
+
CASSETTE_FILE_AIRBNB = 'airbnb_rooms'
|
21
|
+
CASSETTE_FILE_SKYSCANNER = 'skyscanner_flights'
|
22
|
+
|
23
|
+
if File.file?('config/credentials.yml')
|
24
|
+
credentials = YAML.load(File.read('config/credentials.yml'))
|
25
|
+
ENV['AIRBNB_API'] = credentials[:AIRBNB_API]
|
26
|
+
ENV['GOOGLE_API'] = credentials[:GOOGLE_API]
|
27
|
+
ENV['SKYSCANNER_API'] = credentials[:SKYSCANNER_API]
|
28
|
+
end
|
29
|
+
|
30
|
+
RESULT_FILE_AIRBNB = "#{FIXTURES_FOLDER}/airbnb_api_results.yml"
|
31
|
+
RESULT_FILE_GOOGLEMAP = "#{FIXTURES_FOLDER}/googlemap_api_results.yml"
|
32
|
+
RESULT_FILE_SKYSCANNER = "#{FIXTURES_FOLDER}/skyscanner_api_results.yml"
|
33
|
+
# AIRBNB_RESULT = YAML.load(File.read(RESULT_FILE_AIRBNB))
|
34
|
+
# GOOGLEMAP_RESULT = YAML.load(File.read(RESULT_FILE_GOOGLEMAP))
|
metadata
ADDED
@@ -0,0 +1,255 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: VIAJERO
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.73
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Yvonne Shih
|
8
|
+
- Cheng-Han Hsieh
|
9
|
+
- Wei Tang Lin
|
10
|
+
autorequire:
|
11
|
+
bindir: bin
|
12
|
+
cert_chain: []
|
13
|
+
date: 2016-12-18 00:00:00.000000000 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: http
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
|
+
requirements:
|
19
|
+
- - "~>"
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '2.0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
requirements:
|
26
|
+
- - "~>"
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
version: '2.0'
|
29
|
+
- !ruby/object:Gem::Dependency
|
30
|
+
name: minitest
|
31
|
+
requirement: !ruby/object:Gem::Requirement
|
32
|
+
requirements:
|
33
|
+
- - "~>"
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: '5.9'
|
36
|
+
type: :development
|
37
|
+
prerelease: false
|
38
|
+
version_requirements: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - "~>"
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '5.9'
|
43
|
+
- !ruby/object:Gem::Dependency
|
44
|
+
name: minitest-rg
|
45
|
+
requirement: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - "~>"
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '5.2'
|
50
|
+
type: :development
|
51
|
+
prerelease: false
|
52
|
+
version_requirements: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - "~>"
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '5.2'
|
57
|
+
- !ruby/object:Gem::Dependency
|
58
|
+
name: rake
|
59
|
+
requirement: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - "~>"
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '11.3'
|
64
|
+
type: :development
|
65
|
+
prerelease: false
|
66
|
+
version_requirements: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - "~>"
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '11.3'
|
71
|
+
- !ruby/object:Gem::Dependency
|
72
|
+
name: vcr
|
73
|
+
requirement: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
|
+
- - "~>"
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '3.0'
|
78
|
+
type: :development
|
79
|
+
prerelease: false
|
80
|
+
version_requirements: !ruby/object:Gem::Requirement
|
81
|
+
requirements:
|
82
|
+
- - "~>"
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: '3.0'
|
85
|
+
- !ruby/object:Gem::Dependency
|
86
|
+
name: webmock
|
87
|
+
requirement: !ruby/object:Gem::Requirement
|
88
|
+
requirements:
|
89
|
+
- - "~>"
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: '2.1'
|
92
|
+
type: :development
|
93
|
+
prerelease: false
|
94
|
+
version_requirements: !ruby/object:Gem::Requirement
|
95
|
+
requirements:
|
96
|
+
- - "~>"
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '2.1'
|
99
|
+
- !ruby/object:Gem::Dependency
|
100
|
+
name: simplecov
|
101
|
+
requirement: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - "~>"
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: '0.12'
|
106
|
+
type: :development
|
107
|
+
prerelease: false
|
108
|
+
version_requirements: !ruby/object:Gem::Requirement
|
109
|
+
requirements:
|
110
|
+
- - "~>"
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: '0.12'
|
113
|
+
- !ruby/object:Gem::Dependency
|
114
|
+
name: flog
|
115
|
+
requirement: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - "~>"
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '4.4'
|
120
|
+
type: :development
|
121
|
+
prerelease: false
|
122
|
+
version_requirements: !ruby/object:Gem::Requirement
|
123
|
+
requirements:
|
124
|
+
- - "~>"
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
version: '4.4'
|
127
|
+
- !ruby/object:Gem::Dependency
|
128
|
+
name: flay
|
129
|
+
requirement: !ruby/object:Gem::Requirement
|
130
|
+
requirements:
|
131
|
+
- - "~>"
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '2.8'
|
134
|
+
type: :development
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
requirements:
|
138
|
+
- - "~>"
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
version: '2.8'
|
141
|
+
- !ruby/object:Gem::Dependency
|
142
|
+
name: rubocop
|
143
|
+
requirement: !ruby/object:Gem::Requirement
|
144
|
+
requirements:
|
145
|
+
- - "~>"
|
146
|
+
- !ruby/object:Gem::Version
|
147
|
+
version: '0.42'
|
148
|
+
type: :development
|
149
|
+
prerelease: false
|
150
|
+
version_requirements: !ruby/object:Gem::Requirement
|
151
|
+
requirements:
|
152
|
+
- - "~>"
|
153
|
+
- !ruby/object:Gem::Version
|
154
|
+
version: '0.42'
|
155
|
+
description: AIRBNB, GOOGLE MAP, SKYSCANNER
|
156
|
+
email:
|
157
|
+
- yvonshih@gmail.com
|
158
|
+
- q2221252@gmail.com
|
159
|
+
- wtlin0711@gmail.com
|
160
|
+
executables:
|
161
|
+
- flight
|
162
|
+
- googleplace
|
163
|
+
- rent
|
164
|
+
- traffic
|
165
|
+
extensions: []
|
166
|
+
extra_rdoc_files: []
|
167
|
+
files:
|
168
|
+
- Gemfile
|
169
|
+
- Gemfile.lock
|
170
|
+
- LICENSE
|
171
|
+
- README.md
|
172
|
+
- Rakefile
|
173
|
+
- VIAJERO.gemspec
|
174
|
+
- apiformat.txt
|
175
|
+
- bin/flight
|
176
|
+
- bin/googleplace
|
177
|
+
- bin/rent
|
178
|
+
- bin/traffic
|
179
|
+
- config/credentials.yml
|
180
|
+
- coverage/.last_run.json
|
181
|
+
- coverage/.resultset.json
|
182
|
+
- coverage/.resultset.json.lock
|
183
|
+
- coverage/assets/0.10.0/application.css
|
184
|
+
- coverage/assets/0.10.0/application.js
|
185
|
+
- coverage/assets/0.10.0/colorbox/border.png
|
186
|
+
- coverage/assets/0.10.0/colorbox/controls.png
|
187
|
+
- coverage/assets/0.10.0/colorbox/loading.gif
|
188
|
+
- coverage/assets/0.10.0/colorbox/loading_background.png
|
189
|
+
- coverage/assets/0.10.0/favicon_green.png
|
190
|
+
- coverage/assets/0.10.0/favicon_red.png
|
191
|
+
- coverage/assets/0.10.0/favicon_yellow.png
|
192
|
+
- coverage/assets/0.10.0/loading.gif
|
193
|
+
- coverage/assets/0.10.0/magnify.png
|
194
|
+
- coverage/assets/0.10.0/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png
|
195
|
+
- coverage/assets/0.10.0/smoothness/images/ui-bg_flat_75_ffffff_40x100.png
|
196
|
+
- coverage/assets/0.10.0/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png
|
197
|
+
- coverage/assets/0.10.0/smoothness/images/ui-bg_glass_65_ffffff_1x400.png
|
198
|
+
- coverage/assets/0.10.0/smoothness/images/ui-bg_glass_75_dadada_1x400.png
|
199
|
+
- coverage/assets/0.10.0/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png
|
200
|
+
- coverage/assets/0.10.0/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png
|
201
|
+
- coverage/assets/0.10.0/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png
|
202
|
+
- coverage/assets/0.10.0/smoothness/images/ui-icons_222222_256x240.png
|
203
|
+
- coverage/assets/0.10.0/smoothness/images/ui-icons_2e83ff_256x240.png
|
204
|
+
- coverage/assets/0.10.0/smoothness/images/ui-icons_454545_256x240.png
|
205
|
+
- coverage/assets/0.10.0/smoothness/images/ui-icons_888888_256x240.png
|
206
|
+
- coverage/assets/0.10.0/smoothness/images/ui-icons_cd0a0a_256x240.png
|
207
|
+
- coverage/index.html
|
208
|
+
- lib/VIAJERO.rb
|
209
|
+
- lib/VIAJERO/airbnb_api.rb
|
210
|
+
- lib/VIAJERO/flightInfo.rb
|
211
|
+
- lib/VIAJERO/google_api.rb
|
212
|
+
- lib/VIAJERO/google_api_inter.rb
|
213
|
+
- lib/VIAJERO/internal.rb
|
214
|
+
- lib/VIAJERO/rentInfo.rb
|
215
|
+
- lib/VIAJERO/skyscanner_api.rb
|
216
|
+
- lib/VIAJERO/trafficinfo.rb
|
217
|
+
- lib/VIAJERO/version.rb
|
218
|
+
- spec/.load_spec.rb.swp
|
219
|
+
- spec/airbnbapi_spec.rb
|
220
|
+
- spec/fixtures/cassettes/google_distances.yml
|
221
|
+
- spec/fixtures/cassettes/skyscanner_flights.yml
|
222
|
+
- spec/googledistanceapi_spec.rb
|
223
|
+
- spec/skyscanner_spec.rb
|
224
|
+
- spec/spec_helper.rb
|
225
|
+
homepage:
|
226
|
+
licenses:
|
227
|
+
- MIT
|
228
|
+
metadata: {}
|
229
|
+
post_install_message:
|
230
|
+
rdoc_options: []
|
231
|
+
require_paths:
|
232
|
+
- lib
|
233
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
234
|
+
requirements:
|
235
|
+
- - ">="
|
236
|
+
- !ruby/object:Gem::Version
|
237
|
+
version: '0'
|
238
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
239
|
+
requirements:
|
240
|
+
- - ">="
|
241
|
+
- !ruby/object:Gem::Version
|
242
|
+
version: '0'
|
243
|
+
requirements: []
|
244
|
+
rubyforge_project:
|
245
|
+
rubygems_version: 2.6.8
|
246
|
+
signing_key:
|
247
|
+
specification_version: 4
|
248
|
+
summary: TRAVLER NEED IT
|
249
|
+
test_files:
|
250
|
+
- spec/airbnbapi_spec.rb
|
251
|
+
- spec/fixtures/cassettes/google_distances.yml
|
252
|
+
- spec/fixtures/cassettes/skyscanner_flights.yml
|
253
|
+
- spec/googledistanceapi_spec.rb
|
254
|
+
- spec/skyscanner_spec.rb
|
255
|
+
- spec/spec_helper.rb
|