From a19383966b077103eb99b45fd62cf33c2ae0f73b Mon Sep 17 00:00:00 2001 From: Marcin Kulik Date: Fri, 24 Jan 2014 13:25:47 +0100 Subject: [PATCH] Drop ruby 1.8 support, again. This reverts commit 61229c4ffadf599850c8aa6b565f302032f62782. --- .travis.yml | 1 - Gemfile | 4 ++-- Guardfile | 2 +- lib/rainbow/color.rb | 18 +++++++++--------- lib/rainbow/presenter.rb | 14 +++++++------- rainbow.gemspec | 17 +++++++++-------- spec/support/presenter_shared_examples.rb | 2 +- spec/unit/presenter_spec.rb | 4 ++-- 8 files changed, 31 insertions(+), 31 deletions(-) diff --git a/.travis.yml b/.travis.yml index 957bbd8..ea694a8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,5 @@ bundler_args: --without guard rvm: - - 1.8.7 - 1.9.2 - 1.9.3 - 2.0.0 diff --git a/Gemfile b/Gemfile index 6040708..d87aab6 100644 --- a/Gemfile +++ b/Gemfile @@ -3,8 +3,8 @@ source 'https://rubygems.org' # Specify your gem's dependencies in rainbow.gemspec gemspec -gem 'coveralls', :require => false -gem 'mime-types', '< 2.0.0', :platforms => [:ruby_18] +gem 'coveralls', require: false +gem 'mime-types', '< 2.0.0', platforms: [:ruby_18] group :guard do gem 'guard' diff --git a/Guardfile b/Guardfile index ed4d3bc..26fc732 100644 --- a/Guardfile +++ b/Guardfile @@ -1,7 +1,7 @@ # A sample Guardfile # More info at https://github.com/guard/guard#readme -guard :rspec, :cmd => 'rspec --color' do +guard :rspec, cmd: 'rspec --color' do watch(%r{^spec/.+_spec\.rb$}) watch(%r{^lib/(.+)\.rb$}) { "spec" } watch('spec/spec_helper.rb') { "spec" } diff --git a/lib/rainbow/color.rb b/lib/rainbow/color.rb index 631acf0..048d4b5 100644 --- a/lib/rainbow/color.rb +++ b/lib/rainbow/color.rb @@ -52,15 +52,15 @@ def codes class Named < Indexed NAMES = { - :black => 0, - :red => 1, - :green => 2, - :yellow => 3, - :blue => 4, - :magenta => 5, - :cyan => 6, - :white => 7, - :default => 9, + black: 0, + red: 1, + green: 2, + yellow: 3, + blue: 4, + magenta: 5, + cyan: 6, + white: 7, + default: 9, } def initialize(ground, name) diff --git a/lib/rainbow/presenter.rb b/lib/rainbow/presenter.rb index 1868d18..a80578e 100644 --- a/lib/rainbow/presenter.rb +++ b/lib/rainbow/presenter.rb @@ -6,13 +6,13 @@ module Rainbow class Presenter < ::String TERM_EFFECTS = { - :reset => 0, - :bright => 1, - :italic => 3, - :underline => 4, - :blink => 5, - :inverse => 7, - :hide => 8, + reset: 0, + bright: 1, + italic: 3, + underline: 4, + blink: 5, + inverse: 7, + hide: 8, } # Sets color of this text. diff --git a/rainbow.gemspec b/rainbow.gemspec index c791c66..9f89d1d 100644 --- a/rainbow.gemspec +++ b/rainbow.gemspec @@ -4,14 +4,15 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'rainbow/version' Gem::Specification.new do |spec| - spec.name = "rainbow" - spec.version = Rainbow::VERSION - spec.authors = ["Marcin Kulik"] - spec.email = ["m@ku1ik.com"] - spec.description = %q{Colorize printed text on ANSI terminals} - spec.summary = %q{Colorize printed text on ANSI terminals} - spec.homepage = "https://github.com/sickill/rainbow" - spec.license = "MIT" + spec.name = "rainbow" + spec.version = Rainbow::VERSION + spec.authors = ["Marcin Kulik"] + spec.email = ["m@ku1ik.com"] + spec.description = %q{Colorize printed text on ANSI terminals} + spec.summary = %q{Colorize printed text on ANSI terminals} + spec.homepage = "https://github.com/sickill/rainbow" + spec.license = "MIT" + spec.required_ruby_version = '>= 1.9.2' spec.files = `git ls-files`.split($/) spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } diff --git a/spec/support/presenter_shared_examples.rb b/spec/support/presenter_shared_examples.rb index a20e5ca..e819e75 100644 --- a/spec/support/presenter_shared_examples.rb +++ b/spec/support/presenter_shared_examples.rb @@ -1,7 +1,7 @@ shared_examples_for "presenter with shortcut color methods" do [:black, :red, :green, :yellow, :blue, :magenta, :cyan, :white].each do |name| describe "##{name}" do - subject { presenter.send(name) } + subject { presenter.public_send(name) } it { should eq(presenter.color(name)) } end diff --git a/spec/unit/presenter_spec.rb b/spec/unit/presenter_spec.rb index 1491045..36cb007 100644 --- a/spec/unit/presenter_spec.rb +++ b/spec/unit/presenter_spec.rb @@ -17,7 +17,7 @@ module Rainbow end shared_examples_for "text color method" do - let(:color) { double('color', :codes => [1, 2]) } + let(:color) { double('color', codes: [1, 2]) } before do allow(Color).to receive(:build). @@ -34,7 +34,7 @@ module Rainbow end shared_examples_for "text background method" do - let(:color) { double('color', :codes => [1, 2]) } + let(:color) { double('color', codes: [1, 2]) } before do allow(Color).to receive(:build).