diff options
author | Abinoam P. Marques Jr <abinoam@gmail.com> | 2017-09-24 22:23:10 -0300 |
---|---|---|
committer | Abinoam P. Marques Jr <abinoam@gmail.com> | 2017-09-25 06:50:59 -0300 |
commit | e5d8c9a7301a0e5c219feb8218e3fff35475a732 (patch) | |
tree | 678009a68309cf8364abce448727d521ceb230a0 /lib | |
parent | 7e5df1b2848f8c2b4058f67398962ab123c97e95 (diff) | |
download | highline-e5d8c9a7301a0e5c219feb8218e3fff35475a732.tar.gz |
Revert %i use for 1.9 compatibility
Diffstat (limited to 'lib')
-rw-r--r-- | lib/highline/color_scheme.rb | 12 | ||||
-rwxr-xr-x | lib/highline/question.rb | 8 |
2 files changed, 10 insertions, 10 deletions
diff --git a/lib/highline/color_scheme.rb b/lib/highline/color_scheme.rb index 414ebb1..e1bec88 100644 --- a/lib/highline/color_scheme.rb +++ b/lib/highline/color_scheme.rb @@ -130,12 +130,12 @@ class HighLine # A sample ColorScheme. class SampleColorScheme < ColorScheme SAMPLE_SCHEME = { - critical: %i[yellow on_red], - error: %i[bold red], - warning: %i[bold yellow], - notice: %i[bold magenta], - info: %i[bold cyan], - debug: %i[bold green], + critical: [:yellow, :on_red], + error: [:bold, :red], + warning: [:bold, :yellow], + notice: [:bold, :magenta], + info: [:bold, :cyan], + debug: [:bold, :green], row_even: [:cyan], row_odd: [:magenta] }.freeze diff --git a/lib/highline/question.rb b/lib/highline/question.rb index d94df9a..f93d4d1 100755 --- a/lib/highline/question.rb +++ b/lib/highline/question.rb @@ -307,9 +307,9 @@ class HighLine # @return [String] upcased, downcased, capitalized # or unchanged answer String. def change_case(answer_string) - if %i[up upcase].include?(@case) + if [:up, :upcase].include?(@case) answer_string.upcase - elsif %i[down downcase].include?(@case) + elsif [:down, :downcase].include?(@case) answer_string.downcase elsif @case == :capitalize answer_string.capitalize @@ -432,11 +432,11 @@ class HighLine def remove_whitespace(answer_string) if !whitespace answer_string - elsif %i[strip chomp].include?(whitespace) + elsif [:strip, :chomp].include?(whitespace) answer_string.send(whitespace) elsif whitespace == :collapse answer_string.gsub(/\s+/, " ") - elsif %i[strip_and_collapse chomp_and_collapse].include?(whitespace) + elsif [:strip_and_collapse, :chomp_and_collapse].include?(whitespace) result = answer_string.send(whitespace.to_s[/^[a-z]+/]) result.gsub(/\s+/, " ") elsif whitespace == :remove |