elastics-client 1.0.4 → 1.0.5
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/VERSION +1 -1
- data/lib/{elastics.rb → elastics-client.rb} +0 -1
- data/lib/tasks.rake +2 -12
- metadata +3 -5
- data/lib/elastics/deprecation.rb +0 -153
- data/lib/elastics/rails.rb +0 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.5
|
data/lib/tasks.rake
CHANGED
@@ -1,18 +1,8 @@
|
|
1
|
-
require 'elastics'
|
1
|
+
require 'elastics-client'
|
2
2
|
|
3
3
|
env = defined?(Rails) ? :environment : []
|
4
4
|
|
5
|
-
namespace :
|
6
|
-
|
7
|
-
# deprecated tasks
|
8
|
-
task(:create_indices => env) do
|
9
|
-
Elastics::Deprecation.warn 'flex:create_indices', 'elastics:index:create', nil
|
10
|
-
Elastics::Tasks.new.create_indices
|
11
|
-
end
|
12
|
-
task(:delete_indices => env) do
|
13
|
-
Elastics::Deprecation.warn 'flex:delete_indices', 'elastics:index:delete', nil
|
14
|
-
Elastics::Tasks.new.delete_indices
|
15
|
-
end
|
5
|
+
namespace :elastics do
|
16
6
|
|
17
7
|
namespace :index do
|
18
8
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elastics-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-08-
|
12
|
+
date: 2013-08-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: multi_json
|
@@ -75,7 +75,7 @@ files:
|
|
75
75
|
- README.md
|
76
76
|
- VERSION
|
77
77
|
- elastics-client.gemspec
|
78
|
-
- lib/elastics.rb
|
78
|
+
- lib/elastics-client.rb
|
79
79
|
- lib/elastics/api_stubs.rb
|
80
80
|
- lib/elastics/api_templates/cluster_api.yml
|
81
81
|
- lib/elastics/api_templates/core_api.yml
|
@@ -85,7 +85,6 @@ files:
|
|
85
85
|
- lib/elastics/class_proxy/templates/doc.rb
|
86
86
|
- lib/elastics/class_proxy/templates/search.rb
|
87
87
|
- lib/elastics/configuration.rb
|
88
|
-
- lib/elastics/deprecation.rb
|
89
88
|
- lib/elastics/errors.rb
|
90
89
|
- lib/elastics/http_clients/base.rb
|
91
90
|
- lib/elastics/http_clients/loader.rb
|
@@ -93,7 +92,6 @@ files:
|
|
93
92
|
- lib/elastics/http_clients/rest_client.rb
|
94
93
|
- lib/elastics/logger.rb
|
95
94
|
- lib/elastics/prog_bar.rb
|
96
|
-
- lib/elastics/rails.rb
|
97
95
|
- lib/elastics/result.rb
|
98
96
|
- lib/elastics/result/bulk.rb
|
99
97
|
- lib/elastics/result/document.rb
|
data/lib/elastics/deprecation.rb
DELETED
@@ -1,153 +0,0 @@
|
|
1
|
-
module Elastics
|
2
|
-
|
3
|
-
module Deprecation
|
4
|
-
|
5
|
-
extend self
|
6
|
-
|
7
|
-
def warn(old, new, called=1)
|
8
|
-
message = "#{old} is deprecated in favour of #{new}, and will be removed in a next version. Please, read the upgrade notes at http://elastics.github.io/elastics/doc/7-Tutorials/2-Migrate-from-0.x.html. "
|
9
|
-
message << "(called at: #{caller[called]})" if called
|
10
|
-
Conf.logger.warn message
|
11
|
-
end
|
12
|
-
|
13
|
-
module Module
|
14
|
-
def extended(obj)
|
15
|
-
Deprecation.warn(self, self::NEW_MODULE, 2)
|
16
|
-
obj.extend self::NEW_MODULE
|
17
|
-
end
|
18
|
-
def included(base)
|
19
|
-
Deprecation.warn(self, self::NEW_MODULE, 2)
|
20
|
-
base.send :include, self::NEW_MODULE
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
end
|
25
|
-
|
26
|
-
### Deprecation of Flex methods ###
|
27
|
-
|
28
|
-
def info(*names)
|
29
|
-
Deprecation.warn 'Flex.info', 'Elastics.doc'
|
30
|
-
doc *names
|
31
|
-
end
|
32
|
-
|
33
|
-
def process_bulk(options={})
|
34
|
-
Deprecation.warn 'Flex.process_bulk(:collection => collection)', 'Elastics.post_bulk_collection(collection, options)'
|
35
|
-
post_bulk_collection(options.delete(:collection), options)
|
36
|
-
end
|
37
|
-
|
38
|
-
def import_collection(collection, options={})
|
39
|
-
Deprecation.warn 'Flex.import_collection', 'Elastics.post_bulk_collection'
|
40
|
-
post_bulk_collection(collection, options.merge(:action => 'index'))
|
41
|
-
end
|
42
|
-
|
43
|
-
def delete_collection(collection, options={})
|
44
|
-
Deprecation.warn 'Flex.delete_collection(collection)', 'Elastics.post_bulk_collection(collection, :action => "delete")'
|
45
|
-
post_bulk_collection(collection, options.merge(:action => 'delete'))
|
46
|
-
end
|
47
|
-
|
48
|
-
def bulk(*vars)
|
49
|
-
Deprecation.warn 'Flex.bulk(:lines => lines_bulk_string)', 'Elastics.post_bulk_string(:bulk_string => lines_bulk_string)'
|
50
|
-
vars = Vars.new(*vars)
|
51
|
-
post_bulk_string(:bulk_string => vars[:lines])
|
52
|
-
end
|
53
|
-
|
54
|
-
|
55
|
-
### Deprecation of Configuration methods ###
|
56
|
-
|
57
|
-
Configuration.instance_eval do
|
58
|
-
# temprary deprecation warnings
|
59
|
-
def base_uri
|
60
|
-
Deprecation.warn 'Flex::Configuration.base_uri', 'Elastics::Configuration.http_client.base_uri'
|
61
|
-
http_client.base_uri
|
62
|
-
end
|
63
|
-
def base_uri=(val)
|
64
|
-
Deprecation.warn 'Flex::Configuration.base_uri=', 'Elastics::Configuration.http_client.base_uri='
|
65
|
-
http_client.base_uri = val
|
66
|
-
end
|
67
|
-
def http_client_options
|
68
|
-
Deprecation.warn 'Flex::Configuration.http_client_options', 'Elastics::Configuration.http_client.options'
|
69
|
-
http_client.options
|
70
|
-
end
|
71
|
-
def http_client_options=(val)
|
72
|
-
Deprecation.warn 'Flex::Configuration.http_client_options=', 'Elastics::Configuration.http_client.options='
|
73
|
-
http_client.options = val
|
74
|
-
end
|
75
|
-
def raise_proc
|
76
|
-
Deprecation.warn 'Flex::Configuration.raise_proc', 'Elastics::Configuration.http_client.raise_proc'
|
77
|
-
http_client.raise_proc
|
78
|
-
end
|
79
|
-
def raise_proc=(val)
|
80
|
-
Deprecation.warn 'Flex::Configuration.raise_proc=', 'Elastics::Configuration.http_client.raise_proc='
|
81
|
-
http_client.raise_proc = val
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
|
-
|
86
|
-
class Variables
|
87
|
-
def add(*hashes)
|
88
|
-
Deprecation.warn 'Flex::Variables#add', 'Elastics::Variables#deep_merge!'
|
89
|
-
replace deep_merge(*hashes)
|
90
|
-
end
|
91
|
-
end
|
92
|
-
|
93
|
-
|
94
|
-
module Struct::Mergeable
|
95
|
-
def add(*hashes)
|
96
|
-
Deprecation.warn 'Flex::Variables#add', 'Variables#deep_merge!'
|
97
|
-
replace deep_merge(*hashes)
|
98
|
-
end
|
99
|
-
end
|
100
|
-
|
101
|
-
|
102
|
-
module Loader
|
103
|
-
NEW_MODULE = Templates
|
104
|
-
extend Deprecation::Module
|
105
|
-
end
|
106
|
-
|
107
|
-
|
108
|
-
module ClassProxy::Loader
|
109
|
-
NEW_MODULE = ClassProxy::Templates
|
110
|
-
extend Deprecation::Module
|
111
|
-
end
|
112
|
-
|
113
|
-
|
114
|
-
module ClassProxy::Templates
|
115
|
-
module Doc
|
116
|
-
def info(*names)
|
117
|
-
Deprecation.warn 'flex.info', 'elastics.doc'
|
118
|
-
doc *names
|
119
|
-
end
|
120
|
-
end
|
121
|
-
end
|
122
|
-
|
123
|
-
|
124
|
-
module Result::Collection
|
125
|
-
NEW_MODULE = Struct::Paginable
|
126
|
-
extend Deprecation::Module
|
127
|
-
end
|
128
|
-
|
129
|
-
|
130
|
-
module Model
|
131
|
-
def self.included(base)
|
132
|
-
if defined?(Flex::ModelIndexer)
|
133
|
-
Deprecation.warn 'Flex::Model', 'Elastics::ModelIndexer'
|
134
|
-
base.send :include, Elastics::ModelIndexer
|
135
|
-
else
|
136
|
-
raise NotImplementedError, %(Elastics does not include "Flex::Model" anymore. Please, require the "elastics-models" gem, and include "Elastics::ModelIndexer" instead.)
|
137
|
-
end
|
138
|
-
end
|
139
|
-
end
|
140
|
-
|
141
|
-
|
142
|
-
module RelatedModel
|
143
|
-
def self.included(base)
|
144
|
-
if defined?(Flex::ModelSyncer)
|
145
|
-
Deprecation.warn 'Flex::RelatedModel', 'Elastics::ModelSyncer'
|
146
|
-
base.send :include, Elastics::ModelSyncer
|
147
|
-
else
|
148
|
-
raise NotImplementedError, %(Elastics does not include "Flex::RelatedModel" anymore. Please, require the "elastics-models" gem, and include "Elastics::ModelSyncer" instead.)
|
149
|
-
end
|
150
|
-
end
|
151
|
-
end
|
152
|
-
|
153
|
-
end
|
data/lib/elastics/rails.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
raise NotImplementedError, %(The "flex/rails" file has been replaced by the "elastics-rails" gem. Please, use "elastics-rails" in place of "flex" in Rails applications (change "gem 'flex', require => 'flex/rails'" to "gem 'elastics-rails'" in your Gemfile). Please, read the upgrade notes at http://elastics.github.io/elastics/doc/7-Tutorials/2-Migrate-from-0.x.html.)
|