typo 3.99.3 → 3.99.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. data/README +1 -39
  2. data/app/controllers/admin/feedback_controller.rb +71 -0
  3. data/app/controllers/articles_controller.rb +11 -0
  4. data/app/helpers/admin/feedback_helper.rb +9 -0
  5. data/app/helpers/application_helper.rb +5 -1
  6. data/app/models/article.rb +21 -1
  7. data/app/models/blog.rb +25 -1
  8. data/app/models/comment.rb +12 -2
  9. data/app/models/content.rb +63 -4
  10. data/app/models/ping.rb +3 -3
  11. data/app/models/text_filter.rb +1 -1
  12. data/app/models/trackback.rb +12 -1
  13. data/app/views/admin/content/_form.rhtml +2 -2
  14. data/app/views/admin/feedback/_item.rhtml +15 -0
  15. data/app/views/admin/feedback/list.rhtml +46 -0
  16. data/app/views/admin/general/index.rhtml +26 -0
  17. data/app/views/articles/_comment.rhtml +3 -0
  18. data/app/views/articles/read.rhtml +2 -2
  19. data/app/views/layouts/administration.rhtml +1 -0
  20. data/bin/typo +3 -23
  21. data/components/plugins/sidebars/archives_controller.rb +1 -1
  22. data/components/plugins/sidebars/xml_controller.rb +1 -1
  23. data/components/plugins/textfilters/flickr_controller.rb +1 -1
  24. data/components/plugins/textfilters/sparkline_controller.rb +3 -2
  25. data/components/plugins/textfilters/textile_controller.rb +6 -0
  26. data/config/mongrel.conf +2 -0
  27. data/db/converters/wordpress2.rb +291 -0
  28. data/db/migrate/022_superclass_trackbacks.rb +1 -0
  29. data/db/migrate/023_superclass_pages.rb +4 -3
  30. data/db/schema.rb +4 -4
  31. data/doc/Installer.txt +81 -6
  32. data/doc/typo-4.0-release-notes.txt +135 -0
  33. data/installer/rails-installer.rb +22 -3
  34. data/installer/rails-installer/commands.rb +27 -26
  35. data/installer/rails-installer/web-servers.rb +2 -0
  36. data/lib/sidebars/plugin.rb +10 -8
  37. data/lib/tasks/release.rake +1 -1
  38. data/lib/typo_version.rb +1 -1
  39. data/public/javascripts/dragdrop.js +252 -63
  40. data/public/javascripts/effects.js +15 -10
  41. data/public/javascripts/prototype.js +59 -38
  42. data/public/javascripts/typo.js +10 -0
  43. data/public/stylesheets/administration.css +111 -66
  44. data/test/functional/admin/feedback_controller_test.rb +24 -0
  45. data/test/mocks/test/http_mock.rb +2 -1
  46. data/test/unit/article_test.rb +6 -0
  47. data/test/unit/comment_test.rb +12 -9
  48. data/test/unit/ping_test.rb +1 -1
  49. data/test/unit/trackback_test.rb +3 -5
  50. data/themes/azure/stylesheets/azure.css +7 -0
  51. data/themes/scribbish/views/articles/_article.rhtml +1 -1
  52. data/themes/scribbish/views/articles/_comment_form.rhtml +1 -1
  53. data/vendor/akismet/Akismet.rb +36 -17
  54. data/vendor/plugins/expiring_action_cache/lib/actionparamcache.rb +3 -1
  55. metadata +11 -42
  56. data/installer/rails-installer/web-server.rb +0 -108
  57. data/tmp/cache/META/DATA/ACTION_PARAM/10.1.0.181/articles/index/.cache +0 -537
  58. data/tmp/cache/META/DATA/ACTION_PARAM/localhost/articles/index/.cache +0 -537
  59. data/tmp/cache/META/DATA/ACTION_PARAM/localhost/xml/feed/format=atom&type=feed.cache +0 -671
  60. data/tmp/cache/META/DATA/ACTION_PARAM/localhost/xml/feed/format=rss20&type=feed.cache +0 -401
  61. data/tmp/cache/META/META/ACTION_PARAM/10.1.0.181/articles/index/.cache +0 -2
  62. data/tmp/cache/META/META/ACTION_PARAM/localhost/articles/index/.cache +0 -2
  63. data/tmp/cache/META/META/ACTION_PARAM/localhost/xml/feed/format=atom&type=feed.cache +0 -2
  64. data/tmp/cache/META/META/ACTION_PARAM/localhost/xml/feed/format=rss20&type=feed.cache +0 -2
