watts 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +2 -2
- data/lib/watts.rb +6 -7
- data/lib/watts/monkey_patching.rb +0 -2
- metadata +3 -14
data/Rakefile
CHANGED
@@ -21,8 +21,8 @@ spec = Gem::Specification.new { |s|
|
|
21
21
|
s.summary =
|
22
22
|
"Resource-oriented, Rack-based, minimalist web framework."
|
23
23
|
s.homepage = "http://debu.gs/#{s.name}"
|
24
|
-
%w(
|
25
|
-
s.version = '1.0.
|
24
|
+
%w().each &s.method(:add_dependency)
|
25
|
+
s.version = '1.0.3'
|
26
26
|
}
|
27
27
|
|
28
28
|
Rake::RDocTask.new(:doc) { |t|
|
data/lib/watts.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
%w(
|
2
2
|
forwardable
|
3
|
-
metaid
|
4
3
|
rack
|
5
4
|
watts/monkey_patching
|
6
5
|
).each &method(:require)
|
@@ -39,14 +38,14 @@ module Watts
|
|
39
38
|
def rmatch res, args, acc = []
|
40
39
|
return "/#{acc.join('/')}" if args.empty? && resource == res
|
41
40
|
|
42
|
-
rest = args[1..-1]
|
41
|
+
rest = args[1..-1] || []
|
43
42
|
accnext = acc.dup << args[0]
|
44
43
|
|
45
44
|
each { |k,sub|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
45
|
+
if k.kind_of?(String)
|
46
|
+
t = sub.rmatch res, args, acc + [k]
|
47
|
+
return t if t
|
48
|
+
elsif k.kind_of?(Regexp) && k.match(args[0])
|
50
49
|
t = sub.rmatch res, rest, accnext
|
51
50
|
return t if t
|
52
51
|
elsif k.kind_of?(Symbol)
|
@@ -210,7 +209,7 @@ module Watts
|
|
210
209
|
# response, and a method for generating a method. You may also just
|
211
210
|
# def methods, as seen below for the options method.
|
212
211
|
HTTPMethods.each { |http_method|
|
213
|
-
|
212
|
+
define_singleton_method(http_method) { |&b|
|
214
213
|
(http_methods << http_method.to_s.upcase).uniq!
|
215
214
|
bmname = "__#{http_method}".to_sym
|
216
215
|
define_method(bmname, &b)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: watts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,19 +9,8 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
13
|
-
dependencies:
|
14
|
-
- !ruby/object:Gem::Dependency
|
15
|
-
name: metaid
|
16
|
-
requirement: &9112260 !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ! '>='
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '0'
|
22
|
-
type: :runtime
|
23
|
-
prerelease: false
|
24
|
-
version_requirements: *9112260
|
12
|
+
date: 2012-10-25 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
25
14
|
description:
|
26
15
|
email: pete@debu.gs
|
27
16
|
executables: []
|