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:
parent
d2017f66c5
commit
ba89f3ddaf
5 changed files with 24 additions and 8 deletions
|
@ -1,5 +1,6 @@
|
||||||
0.2.0
|
0.2.0
|
||||||
- Added support for logger.ap (including Rails logger)
|
- 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 works with scripts that use ActiveRecord/ActiveSupport outside Rails
|
||||||
- ap now correctly shows file and directory names with fancy characters (shell escape)
|
- ap now correctly shows file and directory names with fancy characters (shell escape)
|
||||||
|
|
||||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
||||||
0.1.4
|
0.2.0
|
||||||
|
|
|
@ -5,11 +5,11 @@
|
||||||
|
|
||||||
Gem::Specification.new do |s|
|
Gem::Specification.new do |s|
|
||||||
s.name = %q{awesome_print}
|
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.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
||||||
s.authors = ["Michael Dvorkin"]
|
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.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.email = %q{mike@dvorkin.net}
|
||||||
s.extra_rdoc_files = [
|
s.extra_rdoc_files = [
|
||||||
|
@ -26,11 +26,14 @@ Gem::Specification.new do |s|
|
||||||
"lib/ap.rb",
|
"lib/ap.rb",
|
||||||
"lib/ap/awesome_print.rb",
|
"lib/ap/awesome_print.rb",
|
||||||
"lib/ap/core_ext/kernel.rb",
|
"lib/ap/core_ext/kernel.rb",
|
||||||
|
"lib/ap/core_ext/logger.rb",
|
||||||
"lib/ap/core_ext/string.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",
|
"rails/init.rb",
|
||||||
|
"spec/active_record_spec.rb",
|
||||||
"spec/awesome_print_spec.rb",
|
"spec/awesome_print_spec.rb",
|
||||||
"spec/rails_spec.rb",
|
"spec/logger_spec.rb",
|
||||||
"spec/spec.opts",
|
"spec/spec.opts",
|
||||||
"spec/spec_helper.rb",
|
"spec/spec_helper.rb",
|
||||||
"spec/string_spec.rb"
|
"spec/string_spec.rb"
|
||||||
|
@ -42,8 +45,9 @@ Gem::Specification.new do |s|
|
||||||
s.rubygems_version = %q{1.3.6}
|
s.rubygems_version = %q{1.3.6}
|
||||||
s.summary = %q{Pretty print Ruby objects with proper indentation and colors.}
|
s.summary = %q{Pretty print Ruby objects with proper indentation and colors.}
|
||||||
s.test_files = [
|
s.test_files = [
|
||||||
"spec/awesome_print_spec.rb",
|
"spec/active_record_spec.rb",
|
||||||
"spec/rails_spec.rb",
|
"spec/awesome_print_spec.rb",
|
||||||
|
"spec/logger_spec.rb",
|
||||||
"spec/spec_helper.rb",
|
"spec/spec_helper.rb",
|
||||||
"spec/string_spec.rb"
|
"spec/string_spec.rb"
|
||||||
]
|
]
|
||||||
|
|
|
@ -22,7 +22,7 @@ class AwesomePrint
|
||||||
:falseclass => :red,
|
:falseclass => :red,
|
||||||
:fixnum => :blue,
|
:fixnum => :blue,
|
||||||
:float => :blue,
|
:float => :blue,
|
||||||
:hash => :gray,
|
:hash => :pale,
|
||||||
:nilclass => :red,
|
:nilclass => :red,
|
||||||
:string => :yellowish,
|
:string => :yellowish,
|
||||||
:symbol => :cyanish,
|
:symbol => :cyanish,
|
||||||
|
|
|
@ -17,6 +17,8 @@ module AwesomePrintActiveSupport
|
||||||
if printable == :self
|
if printable == :self
|
||||||
if object.is_a?(ActiveSupport::TimeWithZone)
|
if object.is_a?(ActiveSupport::TimeWithZone)
|
||||||
printable = :active_support_time
|
printable = :active_support_time
|
||||||
|
elsif object.is_a?(HashWithIndifferentAccess)
|
||||||
|
printable = :hash_with_indifferent_access
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
printable
|
printable
|
||||||
|
@ -28,6 +30,15 @@ module AwesomePrintActiveSupport
|
||||||
awesome_self(object, :as => :time)
|
awesome_self(object, :as => :time)
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
AwesomePrint.send(:include, AwesomePrintActiveSupport)
|
AwesomePrint.send(:include, AwesomePrintActiveSupport)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue