rifle 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -10,7 +10,9 @@ Just use the gem.
10
10
 
11
11
  gem 'rifle'
12
12
 
13
- Now, all of your Rails based servers can write to and query the search engine using the following commands
13
+ Now, all of your Rails based servers can write to and query the search engine using the following commands.
14
+ The store method can take a hash, or a json string. The search method returns an array of hashes, each with a
15
+ urn and a payload
14
16
 
15
17
  Rifle::Client.store('urn:monty:sketch:MP3242', {
16
18
  quote: 'I would like to buy a cat license'
@@ -18,12 +20,13 @@ Now, all of your Rails based servers can write to and query the search engine us
18
20
 
19
21
  Rifle::Client.search('Cat')
20
22
 
21
- # => {
23
+ # => [{
22
24
  # urn: 'urn:monty:sketch:MP3242',
23
25
  # payload: {
24
26
  # quote: 'I would like to buy a cat license'
25
27
  # }
26
- # }
28
+ # }]
29
+
27
30
 
28
31
  # Payloads
29
32
 
@@ -1,6 +1,9 @@
1
1
  module Rifle
2
2
  module Client
3
3
  def self.store(urn, json)
4
+ if (json.is_a? Hash)
5
+ json = json.to_json
6
+ end
4
7
  Resque.enqueue(RifleResque, urn, json)
5
8
  end
6
9
  def self.search(query)
@@ -1,3 +1,3 @@
1
1
  module Rifle
2
- VERSION = '0.0.7'
2
+ VERSION = '0.0.8'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rifle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: