mirror of
https://github.com/awesome-print/awesome_print
synced 2023-03-27 23:22:34 -04:00
Getting ready for 0.4.0 release
This commit is contained in:
parent
24b6192f57
commit
757227bd9f
2 changed files with 20 additions and 11 deletions
10
CHANGELOG
10
CHANGELOG
|
@ -1,3 +1,13 @@
|
||||||
|
0.4.0
|
||||||
|
- 'ap object' now returns the object (Stephan Hagemann)
|
||||||
|
- Added :html => true option to enable HTML colors rather that ANSI (ex. Sinatra templates)
|
||||||
|
- Added AwesomePrint.force_colors! to allow color output on demand (Andrew O'Brien)
|
||||||
|
- Added MongoMapper formatter mixin (Elpizo Choi)
|
||||||
|
- Fixed formatting of methods array when object#method is overridden
|
||||||
|
- Fixed potential stack errors by checking whether AwesomePrint is already loaded
|
||||||
|
- Improved Ruby 1.8.6 and 1.8.7 compatibility
|
||||||
|
- Improved Windows compatibility (Viktar Basharymau)
|
||||||
|
|
||||||
0.3.2
|
0.3.2
|
||||||
- Make sure Rails mixins get loaded in Rails console when required from .irbrc
|
- Make sure Rails mixins get loaded in Rails console when required from .irbrc
|
||||||
- Fixed an issue with classes that define their own #send method (ex: Socket)
|
- Fixed an issue with classes that define their own #send method (ex: Socket)
|
||||||
|
|
21
README.md
21
README.md
|
@ -15,7 +15,7 @@ objects and usage within Rails templates are supported via included mixins.
|
||||||
|
|
||||||
### Usage ###
|
### Usage ###
|
||||||
|
|
||||||
require "ap"
|
require "awesome_print"
|
||||||
ap object, options = {}
|
ap object, options = {}
|
||||||
|
|
||||||
Default options:
|
Default options:
|
||||||
|
@ -49,7 +49,7 @@ Supported color names:
|
||||||
|
|
||||||
### Examples ###
|
### Examples ###
|
||||||
$ cat > 1.rb
|
$ cat > 1.rb
|
||||||
require "ap"
|
require "awesome_print"
|
||||||
data = [ false, 42, %w(forty two), { :now => Time.now, :class => Time.now.class, :distance => 42e42 } ]
|
data = [ false, 42, %w(forty two), { :now => Time.now, :class => Time.now.class, :distance => 42e42 } ]
|
||||||
ap data
|
ap data
|
||||||
^D
|
^D
|
||||||
|
@ -69,7 +69,7 @@ Supported color names:
|
||||||
]
|
]
|
||||||
|
|
||||||
$ cat > 2.rb
|
$ cat > 2.rb
|
||||||
require "ap"
|
require "awesome_print"
|
||||||
data = { :now => Time.now, :class => Time.now.class, :distance => 42e42 }
|
data = { :now => Time.now, :class => Time.now.class, :distance => 42e42 }
|
||||||
ap data, :indent => -2 # <-- Left align hash keys.
|
ap data, :indent => -2 # <-- Left align hash keys.
|
||||||
^D
|
^D
|
||||||
|
@ -81,7 +81,7 @@ Supported color names:
|
||||||
}
|
}
|
||||||
|
|
||||||
$ cat > 3.rb
|
$ cat > 3.rb
|
||||||
require "ap"
|
require "awesome_print"
|
||||||
data = [ false, 42, %w(forty two) ]
|
data = [ false, 42, %w(forty two) ]
|
||||||
data << data # <-- Nested array.
|
data << data # <-- Nested array.
|
||||||
ap data, :multiline => false
|
ap data, :multiline => false
|
||||||
|
@ -90,7 +90,7 @@ Supported color names:
|
||||||
[ false, 42, [ "forty", "two" ], [...] ]
|
[ false, 42, [ "forty", "two" ], [...] ]
|
||||||
|
|
||||||
$ cat > 4.rb
|
$ cat > 4.rb
|
||||||
require "ap"
|
require "awesome_print"
|
||||||
class Hello
|
class Hello
|
||||||
def self.world(x, y, z = nil, &blk)
|
def self.world(x, y, z = nil, &blk)
|
||||||
end
|
end
|
||||||
|
@ -103,7 +103,7 @@ Supported color names:
|
||||||
]
|
]
|
||||||
|
|
||||||
$ cat > 5.rb
|
$ cat > 5.rb
|
||||||
require "ap"
|
require "awesome_print"
|
||||||
ap (''.methods - Object.methods).grep(/!/)
|
ap (''.methods - Object.methods).grep(/!/)
|
||||||
^D
|
^D
|
||||||
$ ruby 5.rb
|
$ ruby 5.rb
|
||||||
|
@ -131,7 +131,7 @@ Supported color names:
|
||||||
]
|
]
|
||||||
|
|
||||||
$ cat > 6.rb
|
$ cat > 6.rb
|
||||||
require "ap"
|
require "awesome_print"
|
||||||
ap 42 == ap(42)
|
ap 42 == ap(42)
|
||||||
^D
|
^D
|
||||||
$ ruby 6.rb
|
$ ruby 6.rb
|
||||||
|
@ -139,9 +139,8 @@ Supported color names:
|
||||||
true
|
true
|
||||||
|
|
||||||
### Example (Rails console) ###
|
### Example (Rails console) ###
|
||||||
$ ruby script/console
|
$ rails console
|
||||||
Loading development environment (Rails 2.3.5)
|
rails> require "awesome_print"
|
||||||
rails> require "ap"
|
|
||||||
rails> ap Account.all(:limit => 2)
|
rails> ap Account.all(:limit => 2)
|
||||||
[
|
[
|
||||||
[0] #<Account:0x1033220b8> {
|
[0] #<Account:0x1033220b8> {
|
||||||
|
@ -201,7 +200,7 @@ To use awesome_print as default formatter in irb and Rails console add the follo
|
||||||
lines into your ~/.irbrc file:
|
lines into your ~/.irbrc file:
|
||||||
|
|
||||||
require "rubygems"
|
require "rubygems"
|
||||||
require "ap"
|
require "awesome_print"
|
||||||
|
|
||||||
unless IRB.version.include?('DietRB')
|
unless IRB.version.include?('DietRB')
|
||||||
IRB::Irb.class_eval do
|
IRB::Irb.class_eval do
|
||||||
|
|
Loading…
Add table
Reference in a new issue