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
Click here to lend your support to: mephisto and make a donation at www.pledgie.com !
rename liquidize to liquify

git-svn-id: http://svn.techno-weenie.net/projects/mephisto/trunk@2357 
567b1171-46fb-0310-a4c9-b4bef9110e78
technoweenie (author)
Tue Oct 10 10:10:26 -0700 2006
commit  971b848af131435d946917d4afdf6a8cbde49f48
tree    3bd7812c90c6ad2aefad56183c164352bdeb391f
parent  30dd979891ea3c8aa8e536c6b34c045cbeb196df
...
15
16
17
18
 
19
20
21
22
 
23
24
25
26
27
 
28
29
30
31
 
32
33
34
...
15
16
17
 
18
19
20
21
 
22
23
24
25
26
 
27
28
29
30
 
31
32
33
34
0
@@ -15,20 +15,20 @@ class ArticleDrop < BaseDrop
0
   end
0
   
0
   def author
0
- @author ||= liquidize(@source.user).first
0
+ @author ||= liquify(@source.user).first
0
   end
0
 
0
   def comments
0
- @comments ||= liquidize(*@source.comments.reject(&:new_record?))
0
+ @comments ||= liquify(*@source.comments.reject(&:new_record?))
0
   end
0
   
0
   def sections
0
     @sections ||= @source.sections.inject([]) { |all, s| s.home? ? all : all << s.to_liquid } # your days are numbered, home section!
0
- @sections ||= liquidize(*@source.sections) { |s| s.home? ? nil : s.to_liquid }
0
+ @sections ||= liquify(*@source.sections) { |s| s.home? ? nil : s.to_liquid }
0
   end
0
 
0
   def tags
0
- @tags ||= liquidize(*@source.tags)
0
+ @tags ||= liquify(*@source.tags)
0
   end
0
 
0
   def blog_sections
...
6
7
8
9
 
10
11
12
...
6
7
8
 
9
10
11
12
0
@@ -6,7 +6,7 @@ class AssetDrop < BaseDrop
0
   end
0
   
0
   def tags
0
- @tags ||= liquidize *@source.tags
0
+ @tags ||= liquify *@source.tags
0
   end
0
 
0
   def path
...
29
30
31
32
 
33
34
35
...
55
56
57
58
59
 
 
60
61
62
...
29
30
31
 
32
33
34
35
...
55
56
57
 
 
58
59
60
61
62
0
@@ -29,7 +29,7 @@ class BaseDrop < Liquid::Drop
0
   end
0
 
0
   # converts an array of records to an array of liquid drops, and assigns the given context to each of them
0
- def self.liquidize(current_context, *records, &block)
0
+ def self.liquify(current_context, *records, &block)
0
     i = -1
0
     records =
0
       records.inject [] do |all, r|
0
@@ -55,7 +55,7 @@ class BaseDrop < Liquid::Drop
0
       end
0
     end
0
     
0
- def liquidize(*records, &block)
0
- self.class.liquidize(@context, *records, &block)
0
+ def liquify(*records, &block)
0
+ self.class.liquify(@context, *records, &block)
0
     end
0
 end
0
\ No newline at end of file
...
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,15 +21,15 @@ class SectionDrop < BaseDrop
0
   end
0
 
0
   def latest_articles(limit = nil)
0
- liquidize(*@source.articles.find_by_date(:limit => (limit || @source.articles_per_page)))
0
+ liquify(*@source.articles.find_by_date(:limit => (limit || @source.articles_per_page)))
0
   end
0
 
0
   def latest_comments(limit = nil)
0
- liquidize(*@source.find_comments(:limit => (limit || @source.articles_per_page)))
0
+ liquify(*@source.find_comments(:limit => (limit || @source.articles_per_page)))
0
   end
0
 
0
   def pages
0
- @pages ||= liquidize(*@source.articles) { |article, i| article.to_liquid(:page => i.zero?) }
0
+ @pages ||= liquify(*@source.articles) { |article, i| article.to_liquid(:page => i.zero?) }
0
   end
0
 
0
   def url
...
22
23
24
25
 
26
27
28
29
30
31
 
32
33
34
...
37
38
39
40
 
41
42
43
44
45
 
46
47
48
49
50
 
51
52
53
...
22
23
24
 
25
26
27
28
29
30
 
31
32
33
34
...
37
38
39
 
40
41
42
43
44
 
45
46
47
48
49
 
50
51
52
53
0
@@ -22,13 +22,13 @@ class SiteDrop < BaseDrop
0
 
0
   def latest_articles(limit = nil)
0
     return @articles if @articles && limit == @source.articles_per_page
0
- articles = liquidize(*@source.articles.find_by_date(:limit => (limit || @source.articles_per_page)))
0
+ articles = liquify(*@source.articles.find_by_date(:limit => (limit || @source.articles_per_page)))
0
     limit == @source.articles_per_page ? (@articles = articles) : articles
0
   end
0
 
0
   def latest_comments(limit = nil)
0
     return @comments if @comments && limit == @source.articles_per_page
0
- comments = liquidize(*@source.comments.find(:all, :limit => (limit || @source.articles_per_page)))
0
+ comments = liquify(*@source.comments.find(:all, :limit => (limit || @source.articles_per_page)))
0
     limit == @source.articles_per_page ? (@comments = comments) : comments
0
   end
0
 
0
@@ -37,17 +37,17 @@ class SiteDrop < BaseDrop
0
     return @section_index[path] if @section_index[path]
0
     @section_index[path] ||= @current_section_liquid if @current_section && @current_section.path == path
0
     @section_index[path] ||= @sections.detect { |s| s['path'] == path } if @sections
