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 +4 -4
- data/Gemfile.lock +1 -1
- data/bin/bhook +11 -0
- data/lib/bhook/args_parser.rb +13 -2
- data/lib/bhook/directory.rb +2 -1
- data/lib/bhook/version.rb +1 -1
- 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: b4ef3049d516cd681eac21ac34923cf9cdd292cbb79ca238d7228e1a18a9a323
|
4
|
+
data.tar.gz: 942754c6193f0e19d1b2dc028aa13e9033e7d2e4f5a01e3edb76248ce2d1e3f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb421ebe8b1ea40155b8fec5139d249b99c99bdc17f44587b07d4af8824a2519ca3edba0134f1029475df2be577da5f140149a0a11d7ea05273de23734c2fcc3
|
7
|
+
data.tar.gz: 9563f8a81b32da179e8f4582f36dfa619076237fe64880fdd3047feafc7f89826bc8098e884ce8ef3c59afc35c155d882d709a74d9e41cf54936b0af2fd21862
|
data/Gemfile.lock
CHANGED
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!
|
data/lib/bhook/args_parser.rb
CHANGED
@@ -1,9 +1,14 @@
|
|
1
|
+
# typed: false
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
1
4
|
module Bhook
|
2
5
|
class ArgsParser
|
3
|
-
|
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
|
data/lib/bhook/directory.rb
CHANGED
@@ -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
|
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
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.
|
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-
|
11
|
+
date: 2022-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: git
|