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 !
extract mephisto customizations to lib so that env.rb can be modified

git-svn-id: http://svn.techno-weenie.net/projects/mephisto/trunk@1553 
567b1171-46fb-0310-a4c9-b4bef9110e78
technoweenie (author)
Mon Aug 07 22:38:00 -0700 2006
commit  c2b527b7011f178b7d4c30a0ee649fbfbac3b8d4
tree    d355b9d2a699bfc252e40ded6df0e546f0c382ae
parent  9a1562da864accd4e9560bc1b019ce5f7ef6e3a9
...
1
 
2
3
4
5
6
 
7
8
9
10
11
12
13
14
15
16
...
 
1
2
3
4
5
 
6
7
8
9
10
11
12
 
 
13
14
0
@@ -1,15 +1,13 @@
0
-class CommentSweeper < ArticleSweeper
0
+class CommentSweeper < ActionController::Caching::Sweeper
0
   observe Comment
0
 
0
   def after_update(record)
0
     return if controller.nil?
0
- expire_overview_feed!
0
+ controller.class.expire_page overview_url(:only_path => true, :skip_relative_url_root => true)
0
     pages = CachedPage.find_by_reference(record.article)
0
     controller.class.benchmark "Expired pages referenced by #{record.class} ##{record.id}" do
0
       pages.each { |p| controller.class.expire_page(p.url) }
0
       CachedPage.expire_pages(pages)
0
     end if pages.any?
0
   end
0
-
0
- undef :after_create
0
 end
0
\ No newline at end of file
...
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
 
132
...
52
53
54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
56
0
@@ -52,80 +52,4 @@ end
0
 # end
0
 
0
 # Include your application configuration below
0
-require 'tzinfo'
0
-require 'time_ext'
0
-require 'zip/zipfilesystem'
0
-require 'dispatcher'
0
-require 'coderay'
0
-
0
-class << Dispatcher
0
- def register_liquid_tags
0
- Liquid::Template.register_filter(Mephisto::Liquid::Filters)
0
- Liquid::Template.register_tag(:textile, Mephisto::Liquid::Textile)
0
- Liquid::Template.register_tag(:commentform, Mephisto::Liquid::CommentForm)
0
- Liquid::Template.register_tag(:pagenavigation, Mephisto::Liquid::PageNavigation)
0
- Liquid::Template.register_tag(:head, Mephisto::Liquid::Head)
0
- end
0
-
0
- def reset_application_with_plugins!
0
- returning reset_application_without_plugins! do
0
- register_liquid_tags
0
- end
0
- end
0
-
0
- alias_method_chain :reset_application!, :plugins
0
-end
0
-
0
-Dispatcher.register_liquid_tags
0
-RubyPants # load RubyPants
0
-
0
-ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS.update \
0
- :standard => '%B %d, %Y @ %I:%M %p',
0
- :stub => '%B %d', # XXX what is the meaning of stub in this context? (Basically it means short)
0
- :time_only => '%I:%M %p',
0
- :plain => '%B %d %I:%M %p'
0
-
0
-# Time.now.to_ordinalized_s :long
0
-# => "February 28th, 2006 21:10"
0
-module ActiveSupport::CoreExtensions::Time::Conversions
0
- def to_ordinalized_s(format = :default)
0
- format = ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS[format]
0
- return to_default_s if format.nil?
0
- strftime(format.gsub(/%d/, '_%d_')).gsub(/_(\d+)_/) { |s| s.to_i.ordinalize }
0
- end
0
-end
0
-
0
-# http://rails.techno-weenie.net/tip/2005/12/23/make_fixtures
0
-ActiveRecord::Base.class_eval do
0
- # person.dom_id #-> "person-5"
0
- # new_person.dom_id #-> "person-new"
0
- # new_person.dom_id(:bare) #-> "new"
0
- # person.dom_id(:person_name) #-> "person-name-5"
0
- def dom_id(prefix=nil)
0
- display_id = new_record? ? "new" : id
0
- prefix ||= self.class.name.underscore
0
- prefix != :bare ? "#{prefix.to_s.dasherize}-#{display_id}" : display_id
0
- end
0
-
0
- # Write a fixture file for testing
0
- def self.to_fixture(fixture_path = nil)
0
- File.open(File.expand_path(fixture_path || "test/fixtures/#{table_name}.yml", RAILS_ROOT), 'w') do |out|
0
- YAML.dump find(:all).inject({}) { |hsh, record| hsh.merge(record.id => record.attributes) }, out
0
- end
0
- end
0
-end
0
-
0
-class Time
0
- class << self
0
- # Used for getting multifield attributes like those generated by a
0
- # select_datetime into a new Time object. For example if you have
0
- # following <tt>params={:meetup=>{:"time(1i)=>..."}}</tt> just do
0
- # following:
0
- #
0
- # <tt>Time.parse_from_attributes(params[:meetup], :time)</tt>
0
- def parse_from_attributes(attrs, field, method=:gm)
0
- attrs = attrs.keys.sort.grep(/^#{field.to_s}\(.+\)$/).map { |k| attrs[k] }
0
- attrs.any? ? Time.send(method, *attrs) : nil
0
- end
0
- end
0
-end
0
+require 'mephisto_init'
0
\ No newline at end of file

Comments

    No one has commented yet.