Git Product home page Git Product logo

Comments (11)

michaeldv avatar michaeldv commented on June 30, 2024

Works fine in my environment (rvm + Ruby 1.9.2 + Rails 3.0.3, bundler 1.0.6, awesome_print 0.3.1). Rails console loads ok as well. What's your setup?
$ rails s -u
=> Booting WEBrick
=> Rails 3.0.3 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
You need to install ruby-debug to run the server in debugging mode. With gems, use 'gem install ruby-debug'
Exiting
$ rails s
=> Booting WEBrick
=> Rails 3.0.3 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2010-11-16 18:44:51] INFO WEBrick 1.3.1
[2010-11-16 18:44:51] INFO ruby 1.9.2 (2010-08-18) [x86_64-darwin10.4.0]
[2010-11-16 18:44:51] INFO WEBrick::HTTPServer#start: pid=4451 port=3000

from awesome_print.

michaeldv avatar michaeldv commented on June 30, 2024

Seems like incompatibility with liquid gem. A quick fix is as follows (Ruby 1.8.7+):

# gems/awesome_print-0.3.1/lib/ap/core_ext/object.rb
class Object #:nodoc:
  methods.grep(/methods$/) do |name|
    next if name.to_s.include? 'instance' # Instance methods are trapped in Class.
    next if method(name).owner == Module # <-- ADD THIS

from awesome_print.

jc00ke avatar jc00ke commented on June 30, 2024

Thanks, will try that in the morning & let you know.

from awesome_print.

jc00ke avatar jc00ke commented on June 30, 2024

yep, looks like that worked. Should that fix get pushed out in the next version?

from awesome_print.

michaeldv avatar michaeldv commented on June 30, 2024

Probably. I'm going to think some more what is the best way to handle it.

from awesome_print.

nathany avatar nathany commented on June 30, 2024

thanks for the fix

from awesome_print.

nathany avatar nathany commented on June 30, 2024

@michael, since there is still no 0.3.2 with this fix, would you happen to know what the latest version I could use in our Gemfile that doesn't have this issue?

from awesome_print.

michaeldv avatar michaeldv commented on June 30, 2024

Oh, you can tell Bundler to install it straight from the Github:

gem 'awesome_print', '>= 0.3.1', :git => "git://github.com/michaeldv/awesome_print.git"

from awesome_print.

nathany avatar nathany commented on June 30, 2024

Sure, but is this fix in GitHub? I don't see it in the commit logs.

So since we use Liquid, I've moved AP back to the 0.2.x line for now.

from awesome_print.

michaeldv avatar michaeldv commented on June 30, 2024

Hi,

Here's a bit cleaner fix (see core_ext/object.rb and core_ext/class.rb):
michaeldv/awesome_print@2562c2b

Basically I replaced methods.grep (which mistakingly includes #liquid_methods) with explicit list of methods that I want to override. Obviously #liquid_methods is not among them ;-)

Best,
Michael

from awesome_print.

nathany avatar nathany commented on June 30, 2024

Perfect.

from awesome_print.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.