reststop 0.5.2 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,6 @@
1
+ === 0.5.3 :: 2010-07-07
2
+ * Fixed issue in the new basic_render method where Tilt templates were not supported (on either actions or layout)
3
+
1
4
  === 0.5.2 :: 2010-06-21
2
5
  * Made the content-type in reststop_render to be text/html only if the format is :HTML, and application/#{format} otherwise
3
6
  * Fixed issue in the new basic_render method where the layout was not being applied.
@@ -12,7 +12,7 @@ For info and downloads please see http://github.com/camping/reststop
12
12
 
13
13
 
14
14
  For an example of a complete Reststop-based Camping app, have a look at
15
- http://github.com/zuk/reststop/blob/master/examples/blog.rb
15
+ http://github.com/camping/reststop/blob/master/examples/blog.rb
16
16
 
17
17
  Reststop essentially gives you three things:
18
18
 
@@ -163,7 +163,7 @@ module Reststop
163
163
  @headers['Content-Type'] = ct
164
164
 
165
165
  s = m.capture{m.send(action)}
166
- s = m.capture{send(:layout){s}} if /^_/!~@method.to_s and m.respond_to?(:layout) # @techarch : replaced a[0] by @method (not 100% sure that's right though)
166
+ s = m.capture{send(:layout){s}} if /^_/!~action.to_s and m.respond_to?(:layout)
167
167
  s
168
168
  end
169
169
  end
@@ -175,8 +175,20 @@ module Reststop
175
175
  app_name = self.class.name.split("::").first # @techarch : get the name of the app
176
176
  mab = (app_name + '::Mab').constantize # @techarch : get the Mab class
177
177
  m = mab.new({}, self) # @techarch : instantiate Mab
178
- s = m.capture{m.send(action)}
179
- s = m.capture{send(:layout){s}} if /^_/!~@method.to_s and m.respond_to?(:layout) # @techarch : replaced a[0] by @method (not 100% sure that's right though)
178
+
179
+ tpl = lookup(action) # check if we have a Tilt template
180
+
181
+ raise "Can't find action #{action}" unless tpl
182
+
183
+ s = (tpl == true) ? m.capture{m.send(action)} : tpl.render(self, {}) # if so render it
184
+ if /^_/!~action.to_s
185
+ layout_tpl = lookup(:layout)
186
+ if layout_tpl
187
+ b = Proc.new { s }
188
+ s = (layout_tpl == true) ? m.capture{send(:layout){s}} : layout_tpl.render(m, {},&b) # if so render it
189
+ end
190
+ end
191
+ s
180
192
  end
181
193
  end
182
194
 
@@ -2,7 +2,7 @@ module Reststop
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 5
5
- TINY = 2
5
+ TINY = 3
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reststop
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
5
4
  prerelease: false
6
5
  segments:
7
6
  - 0
8
7
  - 5
9
- - 2
10
- version: 0.5.2
8
+ - 3
9
+ version: 0.5.3
11
10
  platform: ruby
12
11
  authors:
13
12
  - Matt Zukowski
@@ -16,18 +15,16 @@ autorequire:
16
15
  bindir: bin
17
16
  cert_chain: []
18
17
 
19
- date: 2010-06-22 00:00:00 -06:00
18
+ date: 2010-07-07 00:00:00 -06:00
20
19
  default_executable:
21
20
  dependencies:
22
21
  - !ruby/object:Gem::Dependency
23
22
  name: camping
24
23
  prerelease: false
25
24
  requirement: &id001 !ruby/object:Gem::Requirement
26
- none: false
27
25
  requirements:
28
26
  - - ">="
29
27
  - !ruby/object:Gem::Version
30
- hash: 799
31
28
  segments:
32
29
  - 2
33
30
  - 0
@@ -56,7 +53,6 @@ files:
56
53
  - lib/reststop.rb
57
54
  - lib/reststop/version.rb
58
55
  - README.rdoc
59
- - test/test.rb
60
56
  has_rdoc: true
61
57
  homepage: http://wiki.github.com/camping/reststop/
62
58
  licenses: []
@@ -67,27 +63,23 @@ rdoc_options: []
67
63
  require_paths:
68
64
  - lib
69
65
  required_ruby_version: !ruby/object:Gem::Requirement
70
- none: false
71
66
  requirements:
72
67
  - - ">="
73
68
  - !ruby/object:Gem::Version
74
- hash: 3
75
69
  segments:
76
70
  - 0
77
71
  version: "0"
78
72
  required_rubygems_version: !ruby/object:Gem::Requirement
79
- none: false
80
73
  requirements:
81
74
  - - ">="
82
75
  - !ruby/object:Gem::Version
83
- hash: 3
84
76
  segments:
85
77
  - 0
86
78
  version: "0"
87
79
  requirements: []
88
80
 
89
81
  rubyforge_project: reststop
90
- rubygems_version: 1.3.7
82
+ rubygems_version: 1.3.6
91
83
  signing_key:
92
84
  specification_version: 3
93
85
  summary: REST framework for Camping web services