Skip to content

Commit d576580

Browse files
committed
Added docs with jazzy, improved accessibility
1 parent 3547d94 commit d576580

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+8259
-9
lines changed

.jazzy.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
clean: true
2+
author: WeTransfer
3+
author_url: https://wetransfer.com
4+
documentation: docs/*.md
5+
github_url: https://github.com/WeTransfer/Mocker
6+
github_file_prefix: https://github.com/WeTransfer/Mocker/tree/master
7+
umbrella_header: Mocker/Mocker.h
8+
framework_root: Mocker
9+
module: Mocker
10+
skip_undocumented: true
11+
hide_documentation_coverage: true
12+
theme: fullwidth
13+
sdk: iphonesimulator
14+
readme: README.md

Sources/Mock.swift

+7-7
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,20 @@ public struct Mock: Equatable {
5252
}
5353
}
5454

55-
/// The type of the data which is returned.
56-
public let contentType: ContentType
57-
5855
/// The headers to send back with the response.
59-
public let headers: [String: String]
56+
let headers: [String: String]
6057

6158
/// The HTTP status code to return with the response.
62-
public let statusCode: Int
59+
let statusCode: Int
6360

6461
/// The URL value generated based on the Mock data.
65-
public let url: URL
62+
let url: URL
63+
64+
/// The type of the data which is returned.
65+
private let contentType: ContentType
6666

6767
/// The file extensions to match for.
68-
public let fileExtensions: [String]?
68+
private let fileExtensions: [String]?
6969

7070
/// The data which will be returned as the response based on the HTTP Method.
7171
private let data: [HTTPMethod: Data]

Sources/Mocker.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public struct Mocker {
1818
}
1919

2020
/// The shared instance of the Mocker, can be used to register and return mocks.
21-
static var shared = Mocker()
21+
private static var shared = Mocker()
2222

2323
/// The HTTP Version to use in the mocked response.
2424
public static var httpVersion: HTTPVersion = HTTPVersion.http1_1
@@ -47,7 +47,7 @@ public struct Mocker {
4747
///
4848
/// - Parameter request: The request to search for a mock.
4949
/// - Returns: A mock if found, `nil` if there's no mocked data registered for the given request.
50-
public static func mock(for request: URLRequest) -> Mock? {
50+
static func mock(for request: URLRequest) -> Mock? {
5151
return shared.mocks.first(where: { $0 == request })
5252
}
5353
}

docs/Classes.html

+137
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<title>Classes Reference</title>
5+
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
6+
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
7+
<meta charset="utf-8">
8+
<script src="js/jquery.min.js" defer></script>
9+
<script src="js/jazzy.js" defer></script>
10+
11+
<script src="js/lunr.min.js" defer></script>
12+
<script src="js/typeahead.jquery.js" defer></script>
13+
<script src="js/jazzy.search.js" defer></script>
14+
</head>
15+
<body>
16+
17+
18+
<a title="Classes Reference"></a>
19+
20+
<header class="header">
21+
<p class="header-col header-col--primary">
22+
<a class="header-link" href="index.html">
23+
Mocker Docs
24+
</a>
25+
26+
</p>
27+
28+
<p class="header-col--secondary">
29+
<form role="search" action="search.json">
30+
<input type="text" placeholder="Search documentation" data-typeahead>
31+
</form>
32+
</p>
33+
34+
<p class="header-col header-col--secondary">
35+
<a class="header-link" href="https://github.com/WeTransfer/Mocker">
36+
<img class="header-icon" src="img/gh.png"/>
37+
View on GitHub
38+
</a>
39+
</p>
40+
41+
</header>
42+
43+
<p class="breadcrumbs">
44+
<a class="breadcrumb" href="index.html">Mocker Reference</a>
45+
<img class="carat" src="img/carat.png" />
46+
Classes Reference
47+
</p>
48+
49+
<div class="content-wrapper">
50+
<nav class="navigation">
51+
<ul class="nav-groups">
52+
<li class="nav-group-name">
53+
<a class="nav-group-name-link" href="Classes.html">Classes</a>
54+
<ul class="nav-group-tasks">
55+
<li class="nav-group-task">
56+
<a class="nav-group-task-link" href="Classes/MockingURLProtocol.html">MockingURLProtocol</a>
57+
</li>
58+
</ul>
59+
</li>
60+
<li class="nav-group-name">
61+
<a class="nav-group-name-link" href="Structs.html">Structs</a>
62+
<ul class="nav-group-tasks">
63+
<li class="nav-group-task">
64+
<a class="nav-group-task-link" href="Structs/Mock.html">Mock</a>
65+
</li>
66+
<li class="nav-group-task">
67+
<a class="nav-group-task-link" href="Structs/Mock.html#/s:OV6Mocker4Mock10HTTPMethod">– HTTPMethod</a>
68+
</li>
69+
<li class="nav-group-task">
70+
<a class="nav-group-task-link" href="Structs/Mock.html#/s:OV6Mocker4Mock11ContentType">– ContentType</a>
71+
</li>
72+
<li class="nav-group-task">
73+
<a class="nav-group-task-link" href="Structs/Mocker.html">Mocker</a>
74+
</li>
75+
</ul>
76+
</li>
77+
</ul>
78+
</nav>
79+
<article class="main-content">
80+
81+
<section class="section">
82+
<div class="section-content">
83+
<h1>Classes</h1>
84+
<p>The following classes are available globally.</p>
85+
86+
</div>
87+
</section>
88+
89+
<section class="section">
90+
<div class="section-content">
91+
<div class="task-group">
92+
<ul class="item-container">
93+
<li class="item">
94+
<div>
95+
<code>
96+
<a name="/s:C6Mocker18MockingURLProtocol"></a>
97+
<a name="//apple_ref/swift/Class/MockingURLProtocol" class="dashAnchor"></a>
98+
<a class="token" href="#/s:C6Mocker18MockingURLProtocol">MockingURLProtocol</a>
99+
</code>
100+
</div>
101+
<div class="height-container">
102+
<div class="pointer-container"></div>
103+
<section class="section">
104+
<div class="pointer"></div>
105+
<div class="abstract">
106+
<p>The protocol which can be used to send Mocked data back. Use the <code><a href="Structs/Mocker.html">Mocker</a></code> to register <code><a href="Structs/Mock.html">Mock</a></code> data</p>
107+
108+
<a href="Classes/MockingURLProtocol.html" class="slightly-smaller">See more</a>
109+
</div>
110+
<div class="declaration">
111+
<h4>Declaration</h4>
112+
<div class="language">
113+
<p class="aside-title">Swift</p>
114+
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">final</span> <span class="kd">class</span> <span class="kt">MockingURLProtocol</span><span class="p">:</span> <span class="kt">URLProtocol</span></code></pre>
115+
116+
</div>
117+
</div>
118+
<div class="slightly-smaller">
119+
<a href="https://github.com/WeTransfer/Mocker/tree/master/Sources/MockingURLProtocol.swift#L12-L43">Show on GitHub</a>
120+
</div>
121+
</section>
122+
</div>
123+
</li>
124+
</ul>
125+
</div>
126+
</div>
127+
</section>
128+
129+
</article>
130+
</div>
131+
<section class="footer">
132+
<p>&copy; 2017 <a class="link" href="https://wetransfer.com" target="_blank" rel="external">WeTransfer</a>. All rights reserved. (Last updated: 2017-08-11)</p>
133+
<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>
134+
</section>
135+
</body>
136+
</div>
137+
</html>

0 commit comments

Comments
 (0)