@@ -0,0 +1,24 @@
1
+ require File.dirname(__FILE__) + '/../../test_helper'
2
+ require 'admin/feedback_controller'
3
+
4
+ # Re-raise errors caught by the controller.
5
+ class Admin::FeedbackController; def rescue_action(e) raise e end; end
6
+
7
+ class Admin::FeedbackControllerTest < Test::Unit::TestCase
8
+ fixtures :contents, :users, :resources, :text_filters,
9
+ :blogs, :articles_categories
10
+
11
+ def setup
12
+ @controller = Admin::FeedbackController.new
13
+ @request = ActionController::TestRequest.new
14
+ @response = ActionController::TestResponse.new
15
+ @request.session = { :user => users(:tobi) }
16
+ end
17
+
18
+ def test_index
19
+ get :index
20
+
21
+ assert_success
22
+ assert_rendered_file 'list'
23
+ end
24
+ end
@@ -9,7 +9,8 @@ module Net
9
9
  end
10
10
 
11
11
  class Net::HTTP
12
-
12
+ def initialize(*args)
13
+ end
13
14
 
14
15
  def self.start(host, port)
15
16
  request = Request.new
@@ -119,6 +119,12 @@ class ArticleTest < Test::Unit::TestCase
119
119
 
120
120
  assert_kind_of Article,b
121
121
  assert_equal 0, b.tags.size
122
+
123
+ c = Article.new(:title => 'Foo', :keywords => 'test "tag test" web2.0')
124
+ c.keywords_to_tags
125
+
126
+ assert_equal 3, c.tags.size
127
+ assert_equal ['test', 'tagtest', 'web2.0'].sort, c.tags.collect(&:name).sort
122
128
  end
123
129
 
124
130
  def test_find_published_by_tag_name
@@ -33,10 +33,7 @@ class CommentTest < Test::Unit::TestCase
33
33
  c.url = "http://buy-computer.us"
34
34
  c.ip = "212.42.230.206"
35
35
 
36
- assert ! c.save
37
- assert c.errors.invalid?('body')
38
- assert c.errors.invalid?('url')
39
- assert c.errors.invalid?('ip')
36
+ assert_equal true, c.is_spam?
40
37
  end
41
38
 
42
39
  def test_not_spam_but_rbl_lookup_succeeds
@@ -46,7 +43,7 @@ class CommentTest < Test::Unit::TestCase
46
43
  c.url = "http://www.bofh.org.uk"
47
44
  c.ip = "10.10.10.10"
48
45
 
49
- assert c.save
46
+ assert_equal false, c.is_spam?
50
47
  end
51
48
 
52
49
  def test_reject_spam_pattern
@@ -55,8 +52,7 @@ class CommentTest < Test::Unit::TestCase
55
52
  c.body = "Texas hold-em poker crap"
56
53
  c.url = "http://texas.hold-em.us"
57
54
 
58
- assert ! c.save
59
- assert c.errors.invalid?('body')
55
+ assert_equal true, c.is_spam?
60
56
  end
61
57
 
62
58
  def test_reject_spam_uri_limit
@@ -66,8 +62,7 @@ class CommentTest < Test::Unit::TestCase
66
62
  c.url = "http://www.uri-limit.com"
67
63
  c.ip = "123.123.123.123"
68
64
 
69
- assert ! c.save
70
- assert c.errors.invalid?('body')
65
+ assert_equal true, c.is_spam?
71
66
  end
72
67
 
73
68
  def test_reject_article_age
@@ -114,4 +109,12 @@ class CommentTest < Test::Unit::TestCase
114
109
  assert c.body_html !~ /<script>/
115
110
  end
116
111
  end
112
+
113
+ def test_withdraw
114
+ c = Comment.find(contents(:comment2).id)
115
+ assert c.withdraw!
116
+ assert ! c.published?
117
+ assert c.reload
118
+ assert ! c.published?
119
+ end
117
120
  end
@@ -77,7 +77,7 @@ class PingTest < Test::Unit::TestCase
77
77
  assert_equal "anotherblog.org", ping.host
78
78
  assert_equal 80, ping.port
