Capcode 0.8.4 → 0.8.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. data/README.rdoc +58 -0
  2. data/doc/rdoc/classes/Capcode.html +938 -0
  3. data/doc/rdoc/classes/Capcode/Base.html +136 -0
  4. data/doc/rdoc/classes/Capcode/HTTPError.html +134 -0
  5. data/doc/rdoc/classes/Capcode/Helpers.html +608 -0
  6. data/doc/rdoc/classes/Capcode/Helpers/Authorization.html +188 -0
  7. data/doc/rdoc/classes/Capcode/Mab.html +118 -0
  8. data/doc/rdoc/classes/Capcode/Resource.html +111 -0
  9. data/doc/rdoc/classes/Capcode/Views.html +112 -0
  10. data/doc/rdoc/created.rid +1 -0
  11. data/doc/rdoc/files/AUTHORS.html +107 -0
  12. data/doc/rdoc/files/COPYING.html +531 -0
  13. data/doc/rdoc/files/README_rdoc.html +601 -0
  14. data/doc/rdoc/files/lib/capcode/base/db_rb.html +101 -0
  15. data/doc/rdoc/files/lib/capcode/helpers/auth_rb.html +132 -0
  16. data/doc/rdoc/files/lib/capcode/render/erb_rb.html +108 -0
  17. data/doc/rdoc/files/lib/capcode/render/haml_rb.html +108 -0
  18. data/doc/rdoc/files/lib/capcode/render/json_rb.html +108 -0
  19. data/doc/rdoc/files/lib/capcode/render/markaby_rb.html +108 -0
  20. data/doc/rdoc/files/lib/capcode/render/sass_rb.html +108 -0
  21. data/doc/rdoc/files/lib/capcode/render/static_rb.html +101 -0
  22. data/doc/rdoc/files/lib/capcode/render/text_rb.html +101 -0
  23. data/doc/rdoc/files/lib/capcode/render/webdav_rb.html +124 -0
  24. data/doc/rdoc/files/lib/capcode/render/xml_rb.html +101 -0
  25. data/doc/rdoc/files/lib/capcode_rb.html +119 -0
  26. data/doc/rdoc/fr_class_index.html +34 -0
  27. data/doc/rdoc/fr_file_index.html +41 -0
  28. data/doc/rdoc/fr_method_index.html +44 -0
  29. data/doc/rdoc/index.html +24 -0
  30. data/doc/rdoc/rdoc-style.css +208 -0
  31. data/examples/auth-basic.rb +46 -0
  32. data/examples/auth-digest.rb +47 -0
  33. data/examples/auth-webdav.rb +29 -0
  34. data/examples/blog-couchdb-run.rb +10 -0
  35. data/examples/blog-couchdb.rb +8 -8
  36. data/examples/blog-couchdb.ru +12 -0
  37. data/examples/render-static.rb +1 -1
  38. data/examples/render-static.ru +21 -0
  39. data/examples/render-webdav.rb +26 -0
  40. data/examples/rest-run.rb +3 -0
  41. data/examples/rest.rb +1 -1
  42. data/examples/rest.ru +3 -0
  43. data/lib/capcode.rb +196 -100
  44. data/lib/capcode/helpers/auth.rb +130 -0
  45. data/lib/capcode/render/webdav.rb +45 -0
  46. data/lib/capcode/version.rb +1 -1
  47. metadata +45 -3
@@ -0,0 +1,45 @@
1
+ # From rack_dav
2
+ require 'builder'
3
+ require 'time'
4
+ require 'uri'
5
+ require 'rexml/document'
6
+ require 'webrick/httputils'
7
+
8
+ require 'rack_dav/builder_namespace'
9
+ require 'rack_dav/http_status'
10
+ require 'rack_dav/resource'
11
+ require 'rack_dav/file_resource'
12
+ require 'rack_dav/handler'
13
+ require 'rack_dav/controller'
14
+
15
+
16
+ module Capcode
17
+ module Helpers
18
+
19
+ def render_webdav( f, opts )
20
+ options = {
21
+ :resource_class => RackDAV::FileResource,
22
+ :root => f
23
+ }.merge(opts)
24
+
25
+ request = Rack::Request.new(env)
26
+ response = Rack::Response.new
27
+
28
+ begin
29
+ controller = RackDAV::Controller.new(request, response, options.dup)
30
+ controller.send(request.request_method.downcase)
31
+ rescue RackDAV::HTTPStatus::Status => status
32
+ response.status = status.code
33
+ end
34
+
35
+ # Strings in Ruby 1.9 are no longer enumerable. Rack still expects the response.body to be
36
+ # enumerable, however.
37
+ response.body = [response.body] if not response.body.respond_to? :each
38
+
39
+ response.status = response.status ? response.status.to_i : 200
40
+ response.finish
41
+
42
+ [response.status, response.header, response.body]
43
+ end
44
+ end
45
+ end
@@ -1,3 +1,3 @@
1
1
  module Capcode
