nokogiri_truncate_html 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -41,7 +41,7 @@ module NokogiriTruncateHtml
41
41
  @chars_remaining -= text.length
42
42
  if @chars_remaining < 0
43
43
  @output << @omission
44
- raise TruncateFinished
44
+ throw :truncate_finished
45
45
  end
46
46
  end
47
47
 
@@ -27,9 +27,8 @@ module NokogiriTruncateHtml
27
27
  input = "<div>#{input}</div>"
28
28
  self.document.length = length
29
29
  self.document.omission = omission
30
- begin
30
+ catch(:truncate_finished) do
31
31
  self.parser.parse_memory(input)
32
- rescue TruncateFinished
33
32
  end
34
33
  self.document.output.html_safe
35
34
  end
metadata CHANGED
@@ -1,81 +1,81 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nokogiri_truncate_html
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
5
- prerelease:
4
+ version: 0.0.3
5
+ prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Ian White
9
9
  - Derek Kraan
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-06-17 00:00:00.000000000 Z
13
+ date: 2013-10-18 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: nokogiri
17
- requirement: !ruby/object:Gem::Requirement
18
- none: false
17
+ version_requirements: !ruby/object:Gem::Requirement
19
18
  requirements:
20
19
  - - ~>
21
20
  - !ruby/object:Gem::Version
22
21
  version: 1.5.8
23
- type: :runtime
24
- prerelease: false
25
- version_requirements: !ruby/object:Gem::Requirement
26
22
  none: false
23
+ requirement: !ruby/object:Gem::Requirement
27
24
  requirements:
28
25
  - - ~>
29
26
  - !ruby/object:Gem::Version
30
27
  version: 1.5.8
28
+ none: false
29
+ prerelease: false
30
+ type: :runtime
31
31
  - !ruby/object:Gem::Dependency
32
32
  name: activesupport
33
- requirement: !ruby/object:Gem::Requirement
34
- none: false
33
+ version_requirements: !ruby/object:Gem::Requirement
35
34
  requirements:
36
35
  - - ~>
37
36
  - !ruby/object:Gem::Version
38
37
  version: 3.2.13
39
- type: :runtime
40
- prerelease: false
41
- version_requirements: !ruby/object:Gem::Requirement
42
38
  none: false
39
+ requirement: !ruby/object:Gem::Requirement
43
40
  requirements:
44
41
  - - ~>
45
42
  - !ruby/object:Gem::Version
46
43
  version: 3.2.13
44
+ none: false
45
+ prerelease: false
46
+ type: :runtime
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: htmlentities
49
- requirement: !ruby/object:Gem::Requirement
50
- none: false
49
+ version_requirements: !ruby/object:Gem::Requirement
51
50
  requirements:
52
51
  - - ~>
53
52
  - !ruby/object:Gem::Version
54
53
  version: 4.3.1
55
- type: :runtime
56
- prerelease: false
57
- version_requirements: !ruby/object:Gem::Requirement
58
54
  none: false
55
+ requirement: !ruby/object:Gem::Requirement
59
56
  requirements:
60
57
  - - ~>
61
58
  - !ruby/object:Gem::Version
62
59
  version: 4.3.1
60
+ none: false
61
+ prerelease: false
62
+ type: :runtime
63
63
  - !ruby/object:Gem::Dependency
64
64
  name: rspec
65
- requirement: !ruby/object:Gem::Requirement
66
- none: false
65
+ version_requirements: !ruby/object:Gem::Requirement
67
66
  requirements:
68
- - - ! '>'
67
+ - - '>'
69
68
  - !ruby/object:Gem::Version
70
69
  version: '2'
71
- type: :development
72
- prerelease: false
73
- version_requirements: !ruby/object:Gem::Requirement
74
70
  none: false
71
+ requirement: !ruby/object:Gem::Requirement
75
72
  requirements:
76
- - - ! '>'
73
+ - - '>'
77
74
  - !ruby/object:Gem::Version
78
75
  version: '2'
76
+ none: false
77
+ prerelease: false
78
+ type: :development
79
79
  description: truncate_html helper that is html and html entities friendly
80
80
  email:
81
81
  - derek@springest.com
@@ -88,26 +88,26 @@ files:
88
88
  - lib/nokogiri_truncate_html.rb
89
89
  homepage: https://github.com/Springest/truncate_html
90
90
  licenses: []
91
- post_install_message:
91
+ post_install_message:
92
92
  rdoc_options: []
93
93
  require_paths:
94
94
  - lib
95
95
  required_ruby_version: !ruby/object:Gem::Requirement
96
- none: false
97
96
  requirements:
98
- - - ! '>='
97
+ - - '>='
99
98
  - !ruby/object:Gem::Version
100
99
  version: '0'
101
- required_rubygems_version: !ruby/object:Gem::Requirement
102
100
  none: false
101
+ required_rubygems_version: !ruby/object:Gem::Requirement
103
102
  requirements:
104
- - - ! '>='
103
+ - - '>='
105
104
  - !ruby/object:Gem::Version
106
105
  version: '0'
106
+ none: false
107
107
  requirements: []
108
- rubyforge_project:
109
- rubygems_version: 1.8.23
110
- signing_key:
108
+ rubyforge_project:
109
+ rubygems_version: 1.8.24
110
+ signing_key:
111
111
  specification_version: 3
112
112
  summary: truncate_html helper that is html and html entities friendly
113
113
  test_files: []