79
79
  assert_equal "/a-post/trackback", ping.query
80
- assert_equal "title=Article%201!&excerpt=body&url=http://myblog.net/referring-post&blog_name=test%20blog", ping.post_data
80
+ assert_equal "title=Article+1%21&excerpt=body&url=http://myblog.net/referring-post&blog_name=test+blog", ping.post_data
81
81
  end
82
82
 
83
83
  def test_send_weblogupdatesping
@@ -18,6 +18,7 @@ class TrackbackTest < Test::Unit::TestCase
18
18
  assert tb.save
19
19
  assert tb.errors.empty?
20
20
  assert tb.guid.size > 15
21
+ assert_equal false, tb.is_spam?
21
22
  end
22
23
 
23
24
  def test_reject_spam_rbl
@@ -28,9 +29,7 @@ class TrackbackTest < Test::Unit::TestCase
28
29
  tb.url = "http://buy-computer.us"
29
30
  tb.ip = "212.42.230.206"
30
31
 
31
- assert ! tb.save
32
- assert tb.errors.invalid?('excerpt')
33
- assert tb.errors.invalid?('url')
32
+ assert_equal true, tb.is_spam?
34
33
  end
35
34
 
36
35
  def test_reject_spam_pattern
@@ -39,7 +38,6 @@ class TrackbackTest < Test::Unit::TestCase
39
38
  tb.title = "Spammy trackback"
40
39
  tb.excerpt = "Texas hold-em poker crap"
41
40
 
42
- assert ! tb.save
43
- assert tb.errors.invalid?('excerpt')
41
+ assert_equal true, tb.is_spam?
44
42
  end
45
43
  end
@@ -181,6 +181,13 @@ body {
181
181
  float: right;
182
182
  padding: 0 5px;
183
183
  }
184
+
185
+ .spamwarning {
186
+ margin: 0.5em;
187
+ background: red;
188
+ font-weight: bold;
189
+ font-style: italic;
190
+ }
184
191
  /*+-------------------------------------------+
185
192
  | SIDEBAR |
186
193
  +-------------------------------------------+*/
@@ -6,7 +6,7 @@
6
6
 
7
7
  <p class="author">
8
8
  Posted by <cite><%= author_link(article) %></cite>
9
- <abbr class="published" title="<%= article.created_at.xmlschema %>"><%= js_distance_of_time_in_words_to_now article.created_at %></abbr>
9
+ <abbr class="published" title="<%= article.published_at.xmlschema %>"><%= js_distance_of_time_in_words_to_now article.published_at %></abbr>
10
10
  </p>
11
11
 
12
12
  <div class="content">
@@ -11,7 +11,7 @@
11
11
  <p>
12
12
  <label>Name:<br />
13
13
  <%= text_field "comment", "author" %>
14
- <small>(<%= link_to_function("leave url/email &#187;", "new Effect.toggle('extra_fields', 'blind', {duration: .3})") %></small>)
14
+ <small>(<%= link_to_function("leave url/email &#187;", "new Effect.toggle('extra_fields', 'blind', {duration: .3})") %>)</small>
15
15
  </label>
16
16
  </p>
17
17
 
@@ -3,13 +3,16 @@
3
3
  # Author:: David Czarnecki
4
4
  # Copyright:: Copyright (c) 2005 - David Czarnecki
5
5
  # License:: BSD
6
+ #
7
+ # Heavily modified for Typo by Scott Laird
8
+ #
6
9
  class Akismet
7
10
 
8
- require 'net/HTTP'
11
+ require 'net/http'
9
12
  require 'uri'
10
13
 
11
14
  STANDARD_HEADERS = {
12
- 'User-Agent' => 'Akismet Ruby API/1.0',
15
+ 'User-Agent' => "Typo/#{TYPO_VERSION} | Akismet Ruby API/1.0",
13
16
  'Content-Type' => 'application/x-www-form-urlencoded'
14
17
  }
15
18
 
@@ -83,19 +86,35 @@ class Akismet
83
86
  # The content that was submitted.
84
87
  # Other server enviroment variables
85
88
  # In PHP there is an array of enviroment variables called $_SERVER which contains information about the web server itself as well as a key/value for every HTTP header sent with the request. This data is highly useful to Akismet as how the submited content interacts with the server can be very telling, so please include as much information as possible.
