algoliasearch 1.0.2 → 1.1.0
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.
- checksums.yaml +7 -15
- data/Gemfile.lock +19 -52
- data/algoliasearch.gemspec +2 -3
- data/lib/algolia/client.rb +30 -0
- data/lib/algolia/protocol.rb +8 -0
- metadata +75 -117
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
|
-
---
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
YzU1M2ZmMzlkYzRmM2I2NWZmMGI5MGVkZGM2ZGRmYjlhOGEwNjA0YmU4M2Fj
|
10
|
-
Yzc4OTdlODc4ODZjOWI2ZDI1MWQzNjI3YzY1ZGI3NGQwZDhlMGQwYjYwYTc2
|
11
|
-
OTM1MjE1OThhNjg4OWM1MTk2OGY4YzZlYTYzNzU3NWZmODlmOTg=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
MmNiNWI5OTZjOTU2MzIxM2VjZDI4MTM0N2Y5Mjg1Y2I2OWY5NzcwZTUzOGY3
|
14
|
-
NDY2ZTFlN2M5Y2IxMTM0NWFlM2U5ZGM5ZDhhOTBjYTViMjBjYjQ3Y2UxYWYy
|
15
|
-
ZWNhNjIxZjUyZjM0OWUyNmNjZjk0OTE5ZmUyMzFlOTQ3NzE0N2I=
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
data.tar.gz: a974ff4aaf5416cf977a4e78115b0a7b84c850ce
|
4
|
+
metadata.gz: dbaece1db314ffe49265c381ceb4f41bb746fc52
|
5
|
+
SHA512:
|
6
|
+
data.tar.gz: c4961df560776a7478ba656733e9b6fb5273739c6f0331e2f4d10965e27098a5e1f5bfe860099a6e03e1ebee948d5fda802be93828fd83d7ca7e20edc94739e0
|
7
|
+
metadata.gz: 4db8478142afde6195bf9b61f569be4a02c0bd09d828decaf4a3ed6632495d7508652bdb33168b6f2078c433a542a59033008678b15258e4fec4b2c5de6c4abd
|
data/Gemfile.lock
CHANGED
@@ -1,67 +1,34 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
addressable (2.3.
|
5
|
-
|
6
|
-
crack (0.4.1)
|
7
|
-
safe_yaml (~> 0.9.0)
|
4
|
+
addressable (2.3.4)
|
5
|
+
crack (0.3.2)
|
8
6
|
curb (0.8.4)
|
9
|
-
diff-lcs (1.
|
10
|
-
|
11
|
-
|
12
|
-
git (1.2.6)
|
13
|
-
github_api (0.10.1)
|
14
|
-
addressable
|
15
|
-
faraday (~> 0.8.1)
|
16
|
-
hashie (>= 1.2)
|
17
|
-
multi_json (~> 1.4)
|
18
|
-
nokogiri (~> 1.5.2)
|
19
|
-
oauth2
|
20
|
-
hashie (2.0.5)
|
21
|
-
highline (1.6.19)
|
22
|
-
httpauth (0.2.0)
|
23
|
-
jeweler (1.8.7)
|
24
|
-
builder
|
7
|
+
diff-lcs (1.1.3)
|
8
|
+
git (1.2.5)
|
9
|
+
jeweler (1.8.4)
|
25
10
|
bundler (~> 1.0)
|
26
11
|
git (>= 1.2.5)
|
27
|
-
github_api (= 0.10.1)
|
28
|
-
highline (>= 1.6.15)
|
29
|
-
nokogiri (= 1.5.10)
|
30
12
|
rake
|
31
13
|
rdoc
|
32
14
|
json (1.8.0)
|
33
|
-
|
34
|
-
|
35
|
-
multi_json (1.8.0)
|
36
|
-
multi_xml (0.5.5)
|
37
|
-
multipart-post (1.2.0)
|
38
|
-
nokogiri (1.5.10)
|
39
|
-
oauth2 (0.9.2)
|
40
|
-
faraday (~> 0.8)
|
41
|
-
httpauth (~> 0.2)
|
42
|
-
jwt (~> 0.1.4)
|
43
|
-
multi_json (~> 1.0)
|
44
|
-
multi_xml (~> 0.5)
|
45
|
-
rack (~> 1.2)
|
46
|
-
rack (1.5.2)
|
47
|
-
rake (10.1.0)
|
48
|
-
rdoc (4.0.1)
|
15
|
+
rake (10.0.4)
|
16
|
+
rdoc (3.12.2)
|
49
17
|
json (~> 1.4)
|
50
18
|
redgreen (1.2.2)
|
51
|
-
rspec (2.
|
52
|
-
rspec-core (~> 2.
|
53
|
-
rspec-expectations (~> 2.
|
54
|
-
rspec-mocks (~> 2.
|
55
|
-
rspec-core (2.
|
56
|
-
rspec-expectations (2.
|
57
|
-
diff-lcs (
|
58
|
-
rspec-mocks (2.
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
webmock (1.13.0)
|
19
|
+
rspec (2.11.0)
|
20
|
+
rspec-core (~> 2.11.0)
|
21
|
+
rspec-expectations (~> 2.11.0)
|
22
|
+
rspec-mocks (~> 2.11.0)
|
23
|
+
rspec-core (2.11.1)
|
24
|
+
rspec-expectations (2.11.3)
|
25
|
+
diff-lcs (~> 1.1.3)
|
26
|
+
rspec-mocks (2.11.2)
|
27
|
+
shoulda-context (1.0.2)
|
28
|
+
test-unit (2.5.4)
|
29
|
+
webmock (1.9.0)
|
63
30
|
addressable (>= 2.2.7)
|
64
|
-
crack (>= 0.
|
31
|
+
crack (>= 0.1.7)
|
65
32
|
|
66
33
|
PLATFORMS
|
67
34
|
ruby
|
data/algoliasearch.gemspec
CHANGED
@@ -2,11 +2,10 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: algoliasearch 1.0.2 ruby lib
|
6
5
|
|
7
6
|
Gem::Specification.new do |s|
|
8
7
|
s.name = "algoliasearch"
|
9
|
-
s.version = "1.0
|
8
|
+
s.version = "1.1.0"
|
10
9
|
|
11
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
11
|
s.authors = ["Algolia"]
|
@@ -35,7 +34,7 @@ Gem::Specification.new do |s|
|
|
35
34
|
s.homepage = "http://github.com/algolia/algoliasearch-client-ruby"
|
36
35
|
s.licenses = ["MIT"]
|
37
36
|
s.require_paths = ["lib"]
|
38
|
-
s.rubygems_version = "2.
|
37
|
+
s.rubygems_version = "2.0.5"
|
39
38
|
s.summary = "A simple Ruby client for the algolia.com REST API"
|
40
39
|
|
41
40
|
if s.respond_to? :specification_version then
|
data/lib/algolia/client.rb
CHANGED
@@ -114,6 +114,36 @@ module Algolia
|
|
114
114
|
Algolia.client.get(Protocol.indexes_uri)
|
115
115
|
end
|
116
116
|
|
117
|
+
#
|
118
|
+
# Move an existing index.
|
119
|
+
# @param srcIndexName the name of index to copy.
|
120
|
+
# @param dstIndexName the new index name that will contains a copy of srcIndexName (destination will be overriten if it already exist).
|
121
|
+
#
|
122
|
+
def Algolia.move_index(src_index, dst_index)
|
123
|
+
request = {"operation" => "move", "destination" => dst_index};
|
124
|
+
Algolia.client.post(Protocol.index_operation_uri(src_index), request.to_json)
|
125
|
+
end
|
126
|
+
|
127
|
+
#
|
128
|
+
# Copy an existing index.
|
129
|
+
# @param srcIndexName the name of index to copy.
|
130
|
+
# @param dstIndexName the new index name that will contains a copy of srcIndexName (destination will be overriten if it already exist).
|
131
|
+
#
|
132
|
+
def Algolia.copy_index(src_index, dst_index)
|
133
|
+
request = {"operation" => "copy", "destination" => dst_index};
|
134
|
+
Algolia.client.post(Protocol.index_operation_uri(src_index), request.to_json)
|
135
|
+
end
|
136
|
+
|
137
|
+
#
|
138
|
+
# Return last logs entries.
|
139
|
+
#
|
140
|
+
# @param offset Specify the first entry to retrieve (0-based, 0 is the most recent log entry).
|
141
|
+
# @param length Specify the maximum number of entries to retrieve starting at offset. Maximum allowed value: 1000.
|
142
|
+
#
|
143
|
+
def Algolia.get_logs(offset = 0, length = 10)
|
144
|
+
Algolia.client.get(Protocol.logs(offset, length))
|
145
|
+
end
|
146
|
+
|
117
147
|
# List all existing user keys with their associated ACLs
|
118
148
|
def Algolia.list_user_keys
|
119
149
|
Algolia.client.get(Protocol.keys_uri)
|
data/lib/algolia/protocol.rb
CHANGED
@@ -43,6 +43,10 @@ module Algolia
|
|
43
43
|
"/#{VERSION}/indexes/#{index}/batch"
|
44
44
|
end
|
45
45
|
|
46
|
+
def Protocol.index_operation_uri(index)
|
47
|
+
"/#{VERSION}/indexes/#{index}/operation"
|
48
|
+
end
|
49
|
+
|
46
50
|
def Protocol.task_uri(index, task_id)
|
47
51
|
"#{index_uri(index)}/task/#{task_id}"
|
48
52
|
end
|
@@ -65,6 +69,10 @@ module Algolia
|
|
65
69
|
"#{index_uri(index)}/settings"
|
66
70
|
end
|
67
71
|
|
72
|
+
def Protocol.logs(offset, length)
|
73
|
+
"/#{VERSION}/logs?offset=#{offset}&length=#{length}"
|
74
|
+
end
|
75
|
+
|
68
76
|
def Protocol.keys_uri
|
69
77
|
"/#{VERSION}/keys"
|
70
78
|
end
|
metadata
CHANGED
@@ -1,135 +1,93 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: algoliasearch
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
|
-
authors:
|
6
|
+
authors:
|
7
7
|
- Algolia
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
|
12
|
+
date: 2013-09-17 00:00:00 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
14
15
|
name: curb
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ! '>='
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :runtime
|
21
16
|
prerelease: false
|
22
|
-
|
23
|
-
requirements:
|
24
|
-
-
|
25
|
-
-
|
26
|
-
|
27
|
-
|
17
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
18
|
+
requirements:
|
19
|
+
- &id002
|
20
|
+
- ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: "0"
|
23
|
+
type: :runtime
|
24
|
+
version_requirements: *id001
|
25
|
+
- !ruby/object:Gem::Dependency
|
28
26
|
name: bundler
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ! '>='
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :development
|
35
27
|
prerelease: false
|
36
|
-
|
37
|
-
requirements:
|
38
|
-
-
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: jeweler
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ! '>='
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
28
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- *id002
|
48
31
|
type: :development
|
32
|
+
version_requirements: *id003
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: jeweler
|
49
35
|
prerelease: false
|
50
|
-
|
51
|
-
requirements:
|
52
|
-
-
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: test-unit
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ! '>='
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
36
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- *id002
|
62
39
|
type: :development
|
40
|
+
version_requirements: *id004
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: test-unit
|
63
43
|
prerelease: false
|
64
|
-
|
65
|
-
requirements:
|
66
|
-
-
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: rspec
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ! '>='
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
44
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- *id002
|
76
47
|
type: :development
|
48
|
+
version_requirements: *id005
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
name: rspec
|
77
51
|
prerelease: false
|
78
|
-
|
79
|
-
requirements:
|
80
|
-
-
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: shoulda-context
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ! '>='
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
52
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- *id002
|
90
55
|
type: :development
|
56
|
+
version_requirements: *id006
|
57
|
+
- !ruby/object:Gem::Dependency
|
58
|
+
name: shoulda-context
|
91
59
|
prerelease: false
|
92
|
-
|
93
|
-
requirements:
|
94
|
-
-
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: webmock
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - ! '>='
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '0'
|
60
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
61
|
+
requirements:
|
62
|
+
- *id002
|
104
63
|
type: :development
|
64
|
+
version_requirements: *id007
|
65
|
+
- !ruby/object:Gem::Dependency
|
66
|
+
name: webmock
|
105
67
|
prerelease: false
|
106
|
-
|
107
|
-
requirements:
|
108
|
-
-
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '0'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: redgreen
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - ! '>='
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '0'
|
68
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
69
|
+
requirements:
|
70
|
+
- *id002
|
118
71
|
type: :development
|
72
|
+
version_requirements: *id008
|
73
|
+
- !ruby/object:Gem::Dependency
|
74
|
+
name: redgreen
|
119
75
|
prerelease: false
|
120
|
-
|
121
|
-
requirements:
|
122
|
-
-
|
123
|
-
|
124
|
-
|
76
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
77
|
+
requirements:
|
78
|
+
- *id002
|
79
|
+
type: :development
|
80
|
+
version_requirements: *id009
|
125
81
|
description: A simple Ruby client for the algolia.com REST API
|
126
82
|
email: contact@algolia.com
|
127
83
|
executables: []
|
84
|
+
|
128
85
|
extensions: []
|
129
|
-
|
86
|
+
|
87
|
+
extra_rdoc_files:
|
130
88
|
- LICENSE.txt
|
131
89
|
- README.md
|
132
|
-
files:
|
90
|
+
files:
|
133
91
|
- Gemfile
|
134
92
|
- Gemfile.lock
|
135
93
|
- LICENSE.txt
|
@@ -144,27 +102,27 @@ files:
|
|
144
102
|
- lib/algolia/protocol.rb
|
145
103
|
- lib/algoliasearch.rb
|
146
104
|
homepage: http://github.com/algolia/algoliasearch-client-ruby
|
147
|
-
licenses:
|
105
|
+
licenses:
|
148
106
|
- MIT
|
149
107
|
metadata: {}
|
108
|
+
|
150
109
|
post_install_message:
|
151
110
|
rdoc_options: []
|
152
|
-
|
111
|
+
|
112
|
+
require_paths:
|
153
113
|
- lib
|
154
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
155
|
-
requirements:
|
156
|
-
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
requirements:
|
161
|
-
- - ! '>='
|
162
|
-
- !ruby/object:Gem::Version
|
163
|
-
version: '0'
|
114
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- *id002
|
117
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
118
|
+
requirements:
|
119
|
+
- *id002
|
164
120
|
requirements: []
|
121
|
+
|
165
122
|
rubyforge_project:
|
166
|
-
rubygems_version: 2.
|
123
|
+
rubygems_version: 2.0.3
|
167
124
|
signing_key:
|
168
125
|
specification_version: 4
|
169
126
|
summary: A simple Ruby client for the algolia.com REST API
|
170
127
|
test_files: []
|
128
|
+
|