Sha256: 1e70f92de48d6bf670e61d237e917e32f71e5b2bdf69daa00d5bf38e0d7a5f53

Contents?: true

Size: 658 Bytes

Versions: 1

Compression:

Stored size: 658 Bytes

Contents

module Nrb
  module Commands
    class Base < Thor::Group
      include Thor::Actions

      class_option :verbose, type: :boolean, default: true,
        desc:    'Verbose mode.',
        aliases: '-v'

      def self.source_root
        File.expand_path('../..', __dir__)
      end

      def opts
        options.to_h.symbolize_keys
      end

      private

      def require_main_file
        assumed_file_name = "#{Nrb.root.split('/').last}.rb"
        assumed_file_path = File.join(Nrb.root, assumed_file_name)

        if File.exist?(assumed_file_path)
          require File.join(Nrb.root, assumed_file_name)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nrb-1.1.0 lib/nrb/commands/base/base.rb