elastic-app-search 0.7.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.
@@ -0,0 +1,22 @@
1
+ module ConfigHelper
2
+ def ConfigHelper.get_as_api_key
3
+ ENV.fetch('AS_API_KEY', 'API_KEY')
4
+ end
5
+
6
+ def ConfigHelper.get_as_host_identifier
7
+ ENV['AS_ACCOUNT_HOST_KEY'] || ENV['AS_HOST_IDENTIFIER'] || 'ACCOUNT_HOST_KEY'
8
+ end
9
+
10
+ def ConfigHelper.get_as_api_endpoint
11
+ ENV.fetch('AS_API_ENDPOINT', nil)
12
+ end
13
+
14
+ def ConfigHelper.get_client_options(as_api_key, as_host_identifier, as_api_endpoint)
15
+ {
16
+ :api_key => as_api_key,
17
+ :host_identifier => as_host_identifier
18
+ }.tap do |opts|
19
+ opts[:api_endpoint] = as_api_endpoint unless as_api_endpoint.nil?
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,26 @@
1
+ require 'bundler/setup'
2
+ require 'rspec'
3
+ require 'webmock/rspec'
4
+ require 'awesome_print'
5
+ require 'elastic/app-search'
6
+ require 'config_helper'
7
+
8
+ WebMock.allow_net_connect!
9
+
10
+ RSpec.shared_context 'App Search Credentials' do
11
+ let(:as_api_key) { ConfigHelper.get_as_api_key }
12
+ # AS_ACCOUNT_HOST_KEY is deprecated
13
+ let(:as_host_identifier) { ConfigHelper.get_as_host_identifier }
14
+ let(:as_api_endpoint) { ConfigHelper.get_as_api_endpoint }
15
+ let(:client_options) do
16
+ ConfigHelper.get_client_options(as_api_key, as_host_identifier, as_api_endpoint)
17
+ end
18
+ end
19
+
20
+ RSpec.configure do |config|
21
+ # Run specs in random order to surface order dependencies. If you find an
22
+ # order dependency and want to debug it, you can fix the order by providing
23
+ # the seed, which is printed after each run.
24
+ # --seed 1234
25
+ config.order = 'random'
26
+ end
metadata ADDED
@@ -0,0 +1,151 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: elastic-app-search
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.7.0
5
+ platform: ruby
6
+ authors:
7
+ - Quin Hoxie
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-08-07 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: awesome_print
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.8'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.8'
27
+ - !ruby/object:Gem::Dependency
28
+ name: pry
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.11.3
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.11.3
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: webmock
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.3'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.3'
69
+ - !ruby/object:Gem::Dependency
70
+ name: jwt
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '1.5'
76
+ - - "<"
77
+ - !ruby/object:Gem::Version
78
+ version: '3.0'
79
+ type: :runtime
80
+ prerelease: false
81
+ version_requirements: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: '1.5'
86
+ - - "<"
87
+ - !ruby/object:Gem::Version
88
+ version: '3.0'
89
+ description: API client for accessing the Elastic App Search API with no dependencies.
90
+ email:
91
+ - support@elastic.co
92
+ executables: []
93
+ extensions: []
94
+ extra_rdoc_files: []
95
+ files:
96
+ - ".circleci/config.yml"
97
+ - ".gitignore"
98
+ - ".rspec"
99
+ - ".rubocop.yml"
100
+ - ".travis.yml"
101
+ - Gemfile
102
+ - LICENSE.txt
103
+ - NOTICE.txt
104
+ - README.md
105
+ - Rakefile
106
+ - elastic-app-search.gemspec
107
+ - lib/data/ca-bundle.crt
108
+ - lib/elastic/app-search.rb
109
+ - lib/elastic/app-search/client.rb
110
+ - lib/elastic/app-search/client/documents.rb
111
+ - lib/elastic/app-search/client/engines.rb
112
+ - lib/elastic/app-search/client/query_suggestion.rb
113
+ - lib/elastic/app-search/client/search.rb
114
+ - lib/elastic/app-search/client/search_settings.rb
115
+ - lib/elastic/app-search/exceptions.rb
116
+ - lib/elastic/app-search/request.rb
117
+ - lib/elastic/app-search/utils.rb
118
+ - lib/elastic/app-search/version.rb
119
+ - logo-app-search.png
120
+ - script/console
121
+ - spec/client_spec.rb
122
+ - spec/config_helper.rb
123
+ - spec/spec_helper.rb
124
+ homepage: https://github.com/elastic/app-search-ruby
125
+ licenses:
126
+ - Apache-2.0
127
+ metadata: {}
128
+ post_install_message:
129
+ rdoc_options: []
130
+ require_paths:
131
+ - lib
132
+ required_ruby_version: !ruby/object:Gem::Requirement
133
+ requirements:
134
+ - - ">="
135
+ - !ruby/object:Gem::Version
136
+ version: '0'
137
+ required_rubygems_version: !ruby/object:Gem::Requirement
138
+ requirements:
139
+ - - ">="
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
142
+ requirements: []
143
+ rubyforge_project:
144
+ rubygems_version: 2.5.2.3
145
+ signing_key:
146
+ specification_version: 4
147
+ summary: Official gem for accessing the Elastic App Search API
148
+ test_files:
149
+ - spec/client_spec.rb
150
+ - spec/config_helper.rb
151
+ - spec/spec_helper.rb