colours 0.5.48

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of colours might be problematic. Click here for more details.

Files changed (143) hide show
  1. checksums.yaml +7 -0
  2. data/LICENCE.md +22 -0
  3. data/README.md +867 -0
  4. data/bin/colours +7 -0
  5. data/bin/html_colour_to_hex_value +7 -0
  6. data/bin/html_colourize +7 -0
  7. data/bin/print_rainbow_line +7 -0
  8. data/bin/rainbow_colours +7 -0
  9. data/colours.gemspec +75 -0
  10. data/doc/COLOUR_CODES_CHART.md +28 -0
  11. data/doc/HOW_TO_PICK_YOUR_OWN_COLOURS.md +29 -0
  12. data/doc/README.gen +850 -0
  13. data/lib/colours.rb +5 -0
  14. data/lib/colours/256_colours/support_for_256_colours.rb +180 -0
  15. data/lib/colours/autoalias_e.rb +10 -0
  16. data/lib/colours/autogenerated/README.md +2 -0
  17. data/lib/colours/autogenerated/support_for_256_colours.rb +2235 -0
  18. data/lib/colours/autogenerated/support_for_html_colours.rb +1778 -0
  19. data/lib/colours/autogenerated/toplevel_basic_colour_methods.rb +6366 -0
  20. data/lib/colours/autoinclude.rb +14 -0
  21. data/lib/colours/base/base.rb +23 -0
  22. data/lib/colours/basic_colours/README.md +4 -0
  23. data/lib/colours/basic_colours/basic_colours.rb +279 -0
  24. data/lib/colours/colour_methods/README.md +11 -0
  25. data/lib/colours/colour_methods/default_colour.rb +66 -0
  26. data/lib/colours/colour_methods/sargument.rb +70 -0
  27. data/lib/colours/colour_methods/scomments.rb +105 -0
  28. data/lib/colours/colour_methods/sdir.rb +66 -0
  29. data/lib/colours/colour_methods/sfancy.rb +84 -0
  30. data/lib/colours/colour_methods/sfile.rb +71 -0
  31. data/lib/colours/colour_methods/simportant.rb +92 -0
  32. data/lib/colours/colour_methods/snormal.rb +66 -0
  33. data/lib/colours/colour_methods/ssymlink.rb +102 -0
  34. data/lib/colours/colour_methods/swarn.rb +76 -0
  35. data/lib/colours/colour_table/README.md +3 -0
  36. data/lib/colours/colour_table/colour_table.rb +275 -0
  37. data/lib/colours/colours_e_autoinclude.rb +9 -0
  38. data/lib/colours/commandline/README.md +2 -0
  39. data/lib/colours/commandline/commandline.rb +44 -0
  40. data/lib/colours/commandline/menu.rb +111 -0
  41. data/lib/colours/constants/colour_constants.rb +299 -0
  42. data/lib/colours/constants/file_constants.rb +72 -0
  43. data/lib/colours/constants/hash_simple_colours.rb +146 -0
  44. data/lib/colours/constants/misc.rb +59 -0
  45. data/lib/colours/constants/newline.rb +14 -0
  46. data/lib/colours/constants/registered_colour_methods.rb +53 -0
  47. data/lib/colours/e.rb +5 -0
  48. data/lib/colours/e/README.md +13 -0
  49. data/lib/colours/e/autoinclude.rb +11 -0
  50. data/lib/colours/e/e.rb +35 -0
  51. data/lib/colours/eparse/eparse.rb +77 -0
  52. data/lib/colours/everything/autoinclude.rb +11 -0
  53. data/lib/colours/html_colours/README.md +1 -0
  54. data/lib/colours/html_colours/add_html_colours_onto_the_toplevel_namespace.rb +22 -0
  55. data/lib/colours/html_colours/hash_html_colours.rb +63 -0
  56. data/lib/colours/html_colours/html_colourize.rb +48 -0
  57. data/lib/colours/html_colours/is_this_html_colour_included.rb +64 -0
  58. data/lib/colours/html_colours/misc.rb +186 -0
  59. data/lib/colours/html_colours/show_html_colours.rb +85 -0
  60. data/lib/colours/kde_colour_palette/kde_colour_palette.rb +128 -0
  61. data/lib/colours/map_symbol_to_corresponding_colour/map_symbol_to_corresponding_colour.rb +219 -0
  62. data/lib/colours/module.rb +11 -0
  63. data/lib/colours/project/project_base_directory.rb +22 -0
  64. data/lib/colours/rainbow_colours/README.md +2 -0
  65. data/lib/colours/rainbow_colours/check_for_trollop_being_available_or_exit.rb +26 -0
  66. data/lib/colours/rainbow_colours/constants.rb +30 -0
  67. data/lib/colours/rainbow_colours/do_parse_via_rainbow_colours.rb +164 -0
  68. data/lib/colours/rainbow_colours/paint_detected_mode.rb +20 -0
  69. data/lib/colours/rainbow_colours/print_rainbow_line.rb +68 -0
  70. data/lib/colours/rainbow_colours/println_ani.rb +32 -0
  71. data/lib/colours/rainbow_colours/println_plain.rb +36 -0
  72. data/lib/colours/rainbow_colours/rainbow.rb +38 -0
  73. data/lib/colours/rainbow_colours/report_errors.rb +32 -0
  74. data/lib/colours/rainbow_colours/returnln_plain.rb +63 -0
  75. data/lib/colours/rainbow_colours/set_mode.rb +24 -0
  76. data/lib/colours/requires/require_all_colour_methods.rb +5 -0
  77. data/lib/colours/requires/require_commandline.rb +7 -0
  78. data/lib/colours/requires/require_eparse.rb +11 -0
  79. data/lib/colours/requires/require_rgb.rb +5 -0
  80. data/lib/colours/requires/require_sdir.rb +5 -0
  81. data/lib/colours/requires/require_sfile.rb +5 -0
  82. data/lib/colours/requires/require_the_256_colours_module.rb +16 -0
  83. data/lib/colours/requires/require_the_basic_colours.rb +7 -0
  84. data/lib/colours/requires/require_the_colour_methods.rb +34 -0
  85. data/lib/colours/requires/require_the_colour_table.rb +7 -0
  86. data/lib/colours/requires/require_the_colours_project.rb +52 -0
  87. data/lib/colours/requires/require_the_constants.rb +11 -0
  88. data/lib/colours/requires/require_the_html_colours.rb +11 -0
  89. data/lib/colours/requires/require_the_kde_colour_palette.rb +7 -0
  90. data/lib/colours/requires/require_the_toplevel_methods.rb +42 -0
  91. data/lib/colours/revert/revert.rb +106 -0
  92. data/lib/colours/rgb/rgb.rb +547 -0
  93. data/lib/colours/testing/README.md +2 -0
  94. data/lib/colours/testing/testing.rb +157 -0
  95. data/lib/colours/toplevel_methods/bold.rb +35 -0
  96. data/lib/colours/toplevel_methods/bold_and_italic.rb +36 -0
  97. data/lib/colours/toplevel_methods/cat.rb +39 -0
  98. data/lib/colours/toplevel_methods/clear_screen.rb +18 -0
  99. data/lib/colours/toplevel_methods/cliner.rb +19 -0
  100. data/lib/colours/toplevel_methods/col.rb +56 -0
  101. data/lib/colours/toplevel_methods/e.rb +63 -0
  102. data/lib/colours/toplevel_methods/esystem.rb +19 -0
  103. data/lib/colours/toplevel_methods/fancy_parse.rb +79 -0
  104. data/lib/colours/toplevel_methods/html_colourize.rb +64 -0
  105. data/lib/colours/toplevel_methods/is_on_roebe.rb +16 -0
  106. data/lib/colours/toplevel_methods/italic.rb +104 -0
  107. data/lib/colours/toplevel_methods/make_colour.rb +29 -0
  108. data/lib/colours/toplevel_methods/methods_related_to_html_colours.rb +325 -0
  109. data/lib/colours/toplevel_methods/misc.rb +95 -0
  110. data/lib/colours/toplevel_methods/open_this_file.rb +26 -0
  111. data/lib/colours/toplevel_methods/prefer_this_colour_schemata.rb +80 -0
  112. data/lib/colours/toplevel_methods/random_html_colour.rb +44 -0
  113. data/lib/colours/toplevel_methods/random_value.rb +37 -0
  114. data/lib/colours/toplevel_methods/remove_escape_sequence.rb +107 -0
  115. data/lib/colours/toplevel_methods/set_last_colour_used.rb +32 -0
  116. data/lib/colours/toplevel_methods/show_basic_colour_palette.rb +36 -0
  117. data/lib/colours/toplevel_methods/underline.rb +114 -0
  118. data/lib/colours/toplevel_methods/use_colours.rb +290 -0
  119. data/lib/colours/utility_scripts/README.md +2 -0
  120. data/lib/colours/utility_scripts/autogenerate.rb +291 -0
  121. data/lib/colours/version/version.rb +25 -0
  122. data/lib/colours/yaml/256_colours.yml +277 -0
  123. data/lib/colours/yaml/basic_colours.yml +23 -0
  124. data/lib/colours/yaml/html_colours.yml +835 -0
  125. data/lib/colours/yaml/kde_colour_palette.yml +183 -0
  126. data/lib/colours/yaml/prefer_this_colour_schemata.yml +15 -0
  127. data/lib/colours/yaml/use_these_values_for_the_colour_methods.yml +13 -0
  128. data/test/test.html +18 -0
  129. data/test/testing_256_colours_support.rb +29 -0
  130. data/test/testing_col.rb +10 -0
  131. data/test/testing_colours.rb +95 -0
  132. data/test/testing_colours_e.rb +13 -0
  133. data/test/testing_eparse.rb +13 -0
  134. data/test/testing_kde_colour_palette.rb +30 -0
  135. data/test/testing_konsole_submodule.rb +226 -0
  136. data/test/testing_map_symbol_to_corresponding_colour.rb +14 -0
  137. data/test/testing_rgb_to_hex.rb +32 -0
  138. data/test/testing_the_basic_colours_of_the_colours_project.rb +58 -0
  139. data/test/testing_the_colour_methods.rb +36 -0
  140. data/test/testing_the_constants_of_the_colours_project.rb +9 -0
  141. data/test/testing_the_html_colours_of_the_colours_project.rb +37 -0
  142. data/test/testing_whether_colours_will_be_used.rb +7 -0
  143. metadata +224 -0
