Permalink
Browse files

Merge branch 'master' of git://github.com/shageman/awesome_print into…

… shageman/master
  • Loading branch information...
michaeldv committed May 5, 2011
2 parents b0e47f1 + e9a0387 commit 52bb3e7adba587fea7982fa74376ca3f590e5e51
Showing with 17 additions and 0 deletions.
  1. +8 −0 README.md
  2. +1 −0 lib/ap/core_ext/kernel.rb
  3. +8 −0 spec/awesome_print_spec.rb
View
@@ -129,6 +129,14 @@ Supported color names:
[19] upcase!() String
]
+ $ cat > 6.rb
+ require "ap"
+ ap(42 == ap(42))
+ ^D
+ $ ruby 6.rb
+ 42
+ true
+
### Example (Rails console) ###
$ ruby script/console
Loading development environment (Rails 2.3.5)
@@ -13,6 +13,7 @@ def ai(options = {})
def ap(object, options = {})
puts object.ai(options)
+ object
end
alias :awesome_print :ap
@@ -7,6 +7,14 @@
stub_dotfile!
end
+ describe "ap method" do
+ it "return value" do
+ object = rand
+ self.stub!(:puts)
+ (ap object).should eql(object)
+ end
+ end
+
describe "Array" do
before(:each) do
@arr = [ 1, :two, "three", [ nil, [ true, false] ] ]

0 comments on commit 52bb3e7

Please sign in to comment.