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

Commit

Permalink
Updated docs, podspecs, and some metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtSabintsev committed Apr 8, 2017
1 parent 92932ae commit bb2edf3
Show file tree
Hide file tree
Showing 51 changed files with 481 additions and 2,962 deletions.
2 changes: 1 addition & 1 deletion .jazzy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ author_url: http://www.sabintsev.com
github_url: https://github.com/artsabintsev/guitar
copyright: "© 2016-2017 [Arthur Ariel Sabintsev](http://www.sabintsev.com)"
clean: true
podspec: ../Guitar.podspec
podspec: Guitar.podspec
14 changes: 7 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,14 @@ GEM
netrc (= 0.7.8)
cocoapods-try (1.1.0)
colored (1.2)
colored2 (3.1.2)
colorize (0.8.1)
escape (0.0.4)
fourflusher (2.0.1)
fuzzy_match (2.0.4)
gh_inspector (1.0.3)
i18n (0.8.1)
jazzy (0.7.4)
jazzy (0.7.5)
cocoapods (~> 1.0)
mustache (~> 0.99)
open4
Expand All @@ -60,7 +61,7 @@ GEM
xcinvoke (~> 0.3.0)
liferaft (0.0.6)
minitest (5.10.1)
molinillo (0.5.6)
molinillo (0.5.7)
mustache (0.99.8)
nanaimo (0.2.3)
nap (1.1.0)
Expand All @@ -76,15 +77,14 @@ GEM
colorize (~> 0.7)
xcodeproj (~> 1.0)
thread_safe (0.3.6)
tzinfo (1.2.2)
tzinfo (1.2.3)
thread_safe (~> 0.1)
xcinvoke (0.3.0)
liferaft (~> 0.0.6)
xcodeproj (1.4.2)
xcodeproj (1.4.4)
CFPropertyList (~> 2.3.3)
activesupport (>= 3)
claide (>= 1.0.1, < 2.0)
colored (~> 1.2)
colored2 (~> 3.1)
nanaimo (~> 0.2.3)

PLATFORMS
Expand All @@ -95,4 +95,4 @@ DEPENDENCIES
synx

BUNDLED WITH
1.14.5
1.14.6
2 changes: 1 addition & 1 deletion Guitar.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'Guitar'
s.version = '0.0.13'
s.version = '0.0.14'
s.summary = 'A Cross-Platform String and Regular Expression Library Written in Swift.'

