From 7e74749fc6b31eabb8c52ce509d9798ee8e7ddc2 Mon Sep 17 00:00:00 2001 From: Arthur Ariel Sabintsev Date: Sun, 26 Mar 2017 20:27:56 -0400 Subject: [PATCH] Chord Updates (#14) * Moved chord into a different hierarchy * Updated docs * Updated podspec --- Guitar.podspec | 2 +- Sources/Guitar.swift | 2 +- Sources/GuitarChord.swift | 30 +++-- docs/Enums.html | 113 ------------------ docs/Extensions.html | 11 +- docs/Extensions/String.html | 11 +- docs/Structs.html | 11 +- docs/Structs/Guitar.html | 49 ++++++-- .../Guitar/Chord.html} | 63 +++++----- .../Contents/Resources/Documents/Enums.html | 113 ------------------ .../Resources/Documents/Extensions.html | 11 +- .../Documents/Extensions/String.html | 11 +- .../Contents/Resources/Documents/Structs.html | 11 +- .../Resources/Documents/Structs/Guitar.html | 49 ++++++-- .../Guitar/Chord.html} | 63 +++++----- .../Contents/Resources/Documents/index.html | 11 +- .../Contents/Resources/Documents/search.json | 2 +- .../Contents/Resources/docSet.dsidx | Bin 12288 -> 12288 bytes docs/docsets/Guitar.tgz | Bin 50905 -> 50291 bytes docs/index.html | 11 +- docs/search.json | 2 +- 21 files changed, 179 insertions(+), 397 deletions(-) delete mode 100644 docs/Enums.html rename docs/{Enums/GuitarChord.html => Structs/Guitar/Chord.html} (78%) delete mode 100644 docs/docsets/Guitar.docset/Contents/Resources/Documents/Enums.html rename docs/docsets/Guitar.docset/Contents/Resources/Documents/{Enums/GuitarChord.html => Structs/Guitar/Chord.html} (78%) diff --git a/Guitar.podspec b/Guitar.podspec index 83a56c8..4841837 100644 --- a/Guitar.podspec +++ b/Guitar.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'Guitar' - s.version = '0.0.12' + s.version = '0.0.13' s.summary = 'A Cross-Platform String and Regular Expression Library Written in Swift.' description = <<-DESC diff --git a/Sources/Guitar.swift b/Sources/Guitar.swift index b0803cb..147528c 100644 --- a/Sources/Guitar.swift +++ b/Sources/Guitar.swift @@ -27,7 +27,7 @@ public struct Guitar { /// /// - Parameters: /// - chord: A `chord`, or built-in regex pattern that will be used to perform the match. - public init(chord: GuitarChord) { + public init(chord: Chord) { self.init(pattern: chord.rawValue) } diff --git a/Sources/GuitarChord.swift b/Sources/GuitarChord.swift index 17a4a17..888de6d 100644 --- a/Sources/GuitarChord.swift +++ b/Sources/GuitarChord.swift @@ -8,22 +8,26 @@ import Foundation -// MARK: - GuitarChord +// MARK: - Chord -/// Common Regular Expression Patterns -public enum GuitarChord: String { - /// Pattern matches email addresses. - case email = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,6}" +public extension Guitar { - /// Pattern matches first alphanumeric character of each word. - case firstCharacter = "(\\b\\w|(?<=_)[^_])" + /// Common Regular Expression Patterns + enum Chord: String { + /// Pattern matches email addresses. + case email = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,6}" - /// Pattern matches last alphanumeric character of each word. - case lastCharacter = "(\\w\\b|[^_](?=_))" + /// Pattern matches first alphanumeric character of each word. + case firstCharacter = "(\\b\\w|(?<=_)[^_])" - /// Pattern matches non-Alphanumeric characters. - case nonAlphanumeric = "[^a-zA-Z\\d]" + /// Pattern matches last alphanumeric character of each word. + case lastCharacter = "(\\w\\b|[^_](?=_))" + + /// Pattern matches non-Alphanumeric characters. + case nonAlphanumeric = "[^a-zA-Z\\d]" + + /// Pattern matches non-Alphanumeric and non-Whitespace characters. + case nonAlphanumericSpace = "[^a-zA-Z\\d\\s]" + } - /// Pattern matches non-Alphanumeric and non-Whitespace characters. - case nonAlphanumericSpace = "[^a-zA-Z\\d\\s]" } diff --git a/docs/Enums.html b/docs/Enums.html deleted file mode 100644 index 05837c6..0000000 --- a/docs/Enums.html +++ /dev/null @@ -1,113 +0,0 @@ - - - - Enums Reference - - - - - - - - - -
-
-

Guitar Docs (100% documented)

-

View on GitHub

-
-
-
- -
-
- - -
- - - diff --git a/docs/Extensions.html b/docs/Extensions.html index db77ff2..a5571ad 100644 --- a/docs/Extensions.html +++ b/docs/Extensions.html @@ -27,14 +27,6 @@