diff options
author | Abinoam Praxedes Marques Jr <abinoam@gmail.com> | 2015-02-27 12:17:29 -0300 |
---|---|---|
committer | Abinoam Praxedes Marques Jr <abinoam@gmail.com> | 2015-02-27 12:17:29 -0300 |
commit | e7ed37d5b29df1f07249a7f1472017d6f506b02b (patch) | |
tree | 421e81322f0b5b8ec4e917dabdf21fa9e18faddd /lib/highline/style.rb | |
parent | 3def16d7ef1e048875af8144bfc1ef635edbc89d (diff) | |
download | highline-e7ed37d5b29df1f07249a7f1472017d6f506b02b.tar.gz |
Begin implementation of HighLine::Style.clear_index
There was a commented HighLine::Style.clear_index on teardown of tc_style.rb tests.
Begin implementation of it preserving builtin styles.
This is important to ensure a clean enviroment for each test.
Diffstat (limited to 'lib/highline/style.rb')
-rwxr-xr-x | lib/highline/style.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/highline/style.rb b/lib/highline/style.rb index 3f83527..92f0b84 100755 --- a/lib/highline/style.rb +++ b/lib/highline/style.rb @@ -54,6 +54,11 @@ class HighLine style end + def self.clear_index + # reset to builtin only styles + @@styles = list.select { |name, style| style.builtin } + end + def self.rgb_hex(*colors) colors.map do |color| color.is_a?(Numeric) ? '%02x'%color : color.to_s |