description = <<-DESC
Expand Down
6 changes: 3 additions & 3 deletions GuitarExample/GuitarExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0820;
LastUpgradeCheck = 0820;
LastUpgradeCheck = 0830;
ORGANIZATIONNAME = "Arthur Ariel Sabintsev";
TargetAttributes = {
55DA07561E66AF2200080633 = {
Expand Down Expand Up @@ -467,7 +467,7 @@
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = HT94948NDD;
Expand All @@ -493,7 +493,7 @@
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = HT94948NDD;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0820"
LastUpgradeVersion = "0830"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0820"
LastUpgradeVersion = "0830"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
20 changes: 10 additions & 10 deletions GuitarExample/GuitarExampleTests/GuitarCharacterTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,7 @@ class GuitarCharacterTests: XCTestCase {
XCTAssertEqual("-Hello_World-".last(), "-")
}

func testWithoutAccents() {
XCTAssertEqual("Crème brûlée".withoutAccents(), "Creme brulee")
XCTAssertEqual("août décembre".withoutAccents(), "aout decembre")
XCTAssertEqual("öffne die Tür".withoutAccents(), "offne die Tur")
XCTAssertEqual("El niño corrió hácia el balcón".withoutAccents(), "El nino corrio hacia el balcon")
XCTAssertEqual("meu coração vai continuar".withoutAccents(), "meu coracao vai continuar")
XCTAssertEqual("Hēllö wōrld, Î åm Šïrį āńd Ī čãrrÿ thė àñśwêr tó lìfę".withoutAccents(), "Hello world, I am Siri and I carry the answer to life")
}

func testlength() {
func testLength() {
XCTAssertEqual("Hello World".length(), 11)
XCTAssertEqual("Hello_World".length(), 11)
XCTAssertEqual(" Hello World ".length(), 15)
Expand All @@ -44,4 +35,13 @@ class GuitarCharacterTests: XCTestCase {
XCTAssertEqual("-Hello_World-".reversed(), "-dlroW_olleH-")
}

func testWithoutAccents() {
XCTAssertEqual("Crème brûlée".withoutAccents(), "Creme brulee")
XCTAssertEqual("août décembre".withoutAccents(), "aout decembre")
XCTAssertEqual("öffne die Tür".withoutAccents(), "offne die Tur")
XCTAssertEqual("El niño corrió hácia el balcón".withoutAccents(), "El nino corrio hacia el balcon")
XCTAssertEqual("meu coração vai continuar".withoutAccents(), "meu coracao vai continuar")
XCTAssertEqual("Hēllö wōrld, Î åm Šïrį āńd Ī čãrrÿ thė àñśwêr tó lìfę".withoutAccents(), "Hello world, I am Siri and I carry the answer to life")
}

}
28 changes: 17 additions & 11 deletions Sources/Guitar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,6 @@ public struct Guitar {
return ranges
}

public func replaceOccurences(in string: String, with character: String) -> String {
let ranges = Guitar(pattern: pattern).evaluate(string: string)

var newString = string
for range in ranges {
newString.replaceSubrange(range, with: character)
}

return newString
}

/// Tests a string to see if it matches the regular expression pattern.
///
/// - Parameters:
Expand Down Expand Up @@ -98,3 +87,20 @@ public extension Guitar {
return Guitar(chord: .nonAlphanumeric).replaceOccurences(in: string, with: " ").trimmingCharacters(in: .whitespacesAndNewlines)
}
}

// MARK: - Helpers

public extension Guitar {

func replaceOccurences(in string: String, with character: String) -> String {
let ranges = Guitar(pattern: pattern).evaluate(string: string)

var newString = string
for range in ranges {
newString.replaceSubrange(range, with: character)
}

return newString
}

}
3 changes: 2 additions & 1 deletion Sources/GuitarBoolean.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

import Foundation

/// Boolean Operations
// MARK: - Boolean Operations

public extension String {

/// A Boolean value indicating if all the characters are letters.
Expand Down
3 changes: 2 additions & 1 deletion Sources/GuitarCase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

import Foundation

/// Case Operations
// MARK: - Case Operations

public extension String {

/// Returns a camel cased version of the string.
Expand Down
3 changes: 2 additions & 1 deletion Sources/GuitarCharacter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

import Foundation

/// Character Operations
// MARK: - Character Operations

public extension String {

/// Returns the first character of the string.
Expand Down
2 changes: 1 addition & 1 deletion Sources/GuitarChord.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

// MARK: - Chord
// MARK: - Guitar.Chord

public extension Guitar {

Expand Down
3 changes: 2 additions & 1 deletion Sources/GuitarPadding.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

import Foundation

/// Padding Operations
// MARK: - Padding Operations

public extension String {

/// Returns the center-padded version of the string.
Expand Down
3 changes: 2 additions & 1 deletion Sources/GuitarTrimming.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

import Foundation

/// Trimming Operations
// MARK: - Trimming Operations

public extension String {

/// Returns a prefixed version of the string.
Expand Down
4 changes: 2 additions & 2 deletions docs/Extensions.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<a title="Extensions Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="index.html">Guitar Docs</a> (100% documented)</p>
<p><a href="index.html">Guitar Docs</a> (91% documented)</p>
<p class="header-right"><a href="https://github.com/artsabintsev/guitar"><img src="img/gh.png"/>View on GitHub</a></p>
</div>
</header>
Expand Down Expand Up @@ -91,7 +91,7 @@ <h4>Declaration</h4>
</section>
<section id="footer">
<p>© 2016-2017 <a class="link" href="http://www.sabintsev.com" target="_blank" rel="external">Arthur Ariel Sabintsev</a></p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.5</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
Expand Down
41 changes: 39 additions & 2 deletions docs/Extensions/String.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<a title="String Extension Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">Guitar Docs</a> (100% documented)</p>
<p><a href="../index.html">Guitar Docs</a> (91% documented)</p>
<p class="header-right"><a href="https://github.com/artsabintsev/guitar"><img src="../img/gh.png"/>View on GitHub</a></p>
</div>
</header>
Expand Down Expand Up @@ -745,6 +745,43 @@ <h4>Return Value</h4>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FE6GuitarSS14withoutAccentsFT_SS"></a>
<a name="//apple_ref/swift/Method/withoutAccents()" class="dashAnchor"></a>
<a class="token" href="#/s:FE6GuitarSS14withoutAccentsFT_SS">withoutAccents()</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Returns the string without diacritics.</p>

<pre class="highlight plaintext"><code>let string = "Crème brûlée"
print(string.withoutAccents())
// Prints "Creme brulee"
</code></pre>

</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">withoutAccents</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">String</span></code></pre>

</div>
</div>
<div>
<h4>Return Value</h4>
<p>The string without diacritics.</p>

</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
Expand Down Expand Up @@ -1287,7 +1324,7 @@ <h4>Return Value</h4>
</section>
<section id="footer">
<p>© 2016-2017 <a class="link" href="http://www.sabintsev.com" target="_blank" rel="external">Arthur Ariel Sabintsev</a></p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.5</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
Expand Down
4 changes: 2 additions & 2 deletions docs/Structs.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<a title="Structs Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="index.html">Guitar Docs</a> (100% documented)</p>
<p><a href="index.html">Guitar Docs</a> (91% documented)</p>
<p class="header-right"><a href="https://github.com/artsabintsev/guitar"><img src="img/gh.png"/>View on GitHub</a></p>
</div>
</header>
Expand Down Expand Up @@ -84,7 +84,7 @@ <h1>Structs</h1>
</section>
<section id="footer">
<p>© 2016-2017 <a class="link" href="http://www.sabintsev.com" target="_blank" rel="external">Arthur Ariel Sabintsev</a></p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.5</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
Expand Down
4 changes: 2 additions & 2 deletions docs/Structs/Guitar.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<a title="Guitar Struct Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">Guitar Docs</a> (100% documented)</p>
<p><a href="../index.html">Guitar Docs</a> (91% documented)</p>
<p class="header-right"><a href="https://github.com/artsabintsev/guitar"><img src="../img/gh.png"/>View on GitHub</a></p>
</div>
</header>
Expand Down Expand Up @@ -448,7 +448,7 @@ <h4>Declaration</h4>
</section>
<section id="footer">
<p>© 2016-2017 <a class="link" href="http://www.sabintsev.com" target="_blank" rel="external">Arthur Ariel Sabintsev</a></p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.5</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
Expand Down
4 changes: 2 additions & 2 deletions docs/Structs/Guitar/Chord.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<a title="Chord Enum Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../../index.html">Guitar Docs</a> (100% documented)</p>
<p><a href="../../index.html">Guitar Docs</a> (91% documented)</p>
<p class="header-right"><a href="https://github.com/artsabintsev/guitar"><img src="../../img/gh.png"/>View on GitHub</a></p>
</div>
</header>
Expand Down Expand Up @@ -222,7 +222,7 @@ <h4>Declaration</h4>
</section>
<section id="footer">
<p>© 2016-2017 <a class="link" href="http://www.sabintsev.com" target="_blank" rel="external">Arthur Ariel Sabintsev</a></p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.5</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/badge.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 0 additions & 20 deletions docs/docsets/.docset/Contents/Info.plist

This file was deleted.

Loading

0 comments on commit bb2edf3

Please sign in to comment.