Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

documentation fixes

  • Loading branch information...
commit a66150140b369da39f78646c87214c6a0e3d1336 1 parent 384f339
@shime shime authored
View
2  lib/sinatra/config_file.rb
@@ -10,7 +10,7 @@ module Sinatra
# the files contains specific environment settings and it will use the
# corresponding to the current one.
#
- # Within the application you can access those options through +settings+. If
+ # You can access those options through +settings+ within the application. If
# you try to get the value for a setting that hasn't been defined in the
# config file for the current environment, you will get whatever it was set
# to in the application.
View
4 lib/sinatra/content_for.rb
@@ -78,7 +78,7 @@ module ContentFor
def content_for(key, &block)
content_blocks[key.to_sym] << capture_later(&block)
end
-
+
# Check if a block of content with the given key was defined. For
# example:
#
@@ -100,7 +100,7 @@ def content_for?(key)
# <%= yield_content :head %>
# </head>
#
- # Would render everything you declared with <tt>content_for
+ # Would render everything you declared with <tt>content_for
# :head</tt> before closing the <tt><head></tt> tag.
#
# You can also pass values to the content blocks by passing them
View
2  lib/sinatra/cookies.rb
@@ -42,7 +42,7 @@ module Sinatra
# === Modular Application
#
# In a modular application you need to require the helpers, and then tell
- # the application you will use them:
+ # the application to use them:
#
# require "sinatra/base"
# require "sinatra/cookies"
View
2  lib/sinatra/decompile.rb
@@ -60,7 +60,7 @@ module Decompile
# end
# end
#
- # Will return the internal Regexp if unable to reconstruct the pattern,
+ # Will return the internal Regexp if it's unable to reconstruct the pattern,
# which likely indicates that a Regexp was used in the first place.
#
# You can also use this to check whether you could actually use a string
View
10 lib/sinatra/extension.rb
@@ -6,12 +6,12 @@ module Sinatra
# = Sinatra::Extension
#
# <tt>Sinatra::Extension</tt> is a mixin that provides some syntactic sugar
- # for your extensions. It allows you to call directly inside your extension
- # module almost any <tt>Sinatra::Base</tt> method. This means you can use
- # +get+ to define a route, +before+ to define a before filter, +set+ to
- # define a setting, a so on.
+ # for your extensions. It allows you to call almost any
+ # <tt>Sinatra::Base</tt> method directly inside your extension
+ # module. This means you can use +get+ to define a route, +before+
+ # to define a before filter, +set+ to define a setting and so on.
#
- # Is important to be aware that this mixin remembers the methods calls you
+ # Is important to be aware that this mixin remembers the method calls you
# make, and then, when your extension is registered, replays them on the
# Sinatra application that has been extended. In order to do that, it
# defines a <tt>registered</tt> method, so, if your extension defines one
View
4 lib/sinatra/json.rb
@@ -44,8 +44,8 @@ module Sinatra
#
# === Encoders
#
- # Per default it will try to call +to_json+ on the object, but if it doesn't
- # respond to that message, will use its own, rather simple encoder. You can
+ # By default it will try to call +to_json+ on the object, but if it doesn't
+ # respond to that message, it will use its own rather simple encoder. You can
# easily change that anyways. To use +JSON+, simply require it:
#
# require 'json'
View
4 lib/sinatra/link_header.rb
@@ -53,8 +53,8 @@ module Sinatra
#
module LinkHeader
##
- # Set Link HTTP header and returns HTML tags for telling the browser to
- # prefetch given resources (only supported by Opera and Firefox at the
+ # Sets Link HTTP header and returns HTML tags for telling the browser to
+ # prefetch given resources (only supported by Opera and Firefox at the
# moment).
def prefetch(*urls)
link(:prefetch, *urls)
View
2  lib/sinatra/namespace.rb
@@ -14,7 +14,7 @@ module Sinatra
#
# == Usage
#
- # Once you have loaded the extension (see below), you use the +namespace+
+ # Once you have loaded the extension (see below), you can use the +namespace+
# method to define namespaces in your application.
#
# You can define a namespace by a path prefix:
View
10 lib/sinatra/reloader.rb
@@ -75,7 +75,7 @@ module Sinatra
module Reloader
# Watches a file so it can tell when it has been updated, and what
- # elements contains.
+ # elements does it contain.
class Watcher
# Represents an element of a Sinatra application that may need to
@@ -95,8 +95,8 @@ class Element < Struct.new(:type, :representation)
# Collection of file +Watcher+ that can be associated with a
# Sinatra application. That way, we can know which files belong
# to a given application and which files have been modified. It
- # also provides a mechanism to inform a Watcher the elements
- # defined in the file being watched and if it changes should be
+ # also provides a mechanism to inform a Watcher of the elements
+ # defined in the file being watched and if its changes should be
# ignored.
class List
@app_list_map = Hash.new { |hash, key| hash[key] = new }
@@ -113,7 +113,7 @@ def initialize
end
end
- # Lets the +Watcher+ for the file localted at +path+ know that the
+ # Lets the +Watcher+ for the file located at +path+ know that the
# +element+ is defined there, and adds the +Watcher+ to the +List+,
# if it isn't already there.
def watch(path, element)
@@ -159,7 +159,7 @@ def updated?
!ignore? && !removed? && mtime != File.mtime(path)
end
- # Updates the file being watched mtime.
+ # Updates the mtime of the file being watched.
def update
@mtime = File.mtime(path)
end
View
14 lib/sinatra/respond_with.rb
@@ -1,11 +1,11 @@
-require 'sinatra/base'
require 'sinatra/json'
+require 'sinatra/base'
module Sinatra
- ##
+ #
# = Sinatra::RespondWith
#
- # This extensions lets Sinatra automatically choose what template to render or
+ # These extensions let Sinatra automatically choose what template to render or
# action to perform depending on the request's Accept header.
#
# Example:
@@ -53,8 +53,8 @@ module Sinatra
# == Security
#
# Since methods are triggered based on client input, this can lead to security
- # issues (but not as seviere as those might apear in the first place: keep in
- # mind that only known file extensions are used). You therefore should limit
+ # issues (but not as severe as those might appear in the first place: keep in
+ # mind that only known file extensions are used). You should limit
# the possible formats you serve.
#
# This is possible with the +provides+ condition:
@@ -64,7 +64,7 @@ module Sinatra
# end
#
# However, since you have to set +provides+ for every route, this extension
- # adds a app global (class method) `respond_to`, that let's you define content
+ # adds an app global (class method) `respond_to`, that lets you define content
# types for all routes:
#
# respond_to :html, :json, :xml, :atom
@@ -161,7 +161,7 @@ def respond_to(&block)
private
def template_for(name, exts)
- # in production this is cached, so don't worry to much about runtime
+ # in production this is cached, so don't worry too much about runtime
possible = []
settings.template_engines[:all].each do |engine|
exts.each { |ext| possible << [engine, "#{name}.#{ext}"] }
View
10 lib/sinatra/streaming.rb
@@ -44,9 +44,9 @@ module Sinatra
#
# == Better Middleware Handling
#
- # Blocks passed to #map! or #map will actually be applied while streaming
- # (as you might suspect, #map! applies modifications to the current body,
- # #map creates a new one):
+ # Blocks passed to #map! or #map will actually be applied when streaming
+ # takes place (as you might have suspected, #map! applies modifications
+ # to the current body, while #map creates a new one):
#
# class StupidMiddleware
# def initialize(app) @app = app end
@@ -89,7 +89,7 @@ module Sinatra
#
# require "sinatra/base"
# require "sinatra/streaming"
- #
+ #
# class MyApp < Sinatra::Base
# helpers Sinatra::Streaming
# end
@@ -264,4 +264,4 @@ def tty?
end
helpers Streaming
-end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.