smart_excerpt 0.1.6 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -0
- data/lib/smart_excerpt/version.rb +1 -1
- data/lib/smart_excerpt.rb +2 -2
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 558fab6ac862f11c03b047b230118a562434cde71a408e8f0288cb1885e30fbe
|
4
|
+
data.tar.gz: db30c99fceef25ec931aa655dbf54943fb05c7de25c748b03b40c20f4a337998
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0fada9feee72adef762c345cc36413431c8c99f69e5023fb7baca5acab95896d8316ff71f259c6d550f86ed35d2fa1d80c3303bdba6f2d0706e157b7bdd3ba2
|
7
|
+
data.tar.gz: 630f64d46b675742348938ee1411fe11392d737e218f4ca56fe637796250dca1c26bfb8ce1199cfa1705c7cfae9f6716d60c6c8671f7cd0a137883c712d3f636
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
3.3.1
|
data/lib/smart_excerpt.rb
CHANGED
@@ -26,13 +26,13 @@ module SmartExcerpt
|
|
26
26
|
tx = obj.send(base_field)
|
27
27
|
else
|
28
28
|
tx = obj.send(excerpt_field)
|
29
|
-
if words.is_a?(
|
29
|
+
if words.is_a?(Numeric)
|
30
30
|
words *= trust_multiplier
|
31
31
|
elsif words.is_a?(Hash)
|
32
32
|
if words[:trust_excerpts]
|
33
33
|
words = {words: Float::INFINITY}
|
34
34
|
else
|
35
|
-
words = Hash[words.map {|k, v| [k, v.is_a?(
|
35
|
+
words = Hash[words.map {|k, v| [k, v.is_a?(Numeric) ? (v * trust_multiplier).to_i : v] }]
|
36
36
|
end
|
37
37
|
end
|
38
38
|
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.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- glebtv
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -74,6 +74,7 @@ extensions: []
|
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
76
|
- ".gitignore"
|
77
|
+
- ".ruby-version"
|
77
78
|
- Gemfile
|
78
79
|
- LICENSE.txt
|
79
80
|
- README.md
|
@@ -87,7 +88,7 @@ homepage: https://github.com/rs-pro/smart_excerpt
|
|
87
88
|
licenses:
|
88
89
|
- MIT
|
89
90
|
metadata: {}
|
90
|
-
post_install_message:
|
91
|
+
post_install_message:
|
91
92
|
rdoc_options: []
|
92
93
|
require_paths:
|
93
94
|
- lib
|
@@ -102,8 +103,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
102
103
|
- !ruby/object:Gem::Version
|
103
104
|
version: '0'
|
104
105
|
requirements: []
|
105
|
-
rubygems_version: 3.
|
106
|
-
signing_key:
|
106
|
+
rubygems_version: 3.5.9
|
107
|
+
signing_key:
|
107
108
|
specification_version: 4
|
108
109
|
summary: Allows to create intellegent excerpt fields.
|
109
110
|
test_files: []
|