Skip to content

Commit

Permalink
Drop ruby 1.8 support, again.
Browse files Browse the repository at this point in the history
This reverts commit 61229c4.
  • Loading branch information
ku1ik committed Jan 24, 2014
1 parent f46de59 commit a193839
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 31 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
bundler_args: --without guard
rvm:
- 1.8.7
- 1.9.2
- 1.9.3
- 2.0.0
Expand Down
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion Guardfile
Original file line number Diff line number Diff line change
@@ -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" }
Expand Down
18 changes: 9 additions & 9 deletions lib/rainbow/color.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
14 changes: 7 additions & 7 deletions lib/rainbow/presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
17 changes: 9 additions & 8 deletions rainbow.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ["[email protected]"]
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 = ["[email protected]"]
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) }
Expand Down
2 changes: 1 addition & 1 deletion spec/support/presenter_shared_examples.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions spec/unit/presenter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand All @@ -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).
Expand Down

0 comments on commit a193839

Please sign in to comment.