wax_tasks 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wax_tasks.rb +2 -2
- data/lib/wax_tasks/collection.rb +1 -1
- data/lib/wax_tasks/task_runner.rb +8 -4
- data/spec/spec_helper.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d88624cfe6327eb5449dda2246712718f4bdfb2fea155e12e1593b6a5e10af08
|
4
|
+
data.tar.gz: d6aa6846dedcbaa295d4ae3f909c1f22fa68c55db1524b7aea1e7a958ef241ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3c8dd46e8631bbff1bcdb2792255882ac37cb1afd4b8ed9e193e24e0625c934eeda807d56417832df1fbfbdc9dec435df02df5058c3907794761bf704734fcc
|
7
|
+
data.tar.gz: 954bbf0a5a9561ad4b74bf751de5e45e6cc5ec7de21a5fd82720789483470c29f1efc161fa62af1e69c2b4b8479956f82a4acd73277d3efd42bf36cfb0a2ef97
|
data/lib/wax_tasks.rb
CHANGED
@@ -29,9 +29,9 @@ module WaxTasks
|
|
29
29
|
# @return [String] The path to load Jekyll site config
|
30
30
|
DEFAULT_CONFIG = '_config.yml'.freeze
|
31
31
|
# @return [String] The path to write WaxTasks::LunrIndex
|
32
|
-
LUNR_INDEX_PATH = 'js/
|
32
|
+
LUNR_INDEX_PATH = 'js/lunr-index.json'.freeze
|
33
33
|
# @return [String] The path to write default LunrUI
|
34
|
-
LUNR_UI_PATH = 'js/
|
34
|
+
LUNR_UI_PATH = 'js/lunr-ui.js'.freeze
|
35
35
|
# @return [String] The path to the compiled Jekyll site
|
36
36
|
SITE_DIR = './_site'.freeze
|
37
37
|
end
|
data/lib/wax_tasks/collection.rb
CHANGED
@@ -68,7 +68,7 @@ module WaxTasks
|
|
68
68
|
#
|
69
69
|
# @param generate_ui [Boolean] whether/not to generate a default lunr UI
|
70
70
|
# @return [Nil]
|
71
|
-
def lunr(generate_ui
|
71
|
+
def lunr(generate_ui: false)
|
72
72
|
lunr_collections = Utils.get_lunr_collections(@site)
|
73
73
|
lunr_collections.map! { |name| LunrCollection.new(name, @site) }
|
74
74
|
|
@@ -76,10 +76,14 @@ module WaxTasks
|
|
76
76
|
index_path = Utils.make_path(@site[:source_dir], LUNR_INDEX_PATH)
|
77
77
|
|
78
78
|
FileUtils.mkdir_p(File.dirname(index_path))
|
79
|
-
File.open(index_path, 'w') { |f| f.write(index
|
79
|
+
File.open(index_path, 'w') { |f| f.write(index) }
|
80
|
+
puts "Writing lunr search index to #{index_path}.".cyan
|
80
81
|
|
81
|
-
|
82
|
-
|
82
|
+
if generate_ui
|
83
|
+
ui_path = Utils.make_path(@site[:source_dir], LUNR_UI_PATH)
|
84
|
+
puts "Writing default lunr UI to #{ui_path}.".cyan
|
85
|
+
File.open(ui_path, 'w') { |f| f.write(index.default_ui) }
|
86
|
+
end
|
83
87
|
end
|
84
88
|
|
85
89
|
# Given an array of command line arguments `args`,
|
data/spec/spec_helper.rb
CHANGED
@@ -18,6 +18,6 @@ shared_context 'shared', :shared_context => :metadata do
|
|
18
18
|
let(:task_runner) { WaxTasks::TaskRunner.new }
|
19
19
|
let(:default_site) { task_runner.site }
|
20
20
|
let(:args) { default_site[:collections].map{ |c| c[0] } }
|
21
|
-
let(:index_path) {
|
22
|
-
let(:ui_path) {
|
21
|
+
let(:index_path) { WaxTasks::LUNR_INDEX_PATH }
|
22
|
+
let(:ui_path) { WaxTasks::LUNR_UI_PATH }
|
23
23
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wax_tasks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marii Nyrop
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-09-
|
11
|
+
date: 2018-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: html-proofer
|