Sha256: e16f12e16da05083ce419f6ad559c953c3e20e8882d7f5410cf9578d7b2a30d3

Contents?: true

Size: 716 Bytes

Versions: 10

Compression:

Stored size: 716 Bytes

Contents

# frozen_string_literal: true

require_relative '../models/color_theme'
require_relative '../support/color_themable'

module Dsu
  module Support
    module SubcommandHelpColorizable
      class << self
        def included(base)
          base.extend(ClassMethods)
        end

        module ClassMethods
          def command_help(shell, subcommand = false) # rubocop:disable Style/OptionalBooleanParameter
            help_text = Services::StdoutRedirectorService.call { super }
            puts apply_theme(help_text, theme_color: color_theme.help)
          end

          def color_theme
            @color_theme ||= Models::ColorTheme.current_or_default
          end
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
dsu-2.1.1 lib/dsu/support/subcommand_help_colorizeable.rb
dsu-2.0.8 lib/dsu/support/subcommand_help_colorizeable.rb
dsu-2.0.7 lib/dsu/support/subcommand_help_colorizeable.rb
dsu-2.0.6 lib/dsu/support/subcommand_help_colorizeable.rb
dsu-2.0.5 lib/dsu/support/subcommand_help_colorizeable.rb
dsu-2.0.4 lib/dsu/support/subcommand_help_colorizeable.rb
dsu-2.0.3 lib/dsu/support/subcommand_help_colorizeable.rb
dsu-2.0.2 lib/dsu/support/subcommand_help_colorizeable.rb
dsu-2.0.1 lib/dsu/support/subcommand_help_colorizeable.rb
dsu-2.0.0.alpha.1 lib/dsu/support/subcommand_help_colorizeable.rb