Sha256: dd31606f6c965a6272c45e9995dce394a3fd4bd209d5eddaec994536e10b93db

Contents?: true

Size: 777 Bytes

Versions: 5

Compression:

Stored size: 777 Bytes

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

require 'bundler/setup'
require 'bhook'

puts "Bhook version #{Bhook::VERSION}"
parser = Bhook::ArgsParser.new(ARGV)
args = parser.parse

exit unless args

if args.help
  puts parser.help_text
  exit
end

if args.generate_theme
  Bhook::L.level = Logger::DEBUG
  Bhook::ThemeGenerator.new(args.generate_theme).generate!
  exit
end

Bhook::L.level = args.verbose ? Logger::DEBUG : Logger::INFO

workspace = Bhook::Workspace.new(args.source, args.output, args.theme)

if args.benchmark
  require 'benchmark'
  n = 10
  Benchmark.bmbm do |bench|
    Bhook::L.level = Logger::WARN
    bench.report("Generate HTML #{n} times") { n.times { workspace.process! } }
  end
  exit
end

args.watch ? workspace.watch! : workspace.process!

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
bhook-0.2.2 bin/bhook
bhook-0.2.1 bin/bhook
bhook-0.2.0 bin/bhook
bhook-0.1.6 bin/bhook
bhook-0.1.5 bin/bhook