barometer 0.8.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/.pelusa.yml +7 -0
- data/.travis.yml +6 -3
- data/Gemfile +11 -1
- data/README.md +89 -244
- data/Rakefile +1 -1
- data/barometer.gemspec +22 -24
- data/lib/barometer.rb +14 -65
- data/lib/barometer/base.rb +35 -65
- data/lib/barometer/data.rb +15 -20
- data/lib/barometer/data/attribute.rb +19 -0
- data/lib/barometer/data/attributes/distance.rb +11 -0
- data/lib/barometer/data/attributes/float.rb +11 -0
- data/lib/barometer/data/attributes/integer.rb +11 -0
- data/lib/barometer/data/attributes/location.rb +11 -0
- data/lib/barometer/data/attributes/pressure.rb +11 -0
- data/lib/barometer/data/attributes/sun.rb +15 -0
- data/lib/barometer/data/attributes/temperature.rb +11 -0
- data/lib/barometer/data/attributes/time.rb +11 -0
- data/lib/barometer/data/attributes/vector.rb +11 -0
- data/lib/barometer/data/attributes/zone.rb +11 -0
- data/lib/barometer/data/convertable_units.rb +145 -0
- data/lib/barometer/data/coordinates.rb +16 -0
- data/lib/barometer/data/distance.rb +14 -133
- data/lib/barometer/data/geo.rb +22 -59
- data/lib/barometer/data/location.rb +14 -20
- data/lib/barometer/data/pressure.rb +14 -135
- data/lib/barometer/data/sun.rb +24 -24
- data/lib/barometer/data/temperature.rb +14 -169
- data/lib/barometer/data/vector.rb +44 -0
- data/lib/barometer/data/zone.rb +109 -112
- data/lib/barometer/query.rb +23 -161
- data/lib/barometer/query/base.rb +88 -0
- data/lib/barometer/query/converter.rb +64 -0
- data/lib/barometer/query/converters/from_coordinates_to_noaa_station_id.rb +30 -0
- data/lib/barometer/query/converters/from_geocode_to_coordinates.rb +28 -0
- data/lib/barometer/query/converters/from_short_zipcode_to_zipcode.rb +28 -0
- data/lib/barometer/query/converters/from_weather_id_to_geocode.rb +30 -0
- data/lib/barometer/query/converters/from_woe_id_or_ipv4_to_geocode.rb +32 -0
- data/lib/barometer/query/converters/to_geocode.rb +30 -0
- data/lib/barometer/query/converters/to_weather_id.rb +30 -0
- data/lib/barometer/query/converters/to_woe_id.rb +30 -0
- data/lib/barometer/query/format.rb +59 -0
- data/lib/barometer/query/formats/base.rb +22 -0
- data/lib/barometer/query/formats/coordinates.rb +14 -0
- data/lib/barometer/query/formats/geocode.rb +15 -0
- data/lib/barometer/query/formats/icao.rb +35 -0
- data/lib/barometer/query/formats/ipv4_address.rb +19 -0
- data/lib/barometer/query/formats/noaa_station_id.rb +15 -0
- data/lib/barometer/query/formats/postalcode.rb +20 -0
- data/lib/barometer/query/formats/short_zipcode.rb +15 -0
- data/lib/barometer/{translations → query/formats/translations}/icao_country_codes.yml +0 -0
- data/lib/barometer/{translations → query/formats/translations}/weather_country_codes.yml +0 -0
- data/lib/barometer/query/formats/unknown.rb +14 -0
- data/lib/barometer/query/formats/weather_id.rb +33 -0
- data/lib/barometer/query/formats/woe_id.rb +28 -0
- data/lib/barometer/query/formats/zipcode.rb +15 -0
- data/lib/barometer/query/service.rb +13 -0
- data/lib/barometer/query/services/apis/geonames_timezone.rb +26 -0
- data/lib/barometer/query/services/apis/google_geocode.rb +35 -0
- data/lib/barometer/query/services/apis/noaa_station.rb +31 -0
- data/lib/barometer/query/services/apis/weather_id.rb +35 -0
- data/lib/barometer/query/services/apis/wunderground_timezone.rb +26 -0
- data/lib/barometer/query/services/apis/yahoo_placefinder.rb +35 -0
- data/lib/barometer/query/services/apis/yahoo_weather.rb +31 -0
- data/lib/barometer/query/services/from_weather_id.rb +64 -0
- data/lib/barometer/query/services/geonames_timezone.rb +18 -0
- data/lib/barometer/query/services/google_geocode.rb +106 -0
- data/lib/barometer/query/services/noaa_station_id.rb +28 -0
- data/lib/barometer/query/services/to_weather_id.rb +25 -0
- data/lib/barometer/query/services/to_woe_id.rb +29 -0
- data/lib/barometer/query/services/wunderground_timezone.rb +18 -0
- data/lib/barometer/query/services/yahoo_geocode.rb +69 -0
- data/lib/barometer/response.rb +12 -0
- data/lib/barometer/response/base.rb +57 -0
- data/lib/barometer/response/current.rb +27 -0
- data/lib/barometer/response/prediction.rb +41 -0
- data/lib/barometer/response/prediction_collection.rb +48 -0
- data/lib/barometer/utils.rb +17 -0
- data/lib/barometer/utils/address.rb +33 -0
- data/lib/barometer/utils/api.rb +30 -0
- data/lib/barometer/utils/config_reader.rb +40 -0
- data/lib/barometer/utils/get.rb +17 -0
- data/lib/barometer/utils/json_reader.rb +22 -0
- data/lib/barometer/utils/payload.rb +100 -0
- data/lib/barometer/utils/payload_request.rb +37 -0
- data/lib/barometer/utils/post.rb +24 -0
- data/lib/barometer/utils/time.rb +78 -0
- data/lib/barometer/{translations → utils/translations}/zone_codes.yml +0 -0
- data/lib/barometer/utils/versioned_registration.rb +70 -0
- data/lib/barometer/utils/xml_reader.rb +27 -0
- data/lib/barometer/utils/zone_code_lookup.rb +30 -0
- data/lib/barometer/version.rb +1 -1
- data/lib/barometer/weather.rb +44 -173
- data/lib/barometer/weather_service.rb +41 -0
- data/lib/barometer/weather_services/base.rb +50 -0
- data/lib/barometer/weather_services/forecast_io.rb +36 -0
- data/lib/barometer/weather_services/forecast_io/api.rb +22 -0
- data/lib/barometer/weather_services/forecast_io/query.rb +38 -0
- data/lib/barometer/weather_services/forecast_io/response.rb +31 -0
- data/lib/barometer/weather_services/forecast_io/response/current_weather.rb +78 -0
- data/lib/barometer/weather_services/forecast_io/response/forecasted_weather.rb +74 -0
- data/lib/barometer/weather_services/forecast_io/response/location.rb +19 -0
- data/lib/barometer/weather_services/forecast_io/response/timezone.rb +25 -0
- data/lib/barometer/weather_services/noaa.rb +21 -305
- data/lib/barometer/weather_services/noaa/current_api.rb +25 -0
- data/lib/barometer/weather_services/noaa/current_query.rb +30 -0
- data/lib/barometer/weather_services/noaa/current_response.rb +29 -0
- data/lib/barometer/weather_services/noaa/forecast_api.rb +25 -0
- data/lib/barometer/weather_services/noaa/forecast_query.rb +39 -0
- data/lib/barometer/weather_services/noaa/forecast_response.rb +28 -0
- data/lib/barometer/weather_services/noaa/response/current_location.rb +42 -0
- data/lib/barometer/weather_services/noaa/response/current_station.rb +46 -0
- data/lib/barometer/weather_services/noaa/response/current_weather.rb +82 -0
- data/lib/barometer/weather_services/noaa/response/forecasted_weather.rb +90 -0
- data/lib/barometer/weather_services/noaa/response/location.rb +19 -0
- data/lib/barometer/weather_services/noaa/response/timezone.rb +15 -0
- data/lib/barometer/weather_services/response.rb +9 -0
- data/lib/barometer/weather_services/response/location.rb +42 -0
- data/lib/barometer/weather_services/response/time_zone.rb +19 -0
- data/lib/barometer/weather_services/weather_bug.rb +24 -280
- data/lib/barometer/weather_services/weather_bug/current_api.rb +26 -0
- data/lib/barometer/weather_services/weather_bug/current_response.rb +33 -0
- data/lib/barometer/weather_services/weather_bug/forecast_api.rb +26 -0
- data/lib/barometer/weather_services/weather_bug/forecast_response.rb +29 -0
- data/lib/barometer/weather_services/weather_bug/query.rb +42 -0
- data/lib/barometer/weather_services/weather_bug/response/current_weather.rb +82 -0
- data/lib/barometer/weather_services/weather_bug/response/forecasted_weather.rb +67 -0
- data/lib/barometer/weather_services/weather_bug/response/location.rb +23 -0
- data/lib/barometer/weather_services/weather_bug/response/station.rb +43 -0
- data/lib/barometer/weather_services/weather_bug/response/sun.rb +32 -0
- data/lib/barometer/weather_services/weather_bug/response/time_helper.rb +52 -0
- data/lib/barometer/weather_services/weather_bug/response/timezone.rb +15 -0
- data/lib/barometer/weather_services/wunderground_v1.rb +32 -0
- data/lib/barometer/weather_services/wunderground_v1/current_api.rb +21 -0
- data/lib/barometer/weather_services/wunderground_v1/current_response.rb +31 -0
- data/lib/barometer/weather_services/wunderground_v1/forecast_api.rb +21 -0
- data/lib/barometer/weather_services/wunderground_v1/forecast_response.rb +33 -0
- data/lib/barometer/weather_services/wunderground_v1/query.rb +30 -0
- data/lib/barometer/weather_services/wunderground_v1/response/current_weather.rb +92 -0
- data/lib/barometer/weather_services/wunderground_v1/response/forecasted_weather.rb +87 -0
- data/lib/barometer/weather_services/wunderground_v1/response/full_timezone.rb +22 -0
- data/lib/barometer/weather_services/wunderground_v1/response/location.rb +43 -0
- data/lib/barometer/weather_services/wunderground_v1/response/station.rb +39 -0
- data/lib/barometer/weather_services/wunderground_v1/response/sun.rb +53 -0
- data/lib/barometer/weather_services/wunderground_v1/response/timezone.rb +15 -0
- data/lib/barometer/weather_services/yahoo.rb +16 -198
- data/lib/barometer/weather_services/yahoo/api.rb +21 -0
- data/lib/barometer/weather_services/yahoo/query.rb +42 -0
- data/lib/barometer/weather_services/yahoo/response.rb +39 -0
- data/lib/barometer/weather_services/yahoo/response/current_weather.rb +86 -0
- data/lib/barometer/weather_services/yahoo/response/forecasted_weather.rb +71 -0
- data/lib/barometer/weather_services/yahoo/response/location.rb +47 -0
- data/lib/barometer/weather_services/yahoo/response/sun.rb +43 -0
- data/lib/barometer/weather_services/yahoo/response/timezone.rb +15 -0
- data/spec/barometer_spec.rb +18 -120
- data/spec/base_spec.rb +114 -0
- data/spec/cassettes/Converter_FromCoordinatesToNoaaStationId.json +1 -0
- data/spec/cassettes/Converter_FromWeatherIdToGeocode.json +1 -0
- data/spec/cassettes/Converter_FromWoeIdOrIpv4ToGeocode.json +1 -0
- data/spec/cassettes/Converter_ToGeocode.json +1 -0
- data/spec/cassettes/Converter_ToWeatherId.json +1 -0
- data/spec/cassettes/Converter_ToWoeId.json +1 -0
- data/spec/cassettes/Service_FromWeatherId.json +1 -0
- data/spec/cassettes/Service_GoogleGeocode.json +1 -0
- data/spec/cassettes/Service_NoaaStation.json +1 -0
- data/spec/cassettes/Service_ToWeatherId.json +1 -0
- data/spec/cassettes/Service_ToWoeId.json +1 -0
- data/spec/cassettes/Service_YahooGeocode.json +1 -0
- data/spec/cassettes/WeatherService_ForecastIo.json +1 -0
- data/spec/cassettes/WeatherService_Noaa.json +1 -1
- data/spec/cassettes/WeatherService_WeatherBug.json +1 -1
- data/spec/cassettes/WeatherService_WundergroundV1.json +1 -0
- data/spec/cassettes/WeatherService_Yahoo.json +1 -1
- data/spec/data/attributes/distance_spec.rb +60 -0
- data/spec/data/attributes/location_spec.rb +41 -0
- data/spec/data/attributes/pressure_spec.rb +60 -0
- data/spec/data/attributes/sun_spec.rb +33 -0
- data/spec/data/attributes/temperature_spec.rb +60 -0
- data/spec/data/attributes/time_spec.rb +58 -0
- data/spec/data/attributes/vector_spec.rb +43 -0
- data/spec/data/attributes/zone_spec.rb +34 -0
- data/spec/data/convertable_units_spec.rb +299 -0
- data/spec/data/coordinates_spec.rb +15 -0
- data/spec/data/distance_spec.rb +49 -333
- data/spec/data/geo_spec.rb +72 -71
- data/spec/data/location_spec.rb +70 -65
- data/spec/data/pressure_spec.rb +49 -333
- data/spec/data/sun_spec.rb +57 -81
- data/spec/data/temperature_spec.rb +49 -393
- data/spec/data/vector_spec.rb +100 -0
- data/spec/data/zone_spec.rb +199 -266
- data/spec/query/base_spec.rb +296 -0
- data/spec/query/converter_spec.rb +98 -0
- data/spec/query/converters/from_coordinates_to_noaa_station_id_spec.rb +35 -0
- data/spec/query/converters/from_geocode_to_coordinates_spec.rb +25 -0
- data/spec/query/converters/from_short_zipcode_to_zipcode_spec.rb +31 -0
- data/spec/query/converters/from_weather_id_to_geocode_spec.rb +40 -0
- data/spec/query/converters/from_woe_id_or_ipv4_to_geocode_spec.rb +51 -0
- data/spec/query/converters/to_geocode_spec.rb +99 -0
- data/spec/query/converters/to_weather_id_spec.rb +35 -0
- data/spec/query/converters/to_woe_id_spec.rb +74 -0
- data/spec/query/formats/base_spec.rb +15 -0
- data/spec/query/formats/coordinates_spec.rb +13 -0
- data/spec/query/formats/geocode_spec.rb +9 -0
- data/spec/query/formats/icao_spec.rb +20 -0
- data/spec/query/formats/ipv4_address_spec.rb +33 -0
- data/spec/query/formats/noaa_station_id_spec.rb +9 -0
- data/spec/query/formats/postalcode_spec.rb +18 -0
- data/spec/query/formats/short_zipcode_spec.rb +18 -0
- data/spec/query/formats/unknown_spec.rb +9 -0
- data/spec/query/formats/weather_id_spec.rb +31 -0
- data/spec/query/formats/woe_id_spec.rb +45 -0
- data/spec/query/formats/zipcode_spec.rb +18 -0
- data/spec/query/formats_spec.rb +55 -0
- data/spec/query/services/from_weather_id_spec.rb +54 -0
- data/spec/query/services/google_geocode_spec.rb +60 -0
- data/spec/query/services/noaa_station_id_spec.rb +23 -0
- data/spec/query/services/to_weather_id_spec.rb +23 -0
- data/spec/query/services/to_woe_id_spec.rb +51 -0
- data/spec/query/services/yahoo_geocode_spec.rb +72 -0
- data/spec/response/base_spec.rb +103 -0
- data/spec/response/current_spec.rb +33 -0
- data/spec/response/predicition_spec.rb +65 -0
- data/spec/response/prediction_collection_spec.rb +97 -0
- data/spec/spec_helper.rb +14 -12
- data/spec/support/key_file_parser.rb +22 -0
- data/spec/support/matchers/formats.rb +36 -0
- data/spec/support/matchers/have_data.rb +46 -0
- data/spec/support/matchers/have_field.rb +128 -0
- data/spec/support/matchers/have_forecast.rb +46 -0
- data/spec/support/matchers/path.rb +23 -0
- data/spec/support/query_factory.rb +20 -0
- data/spec/utils/address_spec.rb +67 -0
- data/spec/utils/config_reader_spec.rb +157 -0
- data/spec/utils/get_spec.rb +22 -0
- data/spec/utils/payload_request_spec.rb +69 -0
- data/spec/utils/payload_spec.rb +168 -0
- data/spec/utils/post_spec.rb +20 -0
- data/spec/utils/time_spec.rb +93 -0
- data/spec/utils/versioned_registration_spec.rb +105 -0
- data/spec/weather_services/base_spec.rb +116 -0
- data/spec/weather_services/forecast_io_spec.rb +71 -0
- data/spec/weather_services/noaa/current_response_spec.rb +22 -0
- data/spec/weather_services/noaa/forecast_response_spec.rb +33 -0
- data/spec/weather_services/noaa_spec.rb +68 -166
- data/spec/weather_services/weather_bug/current_response_spec.rb +64 -0
- data/spec/weather_services/weather_bug/forecast_response_spec.rb +23 -0
- data/spec/weather_services/weather_bug_spec.rb +62 -202
- data/spec/weather_services/wunderground_v1/current_response_spec.rb +19 -0
- data/spec/weather_services/wunderground_v1/forecast_response_spec.rb +62 -0
- data/spec/weather_services/wunderground_v1_spec.rb +78 -0
- data/spec/weather_services/yahoo/response_spec.rb +73 -0
- data/spec/weather_services/yahoo_spec.rb +52 -135
- data/spec/weather_services_spec.rb +103 -0
- data/spec/weather_spec.rb +167 -347
- metadata +342 -123
- data/.document +0 -5
- data/TODO +0 -60
- data/bin/barometer +0 -441
- data/lib/barometer/data/local_datetime.rb +0 -145
- data/lib/barometer/data/local_time.rb +0 -134
- data/lib/barometer/data/speed.rb +0 -158
- data/lib/barometer/data/units.rb +0 -49
- data/lib/barometer/formats.rb +0 -13
- data/lib/barometer/formats/coordinates.rb +0 -57
- data/lib/barometer/formats/format.rb +0 -64
- data/lib/barometer/formats/geocode.rb +0 -60
- data/lib/barometer/formats/icao.rb +0 -37
- data/lib/barometer/formats/postalcode.rb +0 -22
- data/lib/barometer/formats/short_zipcode.rb +0 -17
- data/lib/barometer/formats/weather_id.rb +0 -92
- data/lib/barometer/formats/woe_id.rb +0 -150
- data/lib/barometer/formats/zipcode.rb +0 -31
- data/lib/barometer/key_file_parser.rb +0 -20
- data/lib/barometer/measurements/measurement.rb +0 -202
- data/lib/barometer/measurements/result.rb +0 -207
- data/lib/barometer/measurements/result_array.rb +0 -75
- data/lib/barometer/services.rb +0 -19
- data/lib/barometer/weather_services/service.rb +0 -189
- data/lib/barometer/weather_services/wunderground.rb +0 -264
- data/lib/barometer/web_services/geocode.rb +0 -34
- data/lib/barometer/web_services/noaa_station_id.rb +0 -53
- data/lib/barometer/web_services/placemaker.rb +0 -95
- data/lib/barometer/web_services/timezone.rb +0 -38
- data/lib/barometer/web_services/weather_id.rb +0 -50
- data/lib/barometer/web_services/web_service.rb +0 -29
- data/spec/cassettes/Barometer.json +0 -1
- data/spec/cassettes/Query.json +0 -1
- data/spec/cassettes/Query_Format_Coordinates.json +0 -1
- data/spec/cassettes/Query_Format_Geocode.json +0 -1
- data/spec/cassettes/Query_Format_WeatherID.json +0 -1
- data/spec/cassettes/Query_Format_WoeID.json +0 -1
- data/spec/cassettes/WeatherService.json +0 -1
- data/spec/cassettes/WeatherService_Wunderground.json +0 -1
- data/spec/cassettes/WebService_Geocode.json +0 -1
- data/spec/cassettes/WebService_NoaaStation.json +0 -1
- data/spec/data/local_datetime_spec.rb +0 -274
- data/spec/data/local_time_spec.rb +0 -239
- data/spec/data/speed_spec.rb +0 -374
- data/spec/data/units_spec.rb +0 -101
- data/spec/formats/coordinates_spec.rb +0 -166
- data/spec/formats/format_spec.rb +0 -74
- data/spec/formats/geocode_spec.rb +0 -163
- data/spec/formats/icao_spec.rb +0 -55
- data/spec/formats/postalcode_spec.rb +0 -53
- data/spec/formats/short_zipcode_spec.rb +0 -47
- data/spec/formats/weather_id_spec.rb +0 -182
- data/spec/formats/woe_id_spec.rb +0 -211
- data/spec/formats/zipcode_spec.rb +0 -103
- data/spec/key_file_parser_spec.rb +0 -28
- data/spec/measurements/measurement_spec.rb +0 -381
- data/spec/measurements/result_array_spec.rb +0 -150
- data/spec/measurements/result_spec.rb +0 -632
- data/spec/query_spec.rb +0 -498
- data/spec/weather_services/services_spec.rb +0 -135
- data/spec/weather_services/wunderground_spec.rb +0 -179
- data/spec/web_services/geocode_spec.rb +0 -31
- data/spec/web_services/noaa_station_id_spec.rb +0 -33
- data/spec/web_services/placemaker_spec.rb +0 -41
- data/spec/web_services/web_services_spec.rb +0 -20
@@ -0,0 +1,100 @@
|
|
1
|
+
require_relative '../spec_helper'
|
2
|
+
|
3
|
+
module Barometer::Data
|
4
|
+
describe Vector do
|
5
|
+
describe '.initialize' do
|
6
|
+
it 'sets kph' do
|
7
|
+
vector = Vector.new(16.09, nil, nil)
|
8
|
+
expect( vector.kph ).to eq 16.09
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'sets mph' do
|
12
|
+
vector = Vector.new(nil, 10, nil)
|
13
|
+
expect( vector.mph ).to eq 10
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'sets bearing' do
|
17
|
+
vector = Vector.new(nil, nil, 270)
|
18
|
+
expect( vector.bearing ).to eq 270
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'defaults to metric' do
|
22
|
+
vector = Vector.new(20, 270)
|
23
|
+
expect( vector.to_s ).to eq '20 kph @ 270 degrees'
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
describe '#mph' do
|
28
|
+
it 'returns known value as mph' do
|
29
|
+
vector = Vector.new(:imperial, 10, nil)
|
30
|
+
expect( vector.mph ).to eq 10
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
describe '#kph' do
|
35
|
+
it 'returns known value as kph' do
|
36
|
+
vector = Vector.new(:metric, 20, nil)
|
37
|
+
expect( vector.kph ).to eq 20
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
describe '#units' do
|
42
|
+
context 'when vector is metric' do
|
43
|
+
it 'returns kph' do
|
44
|
+
vector = Vector.new(:metric, 20.0, 10.0, nil)
|
45
|
+
expect( vector.units ).to eq 'kph'
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
context 'when vector is imperial' do
|
50
|
+
it 'returns mph' do
|
51
|
+
vector = Vector.new(:imperial, 20.0, 10.0, nil)
|
52
|
+
expect( vector.units ).to eq 'mph'
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
describe '#to_s' do
|
58
|
+
context 'when vector is metric' do
|
59
|
+
it 'returns kph only when no bearing' do
|
60
|
+
vector = Vector.new(:metric, 16, nil, nil)
|
61
|
+
expect( vector.to_s ).to eq '16 kph'
|
62
|
+
end
|
63
|
+
|
64
|
+
it 'returns bearing only when no kph' do
|
65
|
+
vector = Vector.new(:metric, nil, nil, 270)
|
66
|
+
expect( vector.to_s ).to eq '270 degrees'
|
67
|
+
end
|
68
|
+
|
69
|
+
it 'returns kph and bearing' do
|
70
|
+
vector = Vector.new(:metric, 16, nil, 270)
|
71
|
+
expect( vector.to_s ).to eq '16 kph @ 270 degrees'
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
context 'when vector is imperial' do
|
76
|
+
it 'returns mph only when no bearing' do
|
77
|
+
vector = Vector.new(:imperial, nil, 10, nil)
|
78
|
+
expect( vector.to_s ).to eq '10 mph'
|
79
|
+
end
|
80
|
+
|
81
|
+
it 'returns bearing only when no mph' do
|
82
|
+
vector = Vector.new(:imperial, nil, nil, 270)
|
83
|
+
expect( vector.to_s ).to eq '270 degrees'
|
84
|
+
end
|
85
|
+
|
86
|
+
it 'returns mph and bearing' do
|
87
|
+
vector = Vector.new(:imperial, nil, 10, 270)
|
88
|
+
expect( vector.to_s ).to eq '10 mph @ 270 degrees'
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
describe '#nil?' do
|
94
|
+
it 'returns false if only bearing set' do
|
95
|
+
vector = Vector.new(nil, nil, 270)
|
96
|
+
expect( vector ).not_to be_nil
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
data/spec/data/zone_spec.rb
CHANGED
@@ -1,366 +1,299 @@
|
|
1
|
-
|
1
|
+
require_relative '../spec_helper'
|
2
2
|
|
3
|
-
|
3
|
+
module Barometer::Data
|
4
|
+
describe Zone do
|
5
|
+
describe '#new' do
|
6
|
+
let(:zone) { double(:zone) }
|
4
7
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
# end
|
11
|
-
#
|
12
|
-
# it "responds to today and returns Date object" do
|
13
|
-
# Data::Zone.respond_to?("today").should be_true
|
14
|
-
# Data::Zone.today.is_a?(Date).should be_true
|
15
|
-
# end
|
16
|
-
#
|
17
|
-
# end
|
8
|
+
before do
|
9
|
+
ZoneFull.stub(detect?: false)
|
10
|
+
ZoneOffset.stub(detect?: false)
|
11
|
+
ZoneCode.stub(detect?: false)
|
12
|
+
end
|
18
13
|
|
19
|
-
|
14
|
+
it 'detects a full timezone input' do
|
15
|
+
ZoneFull.stub(detect?: true, new: nil)
|
16
|
+
Zone.new(zone)
|
17
|
+
expect( ZoneFull ).to have_received(:new).with(zone)
|
18
|
+
end
|
20
19
|
|
21
|
-
|
20
|
+
it 'detects a timezone code input' do
|
21
|
+
ZoneOffset.stub(detect?: true, new: nil)
|
22
|
+
Zone.new(zone)
|
23
|
+
expect( ZoneOffset ).to have_received(:new).with(zone)
|
24
|
+
end
|
22
25
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
26
|
+
it 'detects a timezone offset input' do
|
27
|
+
ZoneCode.stub(detect?: true, new: nil)
|
28
|
+
Zone.new(zone)
|
29
|
+
expect( ZoneCode ).to have_received(:new).with(zone)
|
27
30
|
end
|
28
31
|
|
29
|
-
it
|
30
|
-
|
31
|
-
|
32
|
+
it 'raises an error when nothing detected' do
|
33
|
+
expect {
|
34
|
+
Zone.new(zone)
|
35
|
+
}.to raise_error(ArgumentError)
|
32
36
|
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
describe ZoneFull do
|
41
|
+
def stub_time(utc_now)
|
42
|
+
now = double(:now, utc: utc_now)
|
43
|
+
double(:time_class, now: now)
|
44
|
+
end
|
33
45
|
|
34
|
-
|
35
|
-
|
46
|
+
describe '.detect?' do
|
47
|
+
it 'returns true when given a full timezone' do
|
48
|
+
expect( ZoneFull.detect?('America/Los_Angeles') ).to be_true
|
36
49
|
end
|
37
50
|
|
38
|
-
it
|
39
|
-
|
51
|
+
it 'returns false when given a timezone code' do
|
52
|
+
expect( ZoneFull.detect?('PST') ).to be_false
|
40
53
|
end
|
41
54
|
|
42
|
-
it
|
43
|
-
|
55
|
+
it 'returns false when given an offset' do
|
56
|
+
expect( ZoneFull.detect?(10) ).to be_false
|
57
|
+
end
|
44
58
|
|
45
|
-
|
46
|
-
|
59
|
+
it 'returns false when given nothing' do
|
60
|
+
expect( ZoneFull.detect?('') ).to be_false
|
61
|
+
expect( ZoneFull.detect?(nil) ).to be_false
|
47
62
|
end
|
63
|
+
end
|
48
64
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
zone
|
53
|
-
zone.tz.should be_nil
|
54
|
-
zone.full.should == @timezone
|
65
|
+
describe '#code' do
|
66
|
+
it 'returns the correct non-DST zone code' do
|
67
|
+
time = stub_time(::Time.utc(2013, 1, 1))
|
68
|
+
zone = ZoneFull.new('America/Los_Angeles', time)
|
55
69
|
|
56
|
-
zone
|
57
|
-
zone.full.should == @timezone
|
70
|
+
expect( zone.code ).to eq 'PST'
|
58
71
|
end
|
59
72
|
|
60
|
-
it
|
61
|
-
|
62
|
-
zone =
|
63
|
-
zone.tz = nil
|
64
|
-
zone.tz.should be_nil
|
65
|
-
zone.code.should be_nil
|
73
|
+
it 'returns the correct DST zone code' do
|
74
|
+
time = stub_time(::Time.utc(2013, 6, 1))
|
75
|
+
zone = ZoneFull.new('America/Los_Angeles', time)
|
66
76
|
|
67
|
-
zone
|
68
|
-
# the expected result of this depends on the time of year
|
69
|
-
# when summer expect "CEST", otherwise "CET"
|
70
|
-
# just let TZINFO handle this
|
71
|
-
zone.code.should == TZInfo::Timezone.get(@timezone).period_for_utc(Time.now.utc).zone_identifier.to_s
|
77
|
+
expect( zone.code ).to eq 'PDT'
|
72
78
|
end
|
79
|
+
end
|
80
|
+
|
81
|
+
describe '#offset' do
|
82
|
+
it 'returns the current non-DST offset' do
|
83
|
+
time = stub_time(::Time.utc(2013, 1, 1, 18, 0, 0))
|
84
|
+
zone = ZoneFull.new('America/Los_Angeles', time)
|
73
85
|
|
74
|
-
|
75
|
-
@zone.respond_to?("dst?").should be_true
|
76
|
-
zone = Data::Zone.new(@timezone)
|
77
|
-
zone.tz = nil
|
78
|
-
zone.tz.should be_nil
|
79
|
-
zone.dst?.should be_nil
|
86
|
+
expect( zone.offset ).to eq(-8 * 60 * 60)
|
80
87
|
end
|
81
88
|
|
82
|
-
it
|
83
|
-
|
84
|
-
|
89
|
+
it 'returns the current DST offset' do
|
90
|
+
time = stub_time(::Time.utc(2013, 6, 1, 18, 0, 0))
|
91
|
+
zone = ZoneFull.new('America/Los_Angeles', time)
|
92
|
+
|
93
|
+
expect( zone.offset ).to eq(-7 * 60 * 60)
|
94
|
+
end
|
95
|
+
end
|
85
96
|
|
86
|
-
|
87
|
-
|
97
|
+
describe '#now' do
|
98
|
+
it 'returns the current non-DST local time' do
|
99
|
+
time = stub_time(::Time.utc(2013, 1, 1, 18, 0, 0))
|
100
|
+
zone = ZoneFull.new('America/Los_Angeles', time)
|
88
101
|
|
89
|
-
now
|
90
|
-
now.hour.should == actual_now.hour
|
91
|
-
now.min.should == actual_now.min
|
92
|
-
now.sec.should == actual_now.sec
|
93
|
-
now.year.should == actual_now.year
|
94
|
-
now.month.should == actual_now.month
|
95
|
-
now.day.should == actual_now.day
|
102
|
+
expect( zone.now ).to eq ::Time.utc(2013, 1, 1, 10, 0, 0)
|
96
103
|
end
|
97
104
|
|
98
|
-
it
|
99
|
-
|
100
|
-
|
105
|
+
it 'returns the current DST local time' do
|
106
|
+
time = stub_time(::Time.utc(2013, 6, 1, 18, 0, 0))
|
107
|
+
zone = ZoneFull.new('America/Los_Angeles', time)
|
101
108
|
|
102
|
-
|
103
|
-
|
109
|
+
expect( zone.now ).to eq ::Time.utc(2013, 6, 1, 11, 0, 0)
|
110
|
+
end
|
111
|
+
end
|
104
112
|
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
now.day.should == actual_now.day
|
113
|
+
describe '#to_s' do
|
114
|
+
it 'returns the input zone' do
|
115
|
+
expect( ZoneFull.new('Europe/Paris').to_s ).to eq 'Europe/Paris'
|
109
116
|
end
|
117
|
+
end
|
110
118
|
|
111
|
-
|
112
|
-
|
113
|
-
|
119
|
+
describe '#local_to_utc' do
|
120
|
+
it 'converts a time in the local time zone to UTC' do
|
121
|
+
zone = ZoneFull.new('America/Los_Angeles')
|
122
|
+
local_time = ::Time.now.utc
|
114
123
|
|
115
|
-
|
116
|
-
utc_time.should == (local_time - offset)
|
124
|
+
expect( zone.local_to_utc(local_time).to_i ).to eq((local_time - zone.offset).to_i)
|
117
125
|
end
|
126
|
+
end
|
118
127
|
|
119
|
-
|
120
|
-
|
121
|
-
|
128
|
+
describe '#utc_to_local' do
|
129
|
+
it 'converts a time in the local time zone to UTC' do
|
130
|
+
zone = ZoneFull.new('America/Los_Angeles')
|
131
|
+
utc_time = ::Time.now.utc
|
122
132
|
|
123
|
-
|
124
|
-
utc_time.should == (local_time - offset)
|
133
|
+
expect( zone.utc_to_local(utc_time).to_i ).to eq((utc_time + zone.offset).to_i)
|
125
134
|
end
|
126
|
-
|
127
135
|
end
|
136
|
+
end
|
128
137
|
|
129
|
-
|
138
|
+
describe ZoneOffset do
|
139
|
+
def stub_time(utc_now)
|
140
|
+
now = double(:now, utc: utc_now)
|
141
|
+
double(:time_class, now: now)
|
142
|
+
end
|
130
143
|
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
@zone = Data::Zone.new(@timezone)
|
144
|
+
describe '.detect?' do
|
145
|
+
it 'returns false when given a full timezone' do
|
146
|
+
expect( ZoneOffset.detect?('America/Los_Angeles') ).to be_false
|
135
147
|
end
|
136
148
|
|
137
|
-
it
|
138
|
-
|
139
|
-
@zone.zone_code.should == @timezone
|
149
|
+
it 'returns false when given a timezone code' do
|
150
|
+
expect( ZoneOffset.detect?('PST') ).to be_false
|
140
151
|
end
|
141
152
|
|
142
|
-
it
|
143
|
-
|
153
|
+
it 'returns true when given an offset' do
|
154
|
+
expect( ZoneOffset.detect?(10) ).to be_true
|
144
155
|
end
|
145
156
|
|
146
|
-
it
|
147
|
-
|
157
|
+
it 'returns false when given an offset out of range' do
|
158
|
+
expect( ZoneOffset.detect?(15) ).to be_false
|
148
159
|
end
|
149
160
|
|
150
|
-
it
|
151
|
-
|
152
|
-
|
161
|
+
it 'returns false when given nothing' do
|
162
|
+
expect( ZoneOffset.detect?('') ).to be_false
|
163
|
+
expect( ZoneOffset.detect?(nil) ).to be_false
|
153
164
|
end
|
165
|
+
end
|
154
166
|
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
zone.tz = nil
|
159
|
-
zone.tz.should be_nil
|
160
|
-
zone.code.should == @timezone
|
161
|
-
|
162
|
-
zone = Data::Zone.new(@timezone)
|
163
|
-
zone.code.should == @timezone
|
167
|
+
describe '#code' do
|
168
|
+
it 'returns nil' do
|
169
|
+
expect( ZoneOffset.new(10).code ).to be_nil
|
164
170
|
end
|
171
|
+
end
|
165
172
|
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
zone.tz = nil
|
170
|
-
zone.tz.should be_nil
|
171
|
-
zone.full.should be_nil
|
172
|
-
|
173
|
-
zone = Data::Zone.new(@timezone)
|
174
|
-
zone.full.should be_nil
|
173
|
+
describe '#offset' do
|
174
|
+
it 'converts the input from hours to seconds' do
|
175
|
+
expect( ZoneOffset.new(5).offset ).to eq(5 * 60 * 60)
|
175
176
|
end
|
177
|
+
end
|
176
178
|
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
actual_now = Time.now.utc + (-6*60*60)
|
179
|
+
describe '#now' do
|
180
|
+
it 'returns the current local time' do
|
181
|
+
time = stub_time(::Time.utc(2013, 1, 1, 10, 0, 0))
|
182
|
+
zone = ZoneOffset.new(5, time)
|
182
183
|
|
183
|
-
now
|
184
|
-
now.hour.should == actual_now.hour
|
185
|
-
now.min.should == actual_now.min
|
186
|
-
now.sec.should == actual_now.sec
|
187
|
-
now.year.should == actual_now.year
|
188
|
-
now.month.should == actual_now.month
|
189
|
-
now.day.should == actual_now.day
|
184
|
+
expect( zone.now ).to eq ::Time.utc(2013, 1, 1, 15, 0, 0)
|
190
185
|
end
|
186
|
+
end
|
191
187
|
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
actual_now = Time.now.utc + (-6*60*60)
|
197
|
-
|
198
|
-
now = @zone.today
|
199
|
-
now.year.should == actual_now.year
|
200
|
-
now.month.should == actual_now.month
|
201
|
-
now.day.should == actual_now.day
|
188
|
+
describe '#to_s' do
|
189
|
+
it 'returns the input zone' do
|
190
|
+
expect( ZoneOffset.new(5).to_s ).to eq '5'
|
202
191
|
end
|
192
|
+
end
|
203
193
|
|
204
|
-
|
205
|
-
|
206
|
-
|
194
|
+
describe '#local_to_utc' do
|
195
|
+
it 'converts a time in the local time zone to UTC' do
|
196
|
+
zone = ZoneOffset.new(5)
|
197
|
+
local_time = ::Time.now.utc
|
207
198
|
|
208
|
-
|
209
|
-
utc_time.month.should == (local_time - @zone.offset).month
|
210
|
-
utc_time.day.should == (local_time - @zone.offset).day
|
211
|
-
utc_time.hour.should == (local_time - @zone.offset).hour
|
212
|
-
utc_time.min.should == (local_time - @zone.offset).min
|
213
|
-
utc_time.sec.should == (local_time - @zone.offset).sec
|
199
|
+
expect( zone.local_to_utc(local_time).to_i ).to eq((local_time - zone.offset).to_i)
|
214
200
|
end
|
201
|
+
end
|
215
202
|
|
216
|
-
|
217
|
-
|
218
|
-
|
203
|
+
describe '#utc_to_local' do
|
204
|
+
it 'converts a time in the local time zone to UTC' do
|
205
|
+
zone = ZoneOffset.new(5)
|
206
|
+
utc_time = ::Time.now.utc
|
219
207
|
|
220
|
-
|
221
|
-
local_time.month.should == (utc_time + @zone.offset).month
|
222
|
-
local_time.day.should == (utc_time + @zone.offset).day
|
223
|
-
local_time.hour.should == (utc_time + @zone.offset).hour
|
224
|
-
local_time.min.should == (utc_time + @zone.offset).min
|
225
|
-
local_time.sec.should == (utc_time + @zone.offset).sec
|
208
|
+
expect( zone.utc_to_local(utc_time).to_i ).to eq((utc_time + zone.offset).to_i)
|
226
209
|
end
|
227
|
-
|
228
210
|
end
|
211
|
+
end
|
229
212
|
|
230
|
-
|
213
|
+
describe ZoneCode do
|
214
|
+
def stub_time(utc_now)
|
215
|
+
now = double(:now, utc: utc_now)
|
216
|
+
double(:time_class, now: now)
|
217
|
+
end
|
231
218
|
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
@zone = Data::Zone.new(@timezone)
|
219
|
+
describe '.detect?' do
|
220
|
+
it 'returns false when given a full timezone' do
|
221
|
+
expect( ZoneCode.detect?('America/Los_Angeles') ).to be_false
|
236
222
|
end
|
237
223
|
|
238
|
-
it
|
239
|
-
|
240
|
-
@zone.zone_offset.should == @timezone
|
224
|
+
it 'returns true when given a timezone code' do
|
225
|
+
expect( ZoneCode.detect?('PST') ).to be_true
|
241
226
|
end
|
242
227
|
|
243
|
-
it
|
244
|
-
|
228
|
+
it 'returns true when given an obscure timezone code' do
|
229
|
+
expect( ZoneCode.detect?('CEST') ).to be_true
|
245
230
|
end
|
246
231
|
|
247
|
-
it
|
248
|
-
|
232
|
+
it 'returns false when given an invalid timezone code' do
|
233
|
+
expect( ZoneCode.detect?('ABC') ).to be_false
|
249
234
|
end
|
250
235
|
|
251
|
-
it
|
252
|
-
|
253
|
-
zone.tz.should be_nil
|
236
|
+
it 'returns false when given an offset' do
|
237
|
+
expect( ZoneCode.detect?(10) ).to be_false
|
254
238
|
end
|
255
239
|
|
256
|
-
it
|
257
|
-
|
258
|
-
|
259
|
-
zone.tz = nil
|
260
|
-
zone.tz.should be_nil
|
261
|
-
zone.offset.should == (@timezone * 60 * 60)
|
262
|
-
|
263
|
-
zone = Data::Zone.new(@timezone)
|
264
|
-
zone.offset.should == (@timezone * 60 * 60)
|
240
|
+
it 'returns false when given nothing' do
|
241
|
+
expect( ZoneCode.detect?('') ).to be_false
|
242
|
+
expect( ZoneCode.detect?(nil) ).to be_false
|
265
243
|
end
|
244
|
+
end
|
266
245
|
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
zone.tz = nil
|
271
|
-
zone.tz.should be_nil
|
272
|
-
zone.full.should be_nil
|
273
|
-
|
274
|
-
zone = Data::Zone.new(@timezone)
|
275
|
-
zone.full.should be_nil
|
246
|
+
describe '#code' do
|
247
|
+
it 'returns the input code' do
|
248
|
+
expect( ZoneCode.new('PST').code ).to eq 'PST'
|
276
249
|
end
|
250
|
+
end
|
277
251
|
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
zone.tz = nil
|
282
|
-
zone.tz.should be_nil
|
283
|
-
zone.code.should be_nil
|
284
|
-
|
285
|
-
zone = Data::Zone.new(@timezone)
|
286
|
-
zone.code.should be_nil
|
252
|
+
describe '#offset' do
|
253
|
+
it 'returns the offset in seconds' do
|
254
|
+
expect( ZoneCode.new('PST').offset ).to eq(-8 * 60 * 60)
|
287
255
|
end
|
288
256
|
|
289
|
-
it
|
290
|
-
|
291
|
-
@zone.now.is_a?(Time).should be_true
|
292
|
-
|
293
|
-
actual_now = Time.now.utc + (@timezone.to_f*60*60)
|
294
|
-
|
295
|
-
now = @zone.now
|
296
|
-
now.hour.should == actual_now.hour
|
297
|
-
now.min.should == actual_now.min
|
298
|
-
now.sec.should == actual_now.sec
|
299
|
-
now.year.should == actual_now.year
|
300
|
-
now.month.should == actual_now.month
|
301
|
-
now.day.should == actual_now.day
|
257
|
+
it 'returns the offset in seconds for an obscure input code' do
|
258
|
+
expect( ZoneCode.new('CEST').offset ).to eq(2 * 60 * 60)
|
302
259
|
end
|
303
260
|
|
304
|
-
it
|
305
|
-
|
306
|
-
@zone.today.is_a?(Date).should be_true
|
307
|
-
|
308
|
-
actual_now = Time.now.utc + (@timezone.to_f*60*60)
|
309
|
-
|
310
|
-
now = @zone.today
|
311
|
-
now.year.should == actual_now.year
|
312
|
-
now.month.should == actual_now.month
|
313
|
-
now.day.should == actual_now.day
|
261
|
+
it 'returns 0 for unknown codes' do
|
262
|
+
expect( ZoneCode.new('ABC').offset ).to be_zero
|
314
263
|
end
|
264
|
+
end
|
315
265
|
|
316
|
-
|
317
|
-
|
318
|
-
|
266
|
+
describe '#now' do
|
267
|
+
it 'returns the current local time' do
|
268
|
+
time = stub_time(::Time.utc(2013, 1, 1, 10, 0, 0))
|
269
|
+
zone = ZoneCode.new('PST', time)
|
319
270
|
|
320
|
-
|
321
|
-
utc_time.month.should == (local_time - @zone.offset).month
|
322
|
-
utc_time.day.should == (local_time - @zone.offset).day
|
323
|
-
utc_time.hour.should == (local_time - @zone.offset).hour
|
324
|
-
utc_time.min.should == (local_time - @zone.offset).min
|
325
|
-
utc_time.sec.should == (local_time - @zone.offset).sec
|
271
|
+
expect( zone.now ).to eq ::Time.utc(2013, 1, 1, 2, 0, 0)
|
326
272
|
end
|
273
|
+
end
|
327
274
|
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
local_time.year.should == (utc_time + @zone.offset).year
|
333
|
-
local_time.month.should == (utc_time + @zone.offset).month
|
334
|
-
local_time.day.should == (utc_time + @zone.offset).day
|
335
|
-
local_time.hour.should == (utc_time + @zone.offset).hour
|
336
|
-
local_time.min.should == (utc_time + @zone.offset).min
|
337
|
-
local_time.sec.should == (utc_time + @zone.offset).sec
|
275
|
+
describe '#to_s' do
|
276
|
+
it 'returns the input zone' do
|
277
|
+
expect( ZoneCode.new('PST').to_s ).to eq 'PST'
|
338
278
|
end
|
339
|
-
|
340
279
|
end
|
341
280
|
|
342
|
-
|
281
|
+
describe '#local_to_utc' do
|
282
|
+
it 'converts a time in the local time zone to UTC' do
|
283
|
+
zone = ZoneCode.new('PST')
|
284
|
+
local_time = ::Time.now.utc
|
343
285
|
|
344
|
-
|
345
|
-
|
346
|
-
it "recognozes a full time zone format" do
|
347
|
-
Data::Zone.is_zone_full?("invalid").should be_false
|
348
|
-
Data::Zone.is_zone_full?("America/New York").should be_true
|
286
|
+
expect( zone.local_to_utc(local_time).to_i ).to eq((local_time - zone.offset).to_i)
|
287
|
+
end
|
349
288
|
end
|
350
289
|
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
Data::Zone.is_zone_offset?(-10).should be_true
|
356
|
-
end
|
290
|
+
describe '#utc_to_local' do
|
291
|
+
it 'converts a time in the local time zone to UTC' do
|
292
|
+
zone = ZoneCode.new('PST')
|
293
|
+
utc_time = ::Time.now.utc
|
357
294
|
|
358
|
-
|
359
|
-
|
360
|
-
Data::Zone.is_zone_code?("MST").should be_true
|
361
|
-
Data::Zone.is_zone_code?("EAST").should be_true
|
295
|
+
expect( zone.utc_to_local(utc_time).to_i ).to eq((utc_time + zone.offset).to_i)
|
296
|
+
end
|
362
297
|
end
|
363
|
-
|
364
298
|
end
|
365
|
-
|
366
299
|
end
|