diff --git a/README.md b/README.md index e8a0e1c..d16e662 100644 --- a/README.md +++ b/README.md @@ -88,9 +88,22 @@ Supported color names: $ cat > 4.rb require "ap" - ap (''.methods - Object.methods).grep(/!/) + class Hello + def self.world(x, y, z = nil, &blk) + end + end + ap Hello.methods - Class.methods ^D $ ruby 4.rb + [ + [0] world(x, y, *z, &blk) Hello + ] + + $ cat > 5.rb + require "ap" + ap (''.methods - Object.methods).grep(/!/) + ^D + $ ruby 5.rb [ [ 0] capitalize!() String [ 1] chomp!(*arg1) String @@ -229,15 +242,9 @@ For example: ### Running Specs ### -Ruby 1.8.7 and RSpec 1.3+: - $ rake spec # Entire spec suite. - $ ruby -rubygems spec/logger_spec.rb # Individual spec file. - -Ruby 1.9.2 and RSpec 2.0+: - - $ rake spec # Entire spec suite. - $ rspec spec/logger_spec.rb # Individual spec file. + $ ruby -rubygems spec/logger_spec.rb # Individual spec file (Ruby 1.8.7 and RSpec 1.3+) + $ rspec spec/logger_spec.rb # Individual spec file (Ruby 1.9.2 and RSpec 2.0+) ### Note on Patches/Pull Requests ### * Fork the project on Github. diff --git a/lib/ap/awesome_print.rb b/lib/ap/awesome_print.rb index c2ec0ed..b7c575b 100755 --- a/lib/ap/awesome_print.rb +++ b/lib/ap/awesome_print.rb @@ -7,7 +7,7 @@ require "shellwords" class AwesomePrint AP = :__awesome_print__ unless defined?(AwesomePrint::AP) - CORE = [ :array, :hash, :class, :file, :dir, :bigdecimal, :rational, :struct, :method, :unboundmethod ].freeze unless defined?(AwesomePrint::CORE) + CORE = [ :array, :hash, :class, :file, :dir, :bigdecimal, :rational, :struct, :method, :unboundmethod ] unless defined?(AwesomePrint::CORE) def initialize(options = {}) @options = { diff --git a/lib/awesome_print.rb b/lib/awesome_print.rb new file mode 100755 index 0000000..67b8582 --- /dev/null +++ b/lib/awesome_print.rb @@ -0,0 +1,25 @@ +# Copyright (c) 2010 Michael Dvorkin +# +# Awesome Print is freely distributable under the terms of MIT license. +# See LICENSE file or http://www.opensource.org/licenses/mit-license.php +#------------------------------------------------------------------------------ +# +# This is the copy of original 'ap.rb' file that matches the gem name. It makes +# it possible to omit the :require part in bundler's Gemfile: +# +# gem 'awesome_print', '>= 0.2.1', :require => 'ap' +# gem 'awesome_print', '>= 3.0.0' +# +require File.dirname(__FILE__) + "/ap/core_ext/array" +require File.dirname(__FILE__) + "/ap/core_ext/string" +require File.dirname(__FILE__) + "/ap/core_ext/object" +require File.dirname(__FILE__) + "/ap/core_ext/class" +require File.dirname(__FILE__) + "/ap/core_ext/kernel" +require File.dirname(__FILE__) + "/ap/awesome_print" + +require File.dirname(__FILE__) + "/ap/core_ext/logger" if defined?(::Logger) or defined?(::ActiveSupport::BufferedLogger) + +require File.dirname(__FILE__) + "/ap/mixin/action_view" if defined?(::ActionView) +require File.dirname(__FILE__) + "/ap/mixin/active_record" if defined?(::ActiveRecord) +require File.dirname(__FILE__) + "/ap/mixin/active_support" if defined?(::ActiveSupport) +