Module: Colora

Defined in:
lib/colora.rb,
lib/colora/data.rb,
lib/colora/lines.rb,
lib/colora/configure.rb,
lib/colora/plugs/diff.rb,
lib/colora/plugs/markdown.rb

Overview

Colora namespace

Defined Under Namespace

Classes: Data, Error, Lines

Constant Summary collapse

VERSION =
'1.0.250401'
OPTIONS =

Filter keys:

%i[git file lang theme tab on off fuzzy].freeze
FILTERS =
%i[quiet in out code comment dupcode dupcomment].freeze
CODES =
%i[context deleted replaced duplicated edited inserted touched].freeze
Config =
Struct::Config.new

Class Method Summary collapse

Class Method Details

.parse_argv(help) ⇒ Object



12
13
14
15
# File 'lib/colora.rb', line 12

def self.parse_argv(help)
  require 'help_parser'
  HelpParser[VERSION, help]
end

.run(options = nil) ⇒ Object

Colora.run(options) :reek:TooManyStatements



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/colora.rb', line 19

def self.run(options = nil)
  require_relative 'colora/requires'
  Config.configure(options) if options # Configure Colora:
  # If stdin is a tty(we're not in a pipe) and no file is specified,
  # then default to running git-diff.
  Config.git = true if $stdin.tty? && !Config.file
  Lines.new.each do |line|
    line.gsub!("\t", '') if Config.tab
    puts line # Puts Colora::Lines
  end
end