diff --git a/.travis.yml b/.travis.yml index d7eaa59..f2d3580 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,8 +2,6 @@ language: ruby cache: bundler rvm: - - 2.3 - - 2.4 - 2.5 - 2.6 @@ -11,12 +9,9 @@ before_install: - gem install bundler gemfile: - # ignore 4.2 for now as the cost to run these tests is too high - # - gemfiles/rails_4.2.gemfile - gemfiles/rails_5.0.gemfile - gemfiles/rails_5.1.gemfile - gemfiles/rails_5.2.gemfile - - gemfiles/mongoid_4.0.gemfile - gemfiles/mongoid_5.0.gemfile - gemfiles/mongoid_6.0.gemfile diff --git a/CHANGELOG.md b/CHANGELOG.md index 597aff8..c199017 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,6 @@ ## master (unreleased) + - Removed check for Ruby 2.4 and earlier [@bryanh] + - Rails 5.0 builds are failing, because the sqlite3 version being installed is wrong version [#366] - Fixes spec suite to properly work via travis, gets a clean build [@imajes, others] - Adds support for ActiveModel::Errors [@dshinzie] - [#301] - removes use of `strip_heredoc` from specs as it's a rails dep [@kstephens] - [#303] @@ -8,7 +10,7 @@ - stat("$HOME/.aprc") once [@kstephens] - [#304] - ActiveRecord: #joins now show the columns #select'ed [@adrianomitre] - [#211] - Handles NoMethodError for IRB implicit `ai` [@jtnegrotto] - [#212] - - Replaced Fixnum reference with Integer + - Replaced Fixnum reference with Integer - Colorize ORM class names [@ixti] ## 1.7.0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d1f2d12..db43db3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -51,6 +51,7 @@ Special thanks goes to awesome team of contributors, namely: * Barry Allard -- https://github.com/steakknife * Benoit Daloze -- http://github.com/eregon * Brandon Zylstra -- https://github.com/brandondrew +* Bryan Hanks, PMP -- https://github.com/bryanh * Dan Lynn -- https://github.com/danlynn * Daniel Johnson -- https://github.com/adhd360 * Daniel Bretoi -- http://github.com/danielb2 diff --git a/README.md b/README.md index 7160932..2851d68 100644 --- a/README.md +++ b/README.md @@ -12,9 +12,8 @@ Awesome Print is a Ruby library that pretty prints Ruby objects in full color exposing their internal structure with proper indentation. Rails ActiveRecord objects and usage within Rails templates are supported via included mixins. -__NOTE__: awesome_print v1.2.0 is the last release supporting Ruby versions -prior to v1.9.3 and Rails versions prior to v3.0. The upcoming awesome_print -v2.0 will *require* Ruby v1.9.3 or later and Rails v3.0 or later. +__NOTE__: awesome_print v1.9.0 may not work on Ruby versions 2.4 or older or Rails versions 4.2 or older. +The upcoming awesome_print v2.0 will *require* Ruby v1.9.3 or later and Rails v3.0 or later. ### Installation ### # Installing as Ruby gem @@ -307,7 +306,7 @@ With other web frameworks (ex: in Sinatra templates) you can explicitly request formatting: <%= ap @accounts.first, :html => true %> - + ### String Convenience Methods ### Use methods such as `.red` to set string color: diff --git a/gemfiles/mongoid_4.0.gemfile b/gemfiles/mongoid_4.0.gemfile deleted file mode 100644 index c899518..0000000 --- a/gemfiles/mongoid_4.0.gemfile +++ /dev/null @@ -1,7 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "mongoid", "~> 4.0.0" - -gemspec path: "../" diff --git a/gemfiles/rails_4.2.gemfile b/gemfiles/rails_4.2.gemfile deleted file mode 100644 index aa2a7ea..0000000 --- a/gemfiles/rails_4.2.gemfile +++ /dev/null @@ -1,8 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "rails", "~> 4.2.0" -gem "mime-types", "2.6.2", platforms: :ruby_19 - -gemspec path: "../" diff --git a/spec/ext/active_record_spec.rb b/spec/ext/active_record_spec.rb index 9d024b7..3aab411 100644 --- a/spec/ext/active_record_spec.rb +++ b/spec/ext/active_record_spec.rb @@ -21,11 +21,11 @@ RSpec.describe 'AwesomePrint/ActiveRecord', skip: -> { !ExtVerifier.has_rails? } :rank => 1 } EOS - if RUBY_VERSION < '1.9' - str.sub!('?', 'Sat Oct 10 12:30:00 UTC 1992') - else - str.sub!('?', '1992-10-10 12:30:00 UTC') - end + + expect(RUBY_VERSION).to be >= '2.5' + + str.sub!('?', '1992-10-10 12:30:00 UTC') + expect(out).to be_similar_to(str) end @@ -49,13 +49,10 @@ RSpec.describe 'AwesomePrint/ActiveRecord', skip: -> { !ExtVerifier.has_rails? } } ] EOS - if RUBY_VERSION < '1.9' - str.sub!('??', 'Sat Oct 10 12:30:00 UTC 1992') - str.sub!('?!', 'Mon May 26 14:15:00 UTC 2003') - else - str.sub!('??', '1992-10-10 12:30:00 UTC') - str.sub!('?!', '2003-05-26 14:15:00 UTC') - end + + str.sub!('??', '1992-10-10 12:30:00 UTC') + str.sub!('?!', '2003-05-26 14:15:00 UTC') + expect(out).to be_similar_to(str) end @@ -81,13 +78,10 @@ RSpec.describe 'AwesomePrint/ActiveRecord', skip: -> { !ExtVerifier.has_rails? } } ] EOS - if RUBY_VERSION < '1.9' - str.sub!('??', 'Sat Oct 10 12:30:00 UTC 1992') - str.sub!('?!', 'Mon May 26 14:15:00 UTC 2003') - else - str.sub!('??', '1992-10-10 12:30:00 UTC') - str.sub!('?!', '2003-05-26 14:15:00 UTC') - end + + str.sub!('??', '1992-10-10 12:30:00 UTC') + str.sub!('?!', '2003-05-26 14:15:00 UTC') + expect(out).to be_similar_to(str) end end @@ -133,21 +127,13 @@ EOS elsif activerecord_5_0? ActiveRecordData.raw_5_0_diana elsif activerecord_4_2? - if RUBY_VERSION > '1.9.3' - ActiveRecordData.raw_4_2_diana - else - ActiveRecordData.raw_4_2_diana_legacy - end + ActiveRecordData.raw_4_2_diana elsif activerecord_4_1? ActiveRecordData.raw_4_1_diana elsif activerecord_4_0? ActiveRecordData.raw_4_0_diana elsif activerecord_3_2? - if RUBY_VERSION > '1.9.3' - ActiveRecordData.raw_3_2_diana - else - ActiveRecordData.raw_3_2_diana_legacy - end + ActiveRecordData.raw_3_2_diana end raw_object_string.sub!('?', '1992-10-10 12:30:00') expect(out).to be_similar_to(raw_object_string) @@ -164,21 +150,13 @@ EOS elsif activerecord_5_0? ActiveRecordData.raw_5_0_multi elsif activerecord_4_2? - if RUBY_VERSION > '1.9.3' - ActiveRecordData.raw_4_2_multi - else - ActiveRecordData.raw_4_2_multi_legacy - end + ActiveRecordData.raw_4_2_multi elsif activerecord_4_1? ActiveRecordData.raw_4_1_multi elsif activerecord_4_0? ActiveRecordData.raw_4_0_multi elsif activerecord_3_2? - if RUBY_VERSION > '1.9.3' - ActiveRecordData.raw_3_2_multi - else - ActiveRecordData.raw_3_2_multi_legacy - end + ActiveRecordData.raw_3_2_multi end raw_object_string.sub!('?', '1992-10-10 12:30:00') raw_object_string.sub!('?', '2003-05-26 14:15:00') @@ -233,24 +211,14 @@ class SubUser < User { out = @ap.awesome(User.methods.grep(/first/)) if ActiveRecord::VERSION::STRING >= '3.2' - if RUBY_VERSION >= '2.4.4' - expect(out).to match(/\sfirst\(\*arg.*?\)\s+User/) - elsif RUBY_VERSION >= '1.9' - expect(out).to match(/\sfirst\(\*args,\s&block\)\s+Class \(ActiveRecord::Querying\)/) - else - expect(out).to match(/\sfirst\(\*arg1\)\s+Class \(ActiveRecord::Querying\)/) - end + expect(out).to match(/\sfirst\(\*arg.*?\)\s+User/) else expect(out).to match(/\sfirst\(\*arg.*?\)\s+User \(ActiveRecord::Base\)/) end # spec 2 out = @ap.awesome(User.methods.grep(/primary_key/)) - if RUBY_VERSION >= '2.4.4' - expect(out).to match(/\sprimary_key\(.*?\)\s+User/) - else - expect(out).to match(/\sprimary_key\(.*?\)\s+Class \(ActiveRecord::AttributeMethods::PrimaryKey::ClassMethods\)/) - end + expect(out).to match(/\sprimary_key\(.*?\)\s+User/) # spec 3 out = @ap.awesome(User.methods.grep(/validate/)) @@ -258,11 +226,7 @@ class SubUser < User { if ActiveRecord::VERSION::MAJOR < 3 expect(out).to match(/\svalidate\(\*arg.*?\)\s+User \(ActiveRecord::Base\)/) else - if RUBY_VERSION >= '2.4.4' - expect(out).to match(/\svalidate\(\*arg.*?\)\s+User/) - else - expect(out).to match(/\svalidate\(\*arg.*?\)\s+Class \(ActiveModel::Validations::ClassMethods\)/) - end + expect(out).to match(/\svalidate\(\*arg.*?\)\s+User/) end end