Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/Kosoku/Feige
Browse files Browse the repository at this point in the history
  • Loading branch information
willbur1984 committed Feb 4, 2025
2 parents df94dd1 + dcc839c commit 2eddda1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 41 deletions.
29 changes: 1 addition & 28 deletions Feige.podspec
Original file line number Diff line number Diff line change
@@ -1,33 +1,6 @@
Pod::Spec.new do |s|
s.name = 'Feige'
s.version = '2.2.1'
s.summary = 'Feige is a Swift iOS/macOS/tvOS/watchOS framework that extends the Foundation framework.'

s.description = <<-DESC
Feige is an iOS/macOS/tvOS/watchOS framework that extends the `Foundation` framework. It includes a number of macros, functions, categories and classes that make repetitive tasks easier.
DESC

s.homepage = 'https://github.com/Kosoku/Feige'
s.license = { :type => 'Apache 2.0', :file => 'LICENSE.txt' }
s.authors = { 'Jason Anderson' => '[email protected]', 'William Towe' => '[email protected]' }
s.source = { :git => 'https://github.com/Kosoku/Feige.git', :tag => s.version.to_s }

s.ios.deployment_target = '14.0'
s.osx.deployment_target = '11.0'
s.tvos.deployment_target = '13.0'
s.watchos.deployment_target = '5.0'

s.requires_arc = true

s.source_files = 'Feige/**/*.{h,m,swift}'

s.swift_versions = ['5']

s.frameworks = 'Foundation'
end
Pod::Spec.new do |s|
s.name = 'Feige'
s.version = '2.2.1'
s.version = '2.2.3'
s.summary = 'Feige is a Swift iOS/macOS/tvOS/watchOS framework that extends the Foundation framework.'

s.description = <<-DESC
Expand Down
2 changes: 1 addition & 1 deletion Feige/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>2.2.1</string>
<string>2.2.3</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSHumanReadableCopyright</key>
Expand Down
24 changes: 12 additions & 12 deletions Feige/ScopeFunctions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ import Foundation
*/
@inlinable
@inline(__always)
public func run<T>(_ block: () -> T) -> T {
block()
public func run<T>(_ block: () throws -> T) rethrows -> T {
try block()
}

/**
Expand Down Expand Up @@ -74,8 +74,8 @@ public extension ScopeFunctions {
*/
@inlinable
@inline(__always)
func `let`<T>(_ block: (Self) -> T) -> T {
block(self)
func `let`<T>(_ block: (Self) throws -> T) rethrows -> T {
try block(self)
}

/**
Expand All @@ -97,8 +97,8 @@ public extension ScopeFunctions {
*/
@inlinable
@inline(__always)
func takeIf(_ predicate: (Self) -> Bool) -> Self? {
predicate(self) ? self : nil
func takeIf(_ predicate: (Self) throws -> Bool) rethrows -> Self? {
try predicate(self) ? self : nil
}

/**
Expand All @@ -120,8 +120,8 @@ public extension ScopeFunctions {
*/
@inlinable
@inline(__always)
func takeUnless(_ predicate: (Self) -> Bool) -> Self? {
predicate(self) ? nil : self
func takeUnless(_ predicate: (Self) throws -> Bool) rethrows -> Self? {
try predicate(self) ? nil : self
}
}

Expand Down Expand Up @@ -150,10 +150,10 @@ public extension ScopeFunctions where Self: Any {
@discardableResult
@inlinable
@inline(__always)
func also(_ block: (inout Self) -> Void) -> Self {
func also(_ block: (inout Self) throws -> Void) rethrows -> Self {
var retval = self

block(&retval)
try block(&retval)

return retval
}
Expand Down Expand Up @@ -184,8 +184,8 @@ public extension ScopeFunctions where Self: AnyObject {
@discardableResult
@inlinable
@inline(__always)
func also(_ block: (Self) -> Void) -> Self {
block(self)
func also(_ block: (Self) throws -> Void) rethrows -> Self {
try block(self)

return self
}
Expand Down

0 comments on commit 2eddda1

Please sign in to comment.