bhook 0.1.4 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +33 -1
- data/Gemfile.lock +29 -17
- data/README.md +10 -1
- data/Rakefile +22 -1
- data/bin/bhook +11 -6
- data/lib/bhook/args_parser.rb +47 -44
- data/lib/bhook/config.rb +43 -14
- data/lib/bhook/converter/html.rb +2 -4
- data/lib/bhook/directory.rb +14 -13
- data/lib/bhook/logger.rb +4 -3
- data/lib/bhook/md_file.rb +33 -19
- data/lib/bhook/theme/page.erb +10 -12
- data/lib/bhook/theme.rb +4 -2
- data/lib/bhook/theme_generator.rb +7 -5
- data/lib/bhook/version.rb +1 -1
- data/lib/bhook/workspace.rb +7 -6
- data/sorbet/rbi/gems/bhook.rbi +2 -1
- data/sorbet/rbi/gems/docile.rbi +36 -0
- data/sorbet/rbi/gems/git.rbi +1 -1
- data/sorbet/rbi/gems/kramdown.rbi +1 -1
- data/sorbet/rbi/gems/parallel.rbi +4 -1
- data/sorbet/rbi/gems/parser.rbi +1 -1
- data/sorbet/rbi/gems/regexp_parser.rbi +138 -120
- data/sorbet/rbi/gems/rspec-mocks.rbi +1 -1
- data/sorbet/rbi/gems/rubocop-ast.rbi +1 -1
- data/sorbet/rbi/gems/rubocop-rspec.rbi +35 -9
- data/sorbet/rbi/gems/rubocop.rbi +268 -40
- data/sorbet/rbi/gems/simplecov-cobertura.rbi +30 -0
- data/sorbet/rbi/gems/simplecov-html.rbi +35 -0
- data/sorbet/rbi/gems/simplecov.rbi +419 -0
- data/sorbet/rbi/gems/simplecov_json_formatter.rbi +47 -0
- data/sorbet/rbi/hidden-definitions/errors.txt +81 -68
- data/sorbet/rbi/hidden-definitions/hidden.rbi +186 -27
- metadata +36 -2
data/lib/bhook/theme.rb
CHANGED
@@ -13,8 +13,10 @@ module Bhook
|
|
13
13
|
@after_h1_strategy = T.let(strategy, T.proc.params(binding_instance: Binding).returns(String))
|
14
14
|
end
|
15
15
|
|
16
|
-
sig
|
17
|
-
|
16
|
+
sig do
|
17
|
+
params(md: String, src_file_sha: T.nilable(String),
|
18
|
+
src_file_date: T.nilable(String), file_url: T.nilable(String)).returns(String)
|
19
|
+
end
|
18
20
|
def render_page(md, src_file_sha, src_file_date, file_url)
|
19
21
|
src_title = T.let('', String)
|
20
22
|
|
@@ -5,17 +5,19 @@ module Bhook
|
|
5
5
|
class ThemeGenerator
|
6
6
|
extend T::Sig
|
7
7
|
|
8
|
-
sig {params(output_path: String).void}
|
8
|
+
sig { params(output_path: String).void }
|
9
9
|
def initialize(output_path)
|
10
10
|
@output_path = T.let(File.join(output_path, 'theme'), String)
|
11
11
|
@template_files = T.let([Bhook::PAGE_TEMPLATE_PATH,
|
12
|
-
|
12
|
+
Bhook::AFTER_H1_TEMPLATE_PATH], T::Array[String])
|
13
13
|
end
|
14
14
|
|
15
|
-
sig {void}
|
15
|
+
sig { void }
|
16
16
|
def generate!
|
17
|
-
FileUtils.mkdir_p(@output_path
|
18
|
-
|
17
|
+
FileUtils.mkdir_p(@output_path)
|
18
|
+
L.debug("mkdir: #{@output_path}")
|
19
|
+
FileUtils.cp(@template_files, @output_path)
|
20
|
+
L.debug("cp: #{@template_files.join(' ')} #{@output_path}")
|
19
21
|
end
|
20
22
|
end
|
21
23
|
end
|
data/lib/bhook/version.rb
CHANGED
data/lib/bhook/workspace.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
module Bhook
|
5
5
|
class Workspace
|
6
6
|
extend T::Sig
|
7
|
-
|
7
|
+
|
8
8
|
sig { params(src_path: String, out_path: String, theme_path: String).void }
|
9
9
|
def initialize(src_path, out_path, theme_path)
|
10
10
|
@src_path = T.let(Pathname.new(src_path).expand_path, Pathname)
|
@@ -13,9 +13,9 @@ module Bhook
|
|
13
13
|
end
|
14
14
|
|
15
15
|
sig { void }
|
16
|
-
def process!
|
16
|
+
def process!
|
17
17
|
root_dir.write!(@theme)
|
18
|
-
L.info
|
18
|
+
L.info 'Done!'
|
19
19
|
end
|
20
20
|
|
21
21
|
sig { void }
|
@@ -24,7 +24,7 @@ module Bhook
|
|
24
24
|
|
25
25
|
L.info "Watching: #{@src_path} for changes..."
|
26
26
|
listener = Listen.to(@src_path.to_s, File.join(@src_path.to_s, '.git')) do |_modified, _added, _removed|
|
27
|
-
L.info
|
27
|
+
L.info 'Detected changes...'
|
28
28
|
process!
|
29
29
|
end
|
30
30
|
listener.start
|
@@ -35,8 +35,9 @@ module Bhook
|
|
35
35
|
def all_md_files
|
36
36
|
root_dir.all_md_files
|
37
37
|
end
|
38
|
-
|
39
|
-
private
|
38
|
+
|
39
|
+
private
|
40
|
+
|
40
41
|
sig { returns(Bhook::Directory) }
|
41
42
|
def root_dir
|
42
43
|
Directory.new_root_directory(@src_path, @out_path)
|
data/sorbet/rbi/gems/bhook.rbi
CHANGED
@@ -0,0 +1,36 @@
|
|
1
|
+
# This file is autogenerated. Do not edit it by hand. Regenerate it with:
|
2
|
+
# srb rbi gems
|
3
|
+
|
4
|
+
# typed: strict
|
5
|
+
#
|
6
|
+
# If you would like to make changes to this file, great! Please create the gem's shim here:
|
7
|
+
#
|
8
|
+
# https://github.com/sorbet/sorbet-typed/new/master?filename=lib/docile/all/docile.rbi
|
9
|
+
#
|
10
|
+
# docile-1.4.0
|
11
|
+
|
12
|
+
module Docile
|
13
|
+
def dsl_eval(dsl, *args, &block); end
|
14
|
+
def dsl_eval_immutable(dsl, *args, &block); end
|
15
|
+
def dsl_eval_with_block_return(dsl, *args, &block); end
|
16
|
+
def self.dsl_eval(dsl, *args, &block); end
|
17
|
+
def self.dsl_eval_immutable(dsl, *args, &block); end
|
18
|
+
def self.dsl_eval_with_block_return(dsl, *args, &block); end
|
19
|
+
extend Docile::Execution
|
20
|
+
end
|
21
|
+
module Docile::Execution
|
22
|
+
def exec_in_proxy_context(dsl, proxy_type, *args, &block); end
|
23
|
+
def self.exec_in_proxy_context(dsl, proxy_type, *args, &block); end
|
24
|
+
end
|
25
|
+
class Docile::FallbackContextProxy
|
26
|
+
def initialize(receiver, fallback); end
|
27
|
+
def instance_variables; end
|
28
|
+
def method_missing(method, *args, &block); end
|
29
|
+
end
|
30
|
+
class Docile::ChainingFallbackContextProxy < Docile::FallbackContextProxy
|
31
|
+
def method_missing(method, *args, &block); end
|
32
|
+
end
|
33
|
+
module Docile::BacktraceFilter
|
34
|
+
def backtrace; end
|
35
|
+
def backtrace_locations; end
|
36
|
+
end
|
data/sorbet/rbi/gems/git.rbi
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
#
|
8
8
|
# https://github.com/sorbet/sorbet-typed/new/master?filename=lib/parallel/all/parallel.rbi
|
9
9
|
#
|
10
|
-
# parallel-1.
|
10
|
+
# parallel-1.22.1
|
11
11
|
|
12
12
|
module Parallel
|
13
13
|
def self.add_progress_bar!(job_factory, options); end
|
@@ -21,6 +21,8 @@ module Parallel
|
|
21
21
|
def self.flat_map(*args, &block); end
|
22
22
|
def self.in_processes(options = nil, &block); end
|
23
23
|
def self.in_threads(options = nil); end
|
24
|
+
def self.instrument_finish(item, index, result, options); end
|
25
|
+
def self.instrument_start(item, index, options); end
|
24
26
|
def self.map(source, options = nil, &block); end
|
25
27
|
def self.map_with_index(array, options = nil, &block); end
|
26
28
|
def self.process_incoming_jobs(read, write, job_factory, options, &block); end
|
@@ -28,6 +30,7 @@ module Parallel
|
|
28
30
|
def self.with_instrumentation(item, index, options); end
|
29
31
|
def self.work_direct(job_factory, options, &block); end
|
30
32
|
def self.work_in_processes(job_factory, options, &blk); end
|
33
|
+
def self.work_in_ractors(job_factory, options); end
|
31
34
|
def self.work_in_threads(job_factory, options, &block); end
|
32
35
|
def self.worker(job_factory, options, &block); end
|
33
36
|
def self.worker_number; end
|