0
- @section_index[path] ||= liquidize(@source.sections.find_by_path(path)).first
0
+ @section_index[path] ||= liquify(@source.sections.find_by_path(path)).first
0
   end
0
   
0
   def find_child_sections(path)
0
     path_search = path + (path == '' ? '%' : '/%')
0
- liquidize(*@source.sections.find(:all, :conditions => ['path != ? AND path LIKE ? AND path NOT LIKE ?', path, path_search, "#{path_search}/%"]))
0
+ liquify(*@source.sections.find(:all, :conditions => ['path != ? AND path LIKE ? AND path NOT LIKE ?', path, path_search, "#{path_search}/%"]))
0
   end
0
   
0
   def find_descendant_sections(path)
0
     path_search = path + (path == '' ? '%' : '/%')
0
- liquidize(*@source.sections.find(:all, :conditions => ['path != ? AND path LIKE ?', path, path_search]))
0
+ liquify(*@source.sections.find(:all, :conditions => ['path != ? AND path LIKE ?', path, path_search]))
0
   end
0
   
0
   def blog_sections
...
54
55
56
57
58
 
 
59
60
...
54
55
56
 
 
57
58
59
60
0
@@ -54,7 +54,7 @@ module CoreFilters
0
   end
0
 
0
   protected
0
- def liquidize(*records, &block)
0
- BaseDrop.liquidize(@context, *records, &block)
0
+ def liquify(*records, &block)
0
+ BaseDrop.liquify(@context, *records, &block)
0
     end
0
 end
...
27
28
29
30
 
31
32
33
34
 
35
36
37
38
 
39
40
41
42
 
43
44
45
...
27
28
29
 
30
31
32
33
 
34
35
36
37
 
38
39
40
41
 
42
43
44
45
0
@@ -27,18 +27,18 @@ module DropFilters
0
 
0
   def monthly_articles(section, date = nil)
0
     date = parse_date(date)
0
- liquidize(*section.source.articles.find_all_in_month(date.year, date.month)) { |r| r.to_liquid :mode => :single }
0
+ liquify(*section.source.articles.find_all_in_month(date.year, date.month)) { |r| r.to_liquid :mode => :single }
0
   end
0
   
0
   def tagged_articles(tags)
0
- liquidize(*@context['site'].source.articles.find(:all, :include => :tags, :conditions => ['tags.name in (?)', Tag.parse(tags)], :order => 'contents.created_at desc'))
0
+ liquify(*@context['site'].source.articles.find(:all, :include => :tags, :conditions => ['tags.name in (?)', Tag.parse(tags)], :order => 'contents.created_at desc'))
0
   end
0
   
0
   def assets_by_type(type)
0
- liquidize(*@context['site'].source.assets.find_all_by_content_types([type.to_sym], :all, :order => 'created_at desc'))
0
+ liquify(*@context['site'].source.assets.find_all_by_content_types([type.to_sym], :all, :order => 'created_at desc'))
0
   end
0
   
0
   def tagged_assets(tags)
0
- liquidize(*@context['site'].source.assets.find(:all, :include => :tags, :conditions => ['tags.name in (?)', Tag.parse(tags)], :order => 'assets.created_at desc'))
0
+ liquify(*@context['site'].source.assets.find(:all, :include => :tags, :conditions => ['tags.name in (?)', Tag.parse(tags)], :order => 'assets.created_at desc'))
0
   end
0
 end
0
\ No newline at end of file
...
223
224
225
226
227
 
 
228
229
230
...
223
224
225
 
 
226
227
228
229
230
0
@@ -223,8 +223,8 @@ class Test::Unit::TestCase
0
     end
0
   end
0
 
0
- def liquidize(*records, &block)
0
- BaseDrop.liquidize(@context, *records, &block)
0
+ def liquify(*records, &block)
0
+ BaseDrop.liquify(@context, *records, &block)
0
   end
0
 
0
   # Assert the block redirects to the login
...
19
20
21
22
 
23
24
25
26
27
28
29
 
30
31
32
...
52
53
54
55
 
56
57
58
...
19
20
21
 
22
23
24
25
26
27
28
 
29
30
31
32
...
52
53
54
 
55
56
57
58
0
@@ -19,14 +19,14 @@ context "Drop Filters" do
0
   end
0
 
0
   specify "should find latest articles by section" do
0
- section = liquidize(sections(:home)).first
0
+ section = liquify(sections(:home)).first
0
     assert_models_equal [contents(:welcome), contents(:another)], latest_articles(section).collect(&:source)
0
     assert_models_equal [contents(:welcome), contents(:another)], latest_articles(section, 2).collect(&:source)
0
     assert_equal contents(:welcome), latest_article(section).source
0
   end
0
 
0
   specify "should find latest comments by section" do
0
- section = liquidize(sections(:home)).first
0
+ section = liquify(sections(:home)).first
0
     assert_models_equal [contents(:welcome_comment)], latest_comments(section).collect(&:source)
0
     assert_models_equal [contents(:welcome_comment)], latest_comments(section, 1).collect(&:source)
0
   end
0
@@ -52,7 +52,7 @@ context "Drop Filters" do
0
   end
0
 
0
   specify "should find articles by month" do
0
- assert_models_equal sections(:home).articles.find_all_in_month(Time.now.year, Time.now.month), monthly_articles(liquidize(sections(:home)).first).collect(&:source)
0
+ assert_models_equal sections(:home).articles.find_all_in_month(Time.now.year, Time.now.month), monthly_articles(liquify(sections(:home)).first).collect(&:source)
0
   end
0
 
0
   specify "should find movies" do

Comments

    No one has commented yet.