Skip to content

Commit

Permalink
Merge pull request sinatra#49 from shime/master
Browse files Browse the repository at this point in the history
documentation fixes
  • Loading branch information
rkh committed May 7, 2012
2 parents 384f339 + a661501 commit 180008c
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion lib/sinatra/config_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions lib/sinatra/content_for.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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:
#
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/sinatra/cookies.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion lib/sinatra/decompile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions lib/sinatra/extension.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/sinatra/json.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions lib/sinatra/link_header.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lib/sinatra/namespace.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 5 additions & 5 deletions lib/sinatra/reloader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions lib/sinatra/respond_with.rb
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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}"] }
Expand Down
10 changes: 5 additions & 5 deletions lib/sinatra/streaming.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -89,7 +89,7 @@ module Sinatra
#
# require "sinatra/base"
# require "sinatra/streaming"
#
#
# class MyApp < Sinatra::Base
# helpers Sinatra::Streaming
# end
Expand Down Expand Up @@ -264,4 +264,4 @@ def tty?
end

helpers Streaming
end
end

0 comments on commit 180008c

Please sign in to comment.