From 7ed93f06251ceab4196627a51d406d39af3bb63d Mon Sep 17 00:00:00 2001 From: Slipp Douglas Thompson Date: Tue, 14 Feb 2017 16:09:22 -0600 Subject: [PATCH] =?UTF-8?q?Renamed=20project=20`Trilean`=E2=86=92`Tribool`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Renamed the project from `Trilean` to `Tribool`, out of respect for a preexisting Swift-Trilean project [here](https://github.com/phelgo/Trilean) _(and for the sake of CocoaPods' unique-name requirement)_. His lib seems to be more capable _(implementing Łukasiewicz logic)_, but also adds some cruft that I don't agree with _(global `yes`/`no`/`maybe` constants? `sure()`/`sureNot()`/`unsure()` free functions?)_, implements `Trilean` as a struct rather than an enum, and most importantly, doesn't provide `@objc` compatibility. My original motivation for creating this lib was that I needed vars of `Bool?` type accessible from Objective-C.  I couldn't find a way to do that implicitly, but since `Tribool` provides an `func init(_:Bool?)` and `var optionalBoolValue:Bool?`, it's a workable solution. Because of these differences, I'm choosing to stick with my own lib under a rename rather than try to introduce the functionality I need as pull requests on his project.  Sometimes simpler is just that much better. * Renamed files & find-and-replaced `Trilean` with `Tribool` everywhere.  Affected: ⁃ `Tribool.swift` ⁃ `README.md` _(also, changed preexisting text “AKA TriBool” to “AKA Trilean”)_ ⁃ `Package.swift`, `Tribool.podspec` ⁃ `Tribool.xcodeproj`, and contained files `Tribool_Info.plist`, `project.pbxproj`, `Tribool.xcscheme`, `xcschememanagement.plist` ‣ _Normally, a mass-find-and-replace within xcodeproj files isn't the best idea— it can cause more problems than it solves.  However, this project is simple enough that the replace was nice & clean, and I looked over and tested everything post-replace and it all looks good._ --- Package.swift | 2 +- README.md | 4 +- Sources/{Trilean.swift => Tribool.swift} | 4 +- Trilean.podspec => Tribool.podspec | 12 ++--- .../Tribool_Info.plist | 0 .../project.pbxproj | 48 +++++++++---------- .../contents.xcworkspacedata | 0 .../xcshareddata/xcschemes/Tribool.xcscheme | 12 ++--- .../xcschemes/xcschememanagement.plist | 2 +- 9 files changed, 42 insertions(+), 42 deletions(-) rename Sources/{Trilean.swift => Tribool.swift} (93%) rename Trilean.podspec => Tribool.podspec (55%) rename Trilean.xcodeproj/Trilean_Info.plist => Tribool.xcodeproj/Tribool_Info.plist (100%) rename {Trilean.xcodeproj => Tribool.xcodeproj}/project.pbxproj (83%) rename {Trilean.xcodeproj => Tribool.xcodeproj}/project.xcworkspace/contents.xcworkspacedata (100%) rename Trilean.xcodeproj/xcshareddata/xcschemes/Trilean.xcscheme => Tribool.xcodeproj/xcshareddata/xcschemes/Tribool.xcscheme (87%) rename {Trilean.xcodeproj => Tribool.xcodeproj}/xcshareddata/xcschemes/xcschememanagement.plist (86%) diff --git a/Package.swift b/Package.swift index 1ca2dcb..fb12287 100644 --- a/Package.swift +++ b/Package.swift @@ -1,5 +1,5 @@ import PackageDescription let package = Package( - name: "Trilean" + name: "Tribool" ) diff --git a/README.md b/README.md index 429283c..3694a8a 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ -# Trilean +# Tribool -Trilean is a Swift micro-library that provides an Obj-C-compatible `Trilean` enum type, for representing 3-value logic states: `.true`, `.false`, and `.indeterminate`. +Tribool is a Swift micro-library that provides an Obj-C-compatible `Tribool` enum type, for representing 3-value logic states: `.true`, `.false`, and `.indeterminate`. diff --git a/Sources/Trilean.swift b/Sources/Tribool.swift similarity index 93% rename from Sources/Trilean.swift rename to Sources/Tribool.swift index 985384f..c78f9b6 100644 --- a/Sources/Trilean.swift +++ b/Sources/Tribool.swift @@ -7,7 +7,7 @@ import Foundation /// Work-around for `Bool?` not being usable in this `@objc` model class. -@objc public enum Trilean : Int, ExpressibleByBooleanLiteral, CustomStringConvertible, CustomDebugStringConvertible +@objc public enum Tribool : Int, ExpressibleByBooleanLiteral, CustomStringConvertible, CustomDebugStringConvertible { case `true` = 1 case `false` = 0 @@ -60,7 +60,7 @@ import Foundation extension Bool { - public init(_ value:Trilean) { + public init(_ value:Tribool) { self = value.boolValue } } diff --git a/Trilean.podspec b/Tribool.podspec similarity index 55% rename from Trilean.podspec rename to Tribool.podspec index e813a10..74d58a6 100644 --- a/Trilean.podspec +++ b/Tribool.podspec @@ -1,12 +1,12 @@ Pod::Spec.new do |s| - s.name = 'Trilean' + s.name = 'Tribool' s.version = '1.0.0' - s.summary = 'A Swift µ-Library Providing a Trilean Type (AKA TriBool)' - s.description = "A Swift micro-library that provides an Obj-C-compatible Trilean enum type, for representing 3-value logic states: `.true`, `.false`, and `.indeterminate`." - s.homepage = 'https://github.com/capnslipp/Trilean' + s.summary = 'A Swift µ-Library Providing a Tribool Type (AKA Trilean)' + s.description = "A Swift micro-library that provides an Obj-C-compatible Tribool enum type, for representing 3-value logic states: `.true`, `.false`, and `.indeterminate`." + s.homepage = 'https://github.com/capnslipp/Tribool' s.license = { :type => 'Public Domain', :file => 'LICENSE' } - s.author = { 'capnslipp' => 'Trilean@capnslipp.com' } - s.source = { :git => 'https://github.com/capnslipp/Trilean.git', :tag => s.version.to_s } + s.author = { 'capnslipp' => 'Tribool@capnslipp.com' } + s.source = { :git => 'https://github.com/capnslipp/Tribool.git', :tag => s.version.to_s } s.social_media_url = 'https://twitter.com/capnslipp' s.ios.deployment_target = '8.0' s.osx.deployment_target = '10.9' diff --git a/Trilean.xcodeproj/Trilean_Info.plist b/Tribool.xcodeproj/Tribool_Info.plist similarity index 100% rename from Trilean.xcodeproj/Trilean_Info.plist rename to Tribool.xcodeproj/Tribool_Info.plist diff --git a/Trilean.xcodeproj/project.pbxproj b/Tribool.xcodeproj/project.pbxproj similarity index 83% rename from Trilean.xcodeproj/project.pbxproj rename to Tribool.xcodeproj/project.pbxproj index 7a08e16..450bd25 100644 --- a/Trilean.xcodeproj/project.pbxproj +++ b/Tribool.xcodeproj/project.pbxproj @@ -7,13 +7,13 @@ objects = { /* Begin PBXBuildFile section */ - OBJ_19 /* Trilean.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_9 /* Trilean.swift */; }; + OBJ_19 /* Tribool.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_9 /* Tribool.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - OBJ_13 /* Trilean.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Trilean.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + OBJ_13 /* Tribool.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Tribool.framework; sourceTree = BUILT_PRODUCTS_DIR; }; OBJ_6 /* Package.swift */ = {isa = PBXFileReference; explicitFileType = sourcecode.swift; path = Package.swift; sourceTree = ""; }; - OBJ_9 /* Trilean.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Trilean.swift; sourceTree = ""; }; + OBJ_9 /* Tribool.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tribool.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -37,7 +37,7 @@ OBJ_12 /* Products */ = { isa = PBXGroup; children = ( - OBJ_13 /* Trilean.framework */, + OBJ_13 /* Tribool.framework */, ); name = Products; sourceTree = BUILT_PRODUCTS_DIR; @@ -55,26 +55,26 @@ OBJ_7 /* Sources */ = { isa = PBXGroup; children = ( - OBJ_8 /* Trilean */, + OBJ_8 /* Tribool */, ); path = Sources; sourceTree = ""; }; - OBJ_8 /* Trilean */ = { + OBJ_8 /* Tribool */ = { isa = PBXGroup; children = ( - OBJ_9 /* Trilean.swift */, + OBJ_9 /* Tribool.swift */, ); - name = Trilean; + name = Tribool; path = Sources; sourceTree = SOURCE_ROOT; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - OBJ_14 /* Trilean */ = { + OBJ_14 /* Tribool */ = { isa = PBXNativeTarget; - buildConfigurationList = OBJ_15 /* Build configuration list for PBXNativeTarget "Trilean" */; + buildConfigurationList = OBJ_15 /* Build configuration list for PBXNativeTarget "Tribool" */; buildPhases = ( OBJ_18 /* Sources */, OBJ_20 /* Frameworks */, @@ -83,9 +83,9 @@ ); dependencies = ( ); - name = Trilean; - productName = Trilean; - productReference = OBJ_13 /* Trilean.framework */; + name = Tribool; + productName = Tribool; + productReference = OBJ_13 /* Tribool.framework */; productType = "com.apple.product-type.framework"; }; /* End PBXNativeTarget section */ @@ -96,7 +96,7 @@ attributes = { LastUpgradeCheck = 9999; }; - buildConfigurationList = OBJ_2 /* Build configuration list for PBXProject "Trilean" */; + buildConfigurationList = OBJ_2 /* Build configuration list for PBXProject "Tribool" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; @@ -108,7 +108,7 @@ projectDirPath = ""; projectRoot = ""; targets = ( - OBJ_14 /* Trilean */, + OBJ_14 /* Tribool */, ); }; /* End PBXProject section */ @@ -118,7 +118,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 0; files = ( - OBJ_19 /* Trilean.swift in Sources */, + OBJ_19 /* Tribool.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -134,14 +134,14 @@ "$(PLATFORM_DIR)/Developer/Library/Frameworks", ); HEADER_SEARCH_PATHS = "$(inherited)"; - INFOPLIST_FILE = Trilean.xcodeproj/Trilean_Info.plist; + INFOPLIST_FILE = Tribool.xcodeproj/Tribool_Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx"; OTHER_LDFLAGS = "$(inherited)"; OTHER_SWIFT_FLAGS = "$(inherited)"; - PRODUCT_BUNDLE_IDENTIFIER = Trilean; + PRODUCT_BUNDLE_IDENTIFIER = Tribool; PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - TARGET_NAME = Trilean; + TARGET_NAME = Tribool; }; name = Debug; }; @@ -154,14 +154,14 @@ "$(PLATFORM_DIR)/Developer/Library/Frameworks", ); HEADER_SEARCH_PATHS = "$(inherited)"; - INFOPLIST_FILE = Trilean.xcodeproj/Trilean_Info.plist; + INFOPLIST_FILE = Tribool.xcodeproj/Tribool_Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx"; OTHER_LDFLAGS = "$(inherited)"; OTHER_SWIFT_FLAGS = "$(inherited)"; - PRODUCT_BUNDLE_IDENTIFIER = Trilean; + PRODUCT_BUNDLE_IDENTIFIER = Tribool; PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - TARGET_NAME = Trilean; + TARGET_NAME = Tribool; }; name = Release; }; @@ -214,7 +214,7 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - OBJ_15 /* Build configuration list for PBXNativeTarget "Trilean" */ = { + OBJ_15 /* Build configuration list for PBXNativeTarget "Tribool" */ = { isa = XCConfigurationList; buildConfigurations = ( OBJ_16 /* Debug */, @@ -223,7 +223,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Debug; }; - OBJ_2 /* Build configuration list for PBXProject "Trilean" */ = { + OBJ_2 /* Build configuration list for PBXProject "Tribool" */ = { isa = XCConfigurationList; buildConfigurations = ( OBJ_3 /* Debug */, diff --git a/Trilean.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Tribool.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from Trilean.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to Tribool.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/Trilean.xcodeproj/xcshareddata/xcschemes/Trilean.xcscheme b/Tribool.xcodeproj/xcshareddata/xcschemes/Tribool.xcscheme similarity index 87% rename from Trilean.xcodeproj/xcshareddata/xcschemes/Trilean.xcscheme rename to Tribool.xcodeproj/xcshareddata/xcschemes/Tribool.xcscheme index ae5794a..f71ed28 100644 --- a/Trilean.xcodeproj/xcshareddata/xcschemes/Trilean.xcscheme +++ b/Tribool.xcodeproj/xcshareddata/xcschemes/Tribool.xcscheme @@ -15,9 +15,9 @@ + BuildableName = "Tribool.framework" + BlueprintName = "Tribool" + ReferencedContainer = "container:Tribool.xcodeproj"> @@ -46,9 +46,9 @@ + BuildableName = "Tribool.framework" + BlueprintName = "Tribool" + ReferencedContainer = "container:Tribool.xcodeproj"> diff --git a/Trilean.xcodeproj/xcshareddata/xcschemes/xcschememanagement.plist b/Tribool.xcodeproj/xcshareddata/xcschemes/xcschememanagement.plist similarity index 86% rename from Trilean.xcodeproj/xcshareddata/xcschemes/xcschememanagement.plist rename to Tribool.xcodeproj/xcshareddata/xcschemes/xcschememanagement.plist index 89f669e..798cbd5 100644 --- a/Trilean.xcodeproj/xcshareddata/xcschemes/xcschememanagement.plist +++ b/Tribool.xcodeproj/xcshareddata/xcschemes/xcschememanagement.plist @@ -3,7 +3,7 @@ SchemeUserState - Trilean.xcscheme + Tribool.xcscheme SuppressBuildableAutocreation