Skip to content

Commit

Permalink
add magic comments
Browse files Browse the repository at this point in the history
  • Loading branch information
takahashim committed Dec 31, 2024
1 parent 3e8617e commit 4508082
Show file tree
Hide file tree
Showing 88 changed files with 180 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

begin
require 'bundler'
Bundler::GemHelper.install_tasks
Expand Down
2 changes: 2 additions & 0 deletions bin/review
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

#
# review: Wrapper command to call subcommand
#
Expand Down
2 changes: 2 additions & 0 deletions bin/review-catalog-converter
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

#
# Copyright (c) 2014-2019 Masanori Kado, Kenshi Muto
#
Expand Down
2 changes: 2 additions & 0 deletions bin/review-check
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

#
# Copyright (c) 2010-2019 Kenshi Muto, Minero Aoki
# 1999-2007 Minero Aoki
Expand Down
4 changes: 3 additions & 1 deletion bin/review-checkdep
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

#
# Copyright (c) 2007-2017 Minero Aoki, Kenshi Muto
# 1999-2007 Minero Aoki
Expand All @@ -11,7 +13,7 @@

$LOAD_PATH.unshift(File.realpath('../lib', __dir__))

PREDEF_FILE = 'PREDEF'.freeze
PREDEF_FILE = 'PREDEF'

def main
@provided = parse_predefined
Expand Down
4 changes: 3 additions & 1 deletion bin/review-compile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

#
# Copyright (c) 2008-2019 Kenshi Muto, Masayoshi Takahashi, KADO Masanori, Minero Aoki
# Copyright (c) 1999-2007 Minero Aoki
Expand All @@ -18,7 +20,7 @@ require 'yaml'

include ReVIEW::Loggable

DEFAULT_CONFIG_FILENAME = 'config.yml'.freeze
DEFAULT_CONFIG_FILENAME = 'config.yml'

def main
Signal.trap(:INT) { exit 1 }
Expand Down
2 changes: 2 additions & 0 deletions bin/review-epub2html
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

#
# Copyright (c) 2018 Kenshi Muto
#
Expand Down
2 changes: 2 additions & 0 deletions bin/review-epubmaker
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

# Copyright (c) 2010-2019 Kenshi Muto and Masayoshi Takahashi
#
# This program is free software.
Expand Down
2 changes: 2 additions & 0 deletions bin/review-idgxmlmaker
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

# Copyright (c) 2019 Kenshi Muto
#
# This program is free software.
Expand Down
2 changes: 2 additions & 0 deletions bin/review-index
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

#
# Copyright (c) 2008-2020 Minero Aoki, Kenshi Muto
# 1999-2007 Minero Aoki
Expand Down
2 changes: 2 additions & 0 deletions bin/review-init
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

#
# Copyright (c) 2013-2017 Masanori Kado, Masayoshi Takahashi, Kenshi Muto
#
Expand Down
2 changes: 2 additions & 0 deletions bin/review-pdfmaker
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

# Copyright (c) 2010-2017 Kenshi Muto and Masayoshi Takahashi
#
# This program is free software.
Expand Down
2 changes: 2 additions & 0 deletions bin/review-preproc
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

#
# Copyright (c) 2010-2019 Minero Aoki, Kenshi Muto
# 1999-2007 Minero Aoki
Expand Down
2 changes: 2 additions & 0 deletions bin/review-textmaker
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

# Copyright (c) 2018 Kenshi Muto
#
# This program is free software.
Expand Down
2 changes: 2 additions & 0 deletions bin/review-update
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

#
# Copyright (c) 2018 Kenshi Muto
#
Expand Down
2 changes: 2 additions & 0 deletions bin/review-validate
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

# Copyright (c) 2010-2019 Kenshi Muto
#
# This program is free software
Expand Down
2 changes: 2 additions & 0 deletions bin/review-vol
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

#
# Copyright (c) 2014-2020 Minero Aoki, Kenshi Muto
# 2003-2014 Minero Aoki
Expand Down
2 changes: 2 additions & 0 deletions bin/review-webmaker
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

#
# This program is free software.
# You can distribute or modify this program under the terms of
Expand Down
2 changes: 2 additions & 0 deletions lib/review.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

