mirror of
https://github.com/awesome-print/awesome_print
synced 2023-03-27 23:22:34 -04:00
Retire eol rubies (#393)
* Removed rubys 2.4 and earlier * Updated docs with changes Co-authored-by: Bryan Hanks, PMP <bryan@master-developer.com>
This commit is contained in:
parent
0d7b6debde
commit
d425b2b59d
7 changed files with 27 additions and 81 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
# This file was generated by Appraisal
|
||||
|
||||
source "https://rubygems.org"
|
||||
|
||||
gem "mongoid", "~> 4.0.0"
|
||||
|
||||
gemspec path: "../"
|
|
@ -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: "../"
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue