Skip to content

Commit

Permalink
Drop MRI 1.8.7-2.2 support (#158)
Browse files Browse the repository at this point in the history
* Remove deprecated TravisCI config
    - this is currently a noop.
* Remove MRI 1.8.7 support
* Remove MRI 1.9 support
* Remove MRI 2.0.0 support
* Remove MRI 2.1 support
* Remove MRI 2.2 support
* Remove rbx-3 from TravisCI matrix
    - it doesn't even install.
  • Loading branch information
deivid-rodriguez authored Feb 10, 2020
1 parent c4af859 commit 92d5134
Show file tree
Hide file tree
Showing 14 changed files with 32 additions and 108 deletions.
11 changes: 0 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,14 @@
sudo: false

before_install: gem install bundler

rvm:
- 1.8.7-head
- 1.9.3-p551
- 2.0.0-p648
- 2.1.10
- 2.2.9
- 2.3.6
- 2.4.3
- 2.5.0
- rbx-3
- jruby-19mode
- ruby-head
- jruby-head

matrix:
fast_finish: true
allow_failures:
- rvm: rbx-3
- rvm: jruby-19mode
- rvm: ruby-head
- rvm: jruby-head
6 changes: 0 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,3 @@ gemspec

# This here to make sure appraisal works with Rails 3.0.0.
gem "thor", "~> 0.14.0"

if RUBY_VERSION < "1.9"
eval File.read("Gemfile-1.8")
elsif RUBY_VERSION < "2.2"
eval File.read("Gemfile-2.1")
end
5 changes: 0 additions & 5 deletions Gemfile-1.8

This file was deleted.

3 changes: 0 additions & 3 deletions Gemfile-2.1

This file was deleted.

2 changes: 2 additions & 0 deletions appraisal.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Gem::Specification.new do |s|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]

s.required_ruby_version = ">= 2.3.0"

s.add_runtime_dependency('rake')
s.add_runtime_dependency('bundler')
s.add_runtime_dependency('thor', '>= 0.14.0')
Expand Down
11 changes: 5 additions & 6 deletions lib/appraisal/bundler_dsl.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require "appraisal/dependency_list"
require "appraisal/ordered_hash"

module Appraisal
class BundlerDSL
Expand All @@ -13,11 +12,11 @@ def initialize
@ruby_version = nil
@dependencies = DependencyList.new
@gemspecs = []
@groups = OrderedHash.new
@platforms = OrderedHash.new
@gits = OrderedHash.new
@paths = OrderedHash.new
@source_blocks = OrderedHash.new
@groups = Hash.new
@platforms = Hash.new
@gits = Hash.new
@paths = Hash.new
@source_blocks = Hash.new
@git_sources = {}
end

Expand Down
3 changes: 1 addition & 2 deletions lib/appraisal/dependency_list.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
require 'appraisal/dependency'
require 'appraisal/ordered_hash'

module Appraisal
class DependencyList
def initialize
@dependencies = OrderedHash.new
@dependencies = Hash.new
end

def add(name, requirements)
Expand Down
22 changes: 0 additions & 22 deletions lib/appraisal/ordered_hash.rb

This file was deleted.

2 changes: 1 addition & 1 deletion lib/appraisal/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def self.format_hash_value(key, value)
key = format_string(key, true)
value = format_string(value, true)

if RUBY_VERSION >= "1.9" && key.start_with?(":")
if key.start_with?(":")
"#{key.sub(/^:/, "")}: #{value}"
else
"#{key} => #{value}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
build_appraisal_file <<-Appraisals
appraise 'breakfast' do
source 'http://some-other-source.com'
ruby "1.8.7"
ruby "2.3.0"
gem 'bread'
gem "pain_au_chocolat", :custom_git_source => "pain_au_chocolat"
Expand Down Expand Up @@ -86,7 +86,7 @@
source "https://rubygems.org"
source "http://some-other-source.com"
ruby "1.8.7"
ruby "2.3.0"
git "../../gems/egg" do
gem "egg"
Expand Down
12 changes: 1 addition & 11 deletions spec/acceptance/bundle_with_custom_path_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@
source "https://rubygems.org"
gem 'appraisal', :path => #{PROJECT_ROOT.inspect}
if RUBY_VERSION < "1.9"
#{File.read(File.join(PROJECT_ROOT, "Gemfile-1.8"))}
elsif RUBY_VERSION < "2.2"
#{File.read(File.join(PROJECT_ROOT, "Gemfile-2.1"))}
end
Gemfile

build_appraisal_file <<-Appraisals
Expand Down Expand Up @@ -48,11 +42,7 @@
build_gemfile <<-Gemfile
source "https://rubygems.org"
if RUBY_VERSION <= "1.9"
gem '#{gem_name}', '~> 1.6.5'
else
gem '#{gem_name}'
end
gem '#{gem_name}'
Gemfile

run 'bundle install --path vendor/another'
Expand Down
22 changes: 11 additions & 11 deletions spec/appraisal/gemfile_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -251,28 +251,28 @@
end

context "relative path handling" do
before { stub_const('RUBY_VERSION', '1.8.7') }
before { stub_const('RUBY_VERSION', '2.3.0') }

context "in :path option" do
it "handles dot path" do
gemfile = Appraisal::Gemfile.new
gemfile.gem "bacon", :path => "."

expect(gemfile.to_s).to eq %(gem "bacon", :path => "../")
expect(gemfile.to_s).to eq %(gem "bacon", path: "../")
end

