static_content 1.0.1 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,4 +3,9 @@ module ContentHelper
3
3
  Content.from_slug(*args).parsed_text
4
4
  end
5
5
  alias :c :content
6
+
7
+ def raw_content(*args)
8
+ Content.from_slug(*args).raw_text
9
+ end
10
+ alias :rc :raw_content
6
11
  end
@@ -5,8 +5,19 @@ class Content < ActiveRecord::Base
5
5
  validates_uniqueness_of :slug
6
6
 
7
7
  def parsed_text
8
- RDiscount.new(text).to_html.html_safe
8
+ markdown.to_html.html_safe
9
9
  end
10
+
11
+ def raw_text
12
+ text.html_safe
13
+ end
14
+
15
+ def markdown
16
+ @content ||= RDiscount.new(text)
17
+ end
18
+
19
+
20
+
10
21
  class << self
11
22
  def from_slug(slug, options={})
12
23
  raise NoDefaultContentError if options[:default].nil?
@@ -1,3 +1,3 @@
1
1
  module StaticContent
2
- VERSION = "1.0.1"
2
+ VERSION = "1.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: static_content
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2012-08-22 00:00:00.000000000 Z
14
+ date: 2012-08-23 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rails
@@ -129,7 +129,7 @@ files:
129
129
  - MIT-LICENSE
130
130
  - Rakefile
131
131
  - README.mkdn
132
- homepage: http://www.helabs.com.br
132
+ homepage: https://github.com/Helabs/static_content
133
133
  licenses: []
134
134
  post_install_message:
135
135
  rdoc_options: []
@@ -143,7 +143,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
143
143
  version: '0'
144
144
  segments:
145
145
  - 0
146
- hash: -2935062702675269822
146
+ hash: 2033020220625899342
147
147
  required_rubygems_version: !ruby/object:Gem::Requirement
148
148
  none: false
149
149
  requirements:
@@ -152,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
152
152
  version: '0'
153
153
  segments:
154
154
  - 0
155
- hash: -2935062702675269822
155
+ hash: 2033020220625899342
156
156
  requirements: []
157
157
  rubyforge_project:
158
158
  rubygems_version: 1.8.24