bookbindery 10.1.14 → 10.1.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/bookbinder.gemspec +5 -5
- data/lib/bookbinder/code_example_reader.rb +1 -1
- data/lib/bookbinder/preprocessing/preprocessor.rb +1 -1
- data/master_middleman/bookbinder_helpers.rb +4 -0
- data/master_middleman/source/stylesheets/partials/_default.scss +3 -1
- data/template_app/Gemfile +2 -2
- data/template_app/Gemfile.lock +27 -19
- 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 +24 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
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']
|
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
|
|
14
14
|
s.bindir = 'install_bin'
|
15
15
|
s.executable = 'bookbinder'
|
16
16
|
|
17
|
-
s.required_ruby_version = '>= 2.
|
17
|
+
s.required_ruby_version = '>= 2.3.3'
|
18
18
|
s.add_runtime_dependency 'fog-aws', ['~> 0.7.1']
|
19
19
|
s.add_runtime_dependency 'ansi', ['~> 1.4']
|
20
20
|
s.add_runtime_dependency 'middleman', ['4.1.10']
|
@@ -25,14 +25,14 @@ 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
|
-
s.add_runtime_dependency 'nokogiri', ['1.
|
29
|
+
s.add_runtime_dependency 'nokogiri', ['1.10.1']
|
31
30
|
s.add_runtime_dependency 'thor', ['0.19.1']
|
32
31
|
s.add_runtime_dependency 'elasticsearch'
|
33
32
|
s.add_runtime_dependency 'font-awesome-sass', ['4.7.0']
|
34
33
|
s.add_runtime_dependency 'middleman-sprockets'
|
35
34
|
s.add_runtime_dependency 'middleman-compass'
|
35
|
+
s.add_runtime_dependency 'sprockets', '3.7.2'
|
36
36
|
|
37
37
|
s.add_development_dependency 'license_finder'
|
38
38
|
s.add_development_dependency 'pry-byebug'
|
@@ -12,7 +12,7 @@ module Bookbinder
|
|
12
12
|
|
13
13
|
def preprocess(sections, *args)
|
14
14
|
sections.group_by { |section|
|
15
|
-
processes.detect
|
15
|
+
processes.detect(Proc.new { NullProcess.new }) { |process| process.applicable_to?(section) }
|
16
16
|
}.each do |process, grouped_sections|
|
17
17
|
process.preprocess(grouped_sections, *args)
|
18
18
|
end
|
data/template_app/Gemfile
CHANGED
data/template_app/Gemfile.lock
CHANGED
@@ -1,43 +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
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
14
|
+
mimemagic (0.3.10)
|
15
|
+
nokogiri (~> 1)
|
16
|
+
rake
|
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
|
+
racc (~> 1.4)
|
24
|
+
puma (5.6.2)
|
25
|
+
nio4r (~> 2.0)
|
26
|
+
racc (1.6.0)
|
27
|
+
rack (2.2.3)
|
20
28
|
rack-rewrite (1.5.1)
|
21
|
-
|
29
|
+
rake (13.0.6)
|
22
30
|
sendgrid-ruby (1.1.6)
|
23
31
|
faraday (~> 0.9)
|
24
32
|
mimemagic
|
25
33
|
smtpapi (~> 0.1)
|
26
34
|
smtpapi (0.1.0)
|
27
|
-
therubyracer (0.12.2)
|
28
|
-
libv8 (~> 3.16.14.0)
|
29
|
-
ref
|
30
35
|
|
31
36
|
PLATFORMS
|
32
37
|
ruby
|
33
38
|
|
34
39
|
DEPENDENCIES
|
35
40
|
elasticsearch
|
41
|
+
mimemagic (~> 0.3.7)
|
36
42
|
puma
|
37
43
|
rack
|
38
44
|
rack-rewrite
|
39
45
|
sendgrid-ruby (< 3.0)
|
40
|
-
|
46
|
+
|
47
|
+
RUBY VERSION
|
48
|
+
ruby 2.6.7p197
|
41
49
|
|
42
50
|
BUNDLED WITH
|
43
|
-
1.
|
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
|
-
|
24
|
+
- Max Hufnagel
|
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
|
@@ -200,14 +187,14 @@ dependencies:
|
|
200
187
|
requirements:
|
201
188
|
- - '='
|
202
189
|
- !ruby/object:Gem::Version
|
203
|
-
version: 1.
|
190
|
+
version: 1.10.1
|
204
191
|
type: :runtime
|
205
192
|
prerelease: false
|
206
193
|
version_requirements: !ruby/object:Gem::Requirement
|
207
194
|
requirements:
|
208
195
|
- - '='
|
209
196
|
- !ruby/object:Gem::Version
|
210
|
-
version: 1.
|
197
|
+
version: 1.10.1
|
211
198
|
- !ruby/object:Gem::Dependency
|
212
199
|
name: thor
|
213
200
|
requirement: !ruby/object:Gem::Requirement
|
@@ -278,6 +265,20 @@ dependencies:
|
|
278
265
|
- - ">="
|
279
266
|
- !ruby/object:Gem::Version
|
280
267
|
version: '0'
|
268
|
+
- !ruby/object:Gem::Dependency
|
269
|
+
name: sprockets
|
270
|
+
requirement: !ruby/object:Gem::Requirement
|
271
|
+
requirements:
|
272
|
+
- - '='
|
273
|
+
- !ruby/object:Gem::Version
|
274
|
+
version: 3.7.2
|
275
|
+
type: :runtime
|
276
|
+
prerelease: false
|
277
|
+
version_requirements: !ruby/object:Gem::Requirement
|
278
|
+
requirements:
|
279
|
+
- - '='
|
280
|
+
- !ruby/object:Gem::Version
|
281
|
+
version: 3.7.2
|
281
282
|
- !ruby/object:Gem::Dependency
|
282
283
|
name: license_finder
|
283
284
|
requirement: !ruby/object:Gem::Requirement
|
@@ -529,7 +530,7 @@ homepage: https://github.com/pivotal-cf/bookbinder
|
|
529
530
|
licenses:
|
530
531
|
- MIT
|
531
532
|
metadata: {}
|
532
|
-
post_install_message:
|
533
|
+
post_install_message:
|
533
534
|
rdoc_options: []
|
534
535
|
require_paths:
|
535
536
|
- lib
|
@@ -537,16 +538,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
537
538
|
requirements:
|
538
539
|
- - ">="
|
539
540
|
- !ruby/object:Gem::Version
|
540
|
-
version: 2.
|
541
|
+
version: 2.3.3
|
541
542
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
542
543
|
requirements:
|
543
544
|
- - ">="
|
544
545
|
- !ruby/object:Gem::Version
|
545
546
|
version: '0'
|
546
547
|
requirements: []
|
547
|
-
|
548
|
-
|
549
|
-
signing_key:
|
548
|
+
rubygems_version: 3.0.3
|
549
|
+
signing_key:
|
550
550
|
specification_version: 4
|
551
551
|
summary: Markdown to Rackup application documentation generator
|
552
552
|
test_files: []
|