sinatra-resources 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +4 -0
- data/lib/sinatra/resources.rb +2 -14
- data/test/sinatra_resources_test.rb +1 -1
- metadata +24 -10
data/CHANGELOG.rdoc
CHANGED
data/lib/sinatra/resources.rb
CHANGED
@@ -1,21 +1,9 @@
|
|
1
1
|
module Sinatra
|
2
2
|
module Resources
|
3
|
-
def self.registered(app)
|
4
|
-
[:get, :post, :put, :delete].each do |meth|
|
5
|
-
# http://whynotwiki.com/Ruby_/_Method_aliasing_and_chaining#Can_you_alias_class_methods.3F
|
6
|
-
app.class_eval <<-EndAlias
|
7
|
-
class << self
|
8
|
-
alias_method :#{meth}_without_resource, :#{meth}
|
9
|
-
alias_method :#{meth}, :#{meth}_with_resource
|
10
|
-
end
|
11
|
-
EndAlias
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
3
|
[:get, :post, :put, :delete].each do |meth|
|
16
4
|
class_eval <<-EndMeth
|
17
|
-
def #{meth}
|
18
|
-
|
5
|
+
def #{meth}(path=nil, options={}, &block)
|
6
|
+
super(make_path(path), options, &block)
|
19
7
|
end
|
20
8
|
EndMeth
|
21
9
|
end
|
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra-resources
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 1
|
8
|
+
- 2
|
9
|
+
version: 0.1.2
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- Nate Wiger
|
@@ -9,20 +14,25 @@ autorequire:
|
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date: 2010-
|
17
|
+
date: 2010-05-23 00:00:00 -07:00
|
13
18
|
default_executable:
|
14
19
|
dependencies:
|
15
20
|
- !ruby/object:Gem::Dependency
|
16
21
|
name: sinatra
|
17
|
-
|
18
|
-
|
19
|
-
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
20
25
|
requirements:
|
21
26
|
- - ">="
|
22
27
|
- !ruby/object:Gem::Version
|
28
|
+
segments:
|
29
|
+
- 0
|
30
|
+
- 9
|
31
|
+
- 0
|
23
32
|
version: 0.9.0
|
24
|
-
|
25
|
-
|
33
|
+
type: :runtime
|
34
|
+
version_requirements: *id001
|
35
|
+
description: Simple nested resources for Sinatra. Based on widely-followed Sinatra ticket.
|
26
36
|
email: nate@wiger.org
|
27
37
|
executables: []
|
28
38
|
|
@@ -50,21 +60,25 @@ rdoc_options:
|
|
50
60
|
require_paths:
|
51
61
|
- lib
|
52
62
|
required_ruby_version: !ruby/object:Gem::Requirement
|
63
|
+
none: false
|
53
64
|
requirements:
|
54
65
|
- - ">="
|
55
66
|
- !ruby/object:Gem::Version
|
67
|
+
segments:
|
68
|
+
- 0
|
56
69
|
version: "0"
|
57
|
-
version:
|
58
70
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
71
|
+
none: false
|
59
72
|
requirements:
|
60
73
|
- - ">="
|
61
74
|
- !ruby/object:Gem::Version
|
75
|
+
segments:
|
76
|
+
- 0
|
62
77
|
version: "0"
|
63
|
-
version:
|
64
78
|
requirements:
|
65
79
|
- sinatra, v0.9.0 or greater
|
66
80
|
rubyforge_project: sinatra-resources
|
67
|
-
rubygems_version: 1.3.
|
81
|
+
rubygems_version: 1.3.7
|
68
82
|
signing_key:
|
69
83
|
specification_version: 3
|
70
84
|
summary: Simple nested resources for Sinatra
|