Permalink
Browse files

Release 0.2.0

  • Loading branch information...
1 parent d2017f6 commit ba89f3ddaf35f6a145d56a7b3f56f8bca373300b @michaeldv michaeldv committed May 6, 2010
Showing with 24 additions and 8 deletions.
  1. +1 −0 CHANGELOG
  2. +1 −1 VERSION
  3. +10 −6 awesome_print.gemspec
  4. +1 −1 lib/ap/awesome_print.rb
  5. +11 −0 lib/ap/mixin/active_support.rb
View
1 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)
View
2 VERSION
@@ -1 +1 @@
-0.1.4
+0.2.0
View
16 awesome_print.gemspec
@@ -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/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"
]
View
2 lib/ap/awesome_print.rb
@@ -22,7 +22,7 @@ def initialize(options = {})
:falseclass => :red,
:fixnum => :blue,
:float => :blue,
- :hash => :gray,
+ :hash => :pale,
:nilclass => :red,
:string => :yellowish,
:symbol => :cyanish,
View
11 lib/ap/mixin/active_support.rb
@@ -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
@@ -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.