-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
205 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# This configuration was generated by | ||
# `rubocop --auto-gen-config` | ||
# on 2017-05-15 22:22:19 +0200 using RuboCop version 0.48.1. | ||
# The point is for the user to remove these configuration records | ||
# one by one as the offenses are removed from the code base. | ||
# Note that changes in the inspected code, or installation of new | ||
# versions of RuboCop, may require this file to be generated again. | ||
|
||
# Offense count: 1 | ||
Metrics/AbcSize: | ||
Max: 25 | ||
|
||
# Offense count: 1 | ||
Metrics/CyclomaticComplexity: | ||
Max: 9 | ||
|
||
# Offense count: 2 | ||
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. | ||
# URISchemes: http, https | ||
Metrics/LineLength: | ||
Max: 85 | ||
|
||
# Offense count: 1 | ||
# Configuration parameters: CountComments. | ||
Metrics/MethodLength: | ||
Max: 23 | ||
|
||
# Offense count: 1 | ||
# Configuration parameters: CountComments. | ||
Metrics/ModuleLength: | ||
Max: 147 | ||
|
||
# Offense count: 1 | ||
Metrics/PerceivedComplexity: | ||
Max: 8 | ||
|
||
# Offense count: 2 | ||
Style/MethodMissing: | ||
Exclude: | ||
- 'lib/rainbow/null_presenter.rb' | ||
- 'lib/rainbow/presenter.rb' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,89 @@ | ||
module Rainbow | ||
|
||
class NullPresenter < ::String | ||
def color(*_values) | ||
self | ||
end | ||
|
||
def background(*_values) | ||
self | ||
end | ||
|
||
def reset | ||
self | ||
end | ||
|
||
def bright | ||
self | ||
end | ||
|
||
def faint | ||
self | ||
end | ||
|
||
def italic | ||
self | ||
end | ||
|
||
def underline | ||
self | ||
end | ||
|
||
def blink | ||
self | ||
end | ||
|
||
def inverse | ||
self | ||
end | ||
|
||
def hide | ||
self | ||
end | ||
|
||
def black | ||
self | ||
end | ||
|
||
def red | ||
self | ||
end | ||
|
||
def color(*values); self; end | ||
def background(*values); self; end | ||
def reset; self; end | ||
def bright; self; end | ||
def faint; self; end | ||
def italic; self; end | ||
def underline; self; end | ||
def blink; self; end | ||
def inverse; self; end | ||
def hide; self; end | ||
|
||
def black; self; end | ||
def red; self; end | ||
def green; self; end | ||
def yellow; self; end | ||
def blue; self; end | ||
def magenta; self; end | ||
def cyan; self; end | ||
def white; self; end | ||
|
||
def method_missing(method_name,*args) | ||
if Color::X11Named.color_names.include? method_name and args.empty? then | ||
def green | ||
self | ||
end | ||
|
||
def yellow | ||
self | ||
end | ||
|
||
def blue | ||
self | ||
end | ||
|
||
def magenta | ||
self | ||
end | ||
|
||
def cyan | ||
self | ||
end | ||
|
||
def white | ||
self | ||
end | ||
|
||
def method_missing(method_name, *args) | ||
if Color::X11Named.color_names.include?(method_name) && args.empty? | ||
self | ||
else | ||
super | ||
end | ||
end | ||
|
||
alias_method :foreground, :color | ||
alias_method :fg, :color | ||
alias_method :bg, :background | ||
alias_method :bold, :bright | ||
alias_method :dark, :faint | ||
|
||
alias foreground color | ||
alias fg color | ||
alias bg background | ||
alias bold bright | ||
alias dark faint | ||
end | ||
|
||
end |
Oops, something went wrong.