86
- def callAkismet(akismet_function, user_ip, user_agent, referrer, permalink, comment_type, comment_author, comment_author_email, comment_author_url, comment_content, other)
89
+ #options[:user_ip] = user_ip
90
+ #options[:user_agent] = user_agent
91
+ #options[:referrer] = referrer
92
+ #options[:permalink] = permalink
93
+ #options[:comment_type] = comment_type
94
+ #options[:comment_author] = comment_author
95
+ #options[:comment_author_email] = comment_author_email
96
+ #options[:comment_author_url] = comment_author_url
97
+ #options[:comment_content] = comment_content
98
+
99
+ def callAkismet(akismet_function, options = {})
87
100
  http = Net::HTTP.new("#{@apiKey}.rest.akismet.com", 80, @proxyHost, @proxyPort)
88
- path = "/1.1/#{akismet_function}"
101
+ path = "/1.1/#{akismet_function}"
102
+
103
+ options[:blog] = @blog
104
+ params=[]
89
105
 
90
- data = "user_ip=#{user_ip}&user_agent=#{user_agent}&referrer=#{referrer}&permalink=#{permalink}&comment_type=#{comment_type}&comment_author=#{comment_author}&comment_author_email=#{comment_author_email}&comment_author_url=#{comment_author_url}&comment_content=#{comment_content}"
91
- if (other != nil)
92
- other.each_pair {|key, value| data.concat("&#{key}=#{value}")}
106
+ options.each_key do |key|
107
+ params.push "#{key}=#{CGI.escape(options[key].to_s)}"
93
108
  end
94
- data = URI.escape(data)
95
-
109
+
110
+ data = params.join('&')
96
111
  resp, data = http.post(path, data, STANDARD_HEADERS)
97
-
98
- return (data != "false")
112
+
113
+ unless data == 'true' or data == 'false' or data == ''
114
+ STDERR.puts "AKISMET error: #{data}"
115
+ end
116
+
117
+ return (data == "true" or data == '')
99
118
  end
100
119
 
101
120
  protected :callAkismet
@@ -122,19 +141,19 @@ class Akismet
122
141
  # The content that was submitted.
123
142
  # Other server enviroment variables
124
143
  # In PHP there is an array of enviroment variables called $_SERVER which contains information about the web server itself as well as a key/value for every HTTP header sent with the request. This data is highly useful to Akismet as how the submited content interacts with the server can be very telling, so please include as much information as possible.
125
- def commentCheck(user_ip, user_agent, referrer, permalink, comment_type, comment_author, comment_author_email, comment_author_url, comment_content, other)
126
- return callAkismet('comment-check', user_ip, user_agent, referrer, permalink, comment_type, comment_author, comment_author_email, comment_author_url, comment_content, other)
144
+ def commentCheck(options = {})
145
+ return callAkismet('comment-check', options)
127
146
  end
128
147
 
129
148
  # This call is for submitting comments that weren't marked as spam but should have been. It takes identical arguments as comment check.
130
149
  # The call parameters are the same as for the #commentCheck method.
131
- def submitSpam(user_ip, user_agent, referrer, permalink, comment_type, comment_author, comment_author_email, comment_author_url, comment_content, other)
132
- callAkismet('submit-spam', user_ip, user_agent, referrer, permalink, comment_type, comment_author, comment_author_email, comment_author_url, comment_content, other)
150
+ def submitSpam(options = {})
151
+ callAkismet('submit-spam', options)
133
152
  end
134
153
 
135
154
  # This call is intended for the marking of false positives, things that were incorrectly marked as spam. It takes identical arguments as comment check and submit spam.
136
155
  # The call parameters are the same as for the #commentCheck method.
137
- def submitHam(user_ip, user_agent, referrer, permalink, comment_type, comment_author, comment_author_email, comment_author_url, comment_content, other)
138
- callAkismet('submit-ham', user_ip, user_agent, referrer, permalink, comment_type, comment_author, comment_author_email, comment_author_url, comment_content, other)
156
+ def submitHam(options = {})
157
+ callAkismet('submit-ham', options)
139
158
  end
140
159
  end
@@ -79,6 +79,7 @@ module ActionController
79
79
  cached_time = meta[:cached_at] rescue nil
80
80
  controller.response.headers['Cache-Control'] = 'max-age=1'
81
81
  controller.response.headers['Last-Modified'] = meta[:cached_at].httpdate rescue nil
