mirror of
https://github.com/sinatra/sinatra
synced 2023-03-27 23:18:01 -04:00
commit
f7cda5d47e
12 changed files with 63 additions and 63 deletions
16
README.de.md
16
README.de.md
|
@ -588,7 +588,7 @@ get('/') { markdown :index }
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Abhängigkeit</td>
|
<td>Abhängigkeit</td>
|
||||||
<td><a href="http://builder.rubyforge.org/">builder</a></td>
|
<td><a href="https://github.com/jimweirich/builder">builder</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Dateierweiterung</td>
|
<td>Dateierweiterung</td>
|
||||||
|
@ -705,8 +705,8 @@ denen man Variablen weitergibt.
|
||||||
<a href="https://github.com/rtomayko/rdiscount" title="RDiscount">RDiscount</a>,
|
<a href="https://github.com/rtomayko/rdiscount" title="RDiscount">RDiscount</a>,
|
||||||
<a href="https://github.com/vmg/redcarpet" title="RedCarpet">RedCarpet</a>,
|
<a href="https://github.com/vmg/redcarpet" title="RedCarpet">RedCarpet</a>,
|
||||||
<a href="http://deveiate.org/projects/BlueCloth" title="BlueCloth">BlueCloth</a>,
|
<a href="http://deveiate.org/projects/BlueCloth" title="BlueCloth">BlueCloth</a>,
|
||||||
<a href="http://kramdown.rubyforge.org/" title="kramdown">kramdown</a> oder
|
<a href="http://kramdown.gettalong.org/" title="kramdown">kramdown</a> oder
|
||||||
<a href="http://maruku.rubyforge.org/" title="maruku">maruku</a>
|
<a href="https://github.com/bhollis/maruku" title="maruku">maruku</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -783,7 +783,7 @@ Templates zu verwenden und einen anderen für das Layout, indem die
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Abhängigkeit</td>
|
<td>Abhängigkeit</td>
|
||||||
<td><a href="http://rdoc.rubyforge.org/">rdoc</a></td>
|
<td><a href="http://rdoc.sourceforge.net/">rdoc</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Dateierweiterung</td>
|
<td>Dateierweiterung</td>
|
||||||
|
@ -842,7 +842,7 @@ denen man Variablen weitergibt.
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Abhängigkeit</td>
|
<td>Abhängigkeit</td>
|
||||||
<td><a href="http://radius.rubyforge.org/">radius</a></td>
|
<td><a href="https://github.com/jlong/radius">radius</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Dateierweiterung</td>
|
<td>Dateierweiterung</td>
|
||||||
|
@ -2339,7 +2339,7 @@ anzuzeigen.
|
||||||
|
|
||||||
## Rack-Middleware
|
## Rack-Middleware
|
||||||
|
|
||||||
Sinatra baut auf [Rack](http://rack.rubyforge.org/), einem minimalistischen
|
Sinatra baut auf [Rack](http://rack.github.io/), einem minimalistischen
|
||||||
Standard-Interface für Ruby-Webframeworks. Eines der interessantesten Features
|
Standard-Interface für Ruby-Webframeworks. Eines der interessantesten Features
|
||||||
für Entwickler ist der Support von Middlewares, die zwischen den Server und
|
für Entwickler ist der Support von Middlewares, die zwischen den Server und
|
||||||
die Anwendung geschaltet werden und so HTTP-Request und/oder Antwort
|
die Anwendung geschaltet werden und so HTTP-Request und/oder Antwort
|
||||||
|
@ -2361,7 +2361,7 @@ end
|
||||||
```
|
```
|
||||||
|
|
||||||
Die Semantik von `use` entspricht der gleichnamigen Methode der
|
Die Semantik von `use` entspricht der gleichnamigen Methode der
|
||||||
[Rack::Builder](http://rack.rubyforge.org/doc/classes/Rack/Builder.html)-DSL
|
[Rack::Builder](http://rubydoc.info/github/rack/rack/master/Rack/Builder)-DSL
|
||||||
(meist verwendet in Rackup-Dateien). Ein Beispiel dafür ist, dass die
|
(meist verwendet in Rackup-Dateien). Ein Beispiel dafür ist, dass die
|
||||||
`use`-Methode mehrere/verschiedene Argumente und auch Blöcke entgegennimmt:
|
`use`-Methode mehrere/verschiedene Argumente und auch Blöcke entgegennimmt:
|
||||||
|
|
||||||
|
@ -2378,7 +2378,7 @@ muss `use` häufig nicht explizit verwendet werden.
|
||||||
|
|
||||||
Hilfreiche Middleware gibt es z.B. hier:
|
Hilfreiche Middleware gibt es z.B. hier:
|
||||||
[rack](https://github.com/rack/rack/tree/master/lib/rack),
|
[rack](https://github.com/rack/rack/tree/master/lib/rack),
|
||||||
[rack-contrib](https://github.com/rack/rack-contrib#readme),
|
[rack-contrib](https://github.com/rack/rack-contrib#readme),
|
||||||
oder im [Rack wiki](https://github.com/rack/rack/wiki/List-of-Middleware).
|
oder im [Rack wiki](https://github.com/rack/rack/wiki/List-of-Middleware).
|
||||||
|
|
||||||
## Testen
|
## Testen
|
||||||
|
|
16
README.es.md
16
README.es.md
|
@ -483,7 +483,7 @@ get('/') { markdown :index }
|
||||||
<tr>
|
<tr>
|
||||||
<td>Dependencias</td>
|
<td>Dependencias</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="http://builder.rubyforge.org/" title="builder">builder</a>
|
<a href="https://github.com/jimweirich/builder" title="builder">builder</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -597,8 +597,8 @@ plantilla Liquid, casi siempre va a querer pasarle locales.
|
||||||
<a href="https://github.com/rtomayko/rdiscount" title="RDiscount">RDiscount</a>,
|
<a href="https://github.com/rtomayko/rdiscount" title="RDiscount">RDiscount</a>,
|
||||||
<a href="https://github.com/vmg/redcarpet" title="RedCarpet">RedCarpet</a>,
|
<a href="https://github.com/vmg/redcarpet" title="RedCarpet">RedCarpet</a>,
|
||||||
<a href="http://deveiate.org/projects/BlueCloth" title="BlueCloth">BlueCloth</a>,
|
<a href="http://deveiate.org/projects/BlueCloth" title="BlueCloth">BlueCloth</a>,
|
||||||
<a href="http://kramdown.rubyforge.org/" title="kramdown">kramdown</a> o
|
<a href="http://kramdown.gettalong.org/" title="kramdown">kramdown</a> o
|
||||||
<a href="http://maruku.rubyforge.org/" title="maruku">maruku</a>
|
<a href="https://github.com/bhollis/maruku" title="maruku">maruku</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -671,7 +671,7 @@ layout distinto al de la plantilla pasando la opción `:layout_engine`.
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Dependencias</td>
|
<td>Dependencias</td>
|
||||||
<td><a href="http://rdoc.rubyforge.org/" title="RDoc">RDoc</a></td>
|
<td><a href="http://rdoc.sourceforge.net/" title="RDoc">RDoc</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Extensiones de Archivo</td>
|
<td>Extensiones de Archivo</td>
|
||||||
|
@ -707,7 +707,7 @@ al de la plantilla pasando la opción `:layout_engine`.
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Dependencias</td>
|
<td>Dependencias</td>
|
||||||
<td><a href="http://radius.rubyforge.org/" title="Radius">Radius</a></td>
|
<td><a href="https://github.com/jlong/radius" title="Radius">Radius</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Extensiones de Archivo</td>
|
<td>Extensiones de Archivo</td>
|
||||||
|
@ -1616,7 +1616,7 @@ Estas opciones son:
|
||||||
página de error.
|
página de error.
|
||||||
|
|
||||||
Si el Rack handler lo soporta, se intentará no transmitir directamente desde el
|
Si el Rack handler lo soporta, se intentará no transmitir directamente desde el
|
||||||
proceso de Ruby. Si usás este método, Sinatra se va a encargar automáticamente de las
|
proceso de Ruby. Si usás este método, Sinatra se va a encargar automáticamente de las
|
||||||
peticiones de rango.
|
peticiones de rango.
|
||||||
|
|
||||||
### Accediendo al objeto de la petición
|
### Accediendo al objeto de la petición
|
||||||
|
@ -2164,7 +2164,7 @@ cuando se ejecuta dentro del entorno de desarrollo "development".
|
||||||
|
|
||||||
## Rack Middleware
|
## Rack Middleware
|
||||||
|
|
||||||
Sinatra corre sobre Rack[http://rack.rubyforge.org/], una interfaz minimalista
|
Sinatra corre sobre [Rack](http://rack.github.io/), una interfaz minimalista
|
||||||
que es un estándar para frameworks webs escritos en Ruby. Una de las
|
que es un estándar para frameworks webs escritos en Ruby. Una de las
|
||||||
características más interesantes de Rack para los desarrolladores de aplicaciones
|
características más interesantes de Rack para los desarrolladores de aplicaciones
|
||||||
es el soporte de "middleware" -- componentes que se ubican entre el servidor y
|
es el soporte de "middleware" -- componentes que se ubican entre el servidor y
|
||||||
|
@ -2187,7 +2187,7 @@ end
|
||||||
```
|
```
|
||||||
|
|
||||||
La semántica de `use` es idéntica a la definida para el DSL
|
La semántica de `use` es idéntica a la definida para el DSL
|
||||||
Rack::Builder[http://rack.rubyforge.org/doc/classes/Rack/Builder.html] (más
|
Rack::Builder[http://rubydoc.info/github/rack/rack/master/Rack/Builder] (más
|
||||||
frecuentemente usado en archivos rackup). Por ejemplo, el método `use`
|
frecuentemente usado en archivos rackup). Por ejemplo, el método `use`
|
||||||
acepta argumentos múltiples/variables así como bloques:
|
acepta argumentos múltiples/variables así como bloques:
|
||||||
|
|
||||||
|
|
14
README.fr.md
14
README.fr.md
|
@ -599,7 +599,7 @@ get('/') { markdown :index }
|
||||||
<tr>
|
<tr>
|
||||||
<td>Dépendances</td>
|
<td>Dépendances</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="http://builder.rubyforge.org/" title="builder">builder</a>
|
<a href="https://github.com/jimweirich/builder" title="builder">builder</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -720,8 +720,8 @@ locales.
|
||||||
<a href="https://github.com/rtomayko/rdiscount" title="RDiscount">RDiscount</a>,
|
<a href="https://github.com/rtomayko/rdiscount" title="RDiscount">RDiscount</a>,
|
||||||
<a href="https://github.com/vmg/redcarpet" title="RedCarpet">RedCarpet</a>,
|
<a href="https://github.com/vmg/redcarpet" title="RedCarpet">RedCarpet</a>,
|
||||||
<a href="http://deveiate.org/projects/BlueCloth" title="BlueCloth">BlueCloth</a>,
|
<a href="http://deveiate.org/projects/BlueCloth" title="BlueCloth">BlueCloth</a>,
|
||||||
<a href="http://kramdown.rubyforge.org/" title="kramdown">kramdown</a>,
|
<a href="http://kramdown.gettalong.org/" title="kramdown">kramdown</a>,
|
||||||
<a href="http://maruku.rubyforge.org/" title="maruku">maruku</a>
|
<a href="https://github.com/bhollis/maruku" title="maruku">maruku</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
@ -799,7 +799,7 @@ pour le layout en utilisant l’option `:layout_engine`.
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Dépendances</td>
|
<td>Dépendances</td>
|
||||||
<td><a href="http://rdoc.rubyforge.org/" title="RDoc">RDoc</a></td>
|
<td><a href="http://rdoc.sourceforge.net/" title="RDoc">RDoc</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Extensions de fichier</td>
|
<td>Extensions de fichier</td>
|
||||||
|
@ -836,7 +836,7 @@ pour le layout en utilisant l’option `:layout_engine`.
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Dépendances</td>
|
<td>Dépendances</td>
|
||||||
<td><a href="http://radius.rubyforge.org/" title="Radius">Radius</a></td>
|
<td><a href="https://github.com/jlong/radius" title="Radius">Radius</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Extensions de fichier</td>
|
<td>Extensions de fichier</td>
|
||||||
|
@ -2345,7 +2345,7 @@ Sinatra installe pour vous quelques gestionnaires `not_found` et
|
||||||
|
|
||||||
## Les Middlewares Rack
|
## Les Middlewares Rack
|
||||||
|
|
||||||
Sinatra tourne avec [Rack](http://rack.rubyforge.org/), une interface standard
|
Sinatra tourne avec [Rack](http://rack.github.io/), une interface standard
|
||||||
et minimale pour les web frameworks Ruby. Un des points forts de Rack est le
|
et minimale pour les web frameworks Ruby. Un des points forts de Rack est le
|
||||||
support de ce que l'on appelle des "middlewares" -- composant qui vient se
|
support de ce que l'on appelle des "middlewares" -- composant qui vient se
|
||||||
situer entre le serveur et votre application, et dont le but est de
|
situer entre le serveur et votre application, et dont le but est de
|
||||||
|
@ -2368,7 +2368,7 @@ end
|
||||||
```
|
```
|
||||||
|
|
||||||
La sémantique de `use` est identique à celle définie dans le DSL de
|
La sémantique de `use` est identique à celle définie dans le DSL de
|
||||||
[Rack::Builder](http://rack.rubyforge.org/doc/classes/Rack/Builder.html)
|
[Rack::Builder](http://rubydoc.info/github/rack/rack/master/Rack/Builder)
|
||||||
(le plus souvent utilisé dans un fichier rackup). Par exemple, la méthode
|
(le plus souvent utilisé dans un fichier rackup). Par exemple, la méthode
|
||||||
`use` accepte divers arguments ainsi que des blocs :
|
`use` accepte divers arguments ainsi que des blocs :
|
||||||
|
|
||||||
|
|
|
@ -495,7 +495,7 @@ bevezetéséhez:
|
||||||
## Rack Middleware
|
## Rack Middleware
|
||||||
|
|
||||||
A Sinatra egy Ruby keretrendszerek számára kifejlesztett egyszerű és szabványos
|
A Sinatra egy Ruby keretrendszerek számára kifejlesztett egyszerű és szabványos
|
||||||
interfészre, a [Rack](http://rack.rubyforge.org/) -re épül. A Rack fejlesztői
|
interfészre, a [Rack](http://rack.github.io/) -re épül. A Rack fejlesztői
|
||||||
szempontból egyik legérdekesebb jellemzője, hogy támogatja az úgynevezett
|
szempontból egyik legérdekesebb jellemzője, hogy támogatja az úgynevezett
|
||||||
"middleware" elnevezésű komponenseket, amelyek beékelődnek a szerver és az
|
"middleware" elnevezésű komponenseket, amelyek beékelődnek a szerver és az
|
||||||
alkalmazás közé, így képesek megfigyelni és/vagy módosítani a HTTP
|
alkalmazás közé, így képesek megfigyelni és/vagy módosítani a HTTP
|
||||||
|
@ -518,7 +518,7 @@ A Sinatra keretrendszerben gyerekjáték a Rack middleware-ek behúzása a
|
||||||
```
|
```
|
||||||
|
|
||||||
A `use` metódus szemantikája megegyezik a
|
A `use` metódus szemantikája megegyezik a
|
||||||
[Rack::Builder](http://rack.rubyforge.org/doc/classes/Rack/Builder.html) DSL-ben
|
[Rack::Builder](http://rubydoc.info/github/rack/rack/master/Rack/Builder) DSL-ben
|
||||||
használt +use+ metóduséval (az említett DSL-t leginkább rackup állományokban
|
használt +use+ metóduséval (az említett DSL-t leginkább rackup állományokban
|
||||||
használják). Hogy egy példát említsünk, a `use` metódus elfogad
|
használják). Hogy egy példát említsünk, a `use` metódus elfogad
|
||||||
változókat és blokkokat egyaránt, akár kombinálva is ezeket:
|
változókat és blokkokat egyaránt, akár kombinálva is ezeket:
|
||||||
|
|
14
README.ja.md
14
README.ja.md
|
@ -557,7 +557,7 @@ get('/') { markdown :index }
|
||||||
<tr>
|
<tr>
|
||||||
<td>依存</td>
|
<td>依存</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="http://builder.rubyforge.org/" title="builder">builder</a>
|
<a href="https://github.com/jimweirich/builder" title="builder">builder</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -673,8 +673,8 @@ LiquidテンプレートからRubyのメソッド(`yield`を除く)を呼び出
|
||||||
<a href="https://github.com/rtomayko/rdiscount" title="RDiscount">RDiscount</a>,
|
<a href="https://github.com/rtomayko/rdiscount" title="RDiscount">RDiscount</a>,
|
||||||
<a href="https://github.com/vmg/redcarpet" title="RedCarpet">RedCarpet</a>,
|
<a href="https://github.com/vmg/redcarpet" title="RedCarpet">RedCarpet</a>,
|
||||||
<a href="http://deveiate.org/projects/BlueCloth" title="BlueCloth">BlueCloth</a>,
|
<a href="http://deveiate.org/projects/BlueCloth" title="BlueCloth">BlueCloth</a>,
|
||||||
<a href="http://kramdown.rubyforge.org/" title="kramdown">kramdown</a>,
|
<a href="http://kramdown.gettalong.org/" title="kramdown">kramdown</a>,
|
||||||
<a href="http://maruku.rubyforge.org/" title="maruku">maruku</a>
|
<a href="https://github.com/bhollis/maruku" title="maruku">maruku</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -742,7 +742,7 @@ TexttileからはRubyを呼ぶことができないので、Textileで書かれ
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td>依存</td>
|
<td>依存</td>
|
||||||
<td><a href="http://rdoc.rubyforge.org/" title="RDoc">RDoc</a></td>
|
<td><a href="http://rdoc.sourceforge.net/" title="RDoc">RDoc</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>ファイル拡張子</td>
|
<td>ファイル拡張子</td>
|
||||||
|
@ -795,7 +795,7 @@ AsciiDocテンプレートからRubyのメソッドを直接呼び出すこと
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td>依存</td>
|
<td>依存</td>
|
||||||
<td><a href="http://radius.rubyforge.org/" title="Radius">Radius</a></td>
|
<td><a href="https://github.com/jlong/radius" title="Radius">Radius</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>ファイル拡張子</td>
|
<td>ファイル拡張子</td>
|
||||||
|
@ -2162,7 +2162,7 @@ Sinatraを開発環境の下で実行している場合は、特別な`not_found
|
||||||
|
|
||||||
## Rackミドルウェア(Rack Middleware)
|
## Rackミドルウェア(Rack Middleware)
|
||||||
|
|
||||||
SinatraはRuby製Webフレームワークのミニマルな標準的インタフェースである[Rack](http://rack.rubyforge.org/)上に構築されています。アプリケーションデベロッパーにとってRackにおける最も興味深い機能は、「ミドルウェア(middleware)」をサポートしていることであり、これは、サーバとアプリケーションとの間に置かれ、HTTPリクエスト/レスポンスを監視および/または操作することで、各種の汎用的機能を提供するコンポーネントです。
|
SinatraはRuby製Webフレームワークのミニマルな標準的インタフェースである[Rack](http://rack.github.io/)上に構築されています。アプリケーションデベロッパーにとってRackにおける最も興味深い機能は、「ミドルウェア(middleware)」をサポートしていることであり、これは、サーバとアプリケーションとの間に置かれ、HTTPリクエスト/レスポンスを監視および/または操作することで、各種の汎用的機能を提供するコンポーネントです。
|
||||||
|
|
||||||
Sinatraはトップレベルの`use`メソッドを通して、Rackミドルウェアパイプラインの構築を楽にします。
|
Sinatraはトップレベルの`use`メソッドを通して、Rackミドルウェアパイプラインの構築を楽にします。
|
||||||
|
|
||||||
|
@ -2178,7 +2178,7 @@ get '/hello' do
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
||||||
`use`の文法は、[Rack::Builder](http://rack.rubyforge.org/doc/classes/Rack/Builder.html)DSLで定義されているそれ(rackupファイルで最もよく使われる)と同じです。例えば `use`メソッドは複数の引数、そしてブロックも取ることができます。
|
`use`の文法は、[Rack::Builder](http://rubydoc.info/github/rack/rack/master/Rack/Builder)DSLで定義されているそれ(rackupファイルで最もよく使われる)と同じです。例えば `use`メソッドは複数の引数、そしてブロックも取ることができます。
|
||||||
|
|
||||||
``` ruby
|
``` ruby
|
||||||
use Rack::Auth::Basic do |username, password|
|
use Rack::Auth::Basic do |username, password|
|
||||||
|
|
14
README.ko.md
14
README.ko.md
|
@ -559,7 +559,7 @@ get('/') { markdown :index }
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td>의존성</td>
|
<td>의존성</td>
|
||||||
<td><a href="http://builder.rubyforge.org/">builder</a></td>
|
<td><a href="https://github.com/jimweirich/builder">builder</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>파일 확장자</td>
|
<td>파일 확장자</td>
|
||||||
|
@ -672,8 +672,8 @@ Liquid 템플릿에서는 루비 메서드(`yield` 제외)를 호출할 수 없
|
||||||
<a href="https://github.com/rtomayko/rdiscount" title="RDiscount">RDiscount</a>,
|
<a href="https://github.com/rtomayko/rdiscount" title="RDiscount">RDiscount</a>,
|
||||||
<a href="https://github.com/vmg/redcarpet" title="RedCarpet">RedCarpet</a>,
|
<a href="https://github.com/vmg/redcarpet" title="RedCarpet">RedCarpet</a>,
|
||||||
<a href="http://deveiate.org/projects/BlueCloth" title="BlueCloth">BlueCloth</a>,
|
<a href="http://deveiate.org/projects/BlueCloth" title="BlueCloth">BlueCloth</a>,
|
||||||
<a href="http://kramdown.rubyforge.org/" title="kramdown">kramdown</a>,
|
<a href="http://kramdown.gettalong.org/" title="kramdown">kramdown</a>,
|
||||||
<a href="http://maruku.rubyforge.org/" title="maruku">maruku</a>
|
<a href="https://github.com/bhollis/maruku" title="maruku">maruku</a>
|
||||||
중 아무거나
|
중 아무거나
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -745,7 +745,7 @@ Textile에서 루비를 호출할 수 없기 때문에, Textile으로 작성된
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td>의존성</td>
|
<td>의존성</td>
|
||||||
<td><a href="http://rdoc.rubyforge.org/">rdoc</a></td>
|
<td><a href="http://rdoc.sourceforge.net/">rdoc</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>파일 확장자</td>
|
<td>파일 확장자</td>
|
||||||
|
@ -800,7 +800,7 @@ AsciiDoc 템플릿에서는 루비 메서드를 호출할 수 없기
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td>의존성</td>
|
<td>의존성</td>
|
||||||
<td><a href="http://radius.rubyforge.org/">radius</a></td>
|
<td><a href="https://github.com/jlong/radius">radius</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>파일 확장자</td>
|
<td>파일 확장자</td>
|
||||||
|
@ -2327,7 +2327,7 @@ Sinatra는 개발 환경에서 동작할 때 브라우저에 괜찮은 스택
|
||||||
|
|
||||||
## Rack 미들웨어(Rack Middleware)
|
## Rack 미들웨어(Rack Middleware)
|
||||||
|
|
||||||
Sinatra는 [Rack](http://rack.rubyforge.org/) 위에서 동작하며, Rack은 루비 웹
|
Sinatra는 [Rack](http://rack.github.io/) 위에서 동작하며, Rack은 루비 웹
|
||||||
프레임워크를 위한 최소한의 표준 인터페이스입니다. Rack이 애플리케이션 개발자들에게
|
프레임워크를 위한 최소한의 표준 인터페이스입니다. Rack이 애플리케이션 개발자들에게
|
||||||
제공하는 가장 흥미로운 기능은 "미들웨어(middleware)"에 대한 지원입니다.
|
제공하는 가장 흥미로운 기능은 "미들웨어(middleware)"에 대한 지원입니다.
|
||||||
여기서 미들웨어란 서버와 여러분의 애플리케이션 사이에 위치하면서 HTTP 요청/응답을
|
여기서 미들웨어란 서버와 여러분의 애플리케이션 사이에 위치하면서 HTTP 요청/응답을
|
||||||
|
@ -2348,7 +2348,7 @@ get '/hello' do
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
||||||
`use`문법은 [Rack::Builder](http://rack.rubyforge.org/doc/classes/Rack/Builder.html]) DSL
|
`use`문법은 [Rack::Builder](http://rubydoc.info/github/rack/rack/master/Rack/Builder]) DSL
|
||||||
(rackup 파일에서 가장 많이 사용)에서 정의한 것과 동일합니다. 예를 들어, `use` 메서드는
|
(rackup 파일에서 가장 많이 사용)에서 정의한 것과 동일합니다. 예를 들어, `use` 메서드는
|
||||||
블록이나 여러 개의/가변적인 인자도 받을 수 있습니다.
|
블록이나 여러 개의/가변적인 인자도 받을 수 있습니다.
|
||||||
|
|
||||||
|
|
14
README.md
14
README.md
|
@ -587,7 +587,7 @@ get('/') { markdown :index }
|
||||||
<tr>
|
<tr>
|
||||||
<td>Dependency</td>
|
<td>Dependency</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="http://builder.rubyforge.org/" title="builder">builder</a>
|
<a href="https://github.com/jimweirich/builder" title="builder">builder</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -702,8 +702,8 @@ template, you almost always want to pass locals to it.
|
||||||
<a href="https://github.com/rtomayko/rdiscount" title="RDiscount">RDiscount</a>,
|
<a href="https://github.com/rtomayko/rdiscount" title="RDiscount">RDiscount</a>,
|
||||||
<a href="https://github.com/vmg/redcarpet" title="RedCarpet">RedCarpet</a>,
|
<a href="https://github.com/vmg/redcarpet" title="RedCarpet">RedCarpet</a>,
|
||||||
<a href="http://deveiate.org/projects/BlueCloth" title="BlueCloth">BlueCloth</a>,
|
<a href="http://deveiate.org/projects/BlueCloth" title="BlueCloth">BlueCloth</a>,
|
||||||
<a href="http://kramdown.rubyforge.org/" title="kramdown">kramdown</a>,
|
<a href="http://kramdown.gettalong.org/" title="kramdown">kramdown</a>,
|
||||||
<a href="http://maruku.rubyforge.org/" title="maruku">maruku</a>
|
<a href="https://github.com/bhollis/maruku" title="maruku">maruku</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -775,7 +775,7 @@ template than for the layout by passing the `:layout_engine` option.
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Dependency</td>
|
<td>Dependency</td>
|
||||||
<td><a href="http://rdoc.rubyforge.org/" title="RDoc">RDoc</a></td>
|
<td><a href="http://rdoc.sourceforge.net/" title="RDoc">RDoc</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>File Extension</td>
|
<td>File Extension</td>
|
||||||
|
@ -830,7 +830,7 @@ almost always want to pass locals to it.
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Dependency</td>
|
<td>Dependency</td>
|
||||||
<td><a href="http://radius.rubyforge.org/" title="Radius">Radius</a></td>
|
<td><a href="https://github.com/jlong/radius" title="Radius">Radius</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>File Extension</td>
|
<td>File Extension</td>
|
||||||
|
@ -2372,7 +2372,7 @@ and additional debugging information in your browser.
|
||||||
|
|
||||||
## Rack Middleware
|
## Rack Middleware
|
||||||
|
|
||||||
Sinatra rides on [Rack](http://rack.rubyforge.org/), a minimal standard
|
Sinatra rides on [Rack](http://rack.github.io/), a minimal standard
|
||||||
interface for Ruby web frameworks. One of Rack's most interesting capabilities
|
interface for Ruby web frameworks. One of Rack's most interesting capabilities
|
||||||
for application developers is support for "middleware" -- components that sit
|
for application developers is support for "middleware" -- components that sit
|
||||||
between the server and your application monitoring and/or manipulating the
|
between the server and your application monitoring and/or manipulating the
|
||||||
|
@ -2394,7 +2394,7 @@ end
|
||||||
```
|
```
|
||||||
|
|
||||||
The semantics of `use` are identical to those defined for the
|
The semantics of `use` are identical to those defined for the
|
||||||
[Rack::Builder](http://rack.rubyforge.org/doc/classes/Rack/Builder.html) DSL
|
[Rack::Builder](http://rubydoc.info/github/rack/rack/master/Rack/Builder) DSL
|
||||||
(most frequently used from rackup files). For example, the `use` method
|
(most frequently used from rackup files). For example, the `use` method
|
||||||
accepts multiple/variable args as well as blocks:
|
accepts multiple/variable args as well as blocks:
|
||||||
|
|
||||||
|
|
|
@ -761,7 +761,7 @@ content_type :foo
|
||||||
|
|
||||||
## Middleware Rack
|
## Middleware Rack
|
||||||
|
|
||||||
O Sinatra roda no [Rack](http://rack.rubyforge.org/), uma interface
|
O Sinatra roda no [Rack](http://rack.github.io/), uma interface
|
||||||
padrão mínima para frameworks web em Ruby. Um das capacidades mais
|
padrão mínima para frameworks web em Ruby. Um das capacidades mais
|
||||||
interessantes do Rack para desenvolver aplicativos é suporte a
|
interessantes do Rack para desenvolver aplicativos é suporte a
|
||||||
“middleware” – componentes que ficam entre o servidor e sua aplicação
|
“middleware” – componentes que ficam entre o servidor e sua aplicação
|
||||||
|
@ -784,7 +784,7 @@ end
|
||||||
```
|
```
|
||||||
|
|
||||||
A semântica de `use` é idêntica aquela definida para a DSL
|
A semântica de `use` é idêntica aquela definida para a DSL
|
||||||
[Rack::Builder](http://rack.rubyforge.org/doc/classes/Rack/Builder.html)
|
[Rack::Builder](http://rubydoc.info/github/rack/rack/master/Rack/Builder)
|
||||||
(mais frequentemente utilizada para arquivos rackup). Por exemplo, o
|
(mais frequentemente utilizada para arquivos rackup). Por exemplo, o
|
||||||
método `use` aceita múltiplos argumentos/variáveis bem como blocos:
|
método `use` aceita múltiplos argumentos/variáveis bem como blocos:
|
||||||
|
|
||||||
|
|
|
@ -586,7 +586,7 @@ content_type :foo
|
||||||
|
|
||||||
## Middleware Rack
|
## Middleware Rack
|
||||||
|
|
||||||
O Sinatra corre no [Rack](http://rack.rubyforge.org/), uma interface
|
O Sinatra corre no [Rack](http://rack.github.io/), uma interface
|
||||||
padrão mínima para frameworks web em Ruby. Uma das capacidades mais
|
padrão mínima para frameworks web em Ruby. Uma das capacidades mais
|
||||||
interessantes do Rack, para desenvolver aplicações, é o suporte de
|
interessantes do Rack, para desenvolver aplicações, é o suporte de
|
||||||
“middleware” – componentes que residem entre o servidor e a aplicação,
|
“middleware” – componentes que residem entre o servidor e a aplicação,
|
||||||
|
@ -609,7 +609,7 @@ end
|
||||||
```
|
```
|
||||||
|
|
||||||
A semântica de `use` é idêntica aquela definida para a DSL
|
A semântica de `use` é idêntica aquela definida para a DSL
|
||||||
[Rack::Builder](http://rack.rubyforge.org/doc/classes/Rack/Builder.html)
|
[Rack::Builder](http://rubydoc.info/github/rack/rack/master/Rack/Builder)
|
||||||
(mais frequentemente utilizada para arquivos rackup). Por exemplo, o
|
(mais frequentemente utilizada para arquivos rackup). Por exemplo, o
|
||||||
método `use` aceita múltiplos argumentos/variáveis, bem como blocos:
|
método `use` aceita múltiplos argumentos/variáveis, bem como blocos:
|
||||||
|
|
||||||
|
|
14
README.ru.md
14
README.ru.md
|
@ -487,7 +487,7 @@ get('/') { markdown :index }
|
||||||
<tr>
|
<tr>
|
||||||
<td>Зависимости</td>
|
<td>Зависимости</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="http://builder.rubyforge.org/" title="builder">builder</a>
|
<a href="https://github.com/jimweirich/builder" title="builder">builder</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -602,8 +602,8 @@ get('/') { markdown :index }
|
||||||
<a href="https://github.com/rtomayko/rdiscount" title="RDiscount">RDiscount</a>,
|
<a href="https://github.com/rtomayko/rdiscount" title="RDiscount">RDiscount</a>,
|
||||||
<a href="https://github.com/vmg/redcarpet" title="RedCarpet">RedCarpet</a>,
|
<a href="https://github.com/vmg/redcarpet" title="RedCarpet">RedCarpet</a>,
|
||||||
<a href="http://deveiate.org/projects/BlueCloth" title="BlueCloth">BlueCloth</a>,
|
<a href="http://deveiate.org/projects/BlueCloth" title="BlueCloth">BlueCloth</a>,
|
||||||
<a href="http://kramdown.rubyforge.org/" title="kramdown">kramdown</a>,
|
<a href="http://kramdown.gettalong.org/" title="kramdown">kramdown</a>,
|
||||||
<a href="http://maruku.rubyforge.org/" title="maruku">maruku</a>
|
<a href="https://github.com/bhollis/maruku" title="maruku">maruku</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -678,7 +678,7 @@ erb :overview, :locals => { :text => textile(:introduction) }
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Зависимости</td>
|
<td>Зависимости</td>
|
||||||
<td><a href="http://rdoc.rubyforge.org/" title="RDoc">RDoc</a></td>
|
<td><a href="http://rdoc.sourceforge.net/" title="RDoc">RDoc</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Расширения файлов</td>
|
<td>Расширения файлов</td>
|
||||||
|
@ -735,7 +735,7 @@ erb :overview, :locals => { :text => rdoc(:introduction) }
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Зависимости</td>
|
<td>Зависимости</td>
|
||||||
<td><a href="http://radius.rubyforge.org/" title="Radius">Radius</a></td>
|
<td><a href="https://github.com/jlong/radius" title="Radius">Radius</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Расширения файлов</td>
|
<td>Расширения файлов</td>
|
||||||
|
@ -2217,7 +2217,7 @@ Sinatra устанавливает специальные `not_found` и `error`
|
||||||
|
|
||||||
## Rack "прослойки"
|
## Rack "прослойки"
|
||||||
|
|
||||||
Sinatra использует [Rack](http://rack.rubyforge.org/), минимальный стандартный
|
Sinatra использует [Rack](http://rack.github.io/), минимальный стандартный
|
||||||
интерфейс для веб-фреймворков на Ruby. Одной из самых интересных для
|
интерфейс для веб-фреймворков на Ruby. Одной из самых интересных для
|
||||||
разработчиков возможностей Rack является поддержка "прослоек" ("middleware") —
|
разработчиков возможностей Rack является поддержка "прослоек" ("middleware") —
|
||||||
компонентов, находящихся "между" сервером и вашим приложением, которые
|
компонентов, находящихся "между" сервером и вашим приложением, которые
|
||||||
|
@ -2239,7 +2239,7 @@ end
|
||||||
```
|
```
|
||||||
|
|
||||||
Семантика `use` идентична той, что определена для
|
Семантика `use` идентична той, что определена для
|
||||||
[Rack::Builder](http://rack.rubyforge.org/doc/classes/Rack/Builder.html) DSL
|
[Rack::Builder](http://rubydoc.info/github/rack/rack/master/Rack/Builder) DSL
|
||||||
(чаще всего используется в rackup файлах). Например, метод `use` принимает как
|
(чаще всего используется в rackup файлах). Например, метод `use` принимает как
|
||||||
множественные переменные, так и блоки:
|
множественные переменные, так и блоки:
|
||||||
|
|
||||||
|
|
|
@ -1660,7 +1660,7 @@ end
|
||||||
|
|
||||||
## Rack 中间件
|
## Rack 中间件
|
||||||
|
|
||||||
Sinatra 依靠 [Rack](http://rack.rubyforge.org/), 一个面向Ruby
|
Sinatra 依靠 [Rack](http://rack.github.io/), 一个面向Ruby
|
||||||
web框架的最小标准接口。
|
web框架的最小标准接口。
|
||||||
Rack的一个最有趣的面向应用开发者的能力是支持“中间件”——坐落在服务器和你的应用之间,
|
Rack的一个最有趣的面向应用开发者的能力是支持“中间件”——坐落在服务器和你的应用之间,
|
||||||
监视 并/或 操作HTTP请求/响应以 提供多样类型的常用功能。
|
监视 并/或 操作HTTP请求/响应以 提供多样类型的常用功能。
|
||||||
|
@ -1680,7 +1680,7 @@ end
|
||||||
~~~~
|
~~~~
|
||||||
|
|
||||||
`use` 的语义和在
|
`use` 的语义和在
|
||||||
[Rack::Builder](http://rack.rubyforge.org/doc/classes/Rack/Builder.html)
|
[Rack::Builder](http://rubydoc.info/github/rack/rack/master/Rack/Builder)
|
||||||
DSL(在rack文件中最频繁使用)中定义的完全一样。例如,`use` 方法接受
|
DSL(在rack文件中最频繁使用)中定义的完全一样。例如,`use` 方法接受
|
||||||
多个/可变 参数,包括代码块:
|
多个/可变 参数,包括代码块:
|
||||||
|
|
||||||
|
@ -2160,7 +2160,7 @@ gem 'activerecord', '~> 3.0' # 也许你还需要 ActiveRecord 3.x
|
||||||
- [Sinatra宝典](https://github.com/sinatra/sinatra-book/) Cookbook教程
|
- [Sinatra宝典](https://github.com/sinatra/sinatra-book/) Cookbook教程
|
||||||
|
|
||||||
- [Sinatra使用技巧](http://recipes.sinatrarb.com/) 网友贡献的实用技巧
|
- [Sinatra使用技巧](http://recipes.sinatrarb.com/) 网友贡献的实用技巧
|
||||||
|
|
||||||
- [最新版本](http://rubydoc.info/gems/sinatra)API文档;[http://rubydoc.info](http://rubydoc.info)的[当前HEAD](http://rubydoc.info/github/sinatra/sinatra)
|
- [最新版本](http://rubydoc.info/gems/sinatra)API文档;[http://rubydoc.info](http://rubydoc.info)的[当前HEAD](http://rubydoc.info/github/sinatra/sinatra)
|
||||||
|
|
||||||
- [CI服务器](http://travis-ci.org/sinatra/sinatra)
|
- [CI服务器](http://travis-ci.org/sinatra/sinatra)
|
||||||
|
|
|
@ -14,7 +14,7 @@ require 'sinatra/version'
|
||||||
|
|
||||||
module Sinatra
|
module Sinatra
|
||||||
# The request object. See Rack::Request for more info:
|
# The request object. See Rack::Request for more info:
|
||||||
# http://rack.rubyforge.org/doc/classes/Rack/Request.html
|
# http://rubydoc.info/github/rack/rack/master/Rack/Request
|
||||||
class Request < Rack::Request
|
class Request < Rack::Request
|
||||||
HEADER_PARAM = /\s*[\w.]+=(?:[\w.]+|"(?:[^"\\]|\\.)*")?\s*/
|
HEADER_PARAM = /\s*[\w.]+=(?:[\w.]+|"(?:[^"\\]|\\.)*")?\s*/
|
||||||
HEADER_VALUE_WITH_PARAMS = /(?:(?:\w+|\*)\/(?:\w+(?:\.|\-|\+)?|\*)*)\s*(?:;#{HEADER_PARAM})*/
|
HEADER_VALUE_WITH_PARAMS = /(?:(?:\w+|\*)\/(?:\w+(?:\.|\-|\+)?|\*)*)\s*(?:;#{HEADER_PARAM})*/
|
||||||
|
@ -116,8 +116,8 @@ module Sinatra
|
||||||
|
|
||||||
# The response object. See Rack::Response and Rack::Response::Helpers for
|
# The response object. See Rack::Response and Rack::Response::Helpers for
|
||||||
# more info:
|
# more info:
|
||||||
# http://rack.rubyforge.org/doc/classes/Rack/Response.html
|
# http://rubydoc.info/github/rack/rack/master/Rack/Response
|
||||||
# http://rack.rubyforge.org/doc/classes/Rack/Response/Helpers.html
|
# http://rubydoc.info/github/rack/rack/master/Rack/Response/Helpers
|
||||||
class Response < Rack::Response
|
class Response < Rack::Response
|
||||||
DROP_BODY_RESPONSES = [204, 205, 304]
|
DROP_BODY_RESPONSES = [204, 205, 304]
|
||||||
def initialize(*)
|
def initialize(*)
|
||||||
|
|
Loading…
Reference in a new issue