Skip to content

Commit

Permalink
Renamed project TrileanTribool
Browse files Browse the repository at this point in the history
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._
  • Loading branch information
capnslipp committed Feb 14, 2017
1 parent 3040fe5 commit 7ed93f0
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 42 deletions.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import PackageDescription

let package = Package(
name: "Trilean"
name: "Tribool"
)
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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`.
4 changes: 2 additions & 2 deletions Sources/Trilean.swift → Sources/Tribool.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -60,7 +60,7 @@ import Foundation

extension Bool
{
public init(_ value:Trilean) {
public init(_ value:Tribool) {
self = value.boolValue
}
}
12 changes: 6 additions & 6 deletions Trilean.podspec → Tribool.podspec
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "<group>"; };
OBJ_9 /* Trilean.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Trilean.swift; sourceTree = "<group>"; };
OBJ_9 /* Tribool.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tribool.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -37,7 +37,7 @@
OBJ_12 /* Products */ = {
isa = PBXGroup;
children = (
OBJ_13 /* Trilean.framework */,
OBJ_13 /* Tribool.framework */,
);
name = Products;
sourceTree = BUILT_PRODUCTS_DIR;
Expand All @@ -55,26 +55,26 @@
OBJ_7 /* Sources */ = {
isa = PBXGroup;
children = (
OBJ_8 /* Trilean */,
OBJ_8 /* Tribool */,
);
path = Sources;
sourceTree = "<group>";
};
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 */,
Expand All @@ -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 */
Expand All @@ -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;
Expand All @@ -108,7 +108,7 @@
projectDirPath = "";
projectRoot = "";
targets = (
OBJ_14 /* Trilean */,
OBJ_14 /* Tribool */,
);
};
/* End PBXProject section */
Expand All @@ -118,7 +118,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 0;
files = (
OBJ_19 /* Trilean.swift in Sources */,
OBJ_19 /* Tribool.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -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;
};
Expand All @@ -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;
};
Expand Down Expand Up @@ -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 */,
Expand All @@ -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 */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "OBJ_14"
BuildableName = "Trilean.framework"
BlueprintName = "Trilean"
ReferencedContainer = "container:Trilean.xcodeproj">
BuildableName = "Tribool.framework"
BlueprintName = "Tribool"
ReferencedContainer = "container:Tribool.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
Expand Down Expand Up @@ -46,9 +46,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "OBJ_14"
BuildableName = "Trilean.framework"
BlueprintName = "Trilean"
ReferencedContainer = "container:Trilean.xcodeproj">
BuildableName = "Tribool.framework"
BlueprintName = "Tribool"
ReferencedContainer = "container:Tribool.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<dict>
<key>SchemeUserState</key>
<dict>
<key>Trilean.xcscheme</key>
<key>Tribool.xcscheme</key>
<dict></dict>
</dict>
<key>SuppressBuildableAutocreation</key>
Expand Down

0 comments on commit 7ed93f0

Please sign in to comment.