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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7721eb80bb7232eed49103106b1a854863ac9d1d45f7b589b0c9b8d2a25826d9
4
- data.tar.gz: abc0444f4e24251a22785652c75091e262032a6d167c7eb485c0f54df75a3e10
3
+ metadata.gz: 558fab6ac862f11c03b047b230118a562434cde71a408e8f0288cb1885e30fbe
4
+ data.tar.gz: db30c99fceef25ec931aa655dbf54943fb05c7de25c748b03b40c20f4a337998
5
5
  SHA512:
6
- metadata.gz: 90ea012681693d2b717f2a8d49c0e19e34fda17a052bfdf130ab6e412d4e4efdd9278fa2b471b3f89118f07a86752730c9e77f1b10ae1f065ea2ce056d6ee84c
7
- data.tar.gz: 7d93e0f09fdcc2a6160a5633f61d62ef55245e84531e778c2024b7f9d3c3a188c192c3f860d060127b22c73774294f5d6b21fec0adbc03ced6d2147758c0d904
6
+ metadata.gz: f0fada9feee72adef762c345cc36413431c8c99f69e5023fb7baca5acab95896d8316ff71f259c6d550f86ed35d2fa1d80c3303bdba6f2d0706e157b7bdd3ba2
7
+ data.tar.gz: 630f64d46b675742348938ee1411fe11392d737e218f4ca56fe637796250dca1c26bfb8ce1199cfa1705c7cfae9f6716d60c6c8671f7cd0a137883c712d3f636
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.3.1
@@ -1,3 +1,3 @@
1
1
  module SmartExcerpt
2
- VERSION = "0.1.6"
2
+ VERSION = "0.2.0"
3
3
  end
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?(Fixnum)
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?(Fixnum) ? (v * trust_multiplier).to_i : v] }]
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.1.6
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: 2019-09-25 00:00:00.000000000 Z
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.0.6
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: []