objects_extensions 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Rakefile CHANGED
@@ -10,6 +10,7 @@ begin
10
10
  gem.email = "jose.fduarte@gmail.com"
11
11
  gem.homepage = "http://github.com/jduarte/objects_extensions"
12
12
  gem.authors = ["jduarte"]
13
+ gem.add_dependency('RedCloth', '>= 4.2.3')
13
14
  gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
14
15
  # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
15
16
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.1
1
+ 0.3.2
@@ -35,11 +35,15 @@ String.class_eval do
35
35
  end
36
36
 
37
37
  # Replaces all \n or \r\n for <br />
38
- def html_text(escape=true)
38
+ def html_text_old(escape=true)
39
39
  str_to_convert = escape.present? ? self.gsub(/\<(.| )*\>/,'') : self
40
40
  str_to_convert.gsub(/\r/, '').gsub(/\n/, '<br />')
41
41
  end
42
42
 
43
+ def html_text(escape=true)
44
+ escape ? RedCloth.new(self).to_html : html_text_old(escape)
45
+ end
46
+
43
47
  # Removes first num_chars from string
44
48
  # If num_chars is a negative number then it will start counting from the end
45
49
  def substr(num_chars)
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{objects_extensions}
8
- s.version = "0.3.1"
8
+ s.version = "0.3.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["jduarte"]
@@ -48,11 +48,14 @@ Gem::Specification.new do |s|
48
48
  s.specification_version = 3
49
49
 
50
50
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
51
+ s.add_runtime_dependency(%q<RedCloth>, [">= 4.2.3"])
51
52
  s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
52
53
  else
54
+ s.add_dependency(%q<RedCloth>, [">= 4.2.3"])
53
55
  s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
54
56
  end
55
57
  else
58
+ s.add_dependency(%q<RedCloth>, [">= 4.2.3"])
56
59
  s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
57
60
  end
58
61
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: objects_extensions
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 1
10
- version: 0.3.1
9
+ - 2
10
+ version: 0.3.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - jduarte
@@ -19,9 +19,25 @@ date: 2010-07-22 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
- name: thoughtbot-shoulda
22
+ name: RedCloth
23
23
  prerelease: false
24
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 49
30
+ segments:
31
+ - 4
32
+ - 2
33
+ - 3
34
+ version: 4.2.3
35
+ type: :runtime
36
+ version_requirements: *id001
37
+ - !ruby/object:Gem::Dependency
38
+ name: thoughtbot-shoulda
39
+ prerelease: false
40
+ requirement: &id002 !ruby/object:Gem::Requirement
25
41
  none: false
26
42
  requirements:
27
43
  - - ">="
@@ -31,7 +47,7 @@ dependencies:
31
47
  - 0
32
48
  version: "0"
33
49
  type: :development
34
- version_requirements: *id001
50
+ version_requirements: *id002
35
51
  description: Convenience Methods
36
52
  email: jose.fduarte@gmail.com
37
53
  executables: []