Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: Remove Yellow Line Rush Plus #33

Merged
merged 1 commit into from
Jan 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions Sources/WMATA/Line+OldLineCodes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,4 @@ public extension Line {

@available(*, deprecated, renamed: "silver")
static let SV = Self.silver

@available(*, deprecated, renamed: "yellowLineRushPlus")
static let YLRP = Self.yellowLineRushPlus
}
23 changes: 5 additions & 18 deletions Sources/WMATA/Line.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ public enum Line: String, CaseIterable, Codable, Hashable, Equatable, RawReprese

/// Silver Line
case silver = "SV"

/// Yellow Line Rush Plus (not currently used)
///
/// This line is only used in the ``Rail/StandardRoutes`` endpoint, and is not in normal service.
case yellowLineRushPlus = "YLRP"
}

public extension Line {
Expand All @@ -43,35 +38,27 @@ public extension Line {
switch self {
case .red:
return "Red"

case .blue:
return "Blue"

case .yellow:
return "Yellow"

case .orange:
return "Orange"

case .green:
return "Green"

case .silver:
return "Silver"

case .yellowLineRushPlus:
return "Yellow Line Rush Plus"
}
}

/// If this line is currently used. ``YLRP`` is not current.
///
/// True for all other lines.
/// Deprecated. All Lines are current. You do not need to check for currency.
@available(*, deprecated, message: "All lines are now current. You may simply remove all calls to this property.")
var current: Bool {
Line.allCurrent.contains(self)
true
}

/// All of the current Lines. ``YLRP`` is not included.
/// Deprecated. Use `allCases` instead.
@available(*, deprecated, renamed: "allCases", message: "All lines are now current.")
static var allCurrent: [Self] {
[.red, .blue, .yellow, .orange, .green, .silver]
}
Expand Down
4 changes: 1 addition & 3 deletions Sources/WMATA/Rail.swift
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,6 @@ public extension Rail {
///
/// Information provided by this endpoint can be used with data from ``Rail/TrainPositions`` and ``Rail/TrackCircuits``
///
/// > Note: This endpoint can return data for the ``Line/YLRP`` line, which is not currently used by WMATA.
///
/// [Additional Details](https://developer.wmata.com/TrainPositionsFAQ)
///
/// [WMATA Standard Routes Documentation](https://developer.wmata.com/docs/services/5763fa6ff91823096cac1057/operations/57641afc031f59363c586dca)
Expand Down Expand Up @@ -995,7 +993,7 @@ public extension Rail {
///
/// For terminal stations (e.g.: Greenbelt, Shady Grove, etc.), predictions may be displayed twice.
///
/// Some stations have two platforms (e.g.: Gallery Place, Fort Totten, L'Enfant Plaza, and Metro Center). Use ``Array/galleryPlace`` and similar for these stations.
/// Some stations have two platforms (e.g.: Gallery Place, Fort Totten, L'Enfant Plaza, and Metro Center). Use `Array.galleryPlace` and similar for these stations.
///
/// For trains with no passengers, the `destinationName` will be `No Passenger`.
///
Expand Down
2 changes: 2 additions & 0 deletions Sources/WMATA/WMATA.docc/Documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ For more details, check out <doc:Endpoints>.

### Updating from Previous Versions

- <doc:v13-Migration-Guide>
- <doc:v12-Migration-Guide>
- <doc:v11-Migration-Guide>

[wmata]: https://developer.wmata.com
27 changes: 27 additions & 0 deletions Sources/WMATA/WMATA.docc/v12 Migration Guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# v12 Migration Guide

WMATA.swift v12 removes the need to use `StationSet` when making calls to ``Rail/NextTrains``.

## Breaking changes

- Removed `Rail.NextTrains.StationSet`.

This part of the package now works more similarly to the rest of the package.

If you wish to make a request for trains at all MetroRail stations, omit the `stations` parameter when using ``Rail/NextTrains/init(key:stations:delegate:)``. Example:

```swift
let nextTrains = Rail.NextTrains(key: API_KEY)
```

If you wish wish to make a request for multiple stations, pass an array of stations to ``Rail/NextTrains/init(key:stations:delegate:)``

```swift
let nextTrains = Rail.NextTrains(key: API_KEY, stations: [.waterfront, .navyYard])
let nextTrains = Rail.NextTrains(key: API_KEY, stations: .fortTotten) // Call for both stations at Fort Totten
```

- Moved `Rail.NextTrains.StationSet.lenfantPlaza` to `Array.lenfantPlaza`
- Moved `Rail.NextTrains.StationSet.metroCenter` to `Array.metroCenter`
- Moved `Rail.NextTrains.StationSet.fortTotten` to `Array.fortTotten`
- Moved `Rail.NextTrains.StationSet.galleryPlace` to `Array.galleryPlace`
17 changes: 17 additions & 0 deletions Sources/WMATA/WMATA.docc/v13 Migration Guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# v13 Migration Guide

WMATA.swift v13 removes the long-unused Yellow Line Rush Plus line, as it's finally been removed from the WMATA API.

## Breaking changes

- Removed `Line.yellowLineRushPlus`.

Data for this line is no longer available from the Standard Routes API. You may need to remove references to this line in your response handling for calls to the ``Rail/StandardRoutes`` endpoint.

- Removed previously deprecated `Line.YLRP`.

## Deprecations

- ``Line/current``, simply remove all references to this property. All lines are current.

- ``Line/allCurrent``, use `Line.allCases` instead.
Loading