k_builder 0.0.57 → 0.0.58

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: 85fabea0178e317cd8bd8658d91b8813a143e48a8af8710465f5531cfba00535
4
- data.tar.gz: b86a69632dac4f08256af550addfea622cd78d26dec7b92e5801f087bd917da7
3
+ metadata.gz: f173e365f4bece5981d87548e67b32f9748e2ae8438d2d3bb54c121de957ec87
4
+ data.tar.gz: 3d2c0d23e74b0049a112f8e175fa6dce05a1afad90b80f77a63f82d3231c772a
5
5
  SHA512:
6
- metadata.gz: e23dfcad31466228dca0ada1a183ff422878a0d5893358f3561fb545748c5a91f1b1e6ed123f5bae2d1117b72c4605cfc08e68c7c2993fb86df0387a2abe7325
7
- data.tar.gz: 8c563d0d7aebb402540852839b55e14c639c1a451e837345b3913f72f6674a3db894089a966d107cc80b3d65ea1c3f720d3716e278bfeac4397c3231dca5c141
6
+ metadata.gz: 63901b9242e0933f4d6b639fbdbba2212b5f37d614b1cf43cf7ace40d97560bd0afb47cba1879c4e2ba9d923f52c12f5456ce03c734a77d63472977adc996184
7
+ data.tar.gz: eec21944c6e4d9cc64f2fa841ecbe1c655f14146626e04152b9ad152824b19f0a1d7450346781aaba1f0d4994649d99faa00ea39a5f40714a1df143b0adbc22a
@@ -8,6 +8,8 @@ module KBuilder
8
8
  # Setter methods (are NOT fluent) can be created as needed
9
9
  # these methods would not be prefixed with the set_
10
10
  class BaseBuilder
11
+ include KLog::Logging
12
+
11
13
  attr_reader :configuration
12
14
 
13
15
  attr_accessor :target_folders
@@ -57,6 +59,17 @@ module KBuilder
57
59
  }
58
60
  end
59
61
 
62
+ def debug
63
+ log.subheading 'kbuilder'
64
+
65
+ target_folders.debug(title: 'target_folders')
66
+
67
+ log.info ''
68
+
69
+ template_folders.debug(title: 'template folders (search order)')
70
+ ''
71
+ end
72
+
60
73
  # ----------------------------------------------------------------------
61
74
  # Fluent interface
62
75
  # ----------------------------------------------------------------------
@@ -92,6 +105,7 @@ module KBuilder
92
105
 
93
106
  # Prettier needs to work with the original file name
94
107
  run_prettier file if opts.key?(:pretty)
108
+ # Need support for rubocop -a
95
109
 
96
110
  self
97
111
  end
@@ -234,9 +248,19 @@ module KBuilder
234
248
 
235
249
  return unless opts[:content_file]
236
250
 
237
- cf = opts[:content_file]
251
+ # NOTE: when using content file, you still want to search for it in the template folders, I THINK?
252
+ cf = find_template_file(opts[:content_file])
253
+
254
+ return "content not found: #{opts[:content_file]}" if cf.nil?
255
+
256
+ # cf = opts[:content_file]
257
+
258
+ # unless File.exist?(cf)
259
+ # cf_from_template_folders = find_template_file(cf)
260
+ # return "Content not found: #{File.expand_path(cf)}" unless File.exist?(cf_from_template_folders)
238
261
 
239
- return "Content not found: #{File.expand_path(cf)}" unless File.exist?(cf)
262
+ # cf = cf_from_template_folders
263
+ # end
240
264
 
241
265
  File.read(cf)
242
266
  end
@@ -298,6 +322,8 @@ module KBuilder
298
322
 
299
323
  puts build_command
300
324
 
325
+ # need to support the fork process options as I was not able to run
326
+ # k_builder_watch -n because it hid all the following output
301
327
  system(build_command)
302
328
  end
303
329
  alias rc run_command
@@ -48,25 +48,15 @@ module KBuilder
48
48
  @template_folders = orig.template_folders.clone
49
49
  end
50
50
 
51
- # rubocop:disable Metrics/AbcSize
52
51
  def debug
53
52
  log.subheading 'kbuilder base configuration'
54
53
 
55
- log.section_heading 'target_folders'
56
- target_folders.folders.each_key do |key|
57
- folder = target_folders.folders[key]
58
- log.kv key.to_s, folder
59
- end
60
- log.info ''
54
+ target_folders.debug(title: 'target_folders')
61
55
 
62
- log.section_heading 'template folders (search order)'
56
+ log.info ''
63
57
 
64
- template_folders.ordered_keys.each do |key|
65
- folder = template_folders.folders[key]
66
- log.kv key.to_s, folder
67
- end
58
+ template_folders.debug(title: 'template folders (search order)')
68
59
  ''
69
60
  end
70
- # rubocop:enable Metrics/AbcSize
71
61
  end
72
62
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module KBuilder
4
- VERSION = '0.0.57'
4
+ VERSION = '0.0.58'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: k_builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.57
4
+ version: 0.0.58
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Cruwys
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-04-19 00:00:00.000000000 Z
11
+ date: 2021-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: handlebars-helpers