bookbindery 10.1.16 → 10.1.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bookbinder.gemspec +2 -3
- data/template_app/Gemfile +2 -3
- data/template_app/Gemfile.lock +22 -26
- data/template_app/lib/search/handler.rb +8 -3
- data/template_app/lib/search/query.rb +11 -3
- data/template_app/search-results.html.erb +3 -0
- metadata +3 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 47e765188260d8e1a4b9c0cd1792f18a4189727231ecf254319c0e7c2449d90f
|
4
|
+
data.tar.gz: 0e14f5c5444cece84358974458e573bbbdc216e6fc204f5dd49c27fe24a8dc4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51cbee0bd5603c8dc5d540f26d99d19b316fbe0f5b8ff85bb6d06ba269e9f99cc98812af2cd5e7205f00ca20ea416787a243177c5a7043d1c60b94b9bb23df7c
|
7
|
+
data.tar.gz: da68052ef9937e89e97c098f5443dcaf9255e3b4ab938263e07aeefe3b4e0c7fc059b78c475b3804ed623eee058e102fa24bea3f23b6286c1a9fbf316173bdd4
|
data/bookbinder.gemspec
CHANGED
@@ -2,10 +2,10 @@ require 'base64'
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = 'bookbindery'
|
5
|
-
s.version = '10.1.
|
5
|
+
s.version = '10.1.18'
|
6
6
|
s.summary = 'Markdown to Rackup application documentation generator'
|
7
7
|
s.description = 'A command line utility to be run in Book repositories to stitch together their constituent Markdown repos into a static-HTML-serving application'
|
8
|
-
s.authors = ['Mike Grafton', 'Lucas Marks', 'Gavin Morgan', 'Nikhil Gajwani', 'Dan Wendorf', 'Brenda Chan', 'Matthew Boedicker', 'Andrew Bruce', 'Frank Kotsianas', 'Elena Sharma', 'Christa Hartsock', 'Michael Trestman', 'Alpha Chen', 'Sarah McAlear', 'Gregg Van Hove', 'Jess B Heron',
|
8
|
+
s.authors = ['Mike Grafton', 'Lucas Marks', 'Gavin Morgan', 'Nikhil Gajwani', 'Dan Wendorf', 'Brenda Chan', 'Matthew Boedicker', 'Andrew Bruce', 'Frank Kotsianas', 'Elena Sharma', 'Christa Hartsock', 'Michael Trestman', 'Alpha Chen', 'Sarah McAlear', 'Gregg Van Hove', 'Jess B Heron', 'Rajan Agaskar', 'Max Hufnagel']
|
9
9
|
s.email = Base64.decode64('Z21vcmdhbkBnb3Bpdm90YWwuY29t') # Gavin's
|
10
10
|
|
11
11
|
s.files = Dir['lib/**/*'] + Dir['template_app/**/*'] + Dir['master_middleman/**/*'] + Dir['install_bin/bookbinder'] + Dir['bookbinder.gemspec']
|
@@ -25,7 +25,6 @@ Gem::Specification.new do |s|
|
|
25
25
|
s.add_runtime_dependency 'css_parser'
|
26
26
|
s.add_runtime_dependency 'puma'
|
27
27
|
s.add_runtime_dependency 'rack-rewrite'
|
28
|
-
s.add_runtime_dependency 'therubyracer'
|
29
28
|
s.add_runtime_dependency 'git', '~> 1.2.8'
|
30
29
|
s.add_runtime_dependency 'nokogiri', ['1.10.1']
|
31
30
|
s.add_runtime_dependency 'thor', ['0.19.1']
|
data/template_app/Gemfile
CHANGED
@@ -1,11 +1,10 @@
|
|
1
1
|
source 'http://rubygems.org'
|
2
2
|
|
3
|
-
ruby '~> 2.
|
3
|
+
ruby '~> 2.6.7'
|
4
4
|
|
5
5
|
gem 'rack'
|
6
6
|
gem 'rack-rewrite'
|
7
7
|
gem 'puma'
|
8
|
-
gem 'therubyracer'
|
9
8
|
gem 'sendgrid-ruby', '< 3.0'
|
10
|
-
gem 'elasticsearch'
|
9
|
+
gem 'elasticsearch'
|
11
10
|
gem 'mimemagic', '~> 0.3.7'
|
data/template_app/Gemfile.lock
CHANGED
@@ -1,55 +1,51 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
elasticsearch (
|
5
|
-
elasticsearch-api (=
|
6
|
-
elasticsearch-transport (=
|
7
|
-
elasticsearch-api (
|
4
|
+
elasticsearch (7.5.0)
|
5
|
+
elasticsearch-api (= 7.5.0)
|
6
|
+
elasticsearch-transport (= 7.5.0)
|
7
|
+
elasticsearch-api (7.5.0)
|
8
8
|
multi_json
|
9
|
-
elasticsearch-transport (
|
10
|
-
faraday
|
9
|
+
elasticsearch-transport (7.5.0)
|
10
|
+
faraday (>= 0.14, < 1)
|
11
11
|
multi_json
|
12
|
-
faraday (0.
|
12
|
+
faraday (0.17.4)
|
13
13
|
multipart-post (>= 1.2, < 3)
|
14
|
-
|
15
|
-
mimemagic (0.3.9)
|
14
|
+
mimemagic (0.3.10)
|
16
15
|
nokogiri (~> 1)
|
17
16
|
rake
|
18
|
-
mini_portile2 (2.
|
19
|
-
multi_json (1.
|
20
|
-
multipart-post (2.
|
21
|
-
|
22
|
-
|
17
|
+
mini_portile2 (2.8.0)
|
18
|
+
multi_json (1.15.0)
|
19
|
+
multipart-post (2.1.1)
|
20
|
+
nio4r (2.5.8)
|
21
|
+
nokogiri (1.13.3)
|
22
|
+
mini_portile2 (~> 2.8.0)
|
23
23
|
racc (~> 1.4)
|
24
|
-
puma (
|
25
|
-
|
26
|
-
|
24
|
+
puma (5.6.2)
|
25
|
+
nio4r (~> 2.0)
|
26
|
+
racc (1.6.0)
|
27
|
+
rack (2.2.3)
|
27
28
|
rack-rewrite (1.5.1)
|
28
|
-
rake (13.0.
|
29
|
-
ref (2.0.0)
|
29
|
+
rake (13.0.6)
|
30
30
|
sendgrid-ruby (1.1.6)
|
31
31
|
faraday (~> 0.9)
|
32
32
|
mimemagic
|
33
33
|
smtpapi (~> 0.1)
|
34
34
|
smtpapi (0.1.0)
|
35
|
-
therubyracer (0.12.2)
|
36
|
-
libv8 (~> 3.16.14.0)
|
37
|
-
ref
|
38
35
|
|
39
36
|
PLATFORMS
|
40
37
|
ruby
|
41
38
|
|
42
39
|
DEPENDENCIES
|
43
|
-
elasticsearch
|
40
|
+
elasticsearch
|
44
41
|
mimemagic (~> 0.3.7)
|
45
42
|
puma
|
46
43
|
rack
|
47
44
|
rack-rewrite
|
48
45
|
sendgrid-ruby (< 3.0)
|
49
|
-
therubyracer
|
50
46
|
|
51
47
|
RUBY VERSION
|
52
|
-
ruby 2.
|
48
|
+
ruby 2.6.7p197
|
53
49
|
|
54
50
|
BUNDLED WITH
|
55
|
-
1.17.
|
51
|
+
1.17.2
|
@@ -15,6 +15,12 @@ module Bookbinder
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def call(request_env)
|
18
|
+
unless elasticsearch_url
|
19
|
+
puts "Configuration Warning: ElasticSearch URL not configured"
|
20
|
+
query = Query.empty_query('Search is currently disabled. Please try again later')
|
21
|
+
return [200, {'Content-Type' => 'text/html'}, [renderer.render_results(query)]]
|
22
|
+
end
|
23
|
+
|
18
24
|
query = Query.new(extract_query_params(request_env['QUERY_STRING']))
|
19
25
|
query.get_results(client_class.new(url: elasticsearch_url))
|
20
26
|
|
@@ -41,8 +47,6 @@ module Bookbinder
|
|
41
47
|
|
42
48
|
searchly = get_searchly(services_hash)
|
43
49
|
return searchly if searchly
|
44
|
-
|
45
|
-
raise 'No Elasticsearch configured!'
|
46
50
|
end
|
47
51
|
|
48
52
|
private
|
@@ -50,7 +54,8 @@ module Bookbinder
|
|
50
54
|
attr_reader :renderer, :client_class, :environment
|
51
55
|
|
52
56
|
def elasticsearch_url
|
53
|
-
|
57
|
+
vcap_services = environment['VCAP_SERVICES']
|
58
|
+
@elasticsearch_url ||= vcap_services ? extract_elasticsearch_url(JSON.parse(vcap_services)) : nil
|
54
59
|
end
|
55
60
|
|
56
61
|
def get_user_provided(services_hash)
|
@@ -5,9 +5,17 @@ require_relative 'hit'
|
|
5
5
|
module Bookbinder
|
6
6
|
module Search
|
7
7
|
class Query
|
8
|
-
|
8
|
+
attr_accessor :result_count, :message
|
9
|
+
attr_reader :search_term, :product_name, :product_version, :page_number, :result_list, :last_page, :page_window
|
9
10
|
|
10
|
-
def
|
11
|
+
def self.empty_query(message)
|
12
|
+
new.tap do |q|
|
13
|
+
q.result_count = 0
|
14
|
+
q.message = message
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def initialize(params={})
|
11
19
|
@search_term = params.fetch('q', '')
|
12
20
|
@product_name = params.fetch('product_name', nil)
|
13
21
|
@product_version = @product_name && params.fetch('product_version', nil)
|
@@ -46,7 +54,7 @@ module Bookbinder
|
|
46
54
|
@last_page = 1
|
47
55
|
else
|
48
56
|
results = elasticsearch_client.search index: 'searching', body: query_options
|
49
|
-
@result_count = results['hits']['total']
|
57
|
+
@result_count = results['hits']['total']['value']
|
50
58
|
@result_list = results['hits']['hits'].map { |h| Hit.new(h) }
|
51
59
|
@last_page = (result_count / 10.0).ceil
|
52
60
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bookbindery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 10.1.
|
4
|
+
version: 10.1.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Grafton
|
@@ -21,10 +21,11 @@ authors:
|
|
21
21
|
- Gregg Van Hove
|
22
22
|
- Jess B Heron
|
23
23
|
- Rajan Agaskar
|
24
|
+
- Max Hufnagel
|
24
25
|
autorequire:
|
25
26
|
bindir: install_bin
|
26
27
|
cert_chain: []
|
27
|
-
date:
|
28
|
+
date: 2022-02-27 00:00:00.000000000 Z
|
28
29
|
dependencies:
|
29
30
|
- !ruby/object:Gem::Dependency
|
30
31
|
name: fog-aws
|
@@ -166,20 +167,6 @@ dependencies:
|
|
166
167
|
- - ">="
|
167
168
|
- !ruby/object:Gem::Version
|
168
169
|
version: '0'
|
169
|
-
- !ruby/object:Gem::Dependency
|
170
|
-
name: therubyracer
|
171
|
-
requirement: !ruby/object:Gem::Requirement
|
172
|
-
requirements:
|
173
|
-
- - ">="
|
174
|
-
- !ruby/object:Gem::Version
|
175
|
-
version: '0'
|
176
|
-
type: :runtime
|
177
|
-
prerelease: false
|
178
|
-
version_requirements: !ruby/object:Gem::Requirement
|
179
|
-
requirements:
|
180
|
-
- - ">="
|
181
|
-
- !ruby/object:Gem::Version
|
182
|
-
version: '0'
|
183
170
|
- !ruby/object:Gem::Dependency
|
184
171
|
name: git
|
185
172
|
requirement: !ruby/object:Gem::Requirement
|