serve 1.5.0.pre → 1.5.0.pre2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +1 -0
- data/README.rdoc +1 -1
- data/VERSION +1 -1
- data/lib/serve/rack.rb +17 -2
- data/lib/serve/view_helpers.rb +1 -1
- metadata +4 -4
data/CHANGELOG.rdoc
CHANGED
data/README.rdoc
CHANGED
@@ -285,7 +285,7 @@ email :: Evaluates the document as if it is an e-mail message; the format is ide
|
|
285
285
|
redirect :: Redirects to the URL contained in the document
|
286
286
|
|
287
287
|
|
288
|
-
== Exporting
|
288
|
+
== Exporting a Serve Project
|
289
289
|
|
290
290
|
The edge version of Serve now has limited support for exporting your Serve
|
291
291
|
project to HTML. To get started with the prerelease version:
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.5.0.
|
1
|
+
1.5.0.pre2
|
data/lib/serve/rack.rb
CHANGED
@@ -4,8 +4,23 @@ require 'rack'
|
|
4
4
|
module Serve
|
5
5
|
class Request < Rack::Request
|
6
6
|
# Returns a Hash of the query params for a request's URL.
|
7
|
-
def
|
8
|
-
@
|
7
|
+
def get_params
|
8
|
+
@get_params ||= Rack::Utils.parse_nested_query(query_string)
|
9
|
+
end
|
10
|
+
alias query get_params
|
11
|
+
|
12
|
+
# Returns a Hash of the query params for a posted form
|
13
|
+
def post_params
|
14
|
+
@post_params ||= form_data? ? Rack::Utils.parse_nested_query(body.read) : {}
|
15
|
+
end
|
16
|
+
|
17
|
+
# Key based access to query parameters. Keys can be strings or symbols.
|
18
|
+
def params
|
19
|
+
@params ||= begin
|
20
|
+
hash = HashWithIndifferentAccess.new.update(get_params)
|
21
|
+
hash.update(post_params) if form_data?
|
22
|
+
hash
|
23
|
+
end
|
9
24
|
end
|
10
25
|
|
11
26
|
# Returns the protocol part of the URL for a request: "http://", "https://", etc.
|
data/lib/serve/view_helpers.rb
CHANGED
@@ -96,7 +96,7 @@ module Serve #:nodoc:
|
|
96
96
|
|
97
97
|
# Key based access to query parameters. Keys can be strings or symbols.
|
98
98
|
def params
|
99
|
-
@params ||=
|
99
|
+
@params ||= request.params
|
100
100
|
end
|
101
101
|
|
102
102
|
# Extract the value for a bool param. Handy for rendering templates in
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: serve
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: -1876988199
|
5
5
|
prerelease: true
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 5
|
9
9
|
- 0
|
10
|
-
-
|
11
|
-
version: 1.5.0.
|
10
|
+
- pre2
|
11
|
+
version: 1.5.0.pre2
|
12
12
|
platform: ruby
|
13
13
|
authors:
|
14
14
|
- John W. Long
|
@@ -18,7 +18,7 @@ autorequire:
|
|
18
18
|
bindir: bin
|
19
19
|
cert_chain: []
|
20
20
|
|
21
|
-
date: 2011-06-
|
21
|
+
date: 2011-06-08 00:00:00 -04:00
|
22
22
|
default_executable: serve
|
23
23
|
dependencies:
|
24
24
|
- !ruby/object:Gem::Dependency
|