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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: bb06b8141b13aeb204196a540e8582da12347bd7
4
- data.tar.gz: 01377b10c9631096add837879cbb6c1e174b546f
2
+ SHA256:
3
+ metadata.gz: 47e765188260d8e1a4b9c0cd1792f18a4189727231ecf254319c0e7c2449d90f
4
+ data.tar.gz: 0e14f5c5444cece84358974458e573bbbdc216e6fc204f5dd49c27fe24a8dc4d
5
5
  SHA512:
6
- metadata.gz: a70e95c9e33691ee3ae4c5397c02d94c34399a6e6f591305fb9610ce5f0682e0b650bb302e36c048930af281b967a980d3b61376766215632120234bc8944e8b
7
- data.tar.gz: 199485cc23531dd469c623a1f90d71d88c86c7560929423a07579e4ddd7df134ea9091778a7d70dd79a14e5c9effe43367385f3591dec9e700a7e7a99b1cf23c
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.14'
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', "Rajan Agaskar"]
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.0.0'
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.8.2']
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'
@@ -77,7 +77,7 @@ module Bookbinder
77
77
  end
78
78
  }.
79
79
  map(&:first).
80
- detect ->{""} {|text| text}
80
+ detect(Proc.new {""}) {|text| text}
81
81
  end
82
82
 
83
83
  def pattern_for(marker)
@@ -12,7 +12,7 @@ module Bookbinder
12
12
 
13
13
  def preprocess(sections, *args)
14
14
  sections.group_by { |section|
15
- processes.detect ->{ NullProcess.new } { |process| process.applicable_to?(section) }
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
@@ -119,6 +119,10 @@ module Bookbinder
119
119
  current_page.data.title= args.join(' ')
120
120
  end
121
121
 
122
+ def set_title_no_spaces(*args)
123
+ current_page.data.title= args.join
124
+ end
125
+
122
126
  def product_info
123
127
  config[:product_info].fetch(template_key, {})
124
128
  end
@@ -116,7 +116,9 @@ ol {
116
116
  padding: 0 0 0 1.4em;
117
117
  }
118
118
  ul ul,
119
- ol ol {
119
+ ol ol,
120
+ ul ol,
121
+ ol ul {
120
122
  margin-top: 1em;
121
123
  padding-bottom: 0
122
124
  }
data/template_app/Gemfile CHANGED
@@ -1,10 +1,10 @@
1
1
  source 'http://rubygems.org'
2
2
 
3
- ruby '~> 2.3.0'
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
9
  gem 'elasticsearch'
10
+ gem 'mimemagic', '~> 0.3.7'
@@ -1,43 +1,51 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- elasticsearch (2.0.0)
5
- elasticsearch-api (= 2.0.0)
6
- elasticsearch-transport (= 2.0.0)
7
- elasticsearch-api (2.0.0)
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 (2.0.0)
10
- faraday
9
+ elasticsearch-transport (7.5.0)
10
+ faraday (>= 0.14, < 1)
11
11
  multi_json
12
- faraday (0.9.2)
12
+ faraday (0.17.4)
13
13
  multipart-post (>= 1.2, < 3)
14
- libv8 (3.16.14.15)
15
- mimemagic (0.3.2)
16
- multi_json (1.12.1)
17
- multipart-post (2.0.0)
18
- puma (3.6.0)
19
- rack (2.0.1)
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
- ref (2.0.0)
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
- therubyracer
46
+
47
+ RUBY VERSION
48
+ ruby 2.6.7p197
41
49
 
42
50
  BUNDLED WITH
43
- 1.12.5
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
- @elasticsearch_url ||= extract_elasticsearch_url(JSON.parse(environment['VCAP_SERVICES']))
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
- attr_reader :search_term, :product_name, :product_version, :page_number, :result_list, :result_count, :last_page, :page_window
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 initialize(params)
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
@@ -11,6 +11,9 @@ end
11
11
  %>
12
12
 
13
13
  <div class="search-results">
14
+ <% if message %>
15
+ <p><%= message %></p>
16
+ <% end %>
14
17
  <form method="get">
15
18
 
16
19
  <% unless product_name.nil? %>
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.14
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
- autorequire:
24
+ - Max Hufnagel
25
+ autorequire:
25
26
  bindir: install_bin
26
27
  cert_chain: []
27
- date: 2018-06-05 00:00:00.000000000 Z
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.8.2
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.8.2
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.0.0
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
- rubyforge_project:
548
- rubygems_version: 2.5.1
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: []