2
- CAPCOD_VERION="0.8.4"
2
+ CAPCOD_VERION="0.8.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Capcode
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.4
4
+ version: 0.8.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Gr\xC3\xA9goire Lejeune"
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-09-05 00:00:00 +02:00
12
+ date: 2009-10-09 00:00:00 +02:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -51,16 +51,47 @@ extra_rdoc_files:
51
51
  - lib/capcode/render/sass.rb
52
52
  - lib/capcode/render/static.rb
53
53
  - lib/capcode/render/text.rb
54
+ - lib/capcode/render/webdav.rb
54
55
  - lib/capcode/render/xml.rb
55
56
  files:
56
57
  - COPYING
57
58
  - README.rdoc
58
59
  - AUTHORS
59
60
  - setup.rb
61
+ - doc/rdoc/classes/Capcode/Base.html
62
+ - doc/rdoc/classes/Capcode/Helpers/Authorization.html
63
+ - doc/rdoc/classes/Capcode/Helpers.html
64
+ - doc/rdoc/classes/Capcode/HTTPError.html
65
+ - doc/rdoc/classes/Capcode/Mab.html
66
+ - doc/rdoc/classes/Capcode/Resource.html
67
+ - doc/rdoc/classes/Capcode/Views.html
68
+ - doc/rdoc/classes/Capcode.html
69
+ - doc/rdoc/created.rid
70
+ - doc/rdoc/files/AUTHORS.html
71
+ - doc/rdoc/files/COPYING.html
72
+ - doc/rdoc/files/lib/capcode/base/db_rb.html
73
+ - doc/rdoc/files/lib/capcode/helpers/auth_rb.html
74
+ - doc/rdoc/files/lib/capcode/render/erb_rb.html
75
+ - doc/rdoc/files/lib/capcode/render/haml_rb.html
76
+ - doc/rdoc/files/lib/capcode/render/json_rb.html
77
+ - doc/rdoc/files/lib/capcode/render/markaby_rb.html
78
+ - doc/rdoc/files/lib/capcode/render/sass_rb.html
79
+ - doc/rdoc/files/lib/capcode/render/static_rb.html
80
+ - doc/rdoc/files/lib/capcode/render/text_rb.html
81
+ - doc/rdoc/files/lib/capcode/render/webdav_rb.html
82
+ - doc/rdoc/files/lib/capcode/render/xml_rb.html
83
+ - doc/rdoc/files/lib/capcode_rb.html
84
+ - doc/rdoc/files/README_rdoc.html
85
+ - doc/rdoc/fr_class_index.html
86
+ - doc/rdoc/fr_file_index.html
87
+ - doc/rdoc/fr_method_index.html
88
+ - doc/rdoc/index.html
89
+ - doc/rdoc/rdoc-style.css
60
90
  - lib/capcode/base/couchdb.rb
61
91
  - lib/capcode/base/db.rb
62
92
  - lib/capcode/base/dm.rb
63
93
  - lib/capcode/core_ext.rb
94
+ - lib/capcode/helpers/auth.rb
64
95
  - lib/capcode/render/erb.rb
65
96
  - lib/capcode/render/haml.rb
66
97
  - lib/capcode/render/json.rb
@@ -68,10 +99,16 @@ files:
68
99
  - lib/capcode/render/sass.rb
69
100
  - lib/capcode/render/static.rb
70
101
  - lib/capcode/render/text.rb
102
+ - lib/capcode/render/webdav.rb
71
103
  - lib/capcode/render/xml.rb
72
104
  - lib/capcode/version.rb
73
105
  - lib/capcode.rb
106
+ - examples/auth-basic.rb
107
+ - examples/auth-digest.rb
108
+ - examples/auth-webdav.rb
109
+ - examples/blog-couchdb-run.rb
74
110
  - examples/blog-couchdb.rb
111
+ - examples/blog-couchdb.ru
75
112
  - examples/blog-couchdb.yml
76
113
  - examples/blog-dm.rb
77
114
  - examples/blog-dm.yml
@@ -90,9 +127,13 @@ files:
90
127
  - examples/render-json.rb
91
128
  - examples/render-markaby.rb
92
129
  - examples/render-static.rb
130
+ - examples/render-static.ru
93
131
  - examples/render-text.rb
132
+ - examples/render-webdav.rb
94
133
  - examples/render-xml.rb
134
+ - examples/rest-run.rb
95
135
  - examples/rest.rb
136
+ - examples/rest.ru
96
137
  - examples/rss.rb
97
138
  - examples/sample.rb
98
139
  - examples/session.rb
@@ -108,7 +149,8 @@ post_install_message: |+
108
149
  If you want to use Markaby renderer, you must install Markaby.
109
150
  If you want to use HAML renderer, you must install haml.
110
151
  If you want to use SASS renderer, you must install sass.
111
- If you want to use JSON renderer, you must install json
152
+ If you want to use JSON renderer, you must install json.
153
+ If you want to use WebDAV renderer, you must install rack_dav.
112
154
 
113
155
  If For more information about Capcode, see
114
156
  http://capcode.rubyforge.org