Dir["#{__dir__}/review/*.rb"].sort.each do |path|
require "review/#{File.basename(path, '.rb')}"
end
2 changes: 2 additions & 0 deletions lib/review/book.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Copyright (c) 2009-2017 Minero Aoki, Kenshi Muto
# 2002-2008 Minero Aoki
#
Expand Down
2 changes: 2 additions & 0 deletions lib/review/book/bib.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

#
# Copyright (c) 2009-2020 Minero Aoki, Kenshi Muto
#
Expand Down
2 changes: 2 additions & 0 deletions lib/review/book/book_unit.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Copyright (c) 2009-2021 Minero Aoki, Kenshi Muto
# 2002-2008 Minero Aoki
#
Expand Down
2 changes: 2 additions & 0 deletions lib/review/book/cache.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

#
# Copyright (c) 2014-2024 Minero Aoki, Kenshi Muto, Masayoshi Takahashi
#
Expand Down
2 changes: 2 additions & 0 deletions lib/review/book/chapter.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

#
# Copyright (c) 2009-2019 Minero Aoki, Kenshi Muto
# 2002-2008 Minero Aoki
Expand Down
2 changes: 2 additions & 0 deletions lib/review/book/image_finder.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

#
# Copyright (c) 2014-2023 Minero Aoki, Kenshi Muto, Masayoshi Takahashi
#
Expand Down
2 changes: 2 additions & 0 deletions lib/review/book/index.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Copyright (c) 2008-2021 Minero Aoki, Kenshi Muto
# 2002-2007 Minero Aoki
#
Expand Down
2 changes: 2 additions & 0 deletions lib/review/book/index/item.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Copyright (c) 2008-2019 Minero Aoki, Kenshi Muto
#
# This program is free software.
Expand Down
2 changes: 2 additions & 0 deletions lib/review/book/page_metric.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Copyright (c) 2009-2020 Minero Aoki, Kenshi Muto
# 2002-2008 Minero Aoki
#
Expand Down
2 changes: 2 additions & 0 deletions lib/review/book/part.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Copyright (c) 2009-2020 Minero Aoki, Kenshi Muto, Masayoshi Takahashi
# 2002-2008 Minero Aoki
#
Expand Down
2 changes: 2 additions & 0 deletions lib/review/book/volume.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Copyright (c) 2007-2020 Minero Aoki, Kenshi Muto
# 2002-2007 Minero Aoki
#
Expand Down
2 changes: 2 additions & 0 deletions lib/review/builder.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Copyright (c) 2002-2024 Minero Aoki, Kenshi Muto
#
# This program is free software.
Expand Down
2 changes: 2 additions & 0 deletions lib/review/call_hook.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ReVIEW
module CallHook
def call_hook(hook_name, *params, base_dir: nil)
Expand Down
2 changes: 2 additions & 0 deletions lib/review/catalog.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'yaml'
require 'date'

Expand Down
2 changes: 2 additions & 0 deletions lib/review/compiler.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Copyright (c) 2009-2024 Minero Aoki, Kenshi Muto
# Copyright (c) 2002-2007 Minero Aoki
#
Expand Down
2 changes: 2 additions & 0 deletions lib/review/configure.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

#
# Copyright (c) 2012-2022 Masanori Kado, Masayoshi Takahashi, Kenshi Muto
#
Expand Down
2 changes: 2 additions & 0 deletions lib/review/converter.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# This program is free software.
# You can distribute or modify this program under the terms of
# the GNU LGPL, Lesser General Public License version 2.1.
Expand Down
2 changes: 2 additions & 0 deletions lib/review/epub2html.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

