soulheart 0.3.0 → 0.4.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
- SHA1:
3
- metadata.gz: 88b097f6348d3eda9dd77ed0088dabed84b29ca8
4
- data.tar.gz: ecd740d965972c75fedd07c32dbd7bb80ba2ab44
2
+ SHA256:
3
+ metadata.gz: cdb795313ac11f814661f05f909345f831b473a8ae77fdef354918820012f13e
4
+ data.tar.gz: 5cf89e90855b28a0d721fb9feeb359c80fb35243f8f42e90297af5b02c49f3dd
5
5
  SHA512:
6
- metadata.gz: e5513754551b3012ca2670bc565cbdbc266a26fb7227ee7b1c5d92fabc9bceff321a91f0d4e2edfd8ecc665507deb07e09b071d08d0b54cabebc2044c15a8d3e
7
- data.tar.gz: 5c7e9b4e16ed48baab14a40067809eafe19662ef9e0229e734dcaee7e75f6b7f9ecf6436f2ad2088d6bc9e12327fefe96661830d83d562eba34d8261387204cd
6
+ metadata.gz: f8e8b2f350377d635fceb04a0da5247bfafe464240454ccda378831c6323eb3e01e9db059716744f0439eb3a7c2cf0ee99347c1abe2db70ed1de30ff2d9b3406
7
+ data.tar.gz: bbea122eeaf96cd47222c8d91256760b53a84e696b0e6a638fb146155579942f51643161f4f8e357206e250a03d41f9d6b512d37c513097a3ad241ee992c3cb6
data/bin/soulheart CHANGED
@@ -107,7 +107,7 @@ def load(file)
107
107
  lines = []
108
108
  @batch_size.times do
109
109
  break if f.eof?
110
- lines << MultiJson.decode(f.gets)
110
+ lines << JSON.parse(f.gets)
111
111
  count += 1
112
112
  end
113
113
  end
data/lib/soulheart.rb CHANGED
@@ -1,5 +1,4 @@
1
- require 'multi_json'
2
-
1
+ require 'json'
3
2
  require 'soulheart/version'
4
3
  require 'soulheart/helpers'
5
4
  require 'soulheart/base'
@@ -120,7 +120,7 @@ module Soulheart
120
120
  redis.pipelined do
121
121
  redis.zadd(no_query_id(category_base_id), priority, item['term']) # Add to master set for queryless searches
122
122
  # store the raw data in a separate key to reduce memory usage, if it's cleaned it's done
123
- redis.hset(results_hashes_id, item['term'], MultiJson.encode(item['data'])) unless cleaned
123
+ redis.hset(results_hashes_id, item['term'], item['data'].to_json) unless cleaned
124
124
  phrase = ([item['term']] + (item['aliases'] || [])).join(' ')
125
125
  # Store all the prefixes
126
126
  prefixes_for_phrase(phrase).each do |p|
@@ -65,7 +65,7 @@ module Soulheart
65
65
  return [] unless terms.size > 0
66
66
  results = redis.hmget(results_hashes_id, *terms)
67
67
  results = results.reject(&:nil?) # handle cached results for terms which have since been deleted
68
- results.map { |r| MultiJson.decode(r) }
68
+ results.map { |r| JSON.parse(r) }
69
69
  end
70
70
 
71
71
  def matches
@@ -15,27 +15,27 @@ module Soulheart
15
15
 
16
16
  get '/' do
17
17
  matches = Matcher.new(params).matches
18
- MultiJson.encode(matches: matches)
18
+ {matches: matches}.to_json
19
19
  end
20
20
 
21
21
  get '/categories' do
22
- MultiJson.encode(categories: Base.new.sorted_category_array)
22
+ {categories: Base.new.sorted_category_array}.to_json
23
23
  end
24
24
 
25
25
  get '/info' do
26
26
  info = Soulheart::Base.new.redis.info
27
- MultiJson.encode({
27
+ {
28
28
  soulheart_version: Soulheart::VERSION,
29
29
  current_time: Time.now.utc.strftime('%H:%M:%S UTC'),
30
30
  redis_used_memory: info['used_memory_human'],
31
31
  stop_words: Soulheart.stop_words,
32
32
  normalizer: Soulheart.normalizer,
33
- })
33
+ }.to_json
34
34
  end
35
35
 
36
36
  not_found do
37
37
  content_type 'application/json', charset: 'utf-8'
38
- MultiJson.encode(error: 'not found')
38
+ {error: 'not found'}.to_json
39
39
  end
40
40
  end
41
41
  end
@@ -1,3 +1,3 @@
1
1
  module Soulheart
2
- VERSION = '0.3.0'
2
+ VERSION = '0.4.0'
3
3
  end
metadata CHANGED
@@ -1,22 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soulheart
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seth Herr
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-17 00:00:00.000000000 Z
11
+ date: 2021-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '3.0'
20
17
  - - ">="
21
18
  - !ruby/object:Gem::Version
22
19
  version: 3.0.5
@@ -24,9 +21,6 @@ dependencies:
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
- - - "~>"
28
- - !ruby/object:Gem::Version
29
- version: '3.0'
30
24
  - - ">="
31
25
  - !ruby/object:Gem::Version
32
26
  version: 3.0.5
@@ -44,26 +38,6 @@ dependencies:
44
38
  - - ">="
45
39
  - !ruby/object:Gem::Version
46
40
  version: 0.1.0
47
- - !ruby/object:Gem::Dependency
48
- name: multi_json
49
- requirement: !ruby/object:Gem::Requirement
50
- requirements:
51
- - - "~>"
52
- - !ruby/object:Gem::Version
53
- version: '1.11'
54
- - - ">="
55
- - !ruby/object:Gem::Version
56
- version: 1.11.2
57
- type: :runtime
58
- prerelease: false
59
- version_requirements: !ruby/object:Gem::Requirement
60
- requirements:
61
- - - "~>"
62
- - !ruby/object:Gem::Version
63
- version: '1.11'
64
- - - ">="
65
- - !ruby/object:Gem::Version
66
- version: 1.11.2
67
41
  - !ruby/object:Gem::Dependency
68
42
  name: sinatra
69
43
  requirement: !ruby/object:Gem::Requirement
@@ -138,7 +112,7 @@ homepage: https://github.com/sethherr/soulheart
138
112
  licenses:
139
113
  - MIT
140
114
  metadata: {}
141
- post_install_message:
115
+ post_install_message:
142
116
  rdoc_options: []
143
117
  require_paths:
144
118
  - lib
@@ -153,9 +127,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
153
127
  - !ruby/object:Gem::Version
154
128
  version: '0'
155
129
  requirements: []
156
- rubyforge_project:
157
- rubygems_version: 2.2.2
158
- signing_key:
130
+ rubygems_version: 3.1.4
131
+ signing_key:
159
132
  specification_version: 4
160
133
  summary: Simple, fast autocomplete server for Ruby and Rails
161
134
  test_files: []