described_routes 0.3.3 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. data/History.txt +8 -1
  2. data/Manifest.txt +31 -0
  3. data/README.rdoc +6 -2
  4. data/Rakefile +13 -11
  5. data/lib/described_routes/rake_task_methods.rb +38 -0
  6. data/lib/described_routes.rb +1 -1
  7. data/lib/tasks/described_routes.rb +12 -22
  8. data/test_rails_app/Rakefile +12 -0
  9. data/test_rails_app/app/controllers/application_controller.rb +10 -0
  10. data/test_rails_app/app/helpers/application_helper.rb +3 -0
  11. data/test_rails_app/config/boot.rb +110 -0
  12. data/test_rails_app/config/environment.rb +41 -0
  13. data/test_rails_app/config/environments/development.rb +17 -0
  14. data/test_rails_app/config/environments/production.rb +28 -0
  15. data/test_rails_app/config/environments/test.rb +28 -0
  16. data/test_rails_app/config/initializers/described_routes.rb +1 -0
  17. data/test_rails_app/config/initializers/new_rails_defaults.rb +19 -0
  18. data/test_rails_app/config/initializers/session_store.rb +15 -0
  19. data/test_rails_app/config/routes.rb +28 -0
  20. data/test_rails_app/log/development.log +0 -0
  21. data/test_rails_app/log/production.log +0 -0
  22. data/test_rails_app/log/server.log +0 -0
  23. data/test_rails_app/log/test.log +0 -0
  24. data/test_rails_app/script/server +3 -0
  25. data/test_rails_app/test/fixtures/build_time/described_routes.json +1 -0
  26. data/test_rails_app/test/fixtures/build_time/described_routes.text +27 -0
  27. data/test_rails_app/test/fixtures/build_time/described_routes.xml +309 -0
  28. data/test_rails_app/test/fixtures/build_time/described_routes.yaml +243 -0
  29. data/test_rails_app/test/fixtures/build_time/described_routes.yaml_short +72 -0
  30. data/test_rails_app/test/fixtures/run_time/described_routes.json +1 -0
  31. data/test_rails_app/test/fixtures/run_time/described_routes.text +27 -0
  32. data/test_rails_app/test/fixtures/run_time/described_routes.xml +336 -0
  33. data/test_rails_app/test/fixtures/run_time/described_routes.yaml +270 -0
  34. data/test_rails_app/test/fixtures/run_time/described_routes.yaml_short +99 -0
  35. data/test_rails_app/test/integration/described_routes_run_time_test.rb +37 -0
  36. data/test_rails_app/test/integration/rake_tasks_test.rb +29 -0
  37. data/test_rails_app/test/test_helper.rb +2 -0
  38. metadata +34 -3
