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

Commit

Permalink
Chord Updates (#14)
Browse files Browse the repository at this point in the history
* Moved chord into a different hierarchy

* Updated docs

* Updated podspec
  • Loading branch information
ArtSabintsev authored Mar 27, 2017
1 parent 10aa293 commit 7e74749
Show file tree
Hide file tree
Showing 21 changed files with 179 additions and 397 deletions.
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.12'
s.version = '0.0.13'
s.summary = 'A Cross-Platform String and Regular Expression Library Written in Swift.'

description = <<-DESC
Expand Down
2 changes: 1 addition & 1 deletion Sources/Guitar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
30 changes: 17 additions & 13 deletions Sources/GuitarChord.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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]"
}
113 changes: 0 additions & 113 deletions docs/Enums.html

This file was deleted.

11 changes: 3 additions & 8 deletions docs/Extensions.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="Enums.html">Enums</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Enums/GuitarChord.html">GuitarChord</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="Extensions.html">Extensions</a>
<ul class="nav-group-tasks">
Expand All @@ -49,6 +41,9 @@
<li class="nav-group-task">
<a href="Structs/Guitar.html">Guitar</a>
</li>
<li class="nav-group-task">
<a href="Structs/Guitar/Chord.html">– Chord</a>
</li>
</ul>
</li>
</ul>
Expand Down
11 changes: 3 additions & 8 deletions docs/Extensions/String.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Enums.html">Enums</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Enums/GuitarChord.html">GuitarChord</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Extensions.html">Extensions</a>
<ul class="nav-group-tasks">
Expand All @@ -50,6 +42,9 @@
<li class="nav-group-task">
<a href="../Structs/Guitar.html">Guitar</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Guitar/Chord.html">– Chord</a>
</li>
</ul>
</li>
</ul>
Expand Down
11 changes: 3 additions & 8 deletions docs/Structs.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="Enums.html">Enums</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Enums/GuitarChord.html">GuitarChord</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="Extensions.html">Extensions</a>
<ul class="nav-group-tasks">
Expand All @@ -49,6 +41,9 @@
<li class="nav-group-task">
<a href="Structs/Guitar.html">Guitar</a>
</li>
<li class="nav-group-task">
<a href="Structs/Guitar/Chord.html">– Chord</a>
</li>
</ul>
</li>
</ul>
Expand Down
49 changes: 38 additions & 11 deletions docs/Structs/Guitar.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Enums.html">Enums</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Enums/GuitarChord.html">GuitarChord</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Extensions.html">Extensions</a>
<ul class="nav-group-tasks">
Expand All @@ -50,6 +42,9 @@
<li class="nav-group-task">
<a href="../Structs/Guitar.html">Guitar</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Guitar/Chord.html">– Chord</a>
</li>
</ul>
</li>
</ul>
Expand Down Expand Up @@ -114,9 +109,9 @@ <h4>Parameters</h4>
<li class="item">
<div>
<code>
<a name="/s:FV6Guitar6GuitarcFT5chordOS_11GuitarChord_S0_"></a>
<a name="/s:FV6Guitar6GuitarcFT5chordOS0_5Chord_S0_"></a>
<a name="//apple_ref/swift/Method/init(chord:)" class="dashAnchor"></a>
<a class="token" href="#/s:FV6Guitar6GuitarcFT5chordOS_11GuitarChord_S0_">init(chord:)</a>
<a class="token" href="#/s:FV6Guitar6GuitarcFT5chordOS0_5Chord_S0_">init(chord:)</a>
</code>
</div>
<div class="height-container">
Expand All @@ -131,7 +126,7 @@ <h4>Parameters</h4>
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">chord</span><span class="p">:</span> <span class="kt"><a href="../Enums/GuitarChord.html">GuitarChord</a></span><span class="p">)</span></code></pre>
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">chord</span><span class="p">:</span> <span class="kt"><a href="../Structs/Guitar/Chord.html">Chord</a></span><span class="p">)</span></code></pre>

</div>
</div>
Expand Down Expand Up @@ -417,6 +412,38 @@ <h4>Return Value</h4>
</li>
</ul>
</div>
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:OV6Guitar6Guitar5Chord"></a>
<a name="//apple_ref/swift/Enum/Chord" class="dashAnchor"></a>
<a class="token" href="#/s:OV6Guitar6Guitar5Chord">Chord</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Common Regular Expression Patterns</p>

<a href="../Structs/Guitar/Chord.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">enum</span> <span class="kt">Chord</span><span class="p">:</span> <span class="kt">String</span></code></pre>

</div>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
Expand Down
Loading

0 comments on commit 7e74749

Please sign in to comment.