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 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(metaid).each &s.method(:add_dependency)
25
- s.version = '1.0.2'
24
+ %w().each &s.method(:add_dependency)
25
+ s.version = '1.0.3'
26
26
  }
27
27
 
28
28
  Rake::RDocTask.new(:doc) { |t|
@@ -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
- t = sub.rmatch res, args, acc + [k]
47
- return t if t
48
-
49
- if k.kind_of?(Regexp) && k.match(args[0])
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
- meta_def(http_method) { |&b|
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)
@@ -1,7 +1,5 @@
1
1
  # This is the place to stuff all of the monkey-patches.
2
2
 
3
- require 'metaid'
4
-
5
3
  class Class
6
4
  # Has instances delegate methods to the class.
7
5
  def to_instance *ms
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.2
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-08-28 00:00:00.000000000 Z
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: []