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

Release 0.2.0

This commit is contained in:
Mike Dvorkin 2010-05-05 22:23:18 -07:00
parent d2017f66c5
commit ba89f3ddaf
5 changed files with 24 additions and 8 deletions

View file

@ -1,5 +1,6 @@
0.2.0
- Added support for logger.ap (including Rails logger)
- Added support for HashWithIndifferentAccess from ActiveSupport
- ap now works with scripts that use ActiveRecord/ActiveSupport outside Rails
- ap now correctly shows file and directory names with fancy characters (shell escape)

View file

@ -1 +1 @@
0.1.4
0.2.0

View file

@ -5,11 +5,11 @@
Gem::Specification.new do |s|
s.name = %q{awesome_print}
s.version = "0.1.4"
s.version = "0.2.0"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Michael Dvorkin"]
s.date = %q{2010-04-08}
s.date = %q{2010-05-05}
s.description = %q{Great Ruby dubugging companion: pretty print Ruby objects to visualize their structure. Supports Rails ActiveRecord objects via included mixin.}
s.email = %q{mike@dvorkin.net}
s.extra_rdoc_files = [
@ -26,11 +26,14 @@ Gem::Specification.new do |s|
"lib/ap.rb",
"lib/ap/awesome_print.rb",
"lib/ap/core_ext/kernel.rb",
"lib/ap/core_ext/logger.rb",
"lib/ap/core_ext/string.rb",
"lib/ap/mixin/rails.rb",
"lib/ap/mixin/active_record.rb",
"lib/ap/mixin/active_support.rb",
"rails/init.rb",
"spec/active_record_spec.rb",
"spec/awesome_print_spec.rb",
"spec/rails_spec.rb",
"spec/logger_spec.rb",
"spec/spec.opts",
"spec/spec_helper.rb",
"spec/string_spec.rb"
@ -42,8 +45,9 @@ Gem::Specification.new do |s|
s.rubygems_version = %q{1.3.6}
s.summary = %q{Pretty print Ruby objects with proper indentation and colors.}
s.test_files = [
"spec/active_record_spec.rb",
"spec/awesome_print_spec.rb",
"spec/rails_spec.rb",
"spec/logger_spec.rb",
"spec/spec_helper.rb",
"spec/string_spec.rb"
]

View file

@ -22,7 +22,7 @@ class AwesomePrint
:falseclass => :red,
:fixnum => :blue,
:float => :blue,
:hash => :gray,
:hash => :pale,
:nilclass => :red,
:string => :yellowish,
:symbol => :cyanish,

View file

@ -17,6 +17,8 @@ module AwesomePrintActiveSupport
if printable == :self
if object.is_a?(ActiveSupport::TimeWithZone)
printable = :active_support_time
elsif object.is_a?(HashWithIndifferentAccess)
printable = :hash_with_indifferent_access
end
end
printable
@ -28,6 +30,15 @@ module AwesomePrintActiveSupport
awesome_self(object, :as => :time)
end
# Format HashWithIndifferentAccess as standard Hash.
#
# NOTE: can't use awesome_self(object, :as => :hash) since awesome_self uses
# object.inspect internally, i.e. it would convert hash to string.
#------------------------------------------------------------------------------
def awesome_hash_with_indifferent_access(object)
awesome_hash(object)
end
end
AwesomePrint.send(:include, AwesomePrintActiveSupport)