reststop 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,52 +1,56 @@
1
- === 0.5.1 :: 2010-06-09
2
- * Update to align with the post 2.0 enhancements in Camping related to Tilt support.
3
- Since Tilt support is now checking for the existing of view methods and Tilt views
4
- RESTstop needs to ensure that view methods can be looked up in Views:HTML as opposed to Views.
5
-
6
- === 0.5.0 :: 2010-04-07
7
-
8
- * Major refactoring for compatibility with Camping 2.0. Thanks to Philippe Monnet
9
- for completing the work.
10
-
11
- === 0.4.1 :: 2009-05-08
12
-
13
- * Custom actions should now work again (needed to make some more changes for
14
- Camping 2.0 compatibility).
15
-
16
- === 0.4.0 :: 2009-05-01
17
-
18
- * Now compatible with Camping 2.0, but no longer works with Camping 1.x :(
19
-
20
- === 0.3.0 :: 2008-06-19
21
-
22
- * Restr has been moved out to its own gem, and should now work properly with
23
- Rails 2.x (fixes bug #17421).
24
- * `R` helper method should now work properly when a Restful controlelr class
25
- is fed as input along with a custom action. The final argument can be a Hash
26
- and will be translated into URL parameters. For example:
27
- R(Kittens, 'list', 'colour' => 'black')
28
-
29
- === 0.2.0 :: 2007-12-10
30
-
31
- * It is now possible to specify the format for rendering a page by appending
32
- it as a filename extension to the URL. For example: '/items.xml' to use the XML
33
- view module, or '/items/5.rss' to use the RSS module.
34
- * Custom actions are now possible. Custom methods defined in your controller will
35
- respond to the standard custom-action URLs. For example, if you have a method
36
- 'foo' in your 'kittens' controller, you can get to it by requesting the URL
37
- '/kittens/foo' or '/kittens/1/foo'. Note that the action will respond to any
38
- HTTP method (post, get, put, delete). It is up to you to handle different
39
- request methods inside your action's definition.
40
- * XML input (from an ActiveResource client, for example) is now parsed into a
41
- nested Hash, and is made available as the standard @input Camping variable.
42
- * HTML forms created using Markaby (i.e. by just using `form`) that
43
- have a :method parameter now automatically insert a hidden '_method' input to
44
- facilitate 'put' and 'delete' HTTP methods for HTML browsers.
45
- * Pages now correctly return HTTP status code 501 when an unimplemented controller
46
- method is called. ActiveRecord::NotFound exceptions are caught and return 404
47
- status.
48
- * R helper now works for routing RESTful controllers.
49
-
50
- === 0.1.0 :: 2007-07-30
51
-
52
- * First public release.
1
+ === 0.5.2 :: 2010-06-21
2
+ * Made the content-type in reststop_render to be text/html only if the format is :HTML, and application/#{format} otherwise
3
+ * Fixed issue in the new basic_render method where the layout was not being applied.
4
+
5
+ === 0.5.1 :: 2010-06-09
6
+ * Update to align with the post 2.0 enhancements in Camping related to Tilt support.
7
+ Since Tilt support is now checking for the existing of view methods and Tilt views
8
+ RESTstop needs to ensure that view methods can be looked up in Views:HTML as opposed to Views.
9
+
10
+ === 0.5.0 :: 2010-04-07
11
+
12
+ * Major refactoring for compatibility with Camping 2.0. Thanks to Philippe Monnet
13
+ for completing the work.
14
+
15
+ === 0.4.1 :: 2009-05-08
16
+
17
+ * Custom actions should now work again (needed to make some more changes for
18
+ Camping 2.0 compatibility).
19
+
20
+ === 0.4.0 :: 2009-05-01
21
+
22
+ * Now compatible with Camping 2.0, but no longer works with Camping 1.x :(
23
+
24
+ === 0.3.0 :: 2008-06-19
25
+
26
+ * Restr has been moved out to its own gem, and should now work properly with
27
+ Rails 2.x (fixes bug #17421).
28
+ * `R` helper method should now work properly when a Restful controlelr class
29
+ is fed as input along with a custom action. The final argument can be a Hash
30
+ and will be translated into URL parameters. For example:
31
+ R(Kittens, 'list', 'colour' => 'black')
32
+
33
+ === 0.2.0 :: 2007-12-10
34
+
35
+ * It is now possible to specify the format for rendering a page by appending
36
+ it as a filename extension to the URL. For example: '/items.xml' to use the XML
37
+ view module, or '/items/5.rss' to use the RSS module.
38
+ * Custom actions are now possible. Custom methods defined in your controller will
39
+ respond to the standard custom-action URLs. For example, if you have a method
40
+ 'foo' in your 'kittens' controller, you can get to it by requesting the URL
41
+ '/kittens/foo' or '/kittens/1/foo'. Note that the action will respond to any
42
+ HTTP method (post, get, put, delete). It is up to you to handle different
43
+ request methods inside your action's definition.
44
+ * XML input (from an ActiveResource client, for example) is now parsed into a
45
+ nested Hash, and is made available as the standard @input Camping variable.
46
+ * HTML forms created using Markaby (i.e. by just using `form`) that
47
+ have a :method parameter now automatically insert a hidden '_method' input to
48
+ facilitate 'put' and 'delete' HTTP methods for HTML browsers.
49
+ * Pages now correctly return HTTP status code 501 when an unimplemented controller
50
+ method is called. ActiveRecord::NotFound exceptions are caught and return 404
51
+ status.
52
+ * R helper now works for routing RESTful controllers.
53
+
54
+ === 0.1.0 :: 2007-07-30
55
+
56
+ * First public release.
@@ -1,22 +1,22 @@
1
- Copyright (c) 2010 the Contributors (see http://github.com/zuk/reststop/commits/master)
2
-
3
- Permission is hereby granted, free of charge, to any person
4
- obtaining a copy of this software and associated documentation
5
- files (the "Software"), to deal in the Software without
6
- restriction, including without limitation the rights to use,
7
- copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- copies of the Software, and to permit persons to whom the
9
- Software is furnished to do so, subject to the following
10
- conditions:
11
-
12
- The above copyright notice and this permission notice shall be
13
- included in all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17
- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1
+ Copyright (c) 2010 the Contributors (see http://github.com/zuk/reststop/commits/master)
2
+
3
+ Permission is hereby granted, free of charge, to any person
4
+ obtaining a copy of this software and associated documentation
5
+ files (the "Software"), to deal in the Software without
6
+ restriction, including without limitation the rights to use,
7
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the
9
+ Software is furnished to do so, subject to the following
10
+ conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
22
  OTHER DEALINGS IN THE SOFTWARE.
@@ -1,12 +1,14 @@
1
- .loadpath
2
- .project
3
- CHANGELOG.txt
4
- History.txt
5
- LICENSE.txt
6
- Manifest.txt
7
- README.txt
8
- Rakefile
9
- examples/blog.rb
10
- lib/reststop.rb
11
- lib/reststop/version.rb
12
- setup.rb
1
+ .loadpath
2
+ .project
3
+ CHANGELOG.txt
4
+ History.txt
5
+ LICENSE.txt
6
+ Manifest.txt
7
+ README.txt
8
+ Rakefile
9
+ examples/blog.rb
10
+ lib/reststop.rb
11
+ lib/reststop/version.rb
12
+ setup.rb
13
+ test/reststop_test.rb
14
+ test/test_helper.rb
@@ -1,126 +1,126 @@
1
- = Reststop
2
-
3
- <b>Reststop makes it easy to write RESTful[http://en.wikipedia.org/wiki/Representational_State_Transfer]
4
- applications in Camping[http://github.com/camping/camping].</b>
5
-
6
- For info and downloads please see http://github.com/camping/reststop
7
-
8
-
9
- *Authors*:: Matt Zukowski and Philippe Monnet (see http://github.com/camping/reststop/commits/master)
10
- *Copyright*:: Copyright (c) 2010 Urbacon Ltd.
11
- *License*:: MIT License[http://en.wikipedia.org/wiki/MIT_License]
12
-
13
-
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
16
-
17
- Reststop essentially gives you three things:
18
-
19
- <b>1. Camping controllers that respond to the standard REST verbs:</b>
20
-
21
- * create (POST)
22
- * read (GET)
23
- * update (PUT)
24
- * destroy (DELETE)
25
- * list (GET)
26
-
27
- Custom actions are also possible. See the Reststop::Controllers#REST method documentation for usage info.
28
-
29
- <b>2. Camping views grouped by output format:</b>
30
-
31
- Your views module:
32
-
33
- module Foobar::Views
34
- module HTML
35
- def foo
36
- html do
37
- p "Hello World"
38
- end
39
- end
40
- end
41
- module XML
42
- def foo
43
- tag!('foo')
44
- "Hello World"
45
- end
46
- end
47
- end
48
- end
49
-
50
- Your render call:
51
-
52
- render(:foo, :XML)
53
-
54
- See the Camping#render method documentation for usage info.
55
-
56
- <b>3. Nice URLs to bring it all together:</b>
57
-
58
- For example a list of kittens in the default format (HTML) is available at:
59
-
60
- /kittens
61
-
62
- The list, in RSS format:
63
-
64
- /kittens.rss
65
-
66
- Kitten with id 1, in XML format:
67
-
68
- /kittens/1.xml
69
-
70
- Using custom action 'meow' on kitten with id 1:
71
-
72
- /kittens/1/meow
73
-
74
- In other words, say you have a "kittens" resource; you can make a GET
75
- request to http://yourapp.com/kittens.xml and get a list of kittens
76
- through your Kittens controller's <tt>list</tt>, formatted using your
77
- <tt>XML</tt> view module.
78
-
79
-
80
- <b>Looking for Restr, the very simple REST client?</b>
81
-
82
- Due to its popularity, <b>Restr</b>, the "very simple rest client",
83
- has been moved out to its own gem. Restr now lives under
84
- http://rubyforge.org/projects/restr/ and can be installed using:
85
-
86
- gem install restr
87
-
88
- Restr is basically a wrapper around Ruby's Net::HTTP, offering
89
- a more RESTfully meaningful interface.
90
-
91
- See the "Restr documentation"[http://restr.rubyforge.org/] for more info,
92
- but here's a simple example of RESTful interaction with Restr:
93
-
94
- require 'restr'
95
- kitten = Restr.get('http://example.com/kittens/1.xml')
96
- puts kitten['name']
97
- puts kitten['colour']
98
-
99
- kitten['colour'] = 'black'
100
- kitten = Restr.put('http://example.com/kittens/1.xml', kitten)
101
-
102
-
103
- == License
104
-
105
- Copyright (c) 2010 the Contributors (see http://github.com/camping/reststop/commits/master)
106
-
107
- Permission is hereby granted, free of charge, to any person
108
- obtaining a copy of this software and associated documentation
109
- files (the "Software"), to deal in the Software without
110
- restriction, including without limitation the rights to use,
111
- copy, modify, merge, publish, distribute, sublicense, and/or sell
112
- copies of the Software, and to permit persons to whom the
113
- Software is furnished to do so, subject to the following
114
- conditions:
115
-
116
- The above copyright notice and this permission notice shall be
117
- included in all copies or substantial portions of the Software.
118
-
119
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
120
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
121
- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
122
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
123
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
124
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
125
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1
+ = Reststop
2
+
3
+ <b>Reststop makes it easy to write RESTful[http://en.wikipedia.org/wiki/Representational_State_Transfer]
4
+ applications in Camping[http://github.com/camping/camping].</b>
5
+
6
+ For info and downloads please see http://github.com/camping/reststop
7
+
8
+
9
+ *Authors*:: Matt Zukowski and Philippe Monnet (see http://github.com/camping/reststop/commits/master)
10
+ *Copyright*:: Copyright (c) 2010 Urbacon Ltd.
11
+ *License*:: MIT License[http://en.wikipedia.org/wiki/MIT_License]
12
+
13
+
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
16
+
17
+ Reststop essentially gives you three things:
18
+
19
+ <b>1. Camping controllers that respond to the standard REST verbs:</b>
20
+
21
+ * create (POST)
22
+ * read (GET)
23
+ * update (PUT)
24
+ * destroy (DELETE)
25
+ * list (GET)
26
+
27
+ Custom actions are also possible. See the Reststop::Controllers#REST method documentation for usage info.
28
+
29
+ <b>2. Camping views grouped by output format:</b>
30
+
31
+ Your views module:
32
+
33
+ module Foobar::Views
34
+ module HTML
35
+ def foo
36
+ html do
37
+ p "Hello World"
38
+ end
39
+ end
40
+ end
41
+ module XML
42
+ def foo
43
+ tag!('foo')
44
+ "Hello World"
45
+ end
46
+ end
47
+ end
48
+ end
49
+
50
+ Your render call:
51
+
52
+ render(:foo, :XML)
53
+
54
+ See the Camping#render method documentation for usage info.
55
+
56
+ <b>3. Nice URLs to bring it all together:</b>
57
+
58
+ For example a list of kittens in the default format (HTML) is available at:
59
+
60
+ /kittens
61
+
62
+ The list, in RSS format:
63
+
64
+ /kittens.rss
65
+
66
+ Kitten with id 1, in XML format:
67
+
68
+ /kittens/1.xml
69
+
70
+ Using custom action 'meow' on kitten with id 1:
71
+
72
+ /kittens/1/meow
73
+
74
+ In other words, say you have a "kittens" resource; you can make a GET
75
+ request to http://yourapp.com/kittens.xml and get a list of kittens
76
+ through your Kittens controller's <tt>list</tt>, formatted using your
77
+ <tt>XML</tt> view module.
78
+
79
+
80
+ <b>Looking for Restr, the very simple REST client?</b>
81
+
82
+ Due to its popularity, <b>Restr</b>, the "very simple rest client",
83
+ has been moved out to its own gem. Restr now lives under
84
+ http://rubyforge.org/projects/restr/ and can be installed using:
85
+
86
+ gem install restr
87
+
88
+ Restr is basically a wrapper around Ruby's Net::HTTP, offering
89
+ a more RESTfully meaningful interface.
90
+
91
+ See the "Restr documentation"[http://restr.rubyforge.org/] for more info,
92
+ but here's a simple example of RESTful interaction with Restr:
93
+
94
+ require 'restr'
95
+ kitten = Restr.get('http://example.com/kittens/1.xml')
96
+ puts kitten['name']
97
+ puts kitten['colour']
98
+
99
+ kitten['colour'] = 'black'
100
+ kitten = Restr.put('http://example.com/kittens/1.xml', kitten)
101
+
102
+
103
+ == License
104
+
105
+ Copyright (c) 2010 the Contributors (see http://github.com/camping/reststop/commits/master)
106
+
107
+ Permission is hereby granted, free of charge, to any person
108
+ obtaining a copy of this software and associated documentation
109
+ files (the "Software"), to deal in the Software without
110
+ restriction, including without limitation the rights to use,
111
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
112
+ copies of the Software, and to permit persons to whom the
113
+ Software is furnished to do so, subject to the following
114
+ conditions:
115
+
116
+ The above copyright notice and this permission notice shall be
117
+ included in all copies or substantial portions of the Software.
118
+
119
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
120
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
121
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
122
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
123
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
124
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
125
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
126
126
  OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile CHANGED
@@ -1,54 +1,56 @@
1
- require 'rubygems'
2
- require 'rake'
3
- require 'rake/clean'
4
- require 'rake/packagetask'
5
- require 'rake/gempackagetask'
6
- require 'rake/rdoctask'
7
- require 'rake/contrib/rubyforgepublisher'
8
- require 'fileutils'
9
- require 'hoe'
10
- include FileUtils
11
- require File.join(File.dirname(__FILE__), 'lib', 'reststop', 'version')
12
-
13
- AUTHOR = "Matt Zukowski" # can also be an array of Authors
14
- EMAIL = "matt@roughest.net"
15
- DESCRIPTION = "Convenient RESTfulness for all your Camping needs (i.e. makes it easy to implement RESTful controllers in Camping)."
16
- GEM_NAME = "reststop"
17
- RUBYFORGE_PROJECT = "reststop" # The unix name for your project
18
- HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
19
-
20
- ENV['NODOT'] = '1'
21
-
22
- NAME = "reststop"
23
- REV = nil
24
- #REV = `svn info`[/Revision: (\d+)/, 1] rescue nil
25
- VERS = ENV['VERSION'] || (Reststop::VERSION::STRING + (REV ? ".#{REV}" : ""))
26
- CLEAN.include ['**/.*.sw?', '*.gem', '.config']
27
- RDOC_OPTS = ['--quiet', '--title', "#{NAME} #{VERS} documentation",
28
- "--opname", "index.html",
29
- "--line-numbers",
30
- "--main", "README",
31
- "--inline-source"]
32
-
33
- class Hoe
34
- def extra_deps
35
- @extra_deps.reject { |x| Array(x).first == 'hoe' }
36
- end
37
- end
38
-
39
- # Generate all the Rake tasks
40
- # Run 'rake -T' to see list of generated tasks (from gem root directory)
41
- hoe = Hoe.new(GEM_NAME, VERS) do |p|
42
- p.author = AUTHOR
43
- p.description = DESCRIPTION
44
- p.email = EMAIL
45
- p.summary = DESCRIPTION
46
- p.url = HOMEPATH
47
- p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
48
- p.clean_globs = CLEAN #An array of file patterns to delete on clean.
49
-
50
- # == Optional
51
- #p.changes - A description of the release's latest changes.
52
- p.extra_deps = ['restr']
53
- #p.spec_extras - A hash of extra values to set in the gemspec.
54
- end
1
+ require 'rubygems'
2
+ require 'rake'
3
+ require 'rake/clean'
4
+ require 'rake/testtask'
5
+ require 'rake/packagetask'
6
+ require 'rake/gempackagetask'
7
+ require 'rake/rdoctask'
8
+ require 'rake/contrib/rubyforgepublisher'
9
+ require 'fileutils'
10
+ require 'hoe'
11
+ include FileUtils
12
+ require File.join(File.dirname(__FILE__), 'lib', 'reststop', 'version')
13
+
14
+ AUTHOR = "Matt Zukowski" # can also be an array of Authors
15
+ EMAIL = "matt@roughest.net"
16
+ DESCRIPTION = "Convenient RESTfulness for all your Camping needs (i.e. makes it easy to implement RESTful controllers in Camping)."
17
+ GEM_NAME = "reststop"
18
+ RUBYFORGE_PROJECT = "reststop" # The unix name for your project
19
+ HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
20
+
21
+ ENV['NODOT'] = '1'
22
+
23
+ NAME = "reststop"
24
+ REV = nil
25
+ #REV = `svn info`[/Revision: (\d+)/, 1] rescue nil
26
+ VERS = ENV['VERSION'] || (Reststop::VERSION::STRING + (REV ? ".#{REV}" : ""))
27
+ CLEAN.include ['**/.*.sw?', '*.gem', '.config']
28
+ RDOC_OPTS = ['--quiet', '--title', "#{NAME} #{VERS} documentation",
29
+ "--opname", "index.html",
30
+ "--line-numbers",
31
+ "--main", "README",
32
+ "--inline-source"]
33
+
34
+ class Hoe
35
+ def extra_deps
36
+ @extra_deps.reject { |x| Array(x).first == 'hoe' }
37
+ end
38
+ end
39
+
40
+ # Generate all the Rake tasks
41
+ # Run 'rake -T' to see list of generated tasks (from gem root directory)
42
+ hoe = Hoe.new(GEM_NAME, VERS) do |p|
43
+ p.author = AUTHOR
44
+ p.description = DESCRIPTION
45
+ p.email = EMAIL
46
+ p.summary = DESCRIPTION
47
+ p.url = HOMEPATH
48
+ p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
49
+ p.test_globs = ["test/**/*_test.rb"]
50
+ p.clean_globs = CLEAN #An array of file patterns to delete on clean.
51
+
52
+ # == Optional
53
+ #p.changes - A description of the release's latest changes.
54
+ p.extra_deps = ['restr']
55
+ #p.spec_extras - A hash of extra values to set in the gemspec.
56
+ end