Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a bunch of typos #281

Merged
merged 1 commit into from
May 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ We use [Break Versioning][breakver]. The version numbers follow a `<major>.<mino
### `reitit-spec`

* Latest features from [spec-tools](https://github.com/metosin/spec-tools)
* Swagger enchancements
* Swagger enhancements
* Better spec coercion via `st/coerce` using spec walking & inference: many simple specs (core predicates, `spec-tools.core/spec`, `s/and`, `s/or`, `s/coll-of`, `s/keys`, `s/map-of`, `s/nillable` and `s/every`) can be transformed without needing spec to be wrapped. Fallbacks to old conformed based approach.
* [example app](https://github.com/metosin/reitit/blob/master/examples/ring-spec-swagger/src/example/server.clj).

Expand Down Expand Up @@ -560,7 +560,7 @@ We use [Break Versioning][breakver]. The version numbers follow a `<major>.<mino

## 0.2.0 (2018-09-03)

Sample apps demonstraing the current status of `reitit`:
Sample apps demonstrating the current status of `reitit`:

* [`reitit-ring` with coercion, swagger and default middleware](https://github.com/metosin/reitit/blob/master/examples/ring-swagger/src/example/server.clj)
* [`reitit-frontend`, the easy way](https://github.com/metosin/reitit/blob/master/examples/frontend/src/frontend/core.cljs)
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ If you have questions about contributing or about reitit in general, join the [#

* Fork the repository on Github
* Create a topic branch from where you want to base your work (usually the master branch)
* Check the formatting rules from existing code (no trailing whitepace, mostly default indentation)
* Check the formatting rules from existing code (no trailing whitespace, mostly default indentation)
* Ensure any new code is well-tested, and if possible, any issue fixed is covered by one or more new tests
* Verify that all tests pass using `./scripts/test.sh clj` and `./scripts/test.sh cljs`.
* Push your code to your fork of the repository
* Make a Pull Request

For more deveploment instructions, [see the manual](https://cljdoc.org/d/metosin/reitit/CURRENT/doc/misc/development-instructions).
For more development instructions, [see the manual](https://cljdoc.org/d/metosin/reitit/CURRENT/doc/misc/development-instructions).

## Commit messages

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ Roadmap is mostly written in [issues](https://github.com/metosin/reitit/issues).

## Special thanks

* Existing Clojure(Script) routing libs, expecially to
* Existing Clojure(Script) routing libs, especially to
[Ataraxy](https://github.com/weavejester/ataraxy), [Bide](https://github.com/funcool/bide), [Bidi](https://github.com/juxt/bidi), [calfpath](https://github.com/ikitommi/calfpath), [Compojure](https://github.com/weavejester/compojure), [Keechma](https://keechma.com/) and
[Pedestal](https://github.com/pedestal/pedestal/tree/master/route).
* [Compojure-api](https://github.com/metosin/compojure-api), [Kekkonen](https://github.com/metosin/kekkonen), [Ring-swagger](https://github.com/metosin/ring-swagger) and [Yada](https://github.com/juxt/yada) and for ideas, coercion & stuff.
Expand Down
4 changes: 2 additions & 2 deletions doc/advanced/composing_routers.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Data-driven approach in `reitit` allows us to compose routes, route data, route specs, middleware and interceptors chains. We can compose routers too. This is needed to achieve dynamic routing like in [Compojure](https://github.com/weavejester/compojure).

## Immutatability
## Immutability

Once a router is created, the routing tree is immutable and cannot be changed. To change the routing, we need to create a new router with changed routes and/or options. For this, the `Router` protocol exposes it's resolved routes via `r/routes` and options via `r/options`.

Expand Down Expand Up @@ -336,7 +336,7 @@ Can we make the nester routing faster? Sure. We could use the Router `:compile`

### When to use nested routers?

Nesting routers is not trivial and because of that, should be avoided. For dynamic (request-time) route generation, it's the only choise. For other cases, nested routes are most likely a better option.
Nesting routers is not trivial and because of that, should be avoided. For dynamic (request-time) route generation, it's the only choice. For other cases, nested routes are most likely a better option.

Let's re-create the previous example with normal route nesting/composition.

Expand Down
6 changes: 3 additions & 3 deletions doc/advanced/dev_workflow.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dev Worklfow
# Dev Workflow

Many applications will require the routes to span multiple namespaces. It is quite easy to do so with reitit, but we might hit a problem during developement.
Many applications will require the routes to span multiple namespaces. It is quite easy to do so with reitit, but we might hit a problem during development.

## An example

Expand Down Expand Up @@ -122,7 +122,7 @@ Notice that the name is now correct, without reloading every namespace under the

## Why is this a crude solution ?

The astute reader will have noticed that we're recompiling the full routing tree on every invocation. While this solution is practical during developement, it goes contrary to the performance goals of reitit.
The astute reader will have noticed that we're recompiling the full routing tree on every invocation. While this solution is practical during development, it goes contrary to the performance goals of reitit.

We need a way to only do this once at production time.

Expand Down
2 changes: 1 addition & 1 deletion doc/basics/error_messages.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Error Messages

All exceptions thrown in router creation are caught, formatted and rethrown by the `reitit.core/router` function. Exception formatting is done by the excepton formatter defined by the `:exception` router option.
All exceptions thrown in router creation are caught, formatted and rethrown by the `reitit.core/router` function. Exception formatting is done by the exception formatter defined by the `:exception` router option.

## Default Errors

Expand Down
2 changes: 1 addition & 1 deletion doc/basics/route_data_validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Route data can be anything, so it's easy to go wrong. Accidentally adding a `:ro

To fail fast, we could use the custom `:coerce` and `:compile` hooks to apply data validation and throw exceptions on first sighted problem.

But there is a better way. Router has a `:validation` hook to validate the whole route tree after it's successfuly compiled. It expects a 2-arity function `routes opts => ()` that can side-effect in case of validation errors.
But there is a better way. Router has a `:validation` hook to validate the whole route tree after it's successfully compiled. It expects a 2-arity function `routes opts => ()` that can side-effect in case of validation errors.

## clojure.spec

Expand Down
2 changes: 1 addition & 1 deletion doc/coercion/clojure_spec_coercion.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The [clojure.spec](https://clojure.org/guides/spec) library specifies the struct

## Warning

`clojure.spec` by itself doesn't support coercion. `reitit` uses [spec-tools](https://github.com/metosin/spec-tools) that adds coercion to spec. Like `clojure.spec`, it's alpha as it leans both on spec walking and `clojure.spec.alpha/conform`, which is concidered a spec internal, that might be changed or removed later.
`clojure.spec` by itself doesn't support coercion. `reitit` uses [spec-tools](https://github.com/metosin/spec-tools) that adds coercion to spec. Like `clojure.spec`, it's alpha as it leans both on spec walking and `clojure.spec.alpha/conform`, which is considered a spec internal, that might be changed or removed later.

## Usage

Expand Down
2 changes: 1 addition & 1 deletion doc/coercion/coercion.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ We can use a helper function `reitit.coercion/coerce!` to do the actual coercion
; {:path {:company "metosin", :user-id 123}}
```

We get the coerced paremeters back. If a coercion fails, a typed (`:reitit.coercion/request-coercion`) ExceptionInfo is thrown, with data about the actual error:
We get the coerced parameters back. If a coercion fails, a typed (`:reitit.coercion/request-coercion`) ExceptionInfo is thrown, with data about the actual error:

```clj
(coercion/coerce!
Expand Down
4 changes: 2 additions & 2 deletions doc/http/sieppari.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

[Sieppari](https://github.com/metosin/sieppari) is a new and fast interceptor implementation for Clojure, with pluggable async supporting [core.async](https://github.com/clojure/core.async), [Manifold](https://github.com/ztellman/manifold) and [Promesa](http://funcool.github.io/promesa/latest).

To use Sieppari with `reitit-http`, we need to attach a `reitit.interceptor.sieppari/executor` to a `http-router` to compile and execute the interceptor chains. Reitit and Sieppari share the same interceptor model, so all reitit default interceptors work seamlesly together.
To use Sieppari with `reitit-http`, we need to attach a `reitit.interceptor.sieppari/executor` to a `http-router` to compile and execute the interceptor chains. Reitit and Sieppari share the same interceptor model, so all reitit default interceptors work seamlessly together.

We can use both syncronous ring and [async-ring](https://www.booleanknot.com/blog/2016/07/15/asynchronous-ring.html) with Sieppari.
We can use both synchronous ring and [async-ring](https://www.booleanknot.com/blog/2016/07/15/asynchronous-ring.html) with Sieppari.

## Synchronous Ring

Expand Down
2 changes: 1 addition & 1 deletion doc/ring/RESTful_form_methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ And apply the middleware like this:
wrap-hidden-method]}) ;; our hidden method wrapper
```
(NOTE: This middleware must be placed here and not inside the route data given to `reitit.ring/handler`.
This is so that our middleware is applied before reitit matches the request with a spesific handler using the wrong method.)
This is so that our middleware is applied before reitit matches the request with a specific handler using the wrong method.)
2 changes: 1 addition & 1 deletion doc/ring/data_driven_middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Reitit defines middleware as data:

1. Middleware can be defined as first-class data entries
2. Middleware can be mounted as a [duct-style](https://github.com/duct-framework/duct/wiki/Configuration) vector (of middleware)
4. Middleware can be optimized & [compiled](compiling_middleware.md) againt an endpoint
4. Middleware can be optimized & [compiled](compiling_middleware.md) against an endpoint
3. Middleware chain can be transformed by the router

## Middleware as data
Expand Down
4 changes: 2 additions & 2 deletions doc/ring/default_middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ A preconfigured middleware using `exception/default-handlers`. Catches:

### `exception/create-exception-middleware`

Creates the exception-middleware with custom options. Takes a map of `identifier => exception request => response` that is used to select the exception handler for the thrown/raised exception identifier. Exception idenfier is either a `Keyword` or a Exception Class.
Creates the exception-middleware with custom options. Takes a map of `identifier => exception request => response` that is used to select the exception handler for the thrown/raised exception identifier. Exception identifier is either a `Keyword` or a Exception Class.

The following handlers are available by default:

Expand All @@ -66,7 +66,7 @@ The following handlers are available by default:
| `::exception/default` | a default exception handler if nothing else matched (default `exception/default-handler`).
| `::exception/wrap` | a 3-arity handler to wrap the actual handler `handler exception request => response` (no default).

The handler is selected from the options map by exception idenfitifier in the following lookup order:
The handler is selected from the options map by exception identifier in the following lookup order:

1) `:type` of exception ex-data
2) Class of exception
Expand Down
2 changes: 1 addition & 1 deletion doc/ring/route_data_validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ Or even flatten the routes:
::rs/explain e/expound-str})))
```

The common Middleware can also be pushed to the router, here cleanly separing behavior and data:
The common Middleware can also be pushed to the router, here cleanly separating behavior and data:

```clj
(def app
Expand Down
4 changes: 2 additions & 2 deletions doc/ring/swagger.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Coercion keys also contribute to the docs:
| key | description |
| --------------|-------------|
| :parameters | optional input parameters for a route, in a format defined by the coercion
| :responses | optional descriptions of responess, in a format defined by coercion
| :responses | optional descriptions of responses, in a format defined by coercion

There is a `reitit.swagger.swagger-feature`, which acts as both a `Middleware` and an `Interceptor` that is not participating in any request processing - it just defines the route data specs for the routes it's mounted to. It is only needed if the [route data validation](route_data_validation.md) is turned on.

Expand All @@ -55,7 +55,7 @@ If you need to post-process the generated spec, just wrap the handler with a cus
| :root | optional resource root, defaults to `"swagger-ui"`
| :url | path to swagger endpoint, defaults to `/swagger.json`
| :path | optional path to mount the handler to. Works only if mounted outside of a router.
| :config | parameters passed to swaggger-ui as-is. See [the docs](https://github.com/swagger-api/swagger-ui/tree/2.x#parameters)
| :config | parameters passed to swagger-ui as-is. See [the docs](https://github.com/swagger-api/swagger-ui/tree/2.x#parameters)

We use swagger-ui from [ring-swagger-ui](https://github.com/metosin/ring-swagger-ui), which can be easily configured from routing application. It stores files `swagger-ui` in the resource classpath.

Expand Down
2 changes: 1 addition & 1 deletion examples/frontend-auth/src/frontend/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
(fn [new-match]
(swap! state (fn [state]
(if new-match
;; Only run the controllers, which are likely to call authentcated APIs,
;; Only run the controllers, which are likely to call authenticated APIs,
;; if user has been authenticated.
;; Alternative solution could be to always run controllers,
;; check authentication status in each controller, or check authentication status in API calls.
Expand Down
2 changes: 1 addition & 1 deletion examples/frontend-prompt/src/frontend/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
;; key here. See how it's handled in `on-navigate` function.
:prompt "Are you sure you want to leave?"
;; It would be possible to define a function here that resolves
;; wheter prompting is needed or not but we'll keep it simple.
;; whether prompting is needed or not but we'll keep it simple.
}]])

(def router
Expand Down
4 changes: 2 additions & 2 deletions modules/reitit-frontend/src/reitit/frontend/history.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
ignore-anchor-click
(fn ignore-anchor-click
[e]
;; Returns the next matching anchestor of event target
;; Returns the next matching ancestor of event target
(when-let [el (closest-by-tag (event-target e) "a")]
(let [uri (.parse Uri (.-href el))]
(when (and (or (and (not (.hasScheme uri)) (not (.hasDomain uri)))
Expand Down Expand Up @@ -125,7 +125,7 @@

Returns History object.

When using with development workflow like Figwheel, rememeber to
When using with development workflow like Figwheel, remember to
remove listeners using stop! call before calling start! again.

Parameters:
Expand Down
2 changes: 1 addition & 1 deletion modules/reitit-http/src/reitit/http.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
(r/router data opts))))

(defn routing-interceptor
"Creates a Pedestal-style routing interceptor that enqueus the interceptors into context.
"Creates a Pedestal-style routing interceptor that enqueues the interceptors into context.
Takes http-router, default ring-handler and and options map, with the following keys:

| key | description |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,17 @@
(defn exception-interceptor
"Creates an Interceptor that catches all exceptions. Takes a map
of `identifier => exception request => response` that is used to select
the exception handler for the thown/raised exception identifier. Exception
idenfier is either a `Keyword` or a Exception Class.
the exception handler for the thrown/raised exception identifier. Exception
identifier is either a `Keyword` or a Exception Class.

The following handlers special handlers are available:

| key | description
|------------------------|-------------
| `::exception/default` | a default exception handler if nothing else mathced (default [[default-handler]]).
| `::exception/default` | a default exception handler if nothing else matched (default [[default-handler]]).
| `::exception/wrap` | a 3-arity handler to wrap the actual handler `handler exception request => response`

The handler is selected from the options map by exception idenfiter
The handler is selected from the options map by exception identifier
in the following lookup order:

1) `:type` of exception ex-data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,17 +118,17 @@
(defn create-exception-middleware
"Creates a Middleware that catches all exceptions. Takes a map
of `identifier => exception request => response` that is used to select
the exception handler for the thown/raised exception identifier. Exception
idenfier is either a `Keyword` or a Exception Class.
the exception handler for the thrown/raised exception identifier. Exception
identifier is either a `Keyword` or a Exception Class.

The following handlers special handlers are available:

| key | description
|------------------------|-------------
| `::exception/default` | a default exception handler if nothing else mathced (default [[default-handler]]).
| `::exception/default` | a default exception handler if nothing else matched (default [[default-handler]]).
| `::exception/wrap` | a 3-arity handler to wrap the actual handler `handler exception request => response`

The handler is selected from the options map by exception idenfiter
The handler is selected from the options map by exception identifier
in the following lookup order:

1) `:type` of exception ex-data
Expand Down
2 changes: 1 addition & 1 deletion modules/reitit-swagger/src/reitit/swagger.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
| key | description |
| --------------|-------------|
| :parameters | optional input parameters for a route, in a format defined by the coercion
| :responses | optional descriptions of responess, in a format defined by coercion
| :responses | optional descriptions of responses, in a format defined by coercion

Example:

Expand Down
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
:metadata {:doc/format :markdown}}
:scm {:name "git"
:url "https://github.com/metosin/reitit"}
;; TODO: need to verify that the code actually workd with Java1.8, see #242
;; TODO: need to verify that the code actually worked with Java1.8, see #242
:javac-options ["-Xlint:unchecked" "-target" "1.8" "-source" "1.8"]
:managed-dependencies [[metosin/reitit "0.3.4"]
[metosin/reitit-core "0.3.4"]
Expand Down
2 changes: 1 addition & 1 deletion test/clj/reitit/http_coercion_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
:coercion schema/coercion}})
{:executor sieppari/executor}))]

(testing "withut exception handling"
(testing "without exception handling"
(let [app (create [(rrc/coerce-request-interceptor)
(rrc/coerce-response-interceptor)])]

Expand Down
2 changes: 1 addition & 1 deletion test/clj/reitit/pedestal_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
(is (= #{0 1 2} (#'pedestal/arities (fn ([]) ([_]) ([_ _]))))))

(deftest interceptor-test
(testing "wihtout :enter, :leave or :error are stripped"
(testing "without :enter, :leave or :error are stripped"
(is (nil? (pedestal/->interceptor {:name ::kikka}))))
(testing ":error arities are wrapped"
(let [has-2-arity-error? (fn [interceptor]
Expand Down