picky-live 2.4.0 → 2.4.1
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/lib/picky-live/backend.rb +5 -16
- metadata +14 -3
data/lib/picky-live/backend.rb
CHANGED
@@ -3,34 +3,23 @@ require 'net/http'
|
|
3
3
|
# Ruby Live Interface to the Picky search engine.
|
4
4
|
#
|
5
5
|
class Backend
|
6
|
-
|
6
|
+
|
7
7
|
attr_reader :host, :port, :path
|
8
|
-
|
8
|
+
|
9
9
|
def initialize options = {}
|
10
10
|
@host = options[:host] || 'localhost'
|
11
11
|
@port = options[:port] || 8080
|
12
12
|
@path = options[:path] || '/admin'
|
13
13
|
end
|
14
|
-
|
14
|
+
|
15
15
|
def get params = {}
|
16
16
|
query_params = params.to_query
|
17
17
|
query_params = "?#{query_params}" unless query_params.empty?
|
18
18
|
Net::HTTP.get self.host, "#{self.path}#{query_params}", self.port
|
19
19
|
end
|
20
|
-
|
20
|
+
|
21
21
|
# Extend hash with to_query method.
|
22
22
|
#
|
23
|
-
|
24
|
-
require 'active_support/core_ext/object/to_query'
|
25
|
-
rescue LoadError
|
23
|
+
require 'active_support/core_ext/object/to_query'
|
26
24
|
|
27
|
-
end
|
28
|
-
class Hash
|
29
|
-
def to_query namespace = nil
|
30
|
-
collect do |key, value|
|
31
|
-
value.to_query(namespace ? "#{namespace}[#{key}]" : key)
|
32
|
-
end.sort * '&'
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
25
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: picky-live
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 2.4.
|
5
|
+
version: 2.4.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Florian Hanke
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
13
|
+
date: 2011-05-25 00:00:00 +10:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -35,6 +35,17 @@ dependencies:
|
|
35
35
|
version: 1.3.0
|
36
36
|
type: :development
|
37
37
|
version_requirements: *id002
|
38
|
+
- !ruby/object:Gem::Dependency
|
39
|
+
name: activesupport
|
40
|
+
prerelease: false
|
41
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 3.0.0
|
47
|
+
type: :development
|
48
|
+
version_requirements: *id003
|
38
49
|
description: Live parameters interface for Picky, the fast Ruby search engine.
|
39
50
|
email: florian.hanke+picky-live@gmail.com
|
40
51
|
executables: []
|
@@ -78,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
89
|
requirements: []
|
79
90
|
|
80
91
|
rubyforge_project: http://rubyforge.org/projects/picky
|
81
|
-
rubygems_version: 1.
|
92
|
+
rubygems_version: 1.6.2
|
82
93
|
signing_key:
|
83
94
|
specification_version: 3
|
84
95
|
summary: Displays parameters (and the possibility of updating them) for Picky.
|