82
+ controller.response.headers['Content-Type'] = meta[:content_type]
82
83
 
83
84
  if request_time and cached_time <= (request_time + 1)
84
85
  controller.render(:text => "", :status => 304)
@@ -94,7 +95,7 @@ module ActionController
94
95
  end
95
96
 
96
97
  def after(controller)
97
- return true if not @actions.include?(controller.action_name.intern) || controller.rendered_action_cache
98
+ return true if !@actions.include?(controller.action_name.intern) || controller.rendered_action_cache
98
99
  return true if controller.response.headers['Status'] != "200 OK" # without this, we cache errors. grr
99
100
 
100
101
  meta = Hash.new
@@ -102,6 +103,7 @@ module ActionController
102
103
  meta[:expires] = Time.now + controller.response.lifetime
103
104
  end
104
105
  meta[:cached_at] = Time.now.utc
106
+ meta[:content_type] = controller.response.headers['Content-Type']
105
107
  controller.response.headers['Cache-Control'] = 'max-age=1'
106
108
  controller.response.headers['Last-Modified'] = meta[:cached_at].httpdate
107
109
  controller.write_meta_fragment(cache_key(controller), meta, controller.response.body)
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: typo
5
5
  version: !ruby/object:Gem::Version
6
- version: 3.99.3
7
- date: 2006-07-09 00:00:00 -07:00
6
+ version: 3.99.4
7
+ date: 2006-07-21 00:00:00 -07:00
8
8
  summary: Modern weblog engine.
9
9
  require_paths:
10
10
  - .
@@ -76,6 +76,7 @@ files:
76
76
  - app/controllers/admin/categories_controller.rb
77
77
  - app/controllers/admin/comments_controller.rb
78
78
  - app/controllers/admin/content_controller.rb
79
+ - app/controllers/admin/feedback_controller.rb
79
80
  - app/controllers/admin/general_controller.rb
80
81
  - app/controllers/admin/pages_controller.rb
81
82
  - app/controllers/admin/resources_controller.rb
@@ -103,6 +104,7 @@ files:
103
104
  - app/helpers/admin/cache_helper.rb
104
105
  - app/helpers/admin/comments_helper.rb
105
106
  - app/helpers/admin/content_helper.rb
107
+ - app/helpers/admin/feedback_helper.rb
106
108
  - app/helpers/admin/general_helper.rb
107
109
  - app/helpers/admin/pages_helper.rb
108
110
  - app/helpers/admin/resources_helper.rb
@@ -180,6 +182,7 @@ files:
180
182
  - app/views/admin/categories
181
183
  - app/views/admin/comments
182
184
  - app/views/admin/content
185
+ - app/views/admin/feedback
183
186
  - app/views/admin/general
184
187
  - app/views/admin/pages
185
188
  - app/views/admin/resources
@@ -225,6 +228,8 @@ files:
225
228
  - app/views/admin/content/new.rhtml
226
229
  - app/views/admin/content/preview.rhtml
227
230
  - app/views/admin/content/show.rhtml
231
+ - app/views/admin/feedback/_item.rhtml
232
+ - app/views/admin/feedback/list.rhtml
228
233
  - app/views/admin/general/index.rhtml
229
234
  - app/views/admin/general/update_database.rhtml
230
235
  - app/views/admin/pages/_form.rhtml
@@ -413,6 +418,7 @@ files:
413
418
  - config/lighttpd.conf
414
419
  - config/mail.yml
415
420
  - config/mail.yml.example
421
+ - config/mongrel.conf
416
422
  - config/routes.rb
417
423
  - config/environments/development.rb
418
424
  - config/environments/production.rb
@@ -437,6 +443,7 @@ files:
437
443
  - db/converters/s9y.rb
438
444
  - db/converters/textpattern.rb
439
445
  - db/converters/wordpress.rb
446
+ - db/converters/wordpress2.rb
440
447
  - db/migrate/001_initial_schema.rb
441
448
  - db/migrate/002_add_user_email.rb
442
449
  - db/migrate/003_add_article_user_id.rb
@@ -487,6 +494,7 @@ files:
487
494
  - db/updates/update.168.to.200.mysql.sql
488
495
  - db/updates/update.168.to.200.psql.sql
489
496
  - doc/Installer.txt
