Skip to content

Commit

Permalink
Release 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Dvorkin committed May 6, 2010
1 parent d2017f6 commit ba89f3d
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
@@ -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)

Expand Down
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
0.1.4
0.2.0
16 changes: 10 additions & 6 deletions awesome_print.gemspec
Expand Up @@ -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 = [
Expand All @@ -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"
Expand All @@ -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/awesome_print_spec.rb",
"spec/rails_spec.rb",
"spec/active_record_spec.rb",
"spec/awesome_print_spec.rb",
"spec/logger_spec.rb",
"spec/spec_helper.rb",
"spec/string_spec.rb"
]
Expand Down
2 changes: 1 addition & 1 deletion lib/ap/awesome_print.rb
Expand Up @@ -22,7 +22,7 @@ def initialize(options = {})
:falseclass => :red,
:fixnum => :blue,
:float => :blue,
:hash => :gray,
:hash => :pale,
:nilclass => :red,
:string => :yellowish,
:symbol => :cyanish,
Expand Down
11 changes: 11 additions & 0 deletions lib/ap/mixin/active_support.rb
Expand Up @@ -17,6 +17,8 @@ def printable_with_active_support(object)
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
Expand All @@ -28,6 +30,15 @@ def awesome_active_support_time(object)
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)

0 comments on commit ba89f3d

Please sign in to comment.