-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Add a GitHub link to the Yams license (#30)
- Loading branch information
Showing
4 changed files
with
114 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
// Copyright (c) 2024 Jason Morley | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in all | ||
// copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
// SOFTWARE. | ||
|
||
import Foundation | ||
|
||
import Interact | ||
import Licensable | ||
|
||
fileprivate let materialIconsLicense = License(id: "https://github.com/google/material-design-icons", | ||
name: "Material Icons", | ||
author: "Google", | ||
text: String(contentsOfResource: "material-icons-license"), | ||
attributes: [ | ||
.url(URL(string: "https://github.com/google/material-design-icons")!, | ||
title: "GitHub"), | ||
]) | ||
|
||
fileprivate let hashRainbowLicense = License(id: "https://github.com/saramah/HashRainbow", | ||
name: "HashRainbow", | ||
author: "Sarah Barbour", | ||
text: String(contentsOfResource: "hashrainbow-license"), | ||
attributes: [ | ||
.url(URL(string: "https://github.com/saramah/HashRainbow")!, | ||
title: "GitHub"), | ||
]) | ||
|
||
fileprivate let yamsLicense = License(id: "https://github.com/jpsim/Yams", | ||
name: "Yams", | ||
author: "JP Simard", | ||
text: String(contentsOfResource: "yams-license"), | ||
attributes: [ | ||
.url(URL(string: "https://github.com/jpsim/Yams")!, title: "GitHub"), | ||
]) | ||
|
||
fileprivate let thoughtsLicense = License(id: "https://github.com/inseven/thoughts", | ||
name: "Thoughts", | ||
author: "Jason Morley", | ||
text: String(contentsOfResource: "thoughts-license"), | ||
attributes: [ | ||
.url(URL(string: "https://github.com/inseven/thoughts")!, title: "GitHub"), | ||
], | ||
licenses: [ | ||
.interact, | ||
.licensable, | ||
materialIconsLicense, | ||
hashRainbowLicense, | ||
yamsLicense, | ||
]) | ||
|
||
extension Licensable where Self == License { | ||
|
||
public static var thoughts: License { thoughtsLicense } | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright (c) 2024 Jason Morley | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in all | ||
// copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
// SOFTWARE. | ||
|
||
import Foundation | ||
|
||
extension String { | ||
|
||
init(contentsOfResource resource: String) { | ||
let url = Bundle.main.url(forResource: resource, withExtension: nil)! | ||
try! self.init(contentsOf: url) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,8 @@ import Interact | |
@main | ||
struct ThoughtsApp: App { | ||
|
||
static let title = "Thoughts Support (\(Bundle.main.version ?? "Unknown Version"))" | ||
|
||
var applicationModel = ApplicationModel() | ||
|
||
var body: some Scene { | ||
|
@@ -45,11 +47,9 @@ struct ThoughtsApp: App { | |
SettingsView(applicationModel: applicationModel) | ||
} | ||
|
||
let title = "Thoughts Support (\(Bundle.main.version ?? "Unknown Version"))" | ||
|
||
About(repository: "inseven/thoughts", copyright: "Copyright © 2024 Jason Morley") { | ||
Diligence.Action("GitHub", url: URL(string: "https://github.com/inseven/thoughts")!) | ||
Diligence.Action("Support", url: URL(address: "[email protected]", subject: title)!) | ||
Diligence.Action("Support", url: URL(address: "[email protected]", subject: Self.title)!) | ||
} acknowledgements: { | ||
Acknowledgements("Developers") { | ||
Credit("Jason Morley", url: URL(string: "https://jbmorley.co.uk")) | ||
|
@@ -59,11 +59,7 @@ struct ThoughtsApp: App { | |
Credit("Sarah Barbour") | ||
} | ||
} licenses: { | ||
(.interact) | ||
License("HashRainbow", author: "Sarah Barbour", filename: "hashrainbow-license") | ||
License("Material Icons", author: "Google", filename: "material-icons-license") | ||
License("Thoughts", author: "Jason Morley", filename: "thoughts-license") | ||
License("Yams", author: "JP Simard", filename: "yams-license") | ||
(.thoughts) | ||
} | ||
.handlesExternalEvents(matching: [.about]) | ||
|
||
|