497
+ - doc/typo-4.0-release-notes.txt
490
498
  - installer/apache13.conf.example.template
491
499
  - installer/apache20.conf.example.template
492
500
  - installer/lighttpd.conf.example.template
@@ -494,7 +502,6 @@ files:
494
502
  - installer/rails-installer.rb
495
503
  - installer/rails_installer_defaults.yml
496
504
  - installer/rails-installer/commands.rb
497
- - installer/rails-installer/web-server.rb
498
505
  - installer/rails-installer/web-servers.rb
499
506
  - lib/backpack_api.rb
500
507
  - lib/bare_migration.rb
@@ -655,6 +662,7 @@ files:
655
662
  - test/functional/admin/categories_controller_test.rb
656
663
  - test/functional/admin/comments_controller_test.rb
657
664
  - test/functional/admin/content_controller_test.rb
665
+ - test/functional/admin/feedback_controller_test.rb
658
666
  - test/functional/admin/general_controller_test.rb
659
667
  - test/functional/admin/pages_controller_test.rb
660
668
  - test/functional/admin/resources_controller_test.rb
@@ -766,45 +774,6 @@ files:
766
774
  - tmp/cache
767
775
  - tmp/sessions
768
776
  - tmp/sockets
769
- - tmp/cache/META
770
- - tmp/cache/META/DATA
771
- - tmp/cache/META/META
772
- - tmp/cache/META/DATA/ACTION_PARAM
773
- - tmp/cache/META/DATA/ACTION_PARAM/10.1.0.181
774
- - tmp/cache/META/DATA/ACTION_PARAM/localhost
775
- - tmp/cache/META/DATA/ACTION_PARAM/localhost.3000
776
- - tmp/cache/META/DATA/ACTION_PARAM/10.1.0.181/articles
777
- - tmp/cache/META/DATA/ACTION_PARAM/10.1.0.181/articles/index
778
- - tmp/cache/META/DATA/ACTION_PARAM/10.1.0.181/articles/index/.cache
779
- - tmp/cache/META/DATA/ACTION_PARAM/localhost/articles
780
- - tmp/cache/META/DATA/ACTION_PARAM/localhost/xml
781
- - tmp/cache/META/DATA/ACTION_PARAM/localhost/articles/index
782
- - tmp/cache/META/DATA/ACTION_PARAM/localhost/articles/index/.cache
783
- - tmp/cache/META/DATA/ACTION_PARAM/localhost/xml/feed
784
- - tmp/cache/META/DATA/ACTION_PARAM/localhost/xml/feed/format=atom&type=feed.cache
785
- - tmp/cache/META/DATA/ACTION_PARAM/localhost/xml/feed/format=rss20&type=feed.cache
786
- - tmp/cache/META/DATA/ACTION_PARAM/localhost.3000/articles
787
- - tmp/cache/META/DATA/ACTION_PARAM/localhost.3000/articles/find_by_date
788
- - tmp/cache/META/DATA/ACTION_PARAM/localhost.3000/articles/index
789
- - tmp/cache/META/DATA/ACTION_PARAM/localhost.3000/articles/read
790
- - tmp/cache/META/META/ACTION_PARAM
791
- - tmp/cache/META/META/ACTION_PARAM/10.1.0.181
792
- - tmp/cache/META/META/ACTION_PARAM/localhost
793
- - tmp/cache/META/META/ACTION_PARAM/localhost.3000
794
- - tmp/cache/META/META/ACTION_PARAM/10.1.0.181/articles
795
- - tmp/cache/META/META/ACTION_PARAM/10.1.0.181/articles/index
796
- - tmp/cache/META/META/ACTION_PARAM/10.1.0.181/articles/index/.cache
797
- - tmp/cache/META/META/ACTION_PARAM/localhost/articles
798
- - tmp/cache/META/META/ACTION_PARAM/localhost/xml
799
- - tmp/cache/META/META/ACTION_PARAM/localhost/articles/index
800
- - tmp/cache/META/META/ACTION_PARAM/localhost/articles/index/.cache
801
- - tmp/cache/META/META/ACTION_PARAM/localhost/xml/feed
802
- - tmp/cache/META/META/ACTION_PARAM/localhost/xml/feed/format=atom&type=feed.cache
803
- - tmp/cache/META/META/ACTION_PARAM/localhost/xml/feed/format=rss20&type=feed.cache
804
- - tmp/cache/META/META/ACTION_PARAM/localhost.3000/articles
805
- - tmp/cache/META/META/ACTION_PARAM/localhost.3000/articles/find_by_date
806
- - tmp/cache/META/META/ACTION_PARAM/localhost.3000/articles/index
807
- - tmp/cache/META/META/ACTION_PARAM/localhost.3000/articles/read
808
777
  - vendor/akismet
