mirror of
https://github.com/awesome-print/awesome_print
synced 2023-03-27 23:22:34 -04:00
Merge pull request #366 from dweinand/fix-rails-5-builds
Fix build failures
This commit is contained in:
commit
0d7b6debde
8 changed files with 16 additions and 14 deletions
|
@ -5,7 +5,7 @@ rvm:
|
|||
- 2.3
|
||||
- 2.4
|
||||
- 2.5
|
||||
- ruby-head
|
||||
- 2.6
|
||||
|
||||
before_install:
|
||||
- gem install bundler
|
||||
|
@ -22,10 +22,9 @@ gemfile:
|
|||
|
||||
matrix:
|
||||
include:
|
||||
- rvm: ruby-head
|
||||
- rvm: 2.6
|
||||
env: RUBYOPT="--enable-frozen-string-literal"
|
||||
# allow_failures:
|
||||
# - rvm: ruby-head
|
||||
gemfile: gemfiles/rails_5.2.gemfile
|
||||
|
||||
addons:
|
||||
code_climate:
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
appraise 'rails-5.0' do
|
||||
gem 'rails', '>= 5.0.0', '< 5.1'
|
||||
gem 'sqlite3', '~> 1.3.6'
|
||||
end
|
||||
|
||||
appraise 'rails-5.1' do
|
||||
|
|
|
@ -3,5 +3,6 @@
|
|||
source "https://rubygems.org"
|
||||
|
||||
gem "rails", ">= 5.0.0", "< 5.1"
|
||||
gem "sqlite3", "~> 1.3.6"
|
||||
|
||||
gemspec path: "../"
|
||||
|
|
|
@ -55,7 +55,7 @@ module AwesomePrint
|
|||
hash
|
||||
end
|
||||
end
|
||||
"#{object} " << awesome_hash(data)
|
||||
"#{object} #{awesome_hash(data)}"
|
||||
end
|
||||
|
||||
# Format ActiveRecord class object.
|
||||
|
@ -95,7 +95,7 @@ module AwesomePrint
|
|||
end
|
||||
|
||||
data.merge!({details: object.details, messages: object.messages})
|
||||
"#{object} " << awesome_hash(data)
|
||||
"#{object} #{awesome_hash(data)}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -31,7 +31,7 @@ module AwesomePrint
|
|||
if options[:multiline]
|
||||
multiline_array
|
||||
else
|
||||
'[ ' << array.map { |item| inspector.awesome(item) }.join(', ') << ' ]'
|
||||
"[ #{array.map { |item| inspector.awesome(item) }.join(', ')} ]"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ module AwesomePrint
|
|||
|
||||
keys.map! do |key|
|
||||
plain_single_line do
|
||||
[inspector.awesome(key), hash[key]]
|
||||
[String.new(inspector.awesome(key)), hash[key]]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -22,7 +22,7 @@ module AwesomePrint
|
|||
object.respond_to?(property) ? :reader : nil
|
||||
end
|
||||
if accessor
|
||||
["attr_#{accessor} :#{property}", var]
|
||||
[String.new("attr_#{accessor} :#{property}"), var]
|
||||
else
|
||||
[var.to_s, var]
|
||||
end
|
||||
|
@ -60,7 +60,8 @@ module AwesomePrint
|
|||
end
|
||||
|
||||
def awesome_instance
|
||||
str = object.send(options[:class_name]).to_s
|
||||
str = String.new
|
||||
str << object.send(options[:class_name]).to_s
|
||||
str << ":0x%08x" % (object.__id__ * 2) if options[:object_id]
|
||||
str
|
||||
end
|
||||
|
|
|
@ -492,7 +492,7 @@ EOS
|
|||
describe 'File' do
|
||||
it 'should display a file (plain)' do
|
||||
File.open(__FILE__, 'r') do |f|
|
||||
expect(f.ai(plain: true)).to eq("#{f.inspect}\n" << `ls -alF #{f.path}`.chop)
|
||||
expect(f.ai(plain: true)).to eq("#{f.inspect}\n#{`ls -alF #{f.path}`.chop}")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -501,7 +501,7 @@ EOS
|
|||
describe 'Dir' do
|
||||
it 'should display a direcory (plain)' do
|
||||
Dir.open(File.dirname(__FILE__)) do |d|
|
||||
expect(d.ai(plain: true)).to eq("#{d.inspect}\n" << `ls -alF #{d.path}`.chop)
|
||||
expect(d.ai(plain: true)).to eq("#{d.inspect}\n#{`ls -alF #{d.path}`.chop}")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -694,7 +694,7 @@ EOS
|
|||
class My < File; end
|
||||
|
||||
my = File.new('/dev/null') rescue File.new('nul')
|
||||
expect(my.ai(plain: true)).to eq("#{my.inspect}\n" << `ls -alF #{my.path}`.chop)
|
||||
expect(my.ai(plain: true)).to eq("#{my.inspect}\n#{`ls -alF #{my.path}`.chop}")
|
||||
end
|
||||
|
||||
it 'inherited from Dir should be displayed as Dir' do
|
||||
|
@ -702,7 +702,7 @@ EOS
|
|||
|
||||
require 'tmpdir'
|
||||
my = My.new(Dir.tmpdir)
|
||||
expect(my.ai(plain: true)).to eq("#{my.inspect}\n" << `ls -alF #{my.path}`.chop)
|
||||
expect(my.ai(plain: true)).to eq("#{my.inspect}\n#{`ls -alF #{my.path}`.chop}")
|
||||
end
|
||||
|
||||
it 'should handle a class that defines its own #send method' do
|
||||
|
|
Loading…
Reference in a new issue