soulheart 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/soulheart +2 -2
- data/lib/soulheart/loader.rb +7 -1
- data/lib/soulheart/server.rb +4 -2
- data/lib/soulheart/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb52ba579f66e836ab61e594ab5e13caa7ce9c9f
|
4
|
+
data.tar.gz: da7bee76c40547870a68c646587248c0f5d15ab7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e96d2237c67c7ccd7cd46410b6f9bc02c953cf4478bd73c08a747d3f2516cc51939ed67c9c06c61c81a56a4c1527dd1d7d8e650affe7f85bf1cd21a892f987c4
|
7
|
+
data.tar.gz: 0b76dce5640c3761886f6ad0fe9e0305c714bd8dab67e44252b5e5b8c65a56a51390e8f342a4982ebac6918c6bdbb700893bfbf3d4647f5918faf15d89a8cbb0
|
data/bin/soulheart
CHANGED
@@ -39,7 +39,7 @@ parser = OptionParser.new do |opts|
|
|
39
39
|
opts.separator ''
|
40
40
|
opts.separator 'Commands:'
|
41
41
|
opts.separator ' load FILE Loads data from a FILE - can be a local file or a url. Accepted formats are .json, .tsv and .csv'
|
42
|
-
opts.separator " reset
|
42
|
+
opts.separator " reset Removes all existing data"
|
43
43
|
opts.separator ''
|
44
44
|
end
|
45
45
|
|
@@ -102,7 +102,7 @@ when 'load'
|
|
102
102
|
load ARGV[1]
|
103
103
|
when 'reset'
|
104
104
|
clear
|
105
|
-
load ARGV[1]
|
105
|
+
load ARGV[1] if ARGV[1]
|
106
106
|
else
|
107
107
|
puts parser.help
|
108
108
|
end
|
data/lib/soulheart/loader.rb
CHANGED
@@ -58,13 +58,19 @@ module Soulheart
|
|
58
58
|
|
59
59
|
def load(items)
|
60
60
|
# Replace with item return so we know we have category_id
|
61
|
-
|
61
|
+
i = 0
|
62
|
+
items.each do |item|
|
63
|
+
item.replace(add_item(item))
|
64
|
+
i += 1
|
65
|
+
end
|
62
66
|
set_category_combos_array.each do |category_combo|
|
63
67
|
items.each do |item|
|
64
68
|
next unless category_combo.match(item['category']) || category_combo == 'all'
|
65
69
|
add_item(item, category_id(category_combo), true) # send it base
|
70
|
+
i += 1
|
66
71
|
end
|
67
72
|
end
|
73
|
+
puts "Total items (including combinatored categories): #{i}"
|
68
74
|
end
|
69
75
|
|
70
76
|
def clean_hash(item)
|
data/lib/soulheart/server.rb
CHANGED
@@ -23,9 +23,11 @@ module Soulheart
|
|
23
23
|
end
|
24
24
|
|
25
25
|
get '/info' do
|
26
|
+
info = Soulheart::Base.new.redis.info
|
26
27
|
MultiJson.encode({
|
27
|
-
|
28
|
-
|
28
|
+
soulheart_version: Soulheart::VERSION,
|
29
|
+
current_time: Time.now.utc.strftime('%H:%M:%S UTC'),
|
30
|
+
redis_used_memory: info['used_memory_human'],
|
29
31
|
})
|
30
32
|
end
|
31
33
|
|
data/lib/soulheart/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soulheart
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Seth Herr
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hiredis
|
@@ -164,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
164
164
|
version: '0'
|
165
165
|
requirements: []
|
166
166
|
rubyforge_project:
|
167
|
-
rubygems_version: 2.4.
|
167
|
+
rubygems_version: 2.4.8
|
168
168
|
signing_key:
|
169
169
|
specification_version: 4
|
170
170
|
summary: Simple, fast autocomplete server for Ruby and Rails
|