Class: BitClust::Subcommands::SetupCommand
- Inherits:
-
BitClust::Subcommand
- Object
- BitClust::Subcommand
- BitClust::Subcommands::SetupCommand
- Defined in:
- lib/bitclust/subcommands/setup_command.rb
Constant Summary collapse
- REPOSITORY_PATH =
"https://github.com/rurema/doctree.git"
Instance Method Summary collapse
- #exec(argv, options) ⇒ Object
-
#initialize ⇒ SetupCommand
constructor
A new instance of SetupCommand.
-
#needs_database? ⇒ Boolean
DB は ~/.bitclust 配下に自前で作るのでグローバル --database は不要.
Methods inherited from BitClust::Subcommand
#align_progress_bar_title, #error, #help, #option_error, #parse, #srcdir_root
Constructor Details
#initialize ⇒ SetupCommand
Returns a new instance of SetupCommand.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/bitclust/subcommands/setup_command.rb', line 18 def initialize super @prepare = nil @cleanup = nil @purge = nil # teeny は付けない。#%if (version == "V") や #%version V の等値ゲートは # 文字列一致なので、teeny 付きの版名で DB を作ると doctree CI・ # 生成済みドキュメントとゲートの判定がずれる @versions = ["3.3", "3.4", "4.0"] @update = true @parser. = "Usage: #{File.basename($0, '.*')} setup [options]" @parser.on('--prepare', 'Prepare config file and checkout repository. Do not create database.') { @prepare = true } @parser.on('--cleanup', 'Cleanup database before create database.') { @cleanup = true } @parser.on('--purge', 'Purge all downloaded and generated files and exit.') { @purge = true } @parser.on('--versions=V1,V2,...', "Specify versions. [#{@versions.join(',')}]") {|versions| @versions = versions.split(",") } @parser.on('--no-update', 'Do not update document repository') { @update = false } end |
Instance Method Details
#exec(argv, options) ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/bitclust/subcommands/setup_command.rb', line 51 def exec(argv, ) purge if @purge prepare return if @prepare @config[:versions].each do |version| puts "Generating database for Ruby#{version}..." prefix = "#{@config[:database_prefix]}-#{version}" FileUtils.rm_rf(prefix) if @cleanup init_argv = ["version=#{version}", "encoding=#{@config[:encoding]}"] # @type var init_options: Subcommand::options = { :prefix => prefix, :capi => false } InitCommand.new.exec(init_argv, ) update_method_database(prefix, ["--markdowntree=#{@config[:mdtree]}"]) update_function_database(prefix, ["--markdowntree=#{@config[:capi_mdtree]}"]) end end |
#needs_database? ⇒ Boolean
DB は ~/.bitclust 配下に自前で作るのでグローバル --database は不要
47 48 49 |
# File 'lib/bitclust/subcommands/setup_command.rb', line 47 def needs_database? false end |