@@ -0,0 +1,99 @@
1
+ ---
2
+ - name: root
3
+ path_template: /
4
+ uri_template: http://www.example.com/
5
+ - name: admin_products
6
+ - name: new_admin_product
7
+ path_template: /admin/products/new{-prefix|.|format}
8
+ uri_template: http://www.example.com/admin/products/new{-prefix|.|format}
9
+ rel: new_admin_product
10
+ - name: admin_product
11
+ - name: edit_admin_product
12
+ path_template: /admin/products/{product_id}/edit{-prefix|.|format}
13
+ uri_template: http://www.example.com/admin/products/{product_id}/edit{-prefix|.|format}
14
+ rel: edit
15
+ path_template: /admin/products/{product_id}{-prefix|.|format}
16
+ uri_template: http://www.example.com/admin/products/{product_id}{-prefix|.|format}
17
+ path_template: /admin/products{-prefix|.|format}
18
+ uri_template: http://www.example.com/admin/products{-prefix|.|format}
19
+ - name: described_routes
20
+ - name: new_described_route
21
+ path_template: /described_routes/new{-prefix|.|format}
22
+ uri_template: http://www.example.com/described_routes/new{-prefix|.|format}
23
+ rel: new_described_route
24
+ - name: described_route
25
+ - name: edit_described_route
26
+ path_template: /described_routes/{route_name}/edit{-prefix|.|format}
27
+ uri_template: http://www.example.com/described_routes/{route_name}/edit{-prefix|.|format}
28
+ rel: edit
29
+ path_template: /described_routes/{route_name}{-prefix|.|format}
30
+ uri_template: http://www.example.com/described_routes/{route_name}{-prefix|.|format}
31
+ path_template: /described_routes{-prefix|.|format}
32
+ uri_template: http://www.example.com/described_routes{-prefix|.|format}
33
+ - name: pages
34
+ - name: new_page
35
+ path_template: /pages/new{-prefix|.|format}
36
+ uri_template: http://www.example.com/pages/new{-prefix|.|format}
37
+ rel: new_page
38
+ - name: page
39
+ - name: edit_page
40
+ path_template: /pages/{page_id}/edit{-prefix|.|format}
41
+ uri_template: http://www.example.com/pages/{page_id}/edit{-prefix|.|format}
42
+ rel: edit
43
+ - name: summary_page
44
+ path_template: /pages/{page_id}/summary{-prefix|.|format}
45
+ uri_template: http://www.example.com/pages/{page_id}/summary{-prefix|.|format}
46
+ rel: summary
47
+ - name: toggle_visibility_page
48
+ path_template: /pages/{page_id}/toggle_visibility{-prefix|.|format}
49
+ uri_template: http://www.example.com/pages/{page_id}/toggle_visibility{-prefix|.|format}
50
+ rel: toggle_visibility
51
+ path_template: /pages/{page_id}{-prefix|.|format}
52
+ uri_template: http://www.example.com/pages/{page_id}{-prefix|.|format}
53
+ path_template: /pages{-prefix|.|format}
54
+ uri_template: http://www.example.com/pages{-prefix|.|format}
55
+ - name: users
56
+ - name: new_user
57
+ path_template: /users/new{-prefix|.|format}
58
+ uri_template: http://www.example.com/users/new{-prefix|.|format}
59
+ rel: new_user
60
+ - name: user
61
+ - name: edit_user
62
+ path_template: /users/{user_id}/edit{-prefix|.|format}
63
+ uri_template: http://www.example.com/users/{user_id}/edit{-prefix|.|format}
64
+ rel: edit
65
+ - name: user_articles
66
+ - name: new_user_article
67
+ path_template: /users/{user_id}/articles/new{-prefix|.|format}
68
+ uri_template: http://www.example.com/users/{user_id}/articles/new{-prefix|.|format}
69
+ rel: new_user_article
70
+ - name: recent_user_articles
71
+ path_template: /users/{user_id}/articles/recent{-prefix|.|format}
72
+ uri_template: http://www.example.com/users/{user_id}/articles/recent{-prefix|.|format}
73
+ rel: recent
74
+ - name: user_article
75
+ - name: edit_user_article
76
+ path_template: /users/{user_id}/articles/{article_id}/edit{-prefix|.|format}
77
+ uri_template: http://www.example.com/users/{user_id}/articles/{article_id}/edit{-prefix|.|format}
78
+ rel: edit
79
+ path_template: /users/{user_id}/articles/{article_id}{-prefix|.|format}
80
+ uri_template: http://www.example.com/users/{user_id}/articles/{article_id}{-prefix|.|format}
81
+ path_template: /users/{user_id}/articles{-prefix|.|format}
82
+ uri_template: http://www.example.com/users/{user_id}/articles{-prefix|.|format}
83
+ rel: articles
84
+ - name: user_profile
85
+ - name: edit_user_profile
86
+ path_template: /users/{user_id}/profile/edit{-prefix|.|format}
87
+ uri_template: http://www.example.com/users/{user_id}/profile/edit{-prefix|.|format}
88
+ rel: edit
89
+ - name: new_user_profile
90
+ path_template: /users/{user_id}/profile/new{-prefix|.|format}
91
+ uri_template: http://www.example.com/users/{user_id}/profile/new{-prefix|.|format}
92
+ rel: new
93
+ path_template: /users/{user_id}/profile{-prefix|.|format}
94
+ uri_template: http://www.example.com/users/{user_id}/profile{-prefix|.|format}
95
+ rel: profile
96
+ path_template: /users/{user_id}{-prefix|.|format}
97
+ uri_template: http://www.example.com/users/{user_id}{-prefix|.|format}
98
+ path_template: /users{-prefix|.|format}
99
+ uri_template: http://www.example.com/users{-prefix|.|format}
@@ -0,0 +1,37 @@
1
+ require 'test/test_helper'
2
+
3
+ class DescribedRoutesRunTimeTest < ActionController::IntegrationTest
4
+ def read_fixture(extension)
5
+ File.read(File.dirname(__FILE__) + '/../fixtures/run_time/described_routes.' + extension)
6
+ end
7
+
8
+ def test_text
9
+ get "/described_routes.text"
10
+ assert_response :success
11
+ assert_equal(read_fixture("text"), body)
12
+ end
13
+
14
+ def test_json
15
+ get "/described_routes.json"
16
+ assert_response :success
17
+ assert_equal(read_fixture("json").chomp, body)
18
+ end
19
+
20
+ def test_xml
21
+ get "/described_routes.xml"
22
+ assert_response :success
23
+ assert_equal(read_fixture("xml"), body)
24
+ end
25
+
26
+ def test_yaml
27
+ get "/described_routes.yaml"
28
+ assert_response :success
29
+ assert_equal(read_fixture("yaml"), body)
30
+ end
31
+
32
+ def test_yaml_short
33
+ get "/described_routes.yaml?short=1"
34
+ assert_response :success
35
+ assert_equal(read_fixture("yaml_short"), body)
36
+ end
37
+ end
@@ -0,0 +1,29 @@
1
+ require 'test/unit'
2
+ require 'test/test_helper'
3
+ require 'described_routes/rake_task_methods'
4
+
5
+ class RakeTasksTest < Test::Unit::TestCase
6
+ def read_fixture(extension)
7
+ File.read(File.dirname(__FILE__) + '/../fixtures/build_time/described_routes.' + extension)
8
+ end
9
+
10
+ def test_text
11
+ assert_equal(read_fixture("text"), DescribedRoutes::RakeTaskMethods.text)
12
+ end
13
+
14
+ def test_json
15
+ assert_equal(read_fixture("json").chomp, DescribedRoutes::RakeTaskMethods.json)
16
+ end
17
+
18
+ def test_yaml
19
+ assert_equal(read_fixture("yaml"), DescribedRoutes::RakeTaskMethods.yaml)
20
+ end
21
+
22
+ def test_yaml_short
23
+ assert_equal(read_fixture("yaml_short"), DescribedRoutes::RakeTaskMethods.yaml_short)
24
+ end
25
+
26
+ def test_xml
27
+ assert_equal(read_fixture("xml"), DescribedRoutes::RakeTaskMethods.xml)
28
+ end
29
+ end
@@ -0,0 +1,2 @@
1
+ ENV["RAILS_ENV"] = "test"
2
+ require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
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.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Burrows
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-05-05 00:00:00 +01:00
12
+ date: 2009-05-06 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -54,6 +54,7 @@ files:
54
54
  - lib/described_routes.rb
