public
Fork of halorgium/mephisto
Description: A mirror of the mephisto code-base
Homepage: http://mephistoblog.com/
Clone URL: git://github.com/technoweenie/mephisto.git
Search Repo:
Click here to lend your support to: mephisto and make a donation at www.pledgie.com !
extract routing, fix some minor test flubs

git-svn-id: http://svn.techno-weenie.net/projects/mephisto/trunk@2139 
567b1171-46fb-0310-a4c9-b4bef9110e78
technoweenie (author)
Sun Sep 10 03:42:29 -0700 2006
commit  f38778fa20abca90a73b4b4e1669a7737c45963a
tree    bafb342decf02c1be596473bb9ae1204f12cea4a
parent  5df2c18d430b16595f2bc70393a55ef4b2a320fe
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 
21
...
1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
3
0
@@ -1,22 +1,4 @@
0
 ActionController::Routing::Routes.draw do |map|
0
- map.feed 'feed/*sections', :controller => 'feed', :action => 'feed'
0
-
0
- map.with_options :controller => 'assets', :action => 'show' do |m|
0
- m.connect ':dir/:path.:ext', :dir => /stylesheets|javascripts|images/
0
- m.css 'stylesheets/:path.:ext', :dir => 'stylesheets'
0
- m.js 'javascripts/:path.:ext', :dir => 'javascripts'
0
- m.images 'images/:path.:ext', :dir => 'images'
0
- end
0
-
0
- map.overview 'admin/overview.xml', :controller => 'admin/overview', :action => 'feed'
0
- map.admin 'admin', :controller => 'admin/overview', :action => 'index'
0
- map.resources :assets, :path_prefix => '/admin', :controller => 'admin/assets', :member => { :add_bucket => :post },
0
- :collection => { :latest => :post, :search => :post, :upload => :post, :clear_bucket => :post }
0
-
0
- map.connect 'xmlrpc', :controller => 'backend', :action => 'xmlrpc'
0
-
0
- map.connect ':controller/:action/:id/:version', :version => nil, :controller => /routing_navigator|account|(admin\/\w+)/
0
-
0
- map.dispatch '*path', :controller => 'mephisto', :action => 'dispatch'
0
+ Mephisto::Routing.connect_with map
0
 end
...
19
20
21
22
 
23
24
25
...
19
20
21
 
22
23
24
25
0
@@ -19,7 +19,7 @@
0
       end
0
       
0
       def link_to_section(section)
0
- content_tag :a, section['name'], :href => section['url']
0
+ content_tag :a, section['name'], :href => section.url
0
       end
0
 
0
       def page_title(page)
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
0
@@ -1 +1,26 @@
0
+module Mephisto
0
+ class Routing
0
+ def self.connect_with(map)
0
+ map.feed 'feed/*sections', :controller => 'feed', :action => 'feed'
0
+
0
+ map.with_options :controller => 'assets', :action => 'show' do |m|
0
+ m.connect ':dir/:path.:ext', :dir => /stylesheets|javascripts|images/
0
+ m.css 'stylesheets/:path.:ext', :dir => 'stylesheets'
0
+ m.js 'javascripts/:path.:ext', :dir => 'javascripts'
0
+ m.images 'images/:path.:ext', :dir => 'images'
0
+ end
0
+
0
+ map.overview 'admin/overview.xml', :controller => 'admin/overview', :action => 'feed'
0
+ map.admin 'admin', :controller => 'admin/overview', :action => 'index'
0
+ map.resources :assets, :path_prefix => '/admin', :controller => 'admin/assets', :member => { :add_bucket => :post },
0
+ :collection => { :latest => :post, :search => :post, :upload => :post, :clear_bucket => :post }
0
+
0
+ map.connect 'xmlrpc', :controller => 'backend', :action => 'xmlrpc'
0
+
0
+ map.connect ':controller/:action/:id/:version', :version => nil, :controller => /routing_navigator|account|(admin\/\w+)/
0
+
0
+ map.dispatch '*path', :controller => 'mephisto', :action => 'dispatch'
0
+ end
0
+ end
0
+end
...
190
191
192
193
 
194
195
196
197
...
203
204
205
206
 
207
208
209
210
211
212
213
 
214
215
216
...
228
229
230
231
 
232
233
234
...
190
191
192
 