809
778
  - vendor/bluecloth
810
779
  - vendor/flickr
@@ -1,108 +0,0 @@
1
- class RailsInstaller
2
-
3
- # Parent class for webserver plugins for the installer. To create a new
4
- # webserver handler, subclass this class and define a 'start' and 'stop'
5
- # class method.
6
- class WebServer
7
- @@server_map = {}
8
-
9
- def self.start(installer, foreground)
10
- raise "Not Implemented"
11
- end
12
-
13
- def self.stop(installer, foreground)
14
- raise "Not Implemented"
15
- end
16
-
17
- def self.inherited(sub)
18
- name = sub.to_s.gsub(/^.*::/,'').gsub(/([A-Z])/) do |match|
19
- "_#{match.downcase}"
20
- end.gsub(/^_/,'')
21
-
22
- @@server_map[name] = sub
23
- end
24
-
25
- def self.servers
26
- @@server_map
27
- end
28
-
29
- class Mongrel < RailsInstaller::WebServer
30
- def self.start(installer, foreground)
31
- args = {}
32
- args['-p'] = installer.config['port-number']
33
- args['-a'] = installer.config['bind-address']
34
- args['-e'] = installer.config['rails-environment']
35
- args['-d'] = foreground
36
- args['-P'] = pid_file(installer)
37
-
38
- # Remove keys with nil values
39
- args.delete_if {|k,v| v==nil}
40
-
41
- args_array = args.to_a.flatten.map {|e| e.to_s}
42
- args_array = ['mongrel_rails', 'start', installer.install_directory] + args_array
43
- installer.message "Starting #{installer.app_name.capitalize} on port #{installer.config['port-number']}"
44
- in_directory installer.install_directory do
45
- system(args_array.join(' '))
46
- end
47
- end
48
-
49
- def self.stop(installer)
50
- args = {}
51
- args['-P'] = pid_file(installer)
52
-
53
- args_array = args.to_a.flatten.map {|e| e.to_s}
54
- args_array = ['mongrel_rails', 'stop', installer.install_directory] + args_array
55
- installer.message "Stopping #{installer.app_name.capitalize}"
56
- in_directory installer.install_directory do
57
- system(args_array.join(' '))
58
- end
59
-
60
- end
61
-
62
- def self.pid_file(installer)
63
- File.join(installer.install_directory,'tmp','pid.txt')
64
- end
65
- end
66
-
67
- class MongrelCluster < RailsInstaller::WebServer
68
- def self.start(installer, foreground)
69
- args = {}
70
- args['-p'] = installer.config['port-number']
71
- args['-a'] = installer.config['bind-address']
72
- args['-e'] = installer.config['rails-environment']
73
- args['-N'] = installer.config['threads']
74
-
75
- # Remove keys with nil values
76
- args.delete_if {|k,v| v==nil}
77
-
78
- args_array = args.to_a.flatten.map {|e| e.to_s}
79
- args_array = ['mongrel_rails', 'cluster::configure'] + args_array
80
- installer.message "Configuring mongrel_cluster for #{installer.app_name.capitalize}"
81
- in_directory installer.install_directory do
82
- system(args_array.join(' '))
83
- end
84
- installer.message "Starting #{installer.app_name.capitalize} on port #{installer.config['port-number']}"
85
- in_directory installer.install_directory do
86
- system('mongrel_rails cluster::start')
87
- end
88
-
89
- end
90
-
91
- def self.stop(installer)
92
- installer.message "Stopping #{installer.app_name.capitalize}"
93
- in_directory installer.install_directory do
94
- system('mongrel_rails cluster::stop')
95
- end
96
- end
97
- end
98
-
99
- # Do-nothing webserver class. Used when the installer doesn't control the web server.
100
- class External < RailsInstaller::WebServer
101
- def self.start(installer, foreground)
102
- end
103
-
104
- def self.stop(installer)
105
- end
106
- end
107
- end
108
- end