it "handles relative path" do
gemfile = Appraisal::Gemfile.new
gemfile.gem "bacon", :path => "../bacon"

expect(gemfile.to_s).to eq %(gem "bacon", :path => "../../bacon")
expect(gemfile.to_s).to eq %(gem "bacon", path: "../../bacon")
end

it "handles absolute path" do
gemfile = Appraisal::Gemfile.new
gemfile.gem "bacon", :path => "/tmp"

expect(gemfile.to_s).to eq %(gem "bacon", :path => "/tmp")
expect(gemfile.to_s).to eq %(gem "bacon", path: "/tmp")
end
end

Expand All @@ -281,29 +281,29 @@
gemfile = Appraisal::Gemfile.new
gemfile.gem "bacon", :git => "."

expect(gemfile.to_s).to eq %(gem "bacon", :git => "../")
expect(gemfile.to_s).to eq %(gem "bacon", git: "../")
end

it "handles relative git path" do
gemfile = Appraisal::Gemfile.new
gemfile.gem "bacon", :git => "../bacon"

expect(gemfile.to_s).to eq %(gem "bacon", :git => "../../bacon")
expect(gemfile.to_s).to eq %(gem "bacon", git: "../../bacon")
end

it "handles absolute git path" do
gemfile = Appraisal::Gemfile.new
gemfile.gem "bacon", :git => "/tmp"

expect(gemfile.to_s).to eq %(gem "bacon", :git => "/tmp")
expect(gemfile.to_s).to eq %(gem "bacon", git: "/tmp")
end

it "handles git uri" do
gemfile = Appraisal::Gemfile.new
gemfile.gem "bacon", :git => "[email protected]:bacon/bacon.git"

expect(gemfile.to_s).
to eq %(gem "bacon", :git => "[email protected]:bacon/bacon.git")
to eq %(gem "bacon", git: "[email protected]:bacon/bacon.git")
end
end

Expand Down Expand Up @@ -414,20 +414,20 @@
gemfile = Appraisal::Gemfile.new
gemfile.gemspec :path => "."

expect(gemfile.to_s).to eq %(gemspec :path => "../")
expect(gemfile.to_s).to eq %(gemspec path: "../")
end
end
end

context "git_source support" do
before { stub_const('RUBY_VERSION', '1.8.7') }
before { stub_const('RUBY_VERSION', '2.3.0') }

it "stores git_source declaration and apply it as git option" do
gemfile = Appraisal::Gemfile.new
gemfile.git_source(:custom_source) { |repo| "path/#{repo}" }
gemfile.gem "bacon", :custom_source => "bacon_pancake"

expect(gemfile.to_s).to eq %(gem "bacon", :git => "../path/bacon_pancake")
expect(gemfile.to_s).to eq %(gem "bacon", git: "../path/bacon_pancake")
end
end
end
27 changes: 8 additions & 19 deletions spec/appraisal/utils_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,24 @@

describe Appraisal::Utils do
describe '.format_string' do
if RUBY_VERSION > "1.9"
it "prints out a nice looking hash without brackets with new syntax" do
hash = { :foo => 'bar' }
expect(Appraisal::Utils.format_string(hash)).to eq('foo: "bar"')
it "prints out a nice looking hash without brackets with new syntax" do
hash = { :foo => 'bar' }
expect(Appraisal::Utils.format_string(hash)).to eq('foo: "bar"')

hash = { 'baz' => { :ball => 'boo' }}
expect(Appraisal::Utils.format_string(hash)).
to eq('"baz" => { ball: "boo" }')
end
else
it "prints out a nice looking hash without brackets with old syntax" do
hash = { :foo => 'bar' }
expect(Appraisal::Utils.format_string(hash)).to eq(':foo => "bar"')

hash = { 'baz' => { :ball => 'boo' }}
expect(Appraisal::Utils.format_string(hash)).
to eq('"baz" => { :ball => "boo" }')
end
hash = { 'baz' => { :ball => 'boo' }}
expect(Appraisal::Utils.format_string(hash)).
to eq('"baz" => { ball: "boo" }')
end
end

describe '.format_arguments' do
before { stub_const('RUBY_VERSION', '1.8.7') }
before { stub_const('RUBY_VERSION', '2.3.0') }

it 'prints out arguments without enclosing square brackets' do
arguments = [:foo, { :bar => { :baz => 'ball' }}]

expect(Appraisal::Utils.format_arguments(arguments)).to eq(
':foo, :bar => { :baz => "ball" }'
':foo, bar: { baz: "ball" }'
)
end

Expand Down
10 changes: 1 addition & 9 deletions spec/support/acceptance_test_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,7 @@ def build_gemspec

def content_of(path)
file(path).read.tap do |content|
if RUBY_VERSION >= "1.9"
content.gsub!(/(\S+): /, ":\\1 => ")
end
content.gsub!(/(\S+): /, ":\\1 => ")
end
end

Expand Down Expand Up @@ -141,12 +139,6 @@ def build_default_gemfile
source 'https://rubygems.org'
gem 'appraisal', :path => '#{PROJECT_ROOT}'
if RUBY_VERSION < "1.9"
#{File.read(File.join(PROJECT_ROOT, "Gemfile-1.8"))}
elsif RUBY_VERSION < "2.2"
#{File.read(File.join(PROJECT_ROOT, "Gemfile-2.1"))}
end
Gemfile

run "bundle install --binstubs --local"
Expand Down

0 comments on commit 92d5134

Please sign in to comment.