193
194
195
196
197
...
203
204
205
 
206
207
208
209
210
211
212
 
213
214
215
216
...
228
229
230
 
231
232
233
234
0
@@ -190,7 +190,7 @@
0
                :children => { :count => 3, :only => { :tag => 'li' } }
0
     assert_tag 'ul', :attributes => { :id => 'nav' },
0
                :descendant => { :tag => 'a', :attributes => { :class => 'selected' } }
0
- assert_tag 'a', :attributes => { :class => 'selected' }, :content => 'Home'
0
+ assert_tag 'a', :attributes => { :class => 'selected' }, :content => 'Welcome to Mephisto'
0
   end
0
 
0
   def test_should_set_home_page_on_paged_sections
0
0
@@ -203,14 +203,14 @@
0
 
0
   def test_should_set_paged_permalinks
0
     dispatch 'about'
0
- assert_tag 'a', :attributes => { :href => '/about', :class => 'selected' }, :content => 'Home'
0
+ assert_tag 'a', :attributes => { :href => '/about', :class => 'selected' }, :content => 'Welcome to Mephisto'
0
     assert_tag 'a', :attributes => { :href => '/about/about-this-page' }, :content => 'About'
0
     assert_tag 'a', :attributes => { :href => '/about/the-site-map' }, :content => 'The Site Map'
0
   end
0
 
0
   def test_should_set_paged_permalinks
0
     dispatch 'about/the-site-map'
0
- assert_tag 'a', :attributes => { :href => '/about' }, :content => 'Home'
0
+ assert_tag 'a', :attributes => { :href => '/about' }, :content => 'Welcome to Mephisto'
0
     assert_tag 'a', :attributes => { :href => '/about/about-this-page' }, :content => 'About'
0
     assert_tag 'a', :attributes => { :href => '/about/the-site-map', :class => 'selected' }, :content => 'The Site Map'
0
   end
0
@@ -228,7 +228,7 @@
0
     date = 3.days.ago
0
     dispatch "#{date.year}/#{date.month}/#{date.day}/welcome-to-mephisto"
0
     assert_dispatch_action :single
0
- assert_tag 'form', :attributes => { :id => 'comment-form', :action => "#{contents(:welcome).full_permalink}/comment#comment-form"}
0
+ assert_tag 'form', :attributes => { :id => 'comment-form', :action => "#{contents(:welcome).full_permalink}/comments#comment-form"}
0
     assert_tag :tag => 'form', :descendant => {
0
                :tag => 'input', :attributes => { :type => 'text', :id => 'comment_author', :name => 'comment[author]' } }
0
     assert_tag :tag => 'form', :descendant => {
...
21
22
23
24
25
 
 
26
27
28
29
 
30
31
32
33
 
34
35
...
21
22
23
 
 
24
25
26
27
28
 
29
30
31
32
 
33
34
35
0
@@ -21,16 +21,16 @@
0
   end
0
   
0
   def test_should_report_section_types
0
- assert Mephisto::Liquid::SectionDrop.new(sections(:home)).is_blog
0
- [:about, :cupcake_home, :cupcake_about].each { |s| assert Mephisto::Liquid::SectionDrop.new(sections(s)).is_paged }
0
+ assert Mephisto::Liquid::SectionDrop.new(sections(:home))['is_blog']
0
+ [:about, :cupcake_home, :cupcake_about].each { |s| assert Mephisto::Liquid::SectionDrop.new(sections(s))['is_paged'] }
0
   end
0
   
0
   def test_should_get_earliest_article_published_date
0
- assert_equal contents(:welcome).published_at.beginning_of_month.to_date, Mephisto::Liquid::SectionDrop.new(sections(:home)).earliest_month
0
+ assert_equal contents(:welcome).published_at.beginning_of_month.to_date, Mephisto::Liquid::SectionDrop.new(sections(:home))['earliest_month']
0
   end
0
   
0
   def test_should_get_month_array
0
- assert_equal [contents(:welcome).published_at.beginning_of_month.to_date], Mephisto::Liquid::SectionDrop.new(sections(:home)).months
0
+ assert_equal [contents(:welcome).published_at.beginning_of_month.to_date], Mephisto::Liquid::SectionDrop.new(sections(:home))['months']
0
   end
0
 end

Comments

    No one has commented yet.