data/bin/colours ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ require 'colours'
6
+
7
+ Colours.menu(ARGV)
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ require 'colours/toplevel_methods/methods_related_to_html_colours.rb'
6
+
7
+ puts Colours.html_colour_to_hex_value(ARGV)
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ require 'colours/html_colours/html_colourize.rb'
6
+
7
+ Colours::HtmlColours.html_colourize(ARGF)
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ require 'colours/rainbow_colours/do_parse_via_rainbow_colours.rb'
6
+
7
+ Colours::RainbowColours.print_rainbow_line(ARGV)
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ require 'colours/rainbow_colours/do_parse_via_rainbow_colours.rb'
6
+
7
+ Colours::RainbowColours.do_parse_via_rainbow_colours(ARGV)
data/colours.gemspec ADDED
@@ -0,0 +1,75 @@
1
+ # =========================================================================== #
2
+ # Gemspec for Project Colours.
3
+ # =========================================================================== #
4
+ require 'colours/version/version.rb'
5
+
6
+ Gem::Specification.new { |s|
7
+
8
+ s.name = 'colours'
9
+ s.version = Colours::VERSION
10
+ s.date = Time.now.strftime('%Y-%m-%d')
11
+
12
+ DESCRIPTION = <<-EOF
13
+
14
+ This library is called colours. It unifies colour-related constants
15
+ and methods, including R,G,B values for colours and the commonly
16
+ known "HTML colours", such as "slateblue" or "royalblue" and so
17
+ on.
18
+
19
+ The primary use case for this project is to make commandline-scripts
20
+ display text on the terminal with colours.
21
+
22
+ For more information about this project, have a look at the online
23
+ documentation for this gem at the link called "documentation", at
24
+ the bottom right side of the colours
25
+ gem homepage:
26
+
27
+ #{Colours::URL_TO_THE_DOCUMENTATION}
28
+
29
+ EOF
30
+
31
+ s.summary = DESCRIPTION
32
+ s.description = DESCRIPTION
33
+
34
+ s.extra_rdoc_files = %w()
35
+
36
+ s.authors = ['Robert A. Heiler']
37
+ s.email = 'shevegen@gmail.com'
38
+ s.files = Dir['**/*']
39
+ s.license = 'MIT'
40
+ s.homepage = 'http://rubygems.org/gems/colours'
41
+
42
+ # ========================================================================= #
43
+ # Show this message when a user installs this project.
44
+ # ========================================================================= #
45
+ s.post_install_message = <<-EOF
46
+
47
+ This is the colours gem.
48
+
49
+ Usage example:
50
+
51
+ require 'colours'
52
+
53
+ Have a look at methods such as sfancy() or simp(). These two methods
54
+ are heavily used to colourize important text. The leading "s" stands
55
+ for "string"; imp stands for "important" text.
56
+
57
+ If you wish to test the konsole colours, try:
58
+
59
+ colours --all_colours
60
+
61
+ or
62
+
63
+ Colours.test
64
+
65
+ EOF
66
+
67
+ s.required_ruby_version = '>= '+RUBY_VERSION
68
+ s.required_rubygems_version = '>= '+Gem::VERSION
69
+ s.rubygems_version = '>= '+Gem::VERSION
70
+
71
+ # ========================================================================= #
72
+ # No dependencies for this project.
73
+ # ========================================================================= #
74
+
75
+ }
@@ -0,0 +1,28 @@
1
+ The available codes are:
2
+
3
+ 0 Normal text, foreground and background
4
+ 1 Bold text
5
+ 4 Underline
6
+ 5 Blink
7
+ 7 Inverse
8
+ 8 Invisible
9
+
10
+ 30 Black foreground
11
+ 31 Red foreground
12
+ 32 Green foreground
13
+ 33 Yellow foreground
14
+ 34 Blue foreground
15
+ 35 Magenta foreground
16
+ 36 Cyan foreground
17
+ 37 White foreground
18
+
19
+ 40 Black background
20
+ 41 Red background
21
+ 42 Green background
22
+ 43 Yellow background
23
+ 44 Blue background
24
+ 45 Magenta background
25
+ 46 Cyan background
26
+ 47 White background
27
+ 49 default background # Unsure if this one works as-is
28
+
@@ -0,0 +1,29 @@
1
+ This file describes how to pick your own colours - or how to use
2
+ the Colours gem.
3
+
4
+ The file colour_methods.rb within the konsole submodule has the
5
+ relevant colours for KDE Konsole. It is stored in the hash
6
+ called @table_colour_methods_to_specific_colour.
7
+
8
+ Within that hash you may see entries such as:
9
+
10
+ sdir: :olivedrab
11
+
12
+ Now, what does this mean?
13
+
14
+ This is a hash entry, a key->value pair, with the key being
15
+ called :sdir, and the value being :olivedrab.
16
+
17
+ "sdir" is an abbreviation for "string_dir", aka "string_directory".
18
+ :olivedrab is the HTML colour called olivedrab, a beige-green variant.
19
+ What this does mean, in english, is to "use the colour olivedrab
20
+ in order to display directories in a coloured fashion".
21
+
22
+ If you wish to use another colour, simply change the Symbol on the
23
+ right hand side, aka :olivedrab, to another name. The names are HTML
24
+ Colour names.
25
+
26
+ If you wish to get an overview of all available HTML colours, in ruby
27
+ code, you can do this via the Colours namespace:
28
+
29
+ Colours.show_html_colours
data/doc/README.gen ADDED
@@ -0,0 +1,850 @@
1
+ ADD_RUBY_HEADER
2
+
3
+ # The Colours project
4
+
5
+ ## Goals, Scope and the History of the colours project
6
+
7
+ The Colours project originated from a requirement to have to support **colours**
8
+ on the commandline. Colours can be immensely helpful, so it makes sense
9
+ to make use of them on the commandline. The modern www also makes use of
10
+ colours - just look at any random webpage; you may find lots of
11
+ different colours in use there.
12
+
13
+ If you look on rubygems.org then you will be able to find **lots** of
14
+ different colour-related projects, written in ruby. The primary reason as
15
+ to why I created a new colour-centric project was because I needed certain
16
+ functionality that was not provided by any of the other projects;
17
+ at the least not in a way as I thought it should be available
18
+ (and used in downstream projects). For example, some terminals support
19
+ **RGB values** and others do not. I did not want to have to spend time
20
+ thinking about this much at all, so I wanted to have a colours-related
21
+ project that could abstract this away for me.
22
+
23
+ ![alt text][screenshot1]
24
+ [screenshot1]: https://i.imgur.com/F6kac8W.png
25
+
26
+ The **main goal** of the **colours project** is to collect colour-related
27
+ code and make this code available to other projects, so that these projects
28
+ can benefit from colour support.
29
+
30
+ The primary goal herein is for **commandline applications**, but there
31
+ are some HTML components as part of this project that could be used,
32
+ such as for when you wish to make use of **HTML colours** (slateblue,
33
+ royalblue, teal, tomato, steelblue and names such as these). The
34
+ partial screenshot above indicates this, on a black **KDE konsole**
35
+ background. (I tend to prefer dark backgrounds for my terminals.)
36
+
37
+ Note that many **terminals** support the **display of HTML colours**, via
38
+ their **corresponding RGB values**. Since I wanted to use good terminals,
39
+ such as the **KDE konsole**, the colours project also had to support
40
+ these names (such as **slateblue** or **royalblue**) directly. This is
41
+ why method calls such as **Colours.royalblue()** will also work - see
42
+ for a later subsection how to customize (and control) this.
43
+
44
+ The **Colours gem** has other, older projects, such as AnsiColours,
45
+ ColourE, AliasE and several other smaller sub-projects that I have
46
+ used over the years, integrated. It is thus a **bundled project**. This
47
+ is specifically mentioned in the event that you may wish to look at
48
+ the code, and wonder a little why it is structured the way it is.
49
+
50
+ ## Requiring the colours project
51
+
52
+ To require the colours project, do:
53
+
54
+ require 'colours'
55
+
56
+ You can also **autoinclude** this module into your project, at
57
+ <b>require-time</b>, via:
58
+
59
+ require 'colours/autoinclude'
60
+
61
+ This will make the **Colours namespace** and the
62
+ **Colours::HtmlColours namespace** available, via
63
+ **include Colours** ultimately.
64
+
65
+ If you need more control over the include-action then you should
66
+ just use the first variant, require 'colours', and then do the
67
+ include action specifically onto whatever class/module you need
68
+ that functionality.
69
+
70
+ ## Introduction and Overview
71
+
72
+ The toplevel module name is **Colours** and you can include
73
+ this module in any of your classes, via:
74
+
75
+ require 'colours'
76
+
77
+ include Colours
78
+
79
+ If you include Colours into main (toplevel), then you can simply
80
+ use the colour-constants directly:
81
+
82
+ puts RED+'This is a red text.'
83
+ puts BLUE+'This will be in blue.'
84
+
85
+ Keep in mind when you use something like the above, with the
86
+ leading escape-code for RED or BLUE, then this is missing the
87
+ proper escape-code for **end** (**revert**). This value is
88
+ usually **\e[0;37m**, or simpler, use **Colours.rev()** such
89
+ as in:
90
+
91
+ puts RED+'This is a red text.'+Colours.rev
92
+ puts BLUE+'This will be in blue.'+Colours.rev
93
+
94
+ The corresponding colour-methods can also be used:
95
+
96
+ red 'This is a red text.'
97
+ blue 'This is a blue text.'
98
+
99
+ This has the advantage that you do not have to use
100
+ Colours.rev anymore. So in some ways the colour-named
101
+ methods are better. (Of course it is a bit complicated
102
+ if you want to use RGB colours, so always make sure to
103
+ specifically **include** what you really need.)
104
+
105
+ Colour-related constants are simply **hardcoded**, such as
106
+ in this way:
107
+
108
+ GREEN = "\e[0;32m"
109
+
110
+ To test all colours, after requiring the project such as
111
+ described above, do:
112
+
113
+ Colours.test
114
+
115
+ Several methods exist as well, such as sfancy(), swarn(),
116
+ simp(), sdir() and sfile(), among others.
117
+
118
+ These methods can be used to colourize certain Strings,
119
+ such as:
120
+
121
+ a file -> use sfile()
122
+ a directory -> use sdir()
123
+ a warning -> use swarn()
124
+
125
+ The methods sfancy() and simp() are there to denote
126
+ more important output, usually in the middle of a String.
127
+ Think of this as a way to **emphasize** what you wish to
128
+ display to the user at hand. (The important parts of
129
+ the sentence should be colourized and emphasized. This is
130
+ the whole point for simp() to exist; simp() is a shorcut
131
+ for **string_important**, by the way.)
132
+
133
+ To make use of the **html-colours component**, such as converting
134
+ a "HTML Colour" to its RGB values, you can do this:
135
+
136
+ puts Colours::HtmlColours.colour_to_rgb(:sienna) # ← This variant no longer works.
137
+ puts Colours.html_colours.colour_to_rgb(:sienna) # ← This variant no longer works.
138
+ pp Colours.colour_to_rgb(:sienna) # ← This variant actually works, and will return an Array such as: [160, 82, 45]
139
+
140
+ If you want to return a random HTML colour, you can use this method
141
+ call:
142
+
143
+ Colours::HtmlColours.random
144
+
145
+ or
146
+
147
+ Colours.html_colours.sample # => "darksalmon"
148
+ Colours.html_colours.sample # => "turquoise"
149
+ Colours.html_colours.sample # => "lightblue"
150
+
151
+ Or just:
152
+
153
+ Colours.sample # => "khaki"
154
+ Colours.random_html_colour # => "slateblue"
155
+
156
+ Use whichever variant you prefer. The shorter names are more elegant in
157
+ my opinion.
158
+
159
+ In general, the html component can be used to convert the trivial
160
+ <b>html colours</b> into <b>corresponding R,G,B values</b>.
161
+
162
+ ## Linux terminals and colour support
163
+
164
+ The general syntax rules for colours is in the form of **fg_bg** values,
165
+ where a value of 38 stands for the foreground, and 48 stands for
166
+ the background.
167
+
168
+ The ANSI colour for red is 196 and the ANSI colour for black is
169
+ 0.
170
+
171
+ To use the colour red, you could issue this command:
172
+
173
+ printf "\e[38;5;196m Hello world in red\n"
174
+
175
+ To use the colour black as background, you could issue this command:
176
+
177
+ printf "\e[48;5;0m Hello world in black\n"
178
+
179
+ Do note that the same can be accomplished via RGB values rather than
180
+ ANSI color codes, as long as the terminal supports this (KDE Konsole
181
+ does).
182
+
183
+ Depending on whether you want to apply the color to the foreground or
184
+ to the background, use an **fg_bg** value of 38 or 48 (respectively).
185
+
186
+ Example:
187
+
188
+ printf "\e[<fg_bg>;2;<R>;<G>;<B>m"
189
+ printf "\e[38;2;255;0;0m Foreground color: red\n"
190
+ printf "\e[48;2;0;0;0m Background color: black\n"
191
+
192
+ This may be the better variant altogether, as it is quite easy to convert
193
+ into (and from) **RGB values**, but your mileage may vary.
194
+
195
+ Of course you can use this in plain ruby just as well - let's show this
196
+ via puts:
197
+
198
+ puts "\e[38;2;#{222};#{131};#{141}m Hello world!"
199
+ puts "\e[38;2;#{122};#{56};#{141}m Hello world!"
200
+ puts "\e[38;2;122;156;141m Hello world!"
201
+ puts "\x1b[3mHello world!\x1b[0m"
202
+ puts "\e[38;3mHello world!\x1b[0m"
203
+
204
+ In bash the ESC code can be either of the following:
205
+
206
+ \e
207
+ \033 (octal)
208
+ \x1B (hexadecimal)
209
+
210
+ The "\e[0m" sequence removes all attributes, including formatting and colors.
211
+ It may be useful to add it to the end of each colour text - and this is
212
+ what the **Colours** project is essentially doing.
213
+
214
+ To see which colours are supported/supportable, for each terminal,
215
+ have a look at the following **link**:
216
+
217
+ https://misc.flogisoft.com/bash/tip_colors_and_formatting#terminals_compatibility
218
+
219
+ To set both the foreground and background colours at once, you can use:
220
+
221
+ printf "\e[S;FG;BGm"
222
+ echo -e "\e[S;FG;BGm"
223
+
224
+ For example, bold white foreground on a red background:
225
+
226
+ printf "\e[1;97;41mHello world!"
227
+ printf "\e[1;97;41mHello world!\n"
228
+
229
+ Thus, if you would like to use red colour on black background,
230
+ you could do this:
231
+
232
+ printf '\e[38;5;196m;\e[48;5;0m Hello world!\n'
233
+
234
+ Specifically, the background colours are:
235
+
236
+ 40 black
237
+ 41 red
238
+ 42 green
239
+ 43 yellow
240
+ 44 blue
241
+ 45 magenta
242
+ 46 cyan
243
+ 47 white
244
+
245
+ The following command will use red background:
246
+
247
+ echo -e '\e[0;41m'
248
+ echo -e '\e[0;41m hello world\n\n ok\e[0;m'
249
+
250
+ ## Obtain all available HTML colours
251
+
252
+ To obtain all available html-colours, do this:
253
+
254
+ Colours::HtmlColours.all_colours?
255
+
256
+ Or in a simpler way, without the ::HtmlColours part:
257
+
258
+ Colours.return_all_html_colours
259
+
260
+ There are presently 142 registered HTML colours available:
261
+
262
+ Colours.return_all_html_colours.size # => 142
263
+
264
+ If you need to find out whether a given String (a **word**)
265
+ is registered as part of the HTML-Colours within **module
266
+ Colours**, then you could use the following toplevel-method:
267
+
268
+ Colours.is_this_html_colour_included?
269
+ Colours.is_this_html_colour_included? :slateblue # => true
270
+ Colours.is_this_html_colour_included? 'royalblue' # => true
271
+
272
+ ## eparse()
273
+
274
+ The eparse() method is a convenience method to apply on
275
+ Strings such as 'Foo: bar'. Note the ':' character
276
+ there. That input will be split, and then displayed
277
+ via two different colours.
278
+
279
+ ## Underline / Underlining
280
+
281
+ You can **underline** text, and print it onto the terminal,
282
+ by issuing a command such as the following:
283
+
284
+ txt = 'Hello world!'
285
+
286
+ Colours.underline(txt)
287
+
288
+ You can also add colours to this, via {}:
289
+
290
+ Colours.underline(txt)
291
+ Colours.underline(txt) { :palegreen }
292
+ Colours.underline(txt) { :slateblue }
293
+ Colours.underline(txt) { :orange }
294
+ Colours.underline(txt) { :crimson }
295
+
296
+ Within the {} block you can use HTML colours, as symbol, such as
297
+ :slateblue or :orange and so forth. If you would rather not like
298
+ to use these colours then simply do not pass them into the
299
+ method, as the first variant shows. :)
300
+
301
+ If you only want to get the colour code for that string, without
302
+ displaying it on the terminal it, then you can use .string_underline()
303
+ or .return_underline() method:
304
+
305
+ Colours.string_underline(txt) { :palegreen }
306
+ Colours.string_underline(txt) { :slateblue }
307
+ Colours.string_underline(txt) { :orange }
308
+ Colours.string_underline(txt) { :crimson }
309
+ Colours.return_underline(txt) { :royalblue }
310
+
311
+ ## include Colours::Methods
312
+
313
+ Since as of February 2019 there is a module called **Methods**
314
+ part of the colours gem. This module allows us to include
315
+ the konsole-related colour methods into a subclass.
316
+
317
+ Example:
318
+
319
+ class Foo
320
+ include Colours::Methods
321
+ end
322
+
323
+ e Foo.new.royalblue('hey there')
324
+
325
+ As you can see, this class will have the HTML colours available,
326
+ such as .royalblue() or .slateblue() and so forth.
327
+
328
+ I needed this in some of my other code, so it was added. I like
329
+ full colour support on terminals such as **KDE konsole**.
330
+
331
+ Note that this has to be specifically included, as I am not sure
332
+ everyone wants to have that the moment **include Colours** is
333
+ done. The toplevel Colours module will stay a bit simpler by
334
+ default; for customization, you will have to go the extra
335
+ line through **include Colours::Methods**, which appears to be
336
+ an acceptable trade-off.
337
+
338
+ Note that you can also subclass from a "dummy" class with colour
339
+ support, such as royalblue() or slateblue.
340
+
341
+ Use code similar to the following variant for this:
342
+
343
+ require 'colours/base/base.rb'
344
+
345
+ class Foobar < Colours::Base # Or whatever the name of your class is
346
+ end
347
+
348
+ ## KDE Konsole support
349
+
350
+ The **Colours gem** used to have a submodule called **Konsole**,
351
+ in particular the <b>KDE Konsole</b>. In May 2019 this submodule
352
+ was removed; the functionality is now available in the form of
353
+ an autogenerated .rb file instead.
354
+
355
+ You can **use RGB colours** in the KDE konsole (but also in
356
+ other terminal-types such as vte-based ones, like
357
+ **mate-terminal**).
358
+
359
+ For an example, have a look at the file **bin/colours**
360
+ that is distributed with this gem here (the colours gem). That file
361
+ will output all the HTML colour variants (via their RGB values).
362
+ Best shown on a black background in your terminal.
363
+
364
+ To **view all RGB colours** based on their HTML names, such
365
+ as <b>palegreen</b> or <b>slateblue</b>, do this:
366
+
367
+ colours
368
+
369
+ Also note that since as of **May 2018**, you can invoke the
370
+ HTML colours on the Konsole namespace directly, including
371
+ text-output, via code like this:
372
+
373
+ Colours.edarkgreen 'yo there'
374
+ Colours.eslateblue 'yo there'
375
+ Colours.eroyalblue 'yo there'
376
+ Colours.edarkgreen 'Hello world!'
377
+
378
+ The leading 'e' of these methods stands for "echo", aka
379
+ puts-related output. In other words, to print the text
380
+ that comes afterwards.
381
+
382
+ To print something in bold, you can use **Colours.bold()**
383
+ like in this way:
384
+
385
+ Colours.bold
386
+
387
+ ## Showing the colour palette on the commandline
388
+
389
+ You can show the "classical" ASCII colours on the commandline by
390
+ invoking this method:
391
+
392
+ Colours.show_palette
393
+
394
+ This also works, or should work, from the commandline, like so:
395
+
396
+ colours --show-palette
397
+ colours --palette
398
+
399
+ ## The KDE colour palette
400
+
401
+ The **KDE project** makes use of a special, **named colour palette**.
402
+
403
+ This palette includes the following **20 different colours**, via
404
+ a trivial name:
405
+
406
+ Abyss Blue
407
+ Alternate Grey
408
+ Beware Orange
409
+ Burnt Charcoal
410
+ Cardboard Grey
411
+ Charcoal Grey
412
+ Coastal Fog
413
+ Deco Blue
414
+ Hover Blue
415
+ Hyper Blue
416
+ Icon Blue
417
+ Icon Green
418
+ Icon Grey
419
+ Icon Red
420
+ Icon Yellow
421
+ Lazy Grey
422
+ Noble Fir
423
+ Paper White
424
+ Pimpinella
425
+ Plasma Blue
426
+
427
+ You can find these entries, including their hex-values and their
428
+ RGB values, on websites such as this one here:
429
+
430
+ https://community.kde.org/KDE_Visual_Design_Group/HIG/Color
431
+
432
+ Note that these are also called the "Breeze" colours, which I
433
+ assume is the name of the theme.
434
+
435
+ Since as of July 2018, the colours project also includes these
436
+ colours, via the file <b>colours/constants/kde_colour_palette.rb</b>.
437
+
438
+ The entries are stored in a **.yml file**, so if anyone wants to re-use
439
+ these from a yaml file, feel free to just copy/paste it from there.
440
+ That file is at <b>colours/yaml/kde_colour_palette.yml</b>.
441
+
442
+ Internally, the values are made available via the constant:
443
+
444
+ Colours::KDE_COLOUR_PALETTE
445
+
446
+ Which is a hash. There are also a few methods that may be useful to
447
+ use. For example, if you want to use a random colour, and output
448
+ <b>Hello world!</b>, then you could use the following method:
449
+
450
+ Colours.write_this_via_kde_colour_palette 'Hello world!', :random
451
+
452
+ While random colours may be nice, perhaps you may want to use a
453
+ definite colour from the above list. Say that you may want to
454
+ write via <b>Plasma Blue</b>. In this case, you could use:
455
+
456
+ Colours.write_this_via_kde_colour_palette 'Hello world!', :plasma_blue
457
+
458
+ So using a symbol works too.
459
+
460
+ If you tend to use this regularly, then an even simpler way may exist,
461
+ by simply calling a method that already has that as part of its name.
462
+
463
+ Examples with **Hello World!**:
464
+
465
+ Colours.kde_colour_palette_abyss_blue 'Hello world!'
466
+ Colours.kde_colour_palette_alternate_grey 'Hello world!'
467
+ Colours.kde_colour_palette_beware_orange 'Hello world!'
468
+ Colours.kde_colour_palette_burnt_charcoal 'Hello world!'
469
+ Colours.kde_colour_palette_cardboard_grey 'Hello world!'
470
+ Colours.kde_colour_palette_charcoal_grey 'Hello world!'
471
+ Colours.kde_colour_palette_coastal_fog 'Hello world!'
472
+ Colours.kde_colour_palette_deco_blue 'Hello world!'
473
+ Colours.kde_colour_palette_hover_blue 'Hello world!'
474
+ Colours.kde_colour_palette_hyper_blue 'Hello world!'
475
+ Colours.kde_colour_palette_icon_blue 'Hello world!'
476
+ Colours.kde_colour_palette_icon_green 'Hello world!'
477
+ Colours.kde_colour_palette_icon_grey 'Hello world!'
478
+ Colours.kde_colour_palette_icon_red 'Hello world!'
479
+ Colours.kde_colour_palette_icon_yellow 'Hello world!'
480
+ Colours.kde_colour_palette_lazy_grey 'Hello world!'
481
+ Colours.kde_colour_palette_noble_fir 'Hello world!'
482
+ Colours.kde_colour_palette_paper_white 'Hello world!'
483
+ Colours.kde_colour_palette_pimpinella 'Hello world!'
484
+ Colours.kde_colour_palette_plasma_blue 'Hello world!'
485
+
486
+ The reason as to why this is so long is so that we can avoid any name clashes -
487
+ but in principle, we could also enable a **shorter name**, such as:
488
+
489
+ Colours.pimpinella # much shorter than Colours.kde_colour_palette_pimpinella
490
+
491
+ You can also use the "e" method, **e** which stands for **echo**, such as in:
492
+
493
+ Colours.epimpinella 'Hello cats!'
494
+
495
+ This functionality is available for the Colours project since as of July 2018 -
496
+ but be careful, since this may change one day, in the event that a conflict
497
+ may exist with an already defined name (such as the names in the HTML colour
498
+ charts, e. g. "slateblue", "royalblue" and so forth).
499
+
500
+ Do note that the behaviour may change, too; e. g. **Colours.pimpinella()** may in
501
+ the future only return a String, and a new method called **Colours.epimpinella()**
502
+ would be tasked with outputting the text - but for the time being, things stay
503
+ as described above (in July 2018).
504
+
505
+ ## Generating a shell file with all HTML colours
506
+
507
+ You can generate a shell file that can be sourced, in **bash**, **fish**
508
+ and possibly **zsh**, in order to make use of the HTML colours on the
509
+ commandline.
510
+
511
+ The method that does so is:
512
+
513
+ Colours.generate_shell_file_containing_the_html_colours()
514
+
515
+ This will store in the current working directory; or to another
516
+ directory if you pass an argument to it.
517
+
518
+ The file will have entries such as:
519
+
520
+ export CHARTREUSE="\e[38;2;127;255;0m"
521
+
522
+ This is the RGB variant for the colour at hand. The closing tag
523
+ is missing there, so you may have to use it if you wish to
524
+ output text that is coloured.
525
+
526
+ You can source this .sh file and re-use it in your own scripts.
527
+
528
+ You can also generate this **shell file** from the commandline,
529
+ through **bin/colours**.
530
+
531
+ Issue a command like any of the following variants:
532
+
533
+ colours --generate-shell-file-containing-the-html-colours
534
+ colours --generate_shell_file_containing_the_html_colours
535
+ colours --generateshellfilecontainingthehtmlcolours
536
+ colours --create-shell-file
537
+
538
+ == Using the Konsole submodule
539
+
540
+ In the past there was a Konsole submodule, but in May 2019 during
541
+ a large rewrite, this submodule has been removed.
542
+
543
+ The functionality has been integrated into an autogenerated .rb
544
+ file though. That module can be found in the file called
545
+ **toplevel_basic_colour_methods.rb**.
546
+
547
+ Old invocation examples such as:
548
+
549
+ Colours[:slateblue]
550
+
551
+ Should be possible still.
552
+
553
+ You can also include this new module:
554
+
555
+ include Colours::AllColourMethods
556
+
557
+ Then you can simply call the respective colour output:
558
+
559
+ slateblue('Hello World!')
560
+
561
+ eslateblue()
562
+ eslateblue('Hello World!')
563
+
564
+ eslateblue() works like slateblue() but outputs the
565
+ result.
566
+
567
+ konsole_colour_slateblue('Hello World!')
568
+ ekonsole_colour_slateblue('Hello world!')
569
+
570
+ The above two variants are probably too long, but they
571
+ also exist if you wish to be more specific.
572
+
573
+ Automatic inclusion can be done like so:
574
+
575
+ require 'colours/konsole/autoinclude'
576
+
577
+ Konsole['slateblue']+'Hello World'
578
+ konsole :green, 'hello world'
579
+
580
+ Of course you can also manually include it by yourself:
581
+
582
+ require 'colours'
583
+
584
+ Note that when you include that module, you will have access
585
+ to methods such as e. g. slateblue() or sandybrown().
586
+
587
+ konsole_colours :slateblue, 'hello world!'
588
+
589
+ ## 256 colour support
590
+
591
+ Some terminals allow **support for 256 colours**.
592
+
593
+ The colours gem allows you to test this, via this toplevel-method:
594
+
595
+ Colours.show_all_256_colours
596
+
597
+ If you need to specifically use one of these colours, have a look
598
+ at the following two methods:
599
+
600
+ Colours.return_this_256_colour()
601
+ Colours.display_this_256_colour()
602
+
603
+ The first input argument should be the number, from 0-255, and
604
+ the second argument is the text that is to be displayed (append
605
+ a newline to this if you need one).
606
+
607
+ The first input argument is called <b>id</b>, for the purpose of
608
+ this document here.
609
+
610
+ Let's provide specific examples how to use the latter method.
611
+
612
+ For example, to ouput, in **red**, the sentence "<b>Ruby is awesome!</b>",
613
+ you could use either of the following methods:
614
+
615
+ Colours.display_this_256_colour(88, "Ruby is awesome!\n")
616
+ Colours.display_this_in_256_colour(88, "Ruby is awesome!\n")
617
+
618
+ Note that you can also use several colours, based on the id input,
619
+ via a pseudo-range. A **pseudo-range** is input that is a String and
620
+ includes one '-' character. For example, **33-44** is a pseudo-range
621
+ and so is **0-255**.
622
+
623
+ In ruby code, this could work like so - give it a try:
624
+
625
+ require 'colours'
626
+
627
+ Colours.display_this_256_colour('0-255',"Hello world, in a batch!\n")
628
+
629
+ If you wish to make use of these colour-methods in one of your classes,
630
+ then you can require the module, and include it into your class.
631
+
632
+ Example for this:
633
+
634
+ require 'new_colours/autogenerated/support_for_256_colours.rb'
635
+
636
+ class Foobar
637
+
638
+ include NewColours::SupportFor256Colours
639
+
640
+ def initialize
641
+ puts darkturquoise('HELLO ')+
642
+ maroon('WORLD ')+
643
+ 'This is ok again'
644
+ end
645
+
646
+ end
647
+
648
+ Foobar.new
649
+
650
+ ## revert
651
+
652
+ The toplevel instance variable called **@revert** designates which
653
+ escape code is used for reverting the colours again.
654
+
655
+ By default, this is **\e0m**. However had, for some strange reason
656
+ this does not appear to work very well on the default terminal
657
+ style that I use (KDE konsole, white font on black background).
658
+ It seems to default to white bold text, but I would rather want
659
+ light white text, aka **\e[0;37m**. This is why revert defaults
660
+ to **\e[0;37m**.
661
+
662
+ If you wish to use \e0m instead, then you can do so via:
663
+
664
+ Colours.set_revert('\e0m')
665
+
666
+ Or, via symbol, to the same value:
667
+
668
+ Colours.set_revert(:default)
669
+
670
+ ## Legacy versions of the Colours gem
671
+
672
+ In May 2019, the old **Konsole** submodule has been removed; the
673
+ functionality itself has been retained, though. Still, as the API
674
+ changed this means that not everyone may be able to use the new
675
+ colours gem release.
676
+
677
+ This is the reason why the old version at **0.3.40** will continue
678
+ to be available here. This one still has the old **Colours::Konsole**
679
+ submodule defined, so if you need it in a project, feel free to
680
+ use that older version.
681
+
682
+ Otherwise I recommend to **upgrade** to the latest version of the
683
+ colours gem - the code is, in my opinion, better too.
684
+
685
+ ## Available colour methods
686
+
687
+ If you wish to find out which colour methods will be available by
688
+ default, onto the main Colours namespace, you can use the following
689
+ method to find out:
690
+
691
+ Colours.all_available_colour_methods?
692
+
693
+ This will return an Array containing the names of all these
694
+ toplevel methods. In May 2019 we can find 307 available
695
+ colour methods e. g. such as **Colours.slateblue** or
696
+ **Colours.lightblue** and so forth.
697
+
698
+ ## Remove escaping sequences
699
+
700
+ If you wish to remove all escaping sequences from a given String,
701
+ you can use the following API for this:
702
+
703
+ Colours.remove_escape_sequences()
704
+ Colours.remove_escape_sequences "\e[38;2;41;128;18mHello world!\e[0;37m" # => "Hello world!"
705
+ pp Colours.remove_escape_sequences(Colours.slateblue('Hello world!')) # => "Hello world!"
706
+
707
+ The latter example shows that the escape-sequences are properly removed.
708
+
709
+ If you still find an example where the escape sequences are not
710
+ working properly, e. g. because they are retained, then consider
711
+ this to be a bug; once reported, a test case can be added to allow
712
+ for removing this escape sequence as well.
713
+
714
+ **Sometimes** you may **only wish to remove the trailing escape
715
+ sequence**, aka "\e[0;37m". In this case the following method may
716
+ be useful:
717
+
718
+ Colours.remove_trailing_end_from()
719
+ Colours.remove_trailing_ansii_escape_code()
720
+
721
+ Usage example:
722
+
723
+ x = Colours.remove_trailing_end_from("\e[38;2;70;130;180m\e[0;37m") # => "\e[38;2;70;130;180m"
724
+
725
+ ## Colours.does_this_line_include_a_html_colour?
726
+
727
+ If you need to determine whether a line (a string) includes a valid
728
+ HTML colour, such as slateblue>, then you can use the following method:
729
+
730
+ Colours.does_this_line_include_a_html_colour?
731
+ Colours.does_this_line_include_a_html_colour? "<green>yo there</green> <orange>getline() function</orange>" # => true
732
+ Colours.does_this_line_include_a_html_colour? "foo bar" # => false
733
+
734
+ ## Colours.replace_all_html_colours_in_this_line
735
+
736
+ If you wish to replace all HTML colours in a given line/string,
737
+ then the following **toplevel method** can be used:
738
+
739
+ Colours.replace_all_html_colours_in_this_line
740
+ puts Colours.replace_all_html_colours_in_this_line '<one>hey</one>' # ← This variant works as well.
741
+
742
+ This has been specifically added for commandline-use. It allows us
743
+ to replace HTML colour "tags" with the corresponding RGB value,
744
+ so that a terminal emulator such as the KDE konsole can display
745
+ this.
746
+
747
+ ## Rainbow colours
748
+
749
+ You must install the paint gem first:
750
+
751
+ gem install paint
752
+
753
+ Then you can do the following:
754
+
755
+ Colours::RainbowColours.print_rainbow_line("Hello world \n" * 40)
756
+
757
+ To print a line directly you can also use printl_plain():
758
+
759
+ Colours::RainbowColours.println_plain "one two three four five six seven eight nine ten\n\n\n"
760
+
761
+ ## Colours.fancy_parse
762
+
763
+ The toplevel method **Colours.fancy_parse()** can be used to
764
+ parse a more complicated text/string.
765
+
766
+ For example, say that you have a HTML string with embedded i
767
+ tag and HTML colours.
768
+
769
+ You can display this on the commandline.
770
+
771
+ Example:
772
+
773
+ puts Colours.fancy_parse "<lightgreen><i>hey</i></lightgreen> <teal>there</teal>"
774
+ puts Colours.fancy_parse "<tomato>hey</tomato> <teal>there</teal>"
775
+ puts Colours.fancy_parse "<tomato><i>hey</i></tomato> <teal>there</teal>"
776
+ puts Colours.fancy_parse "<tomato><b>Hello world.</b></tomato>"
777
+ puts Colours.fancy_parse "<tomato>Hello world.</tomato>"
778
+
779
+ I recommend the KDE Konsole for this, but it should work on gnome-terminal as
780
+ well. Currently (September 2019) only HTML colours, such as tomato, steelblue,
781
+ and so forth, are supported, as well as i (italic). This may be extended at
782
+ a later time including bold.
783
+
784
+ Note that this is not working perfectly correctly for longer strings with
785
+ lots of tags. At a later point this will have to be improved, but for now,
786
+ it simply has to suffice. Patches are welcome, though. :)
787
+
788
+ ## Support for italic text
789
+
790
+ In KDE konsole, the escape sequences \e[3m and \e[23m can be used
791
+ to turn italics on and off, respectively. See this commit:
792
+
793
+ https://invent.kde.org/utilities/konsole/commit/68a98ed77063e622985d422b625d7dc5895f10c3
794
+
795
+ Let's have a look at an example for this in ruby (and KDE konsole):
796
+
797
+ puts "\e[3mHello world!\e[23m"
798
+
799
+ I tested this in July 2020 and it works fine.
800
+
801
+ Of course it can also work on the commandline, e. g. via bash/zsh or
802
+ a similar shell:
803
+
804
+ echo -e "\e[3mHello world!\e[23m"
805
+
806
+ ## Converting html-colours to their HEX value
807
+
808
+ If you want to convert a html-colour into the corresponding RGB value
809
+ then try bin/html_colour_to_hex_value like in this way:
810
+
811
+ html_colour_to_hex_value slateblue # Output would be '#6A5ACD', without '' quotes.
812
+
813
+ (You may have to add the bin/ path of that gem to your $PATH.)
814
+
815
+ ## Removing html-colours and other "tags" from a String
816
+
817
+ If you have entries such as <one> or <steelblue> (aka one, and steelblue),
818
+ and wish to replace them with the RGB values, for commandline use,
819
+ you could try to use this method:
820
+
821
+ Colours.eliminate_html(your_string_here)
822
+ Colours.away_with_html_colours_and_special_numbers(your_string_here)
823
+ Colours.away_with_html_colours_and_special_numbers "<royalblue>+</royalblue>" # => "\e[38;2;128;128;128m\e[38;2;65;105;225m+\e[38;2;128;128;128m"
824
+
825
+ This was needed so that other projects can **turn strings into colourized
826
+ strings** - on the commandline. This explains the result, as the \e is
827
+ typically used to specify an escape sequence.
828
+
829
+ ## Licence
830
+
831
+ The project used to be under the **GPL-2.0 licence** (no later clause),
832
+ until **August 2019** (**26.08.2019**, in dd.mm.yyyy notation).
833
+
834
+ However had, I have changed my mind for various reasons (including the
835
+ situation that different projects, with different licenses, may make
836
+ use of the **colours gem**) and thus re-published the colours
837
+ project under the less stringent **MIT licence**. Both licences are
838
+ fine licences, but I feel that for the basic building blocks, such
839
+ as the colours gem, a less stringent licence makes a lot more
840
+ sense.
841
+
842
+ See the file **LICENCE.md** for this licence, or just have look at
843
+ the following URL here:
844
+
845
+ https://opensource.org/licenses/MIT
846
+
847
+ Replace the effective year simply with whatever was the last release
848
+ on the rubygems.org homepage of this gem here.
849
+
850
+ ADD_CONTACT_INFORMATION