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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6a9f379405599184347f73da048e52435aacd769de71046e617bcd9b44b0f760
4
- data.tar.gz: 3e9e07cda10a6063cb82a3b6af02ce2453ee561fa085baf9118f6c6ef4183a52
3
+ metadata.gz: d88624cfe6327eb5449dda2246712718f4bdfb2fea155e12e1593b6a5e10af08
4
+ data.tar.gz: d6aa6846dedcbaa295d4ae3f909c1f22fa68c55db1524b7aea1e7a958ef241ad
5
5
  SHA512:
6
- metadata.gz: 939570ab776be0b04c78665439e36254f0c1a2a6fb071383f439844be039167a84986ac2fa430c6865cb61be3f35d8e1fa539a90d0054719f538a4d15d1c5dd5
7
- data.tar.gz: b27e94c4c56e17b9298cfb5c612497c049890a3e91ec05ea8ba44d2401c9f7a5873e315fbb78d571bd0b708f0ade59db6b799b779d3b75ebc1923b5d37b23bdd
6
+ metadata.gz: b3c8dd46e8631bbff1bcdb2792255882ac37cb1afd4b8ed9e193e24e0625c934eeda807d56417832df1fbfbdc9dec435df02df5058c3907794761bf704734fcc
7
+ data.tar.gz: 954bbf0a5a9561ad4b74bf751de5e45e6cc5ec7de21a5fd82720789483470c29f1efc161fa62af1e69c2b4b8479956f82a4acd73277d3efd42bf36cfb0a2ef97
@@ -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/lunr_index.json'.freeze
32
+ LUNR_INDEX_PATH = 'js/lunr-index.json'.freeze
33
33
  # @return [String] The path to write default LunrUI
34
- LUNR_UI_PATH = 'js/lunr_ui.js'.freeze
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
@@ -28,7 +28,7 @@ module WaxTasks
28
28
  @config = collection_config
29
29
  @page_dir = Utils.make_path(@site[:source_dir],
30
30
  @site[:collections_dir],
31
- @name)
31
+ "_#{@name}")
32
32
  end
33
33
 
34
34
  # Finds the collection config within the site config
@@ -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 = false)
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.to_s) }
79
+ File.open(index_path, 'w') { |f| f.write(index) }
80
+ puts "Writing lunr search index to #{index_path}.".cyan
80
81
 
81
- ui_path = Utils.make_path(@site[:source_dir], LUNR_UI_PATH)
82
- File.open(ui_path, 'w') { |f| f.write(index.default_ui) } if generate_ui
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`,
@@ -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) { 'js/lunr_index.json' }
22
- let(:ui_path) { 'js/lunr_ui.js'}
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.1
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-19 00:00:00.000000000 Z
11
+ date: 2018-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: html-proofer