Skip to content

Commit

Permalink
Restore 1.9 compatibility, fix rake task
Browse files Browse the repository at this point in the history
  • Loading branch information
nateberkopec committed Sep 21, 2016
1 parent 3eb7852 commit cfbeedd
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ source 'https://rubygems.org'

# Specify your gem's dependencies in test-gem.gemspec
gemspec

gem 'tins', '~> 1.0.0' # Ruby 1.9 compat
14 changes: 10 additions & 4 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
require "bundler/gem_tasks"
require 'bundler'
Bundler.setup
Bundler::GemHelper.install_tasks

desc "Run specs"
task :spec do
sh "bundle exec rspec -f progress"
require 'rake'
require 'rspec/core/rake_task'

desc "Run all examples"
RSpec::Core::RakeTask.new(:spec) do |t|
t.ruby_opts = %w[-w]
t.rspec_opts = %w[--color]
end

desc "Default: Run specs"
Expand Down
2 changes: 1 addition & 1 deletion lib/terminal-table/table.rb
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def recalc_column_widths
end
end

resolve = -> (colspan, full_width, index = 0) do
resolve = lambda do |colspan, full_width, index = 0|
# stop if reaches the bottom level.
return @column_widths[index] = full_width if colspan == 1

Expand Down
1 change: 1 addition & 0 deletions spec/table_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# encoding: utf-8
require 'spec_helper'

module Terminal
Expand Down

0 comments on commit cfbeedd

Please sign in to comment.