Sha256: 6f7e4e19fb81c31784eb720df4279cdd190dfe815aed1ce307b64ddb73d118a4

Contents?: true

Size: 460 Bytes

Versions: 16

Compression:

Stored size: 460 Bytes

Contents

# frozen_string_literal: true

module EacCli
  class DocoptRunner
    PROGRAM_MACRO = '__PROGRAM__'

    def source_doc
      setting_value(:doc)
    end

    def target_doc
      source_doc.gsub(PROGRAM_MACRO, target_program_name).strip + "\n"
    end

    def source_program_name
      setting_value(:program_name, false)
    end

    def target_program_name
      [source_program_name, ENV['PROGRAM_NAME'], $PROGRAM_NAME].find(&:present?)
    end
  end
end

Version data entries

16 entries across 16 versions & 3 rubygems

Version Path
eac_cli-0.20.4 lib/eac_cli/docopt_runner/_doc.rb
eac_cli-0.20.3 lib/eac_cli/docopt_runner/_doc.rb
avm-tools-0.102.2 vendor/eac_cli/lib/eac_cli/docopt_runner/_doc.rb
eac_cli-0.20.2 lib/eac_cli/docopt_runner/_doc.rb
avm-tools-0.102.1 vendor/eac_cli/lib/eac_cli/docopt_runner/_doc.rb
eac_cli-0.20.1 lib/eac_cli/docopt_runner/_doc.rb
eac_cli-0.20.0 lib/eac_cli/docopt_runner/_doc.rb
avm-tools-0.102.0 vendor/eac_cli/lib/eac_cli/docopt_runner/_doc.rb
eac_cli-0.19.0 lib/eac_cli/docopt_runner/_doc.rb
avm-tools-0.101.0 vendor/eac_cli/lib/eac_cli/docopt_runner/_doc.rb
eac_cli-0.18.0 lib/eac_cli/docopt_runner/_doc.rb
avm-tools-0.100.0 vendor/eac_cli/lib/eac_cli/docopt_runner/_doc.rb
ehbrs-tools-0.21.0 vendor/eac_cli/lib/eac_cli/docopt_runner/_doc.rb
avm-tools-0.99.1 vendor/eac_cli/lib/eac_cli/docopt_runner/_doc.rb
eac_cli-0.17.0 lib/eac_cli/docopt_runner/_doc.rb
avm-tools-0.99.0 vendor/eac_cli/lib/eac_cli/docopt_runner/_doc.rb