bhook 0.1.2 → 0.1.3

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: e294643cd33777109cba77c7582e4d145f300f8d3960c4dbf5862f616a6a6929
4
- data.tar.gz: 4031364646363638654b1b98a9c8d026c2d8c6ac368554315853701d918bb188
3
+ metadata.gz: b4ef3049d516cd681eac21ac34923cf9cdd292cbb79ca238d7228e1a18a9a323
4
+ data.tar.gz: 942754c6193f0e19d1b2dc028aa13e9033e7d2e4f5a01e3edb76248ce2d1e3f6
5
5
  SHA512:
6
- metadata.gz: 11a403217488e651e2627f053e7de1658a831d2def49679b1fb767bb35885008431cc37c333fd37e4b97b564289af9f6a573fb074b40e48dccb8c6e46e42bfd1
7
- data.tar.gz: 16336203e9e8c511361cd529bae17dcb845ba8bb654a63719b378e66ceda6188b4ac7854ec98fa0057afeabd88cc385c19c0669718a1e6613836fac4c8b69180
6
+ metadata.gz: cb421ebe8b1ea40155b8fec5139d249b99c99bdc17f44587b07d4af8824a2519ca3edba0134f1029475df2be577da5f140149a0a11d7ea05273de23734c2fcc3
7
+ data.tar.gz: 9563f8a81b32da179e8f4582f36dfa619076237fe64880fdd3047feafc7f89826bc8098e884ce8ef3c59afc35c155d882d709a74d9e41cf54936b0af2fd21862
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bhook (0.1.2)
4
+ bhook (0.1.3)
5
5
  git (~> 1.10)
6
6
  kramdown (~> 2.3)
7
7
  listen (~> 3.7)
data/bin/bhook CHANGED
@@ -19,4 +19,15 @@ if args.generate_theme
19
19
  end
20
20
 
21
21
  workspace = Bhook::Workspace.new(args.source, args.output, args.theme)
22
+
23
+ if args.benchmark
24
+ require 'benchmark'
25
+ n = 10
26
+ Benchmark.bmbm do |bench|
27
+ Bhook::L.level = Logger::WARN
28
+ bench.report("Generate HTML #{n} times") { n.times { workspace.process! } }
29
+ end
30
+ exit
31
+ end
32
+
22
33
  args.watch ? workspace.watch! : workspace.process!
@@ -1,9 +1,14 @@
1
+ # typed: false
2
+ # frozen_string_literal: true
3
+
1
4
  module Bhook
2
5
  class ArgsParser
3
- Options = Struct.new(:source, :output, :watch, :verbose, :theme, :generate_theme)
6
+ extend T::Sig
7
+
8
+ Options = Struct.new(:source, :output, :watch, :verbose, :theme, :generate_theme, :benchmark)
4
9
 
5
10
  def initialize(argv)
6
- @args = Options.new(nil, nil, false, false, nil, nil)
11
+ @args = Options.new(nil, nil, false, false, nil, nil, false)
7
12
  @argv = argv.clone
8
13
  @opt_parser = build_opt_parser
9
14
  end
@@ -74,6 +79,12 @@ module Bhook
74
79
  @args.generate_theme = path
75
80
  end
76
81
 
82
+ opts.on("--benchmark",
83
+ FalseClass,
84
+ "Run a performance benchmark for the specified source") do
85
+ @args.benchmark = true
86
+ end
87
+
77
88
  opts.on("-h", "--help", "Prints this help") do
78
89
  puts opts
79
90
  exit
@@ -20,7 +20,8 @@ module Bhook
20
20
 
21
21
  sig { params(theme: Theme).void }
22
22
  def write!(theme)
23
- FileUtils.mkdir_p(@out_path, verbose: true)
23
+ FileUtils.mkdir_p(@out_path)
24
+ L.debug("mkdir: #{@out_path}")
24
25
  @sub_dirs.each { |dir| dir.write!(theme) }
25
26
  @md_files.map do |file|
26
27
  Thread.new { file.write!(theme) }
data/lib/bhook/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Bhook
5
- VERSION = '0.1.2'
5
+ VERSION = '0.1.3'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bhook
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sidu Ponnappa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-15 00:00:00.000000000 Z
11
+ date: 2022-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: git