55
55
  - lib/described_routes/rails_controller.rb
56
56
  - lib/described_routes/rails_routes.rb
57
+ - lib/described_routes/rake_task_methods.rb
57
58
  - lib/described_routes/resource_template.rb
58
59
  - lib/tasks/described_routes.rb
59
60
  - script/console
@@ -63,8 +64,38 @@ files:
63
64
  - test/test_described_routes.rb
64
65
  - test/test_helper.rb
65
66
  - test/test_resource_template.rb
67
+ - test_rails_app/Rakefile
68
+ - test_rails_app/app/controllers/application_controller.rb
69
+ - test_rails_app/app/helpers/application_helper.rb
70
+ - test_rails_app/config/boot.rb
71
+ - test_rails_app/config/environment.rb
72
+ - test_rails_app/config/environments/development.rb
73
+ - test_rails_app/config/environments/production.rb
74
+ - test_rails_app/config/environments/test.rb
75
+ - test_rails_app/config/initializers/described_routes.rb
76
+ - test_rails_app/config/initializers/new_rails_defaults.rb
77
+ - test_rails_app/config/initializers/session_store.rb
78
+ - test_rails_app/config/routes.rb
79
+ - test_rails_app/log/development.log
80
+ - test_rails_app/log/production.log
81
+ - test_rails_app/log/server.log
82
+ - test_rails_app/log/test.log
83
+ - test_rails_app/script/server
84
+ - test_rails_app/test/fixtures/build_time/described_routes.json
85
+ - test_rails_app/test/fixtures/build_time/described_routes.text
86
+ - test_rails_app/test/fixtures/build_time/described_routes.xml
87
+ - test_rails_app/test/fixtures/build_time/described_routes.yaml
88
+ - test_rails_app/test/fixtures/build_time/described_routes.yaml_short
89
+ - test_rails_app/test/fixtures/run_time/described_routes.json
90
+ - test_rails_app/test/fixtures/run_time/described_routes.text
91
+ - test_rails_app/test/fixtures/run_time/described_routes.xml
92
+ - test_rails_app/test/fixtures/run_time/described_routes.yaml
93
+ - test_rails_app/test/fixtures/run_time/described_routes.yaml_short
94
+ - test_rails_app/test/integration/described_routes_run_time_test.rb
95
+ - test_rails_app/test/integration/rake_tasks_test.rb
96
+ - test_rails_app/test/test_helper.rb
66
97
  has_rdoc: true
67
- homepage: http://positiveincline.com/?tag=described_routes
98
+ homepage: http://positiveincline.com/?p=213
68
99
  licenses: []
69
100
 
70
101
  post_install_message: PostInstall.txt