described_routes 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -71,6 +71,7 @@ You (or your client application) can now browse to any of the following top leve
71
71
  * .../described_routes.xml
72
72
  * .../described_routes.yaml
73
73
  * .../described_routes.yaml?short=true
74
+ * .../described_routes.ytxt
74
75
 
75
76
  and for the named route "users" (say):
76
77
 
@@ -78,25 +79,25 @@ and for the named route "users" (say):
78
79
  * .../described_routes/users.xml
79
80
  * .../described_routes/users.yaml
80
81
  * .../described_routes/users.yaml?short=true
82
+ * .../described_routes/users.txt
81
83
 
82
84
  If the application has a route named "root", run-time-generated data will include uri_template attributes based on root_url in addition to the path_template attributes supported at build time.
83
85
 
84
86
  Example:
85
87
 
86
- $ curl http://localhost:3000/described_routes.txt | head
87
- % Total % Received % Xferd Average Speed Time Time Time Current
88
- Dload Upload Total Spent Left Speed
89
- 100 3536 100 3536 0 0 226k 0 --:--:-- --:--:-- --:--:-- 3453k
90
- root root http://localhost:3000/
91
- admin_products admin_products GET, POST http://localhost:3000/admin/products{-prefix|.|format}
92
- new_admin_product new_admin_product GET http://localhost:3000/admin/products/new{-prefix|.|format}
93
- {product_id} admin_product GET, PUT, DELETE http://localhost:3000/admin/products/{product_id}{-prefix|.|format}
94
- edit edit_admin_product GET http://localhost:3000/admin/products/{product_id}/edit{-prefix|.|format}
95
- described_routes described_routes GET, POST http://localhost:3000/described_routes{-prefix|.|format}
96
- new_described_route new_described_route GET http://localhost:3000/described_routes/new{-prefix|.|format}
97
- {route_name} described_route GET, PUT, DELETE http://localhost:3000/described_routes/{route_name}{-prefix|.|format}
98
- edit edit_described_route GET http://localhost:3000/described_routes/{route_name}/edit{-prefix|.|format}
99
- pages pages GET, POST http://localhost:3000/pages{-prefix|.|format}
88
+ $ curl http://localhost:3000/described_routes/users.txt
89
+ users users GET, POST http://localhost:3000/users{-prefix|.|format}
90
+ new_user new_user GET http://localhost:3000/users/new{-prefix|.|format}
91
+ {user_id} user GET, PUT, DELETE http://localhost:3000/users/{user_id}{-prefix|.|format}
92
+ edit edit_user GET http://localhost:3000/users/{user_id}/edit{-prefix|.|format}
93
+ articles user_articles GET, POST http://localhost:3000/users/{user_id}/articles{-prefix|.|format}
94
+ new_user_article new_user_article GET http://localhost:3000/users/{user_id}/articles/new{-prefix|.|format}
95
+ recent recent_user_articles GET http://localhost:3000/users/{user_id}/articles/recent{-prefix|.|format}
96
+ {article_id} user_article GET, PUT, DELETE http://localhost:3000/users/{user_id}/articles/{article_id}{-prefix|.|format}
97
+ edit edit_user_article GET http://localhost:3000/users/{user_id}/articles/{article_id}/edit{-prefix|.|format}
98
+ profile user_profile GET, PUT, DELETE, POST http://localhost:3000/users/{user_id}/profile{-prefix|.|format}
99
+ edit edit_user_profile GET http://localhost:3000/users/{user_id}/profile/edit{-prefix|.|format}
100
+ new new_user_profile GET http://localhost:3000/users/{user_id}/profile/new{-prefix|.|format}
100
101
 
101
102
  == DATA STRUCTURES and FORMATS
102
103
 
@@ -32,7 +32,7 @@ module DescribedRoutes
32
32
  respond_to do |format|
33
33
  format.html # show.html.erb
34
34
  format.json { render :json => resource_template.to_json }
35
- format.text { render :text => resource_template.to_text }
35
+ format.text { render :text => ResourceTemplate.to_text([resource_template]) }
36
36
  format.xml do
37
37
  render :xml => resource_template.to_xml(Builder::XmlMarkup.new(:indent => 2)).target!
38
38
  end
@@ -2,5 +2,5 @@ require 'described_routes/resource_template'
2
2
 
3
3
  module DescribedRoutes
4
4
  # rubygem version
5
- VERSION = "0.3.1"
5
+ VERSION = "0.3.2"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: described_routes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Burrows