README.md in tanshuku-0.0.19 vs README.md in tanshuku-0.0.20

- old
+ new

@@ -2,23 +2,23 @@ Tanshuku is a simple and small Rails engine that makes it easier to shorten URLs. ## Key Features -* Generates a unique key for a URL. - * The uniqueness is ensured at database level. -* Creates no additional shortened URL record if the given URL has already been shortened. - * You can create an additional record for the same URL with using a different namespace from existing records'. - * Checks its existence considering the performance. -* Provides a Rails controller and action for finding a shortened URL record and redirecting to its original, i.e., non-shortened, URL. - * The redirection is done with 301 HTTP status. +- Generates a unique key for a URL. + - The uniqueness is ensured at database level. +- Creates no additional shortened URL record if the given URL has already been shortened. + - You can create an additional record for the same URL with using a different namespace from existing records’. + - Checks its existence considering the performance. +- Provides a Rails controller and action for finding a shortened URL record and redirecting to its original, i.e., non-shortened, URL. + - The redirection is done with 301 HTTP status. ## Usage ### 1. Mount `Tanshuku::Engine` -For example, the following code generates a routing `` GET `/t/:key` to `Tanshuku::UrlsController#show` ``. When your Rails app receives a request to `/t/abcdefghij0123456789`, `Tanshuku::UrlsController#show` will be called and a `Tanshuku::Url` record with a key `abcdefghij0123456789` will be found. Then the request will be redirected to the `Tanshuku::Url` record's original URL. +For example, the following code generates a routing `` GET `/t/:key` to `Tanshuku::UrlsController#show` ``. When your Rails app receives a request to `/t/abcdefghij0123456789`, `Tanshuku::UrlsController#show` will be called and a `Tanshuku::Url` record with a key `abcdefghij0123456789` will be found. Then the request will be redirected to the `Tanshuku::Url` record’s original URL. ```rb # config/routes.rb Rails.application.routes.draw do mount Tanshuku::Engine, at: "/t" @@ -29,13 +29,13 @@ ### 2. Configure Tanshuku (Optional) **Note**: This step is optional. -**Note**: An initializer file for configuration can be generated by `bin/rails generate tanshuku:install`. See the "[Installation](#installation)" section below for more information. +**Note**: An initializer file for configuration can be generated by `bin/rails generate tanshuku:install`. See the “[Installation](#installation)” section below for more information. -**Note**: Mutating a `Tanshuku::Configuration` object is thread-***unsafe***. It is recommended to use `Tanshuku.configure` for configuration. +**Note**: Mutating a `Tanshuku::Configuration` object is thread-**_unsafe_**. It is recommended to use `Tanshuku.configure` for configuration. #### `config.default_url_options` Tanshuku uses configured `config.default_url_options` when generating shortened URLs. @@ -70,11 +70,11 @@ end ``` #### More information -cf. [`Tanshuku::Configuration`'s API documentation](https://kg8m.github.io/tanshuku/Tanshuku/Configuration.html) +cf. [`Tanshuku::Configuration`’s API documentation](https://kg8m.github.io/tanshuku/Tanshuku/Configuration.html) ### 3. Generate shortened URLs #### Basic cases @@ -113,14 +113,14 @@ #### Shortening a URL with a namespace You can create additional records for the same URL with specifying a namespace. ```rb -# When no record exists for "https://google.com/", a new record will be created. +# When no record exists for “https://google.com/”, a new record will be created. Tanshuku::Url.shorten("https://google.com/") #=> "https://example.com/t/abc012def345ghi678j9" -# Even when a record already exists for "https://google.com/", an additional record will be created if namespace is +# Even when a record already exists for “https://google.com/”, an additional record will be created if namespace is # specified. Tanshuku::Url.shorten("https://google.com/", namespace: "a") #=> "https://example.com/t/ab01cd23ef45gh67ij89" Tanshuku::Url.shorten("https://google.com/", namespace: "b") #=> "https://example.com/t/a0b1c2d3e4f5g6h7i8j9" Tanshuku::Url.shorten("https://google.com/", namespace: "c") #=> "https://example.com/t/abcd0123efgh4567ij89" @@ -129,11 +129,11 @@ Tanshuku::Url.shorten("https://google.com/", namespace: "a") #=> "https://example.com/t/ab01cd23ef45gh67ij89" ``` #### More information -cf. [`Tanshuku::Url.shorten`'s API documentation](https://kg8m.github.io/tanshuku/Tanshuku/Url.html#shorten-class_method) +cf. [`Tanshuku::Url.shorten`’s API documentation](https://kg8m.github.io/tanshuku/Tanshuku/Url.html#shorten-class_method) ### 4. Share the shortened URLs You can share the shortened URLs, e.g., `https://example.com/t/abcdefghij0123456789`. @@ -141,11 +141,11 @@ ## Installation ### 1. Enable Tanshuku -Add `gem "tanshuku"` to your application's `Gemfile`. +Add `gem "tanshuku"` to your application’s `Gemfile`. ```rb # Gemfile gem "tanshuku" ``` @@ -166,22 +166,22 @@ bin/rails db:migrate ``` ## Q&A -### What does "tanshuku" mean? +### Q. What does “tanshuku” mean? -"Tanshuku" is a Japanese word "短縮." It means "shortening." "短縮URL" in Japanese means "shortened URL" in English. +A. “Tanshuku” is a Japanese word “短縮.” It means “shortening.” And “短縮URL” in Japanese means “shortened URL” in English. -### \*\* (anything you want) isn't implemented? +### Q. \*\* (anything you want) isn’t implemented? -Does Tanshuku have some missing features? Please [create an issue](https://github.com/kg8m/tanshuku/issues/new). +A. Does Tanshuku have some missing features? Please [create an issue](https://github.com/kg8m/tanshuku/issues/new). ## How to develop 1. Fork this repository 1. `git clone` your fork -1. `bundle install` +1. `bundle install` and `rake steep:prepare` 1. Update sources 1. `rake` 1. Fix `rake` errors if `rake` fails 1. Create a pull request