Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Releases: ArtSabintsev/Guitar

Changes to accommodate Swift 4.1

29 Mar 20:25
Compare
Choose a tag to compare

Minor changes in a few places to make the library Swift 4.1 compatible.

Fixed Warnings and Updated Podspec

15 Mar 03:03
Compare
Choose a tag to compare
  • Fixed .characters reference warning.
  • Updated Podspec file.
  • Removed .swift-version file, as it's been deprecated.

Support for Swift 4 / iOS 11 / Xcode 9

14 Sep 01:59
Compare
Choose a tag to compare

Siren v0.3.0 adds support for Swift 4 / iOS 11 / Xcode 9.

A small set of functions offered by Guitar were removed in this version as Apple added many of these features to the Swift 4 language. The functions that were removed were: first, last, length, prefixed, suffixed, trimLeft, trimRight, truncated. The reversed function was renamed to reversedString as it acts slightly differently than Swift's built-in reversed function.

Moving forward, only support for the Swift 4 codebase (on master) will be maintained.

Swift Version Branch Name Will Continue to Receive Updates?
4.0 master Yes
3.2 swift3.2 No
3.1 swift3.1 No

Swift PM Improvements

25 Apr 02:29
Compare
Choose a tag to compare

#18

  • Tests moved to Tests/ folder in root directory
  • Added support for Linux Tests.
  • Invoked #availability and #if os() checks where necessary.

Beta Release!

15 Apr 21:53
Compare
Choose a tag to compare

As of v0.1.0, Guitar has transitioned from alpha to beta.

The existing API has stabilized and tests have been written for each public method and extension. Documentation has also been updated. To move from beta to a 1.0.0 release, more real-world testing is needed.

Please leave issues and PRs with any missing features or bugs!

Thanks!

Arthur

Latinization function

09 Apr 20:11
Compare
Choose a tag to compare

#16
Adds a latinization function (thanks to @EthanSchatzline)

    func testLatinized() {
        XCTAssertEqual("Hello! こんにちは! สวัสดี! مرحبا! 您好!".latinized(), "Hello! kon'nichiha! swasdi! mrhba! nin hao!")
        XCTAssertEqual("как прекрасен этот мир".latinized(), "kak prekrasen etot mir")
        XCTAssertEqual("你叫(做)乜野名呀?".latinized(), "ni jiao (zuo) mie ye ming ya?")
        XCTAssertEqual("어떻게 지내세요?".latinized(), "eotteohge jinaeseyo?")
        XCTAssertEqual("What a wonderful world! That's not cliché at all!".latinized(), "What a wonderful world! That's not cliche at all!")

    }

Latinization Function

08 Apr 14:55
Compare
Choose a tag to compare

#15

  • @EthanSchatzline added the implementation and tests for withoutAccents(), which removes diacritics (e.g., accent marks) from latin characters. This is sometime referred to as latinization.

Guitar.Chord

27 Mar 00:30
Compare
Choose a tag to compare

Chord is now an enum within the Guitar class, which is turning more into a Regex handling class.

Kebab Case and Slug Case

27 Mar 00:30
Compare
Choose a tag to compare

Renamed slugCased function. Renamed it to kebabCased.

Removed kebabCased's old functionality as it was useless.

splitWordsByCase() Function

13 Mar 05:52
Compare
Choose a tag to compare

In #12, I added a new splitWordsByCase() function that is able to create a string with whitespace-delimited words from any other case; camelCased, -kebab-cased-, PascalCase, snake_case, slug-case.

A few examples from the tests:

    func testCaseMorphing() {
        let string = "Hello World"

        XCTAssertEqual(string.camelCased().kebabCased(), "-hello-world-")
        XCTAssertEqual(string.camelCased().pascalCased(), "HelloWorld")
        XCTAssertEqual(string.camelCased().slugCased(), "hello-world")
        XCTAssertEqual(string.camelCased().snakeCased(), "hello_world")

        XCTAssertEqual(string.kebabCased().camelCased(), "helloWorld")
        XCTAssertEqual(string.kebabCased().pascalCased(), "HelloWorld")
        XCTAssertEqual(string.kebabCased().slugCased(), "hello-world")
        XCTAssertEqual(string.kebabCased().snakeCased(), "hello_world")

        XCTAssertEqual(string.pascalCased().camelCased(), "helloWorld")
        XCTAssertEqual(string.pascalCased().kebabCased(), "-hello-world-")
        XCTAssertEqual(string.pascalCased().slugCased(), "hello-world")
        XCTAssertEqual(string.pascalCased().snakeCased(), "hello_world")

        XCTAssertEqual(string.slugCased().camelCased(), "helloWorld")
        XCTAssertEqual(string.slugCased().kebabCased(), "-hello-world-")
        XCTAssertEqual(string.slugCased().pascalCased(), "HelloWorld")
        XCTAssertEqual(string.slugCased().snakeCased(), "hello_world")

        XCTAssertEqual(string.snakeCased().camelCased(), "helloWorld")
        XCTAssertEqual(string.snakeCased().kebabCased(), "-hello-world-")
        XCTAssertEqual(string.snakeCased().pascalCased(), "HelloWorld")
        XCTAssertEqual(string.snakeCased().slugCased(), "hello-world")
    }