1
0
Fork 0
mirror of https://github.com/awesome-print/awesome_print synced 2023-03-27 23:22:34 -04:00

Improve readability by following style rules

These were mostly fixes to Rubocop issues which also helped with
readablity of the code.
This commit is contained in:
Gerard Caulfield 2016-08-27 23:10:00 +10:00
parent 4db8bb4d1e
commit fa6f4d3768
No known key found for this signature in database
GPG key ID: 623B327128A9BEC3
2 changed files with 22 additions and 8 deletions

View file

@ -5,13 +5,17 @@
#------------------------------------------------------------------------------
module AwesomePrint
module ActionView
# Use HTML colors and add default "debug_dump" class to the resulting HTML.
def ap_debug(object, options = {})
object.ai(options.merge(:html => true)).sub(/^<pre([\s>])/, '<pre class="debug_dump"\\1')
object.ai(
options.merge(html: true)
).sub(
/^<pre([\s>])/,
'<pre class="debug_dump"\\1'
)
end
alias_method :ap, :ap_debug
alias ap ap_debug
end
end

View file

@ -23,8 +23,17 @@ Dir[File.dirname(__FILE__) + '/support/**/*.rb'].each do |file|
require file
end
ExtVerifier.require_dependencies!(%w{rails active_record action_view
active_support/all mongoid mongo_mapper ripple nobrainer})
ExtVerifier.require_dependencies!(
%w(
rails
active_record
action_view
active_support/all
mongoid
mongo_mapper
ripple nobrainer
)
)
require 'nokogiri'
require 'awesome_print'
@ -42,8 +51,8 @@ RSpec.configure do |config|
mocks.syntax = :expect
mocks.verify_partial_doubles = true
end
if config.files_to_run.one?
config.default_formatter = 'doc'
config.default_formatter = 'doc' if config.files_to_run.one?
end
end
@ -77,7 +86,8 @@ def stub_dotfile!
end
def capture!
standard, $stdout = $stdout, StringIO.new
standard = $stdout
$stdout = StringIO.new
yield
ensure
$stdout = standard