smart_excerpt 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +1 -1
- data/lib/smart_excerpt/helper.rb +1 -1
- data/lib/smart_excerpt/version.rb +1 -1
- data/smart_excerpt.gemspec +2 -2
- metadata +11 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 7721eb80bb7232eed49103106b1a854863ac9d1d45f7b589b0c9b8d2a25826d9
|
4
|
+
data.tar.gz: abc0444f4e24251a22785652c75091e262032a6d167c7eb485c0f54df75a3e10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90ea012681693d2b717f2a8d49c0e19e34fda17a052bfdf130ab6e412d4e4efdd9278fa2b471b3f89118f07a86752730c9e77f1b10ae1f065ea2ce056d6ee84c
|
7
|
+
data.tar.gz: 7d93e0f09fdcc2a6160a5633f61d62ef55245e84531e778c2024b7f9d3c3a188c192c3f860d060127b22c73774294f5d6b21fec0adbc03ced6d2147758c0d904
|
data/README.md
CHANGED
@@ -60,7 +60,7 @@ All excerpts are passed through strip_tags and html entity decode.
|
|
60
60
|
|
61
61
|
## Contributing
|
62
62
|
|
63
|
-
1. Fork it ( https://github.com/
|
63
|
+
1. Fork it ( https://github.com/rs-pro/smart_excerpt/fork )
|
64
64
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
65
65
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
66
66
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/lib/smart_excerpt/helper.rb
CHANGED
@@ -6,7 +6,7 @@ module SmartExcerpt
|
|
6
6
|
return '' if s.blank?
|
7
7
|
opts = {words: 25}.merge(opts)
|
8
8
|
if opts[:sentences]
|
9
|
-
return s.split(/\.(\s|$)+/)[0, opts[:sentences]].map{|s| s.strip}.join('. ') + '.'
|
9
|
+
return s.split(/\.(\s|$)+/).delete_if {|s| s.blank? }[0, opts[:sentences]].map{|s| s.strip}.join('. ') + '.'
|
10
10
|
end
|
11
11
|
if opts[:letters]
|
12
12
|
return truncate(s, length: opts[:letters], separator: ' ', omission: '...')
|
data/smart_excerpt.gemspec
CHANGED
@@ -21,6 +21,6 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.add_dependency 'activesupport'
|
22
22
|
spec.add_dependency 'htmlentities'
|
23
23
|
|
24
|
-
spec.add_development_dependency "bundler"
|
25
|
-
spec.add_development_dependency "rake"
|
24
|
+
spec.add_development_dependency "bundler"
|
25
|
+
spec.add_development_dependency "rake"
|
26
26
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smart_excerpt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- glebtv
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -42,30 +42,30 @@ dependencies:
|
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '0'
|
69
69
|
description: ''
|
70
70
|
email:
|
71
71
|
- glebtv@gmail.com
|
@@ -102,8 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '0'
|
104
104
|
requirements: []
|
105
|
-
|
106
|
-
rubygems_version: 2.2.2
|
105
|
+
rubygems_version: 3.0.6
|
107
106
|
signing_key:
|
108
107
|
specification_version: 4
|
109
108
|
summary: Allows to create intellegent excerpt fields.
|