Permalink
Browse files

General fixes etc

  • Loading branch information...
1 parent 225a25c commit d7c77ed47589740d59a73aa2c983b80339f12e25 @Sutto committed May 3, 2010
Showing with 5 additions and 4 deletions.
  1. +2 −1 almost-happy.gemspec
  2. +1 −1 lib/almost_happy.rb
  3. +1 −1 lib/almost_happy/active_record_mixin.rb
  4. +1 −1 lib/almost_happy/convertor.rb
View
@@ -5,7 +5,7 @@
Gem::Specification.new do |s|
s.name = %q{almost-happy}
- s.version = "0.1.0"
+ s.version = "0.1.1"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Darcy Laycock"]
@@ -31,6 +31,7 @@ Gem::Specification.new do |s|
"lib/almost_happy/format_validator.rb",
"lib/almost_happy/publishable.rb",
"lib/almost_happy/scopeable.rb",
+ "lib/vendor/albino.rb",
"test/helper.rb",
"test/test_almost-happy.rb"
]
View
@@ -4,7 +4,7 @@
require 'active_support/concern'
module AlmostHappy
- VERSION = '0.1.0'.freeze
+ VERSION = '0.1.1'.freeze
extend ActiveSupport::Autoload
@@ -11,7 +11,7 @@ def is_convertable(*args)
self.convertable_fields += fields
# Define accessors for each field.
fields.each do |field|
- define_method(:"#{field}_as_html") { send(field).to_s.html_safe }
+ define_method(:"#{field}_as_html") { send(:"rendered_#{field}").to_s.html_safe }
end
validate_convertable_format if options.fetch(:validate, true)
end
@@ -85,7 +85,7 @@ def render
end
add_renderer :markdown, :filters => [:smart, :autolink] do |raw|
- html = RDiscount.new(raw, *ContentRenderer[:markdown].fetch(:filters, [])).to_html
+ html = RDiscount.new(raw, *Convertor[:markdown].fetch(:filters, [])).to_html
html.gsub!(/^(?:<p>)?@@@(?:<\/p>)?$/, '</div>')
html.gsub!(/^(?:<p>)?@@@\s*([\w\+]+)(?:<\/p>)?$/, '<div class="code" rel="\1">')
Albino.highlight_code(html)

0 comments on commit d7c77ed

Please sign in to comment.