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 !
enhancements to typo converter, set article filter to textile by default 
[danp]

git-svn-id: http://svn.techno-weenie.net/projects/mephisto/trunk@1208 
567b1171-46fb-0310-a4c9-b4bef9110e78
technoweenie (author)
Sat Jun 10 11:01:40 -0700 2006
commit  a53fc38b750f08b39e9a28eda30fe7bb922c65ee
tree    117f111994bd511449385b28dd840d5ebed6ba58
parent  b03b44f33792a7b8babad76788e2c8331ecb0cf6
...
19
20
21
22
 
23
24
25
...
19
20
21
 
22
23
24
25
0
@@ -19,7 +19,7 @@ set :repository, "http://svn.techno-weenie.net/projects/mephisto"
0
 # Use this to freeze your deployment to a specific rails version. Uses the rake
0
 # init task run in after_symlink below.
0
 
0
-set :rails_version, 4371
0
+set :rails_version, 4393
0
 
0
 # TODO: test this works and I can remove the restart task and use the cleanup task
0
 # set :use_sudo, false
...
13
14
15
16
 
 
17
18
 
19
20
21
 
 
22
23
24
...
32
33
34
35
 
36
37
38
...
54
55
56
57
 
 
58
59
60
...
66
67
68
69
 
 
70
71
72
...
76
77
78
 
 
79
80
81
...
13
14
15
 
16
17
18
 
19
20
21
 
22
23
24
25
26
...
34
35
36
 
37
38
39
40
...
56
57
58
 
59
60
61
62
63
...
69
70
71
 
72
73
74
75
76
...
80
81
82
83
84
85
86
87
0
@@ -13,12 +13,14 @@ module Typo
0
 
0
       Typo::User.find(:all).each do |typo_user|
0
         ActiveRecord::Base.logger.info "Creating new user for #{typo_user.login}"
0
- unless ::User.find_by_email(typo_user.email)
0
+ unless ::User.find_by_login(typo_user.login)
0
+ typo_user.email = nil if typo_user.email.blank?
0
           new_user = ::User.create(
0
- :email => typo_user.email || 'foo@bar.com',
0
+ :email => typo_user.email || "#{typo_user.login}@notfound.com",
0
             :login => typo_user.login,
0
             :password => newpass,
0
- :password_confirmation => newpass
0
+ :password_confirmation => newpass,
0
+ :filters => [:textile_filter]
0
           )
0
           unless new_user.valid?
0
             ActiveRecord::Base.logger.info "New user errors: #{new_user.errors.to_yaml}"
0
@@ -32,7 +34,7 @@ module Typo
0
 
0
     def find_or_create_sections(typo_article)
0
       home_section = Section.find_by_name 'home'
0
- section_ids = typo_article.categories.inject([home_section.id]) { |a, c| a << ::Section.find_or_create_by_name(c.name).id }
0
+ section_ids = typo_article.categories.inject([home_section.id]) { |a, c| a << ::Section.find_or_create_by_name(c.name, :site_id => 1).id }
0
     end
0
 
0
     def create_article(site, typo_article)
0
@@ -54,7 +56,8 @@ module Typo
0
         :updated_at => typo_article.updated_at,
0
         :user => user,
0
         :updater => user,
0
- :section_ids => section_ids
0
+ :section_ids => section_ids,
0
+ :filters => [:textile_filter]
0
     end
0
 
0
     def create_comment(article, typo_comment)
0
@@ -66,7 +69,8 @@ module Typo
0
         :author => typo_comment.author,
0
         :author_url => typo_comment.url,
0
         :author_email => typo_comment.email,
0
- :author_ip => typo_comment.ip
0
+ :author_ip => typo_comment.ip,
0
+ :filters => [:textile_filter]
0
       comment.approved = true
0
       comment.save
0
     end
0
@@ -76,6 +80,8 @@ module Typo
0
       comments = 0
0
 
0
       Typo::Article.find_all_by_type('Article').each do |typo_article|
0
+ next if typo_article.body.blank? or typo_article.title.blank?
0
+
0
         article = create_article(site, typo_article)
0
         articles += 1
0
 

Comments

    No one has commented yet.