Skip to content

Commit

Permalink
Override Rails 2.3's BlueCloth dependency with RDiscount. [#24]
Browse files Browse the repository at this point in the history
  • Loading branch information
marnen committed May 29, 2009
1 parent 9fb1f8d commit bdbc45e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions app/controllers/application_controller.rb
Expand Up @@ -10,6 +10,8 @@ class ApplicationController < ActionController::Base
before_filter :login_from_cookie
before_filter :set_current_user

ActionView::Helpers::TextHelper::BlueCloth = RDiscount

helper :all # include all helpers, all the time

# Check to see if the current user is an admin of at least one calendar.
Expand Down
2 changes: 2 additions & 0 deletions config/environment.rb
Expand Up @@ -74,6 +74,8 @@

config.gem 'grosser-fast_gettext', :lib => 'fast_gettext', :source => 'http://gems.github.com'

config.gem 'rdiscount', :version => '>= 1.2.11'

# Set app to Eastern time for now -- we'll have configurable time zones soon enough
config.time_zone = 'Eastern Time (US & Canada)'
end
2 changes: 0 additions & 2 deletions config/geminstaller.yml
Expand Up @@ -42,8 +42,6 @@ gems:
version: 0.8.1
- name: rcov # testing
version: 0.8.1.2.0
- name: rdiscount
version: 1.2.11
- name: rspec # testing
version: 1.1.9
- name: rspec-rails # testing
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/events_controller_spec.rb
Expand Up @@ -132,7 +132,7 @@
it "should contain an entry for every event, with <title>, <description> (with address and description), <link>, <guid>, and <pubDate> elements" do
@events.each do |e|
response.should have_tag('item title',ERB::Util::html_escape(e.name)) # actually, this is XML escape, but close enough
response.should have_tag('item description', /#{ERB::Util::html_escape(e.date.to_s(:rfc822))}.*#{ERB::Util::html_escape(e.address.to_s(:geo))}.*#{ERB::Util::html_escape(BlueCloth::new(ERB::Util::html_escape(e.description)).to_html)}/m) # kinky but accurate
response.should have_tag('item description', /#{ERB::Util::html_escape(e.date.to_s(:rfc822))}.*#{ERB::Util::html_escape(e.address.to_s(:geo))}.*#{ERB::Util::html_escape(RDiscount.new(ERB::Util::html_escape(e.description)).to_html)}/m) # kinky but accurate
response.should have_tag('item link', event_url(e))
response.should have_tag('item guid', event_url(e))
response.should have_tag('item pubDate', e.created_at.to_s(:rfc822))
Expand Down

0 comments on commit bdbc45e

Please sign in to comment.