#
# Copyright (c) 2018-2019 Kenshi Muto
#
Expand Down
2 changes: 2 additions & 0 deletions lib/review/epubbuilder.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# epubbuilder.rb
# just for compatibility
#
Expand Down
2 changes: 2 additions & 0 deletions lib/review/epubmaker.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Copyright (c) 2010-2024 Kenshi Muto and Masayoshi Takahashi
#
# This program is free software.
Expand Down
2 changes: 2 additions & 0 deletions lib/review/epubmaker/content.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# = content.rb -- Content object for EPUBMaker.
#
# Copyright (c) 2010-2020 Kenshi Muto
Expand Down
2 changes: 2 additions & 0 deletions lib/review/epubmaker/epubcommon.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# = epubcommon.rb -- super class for EPUBv2 and EPUBv3
#
# Copyright (c) 2010-2024 Kenshi Muto and Masayoshi Takahashi
Expand Down
2 changes: 2 additions & 0 deletions lib/review/epubmaker/epubv2.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# = epubv2.rb -- EPUB version 2 producer.
#
# Copyright (c) 2010-2022 Kenshi Muto and Masayoshi Takahashi
Expand Down
2 changes: 2 additions & 0 deletions lib/review/epubmaker/producer.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# = producer.rb -- EPUB producer.
#
# Copyright (c) 2010-2023 Kenshi Muto
Expand Down
2 changes: 2 additions & 0 deletions lib/review/epubmaker/zip_exporter.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Copyright (c) 2010-2017 Kenshi Muto and Masayoshi Takahashi
#
# This program is free software.
Expand Down
2 changes: 2 additions & 0 deletions lib/review/exception.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

#
# Copyright (c) 2007-2017 Minero Aoki, Kenshi Muto
# 2002-2007 Minero Aoki
Expand Down
2 changes: 2 additions & 0 deletions lib/review/extentions.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'review/extentions/object'
require 'review/extentions/string'
require 'review/extentions/hash'
2 changes: 2 additions & 0 deletions lib/review/extentions/hash.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class Hash
def deep_merge!(other)
self.merge!(other) do |_key, v_self, v_other|
Expand Down
2 changes: 2 additions & 0 deletions lib/review/extentions/object.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class Object
def blank?
respond_to?(:empty?) ? empty? : !self
Expand Down
2 changes: 2 additions & 0 deletions lib/review/extentions/string.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

if defined?(Encoding) && Encoding.respond_to?(:default_external) &&
Encoding.default_external != Encoding::UTF_8
Encoding.default_external = 'UTF-8'
Expand Down
2 changes: 2 additions & 0 deletions lib/review/htmlbuilder.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Copyright (c) 2008-2023 Minero Aoki, Kenshi Muto, Masayoshi Takahashi,
# KADO Masanori
# 2002-2007 Minero Aoki
Expand Down
2 changes: 2 additions & 0 deletions lib/review/htmltoc.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ReVIEW
class HTMLToc
def initialize(basedir)
Expand Down
2 changes: 2 additions & 0 deletions lib/review/htmlutils.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

#
# Copyright (c) 2006-2018 Minero Aoki, Kenshi Muto
# 2002-2006 Minero Aoki
Expand Down
2 changes: 2 additions & 0 deletions lib/review/i18n.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'yaml'

module ReVIEW
Expand Down
2 changes: 2 additions & 0 deletions lib/review/idgxmlbuilder.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Copyright (c) 2008-2024 Minero Aoki, Kenshi Muto
# 2002-2007 Minero Aoki
#
Expand Down
2 changes: 2 additions & 0 deletions lib/review/idgxmlmaker.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Copyright (c) 2019-2023 Kenshi Muto
#
# This program is free software.
Expand Down
2 changes: 2 additions & 0 deletions lib/review/img_graph.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

#
# Copyright (c) 2023 Kenshi Muto
#
Expand Down
2 changes: 2 additions & 0 deletions lib/review/index_builder.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Copyright (c) 2008-2022 Minero Aoki, Kenshi Muto, Masayoshi Takahashi,
# KADO Masanori
#
Expand Down
2 changes: 2 additions & 0 deletions lib/review/init.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

#
# Copyright (c) 2018-2022 Masanori Kado, Masayoshi Takahashi, Kenshi Muto
#
Expand Down
4 changes: 3 additions & 1 deletion lib/review/latexbuilder.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Copyright (c) 2002-2007 Minero Aoki
# 2008-2009 Minero Aoki, Kenshi Muto
# 2010-2022 Minero Aoki, Kenshi Muto, TAKAHASHI Masayoshi
Expand Down Expand Up @@ -1163,7 +1165,7 @@ def printendnotes
blank
end

BOUTEN = '・'.freeze
BOUTEN = '・'

def inline_bou(str)
macro('reviewbou', escape(str))
Expand Down
Loading

0 comments on commit 4508082

Please sign in to comment.