Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

fix reloader issue with some gems that redefine Class#name (like pry) #807

Closed
wants to merge 2 commits into from

5 participants

@dcu

padrino start doesn't work when using 'pry'

@dcu dcu fix reloader issue with some gems that redefine Class#name (like pry)
Signed-off-by: David A. Cuadrado <krawek@gmail.com>
9e7b99b
@DAddYE
Owner

Yep, we reverted back to name because some libs redefine also to_s ... so suggestions?

@DAddYE DAddYE referenced this pull request from a commit
@DAddYE DAddYE Propose a new fix for #807 and #808 5c2623e
@dcu dcu make sure we can always use the original class name
Signed-off-by: David A. Cuadrado <krawek@gmail.com>
7b38e26
@nesquena
Owner

@DAddYE Should we still merge this or is the commit you put in fix it as well?

@dcu
dcu commented

this issue is critic... you should release a version to fix this as soon as possible.

@nesquena
Owner

@dcu Does our version solve it 5c2623e or do we still need this?

@dcu
dcu commented

according to @DAddYE it was .to_s before changing it to .name. his change only reverts back to the original(to_s) behaviour which, I understand, doesn't work because some libs override Class|Module#to_s
I think I explain well in the commit comments why that change won't work

my commit guarantees that it will always work in all cases

@nesquena
Owner

OK, let's just apply your change. Does that work @DAddYE

@nesquena
Owner

OK, well I applied your version here: 865d67c. Does that look OK @dcu? Thanks for your help in all this. I plan to release a new version soon.

@nesquena nesquena closed this
@dcu
dcu commented

you should start doing faster release cycles. if you don't want to do a 0.10.7 why dont you release 0.10.6.1 ?

@nesquena
Owner

@daddye What do you think? Perhaps we should release either what we have as 0.10.7 or do as dcu suggests and just push a 0.10.6.1 at least?

@DAddYE
Owner

I agree we can release 0.10.7

@exolab

When is the release due?

@DAddYE
Owner

We are waiting @nesquena and @achiu confirmations

@argent-smith

C'mon guys! You can!

@nesquena
Owner

@argent-smith Yay we can and we have, pushed 0.10.7 finally. Sorry everyone for the delays!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 16, 2012
  1. @dcu

    fix reloader issue with some gems that redefine Class#name (like pry)

    dcu authored
    Signed-off-by: David A. Cuadrado <krawek@gmail.com>
Commits on Mar 23, 2012
  1. @dcu

    make sure we can always use the original class name

    dcu authored
    Signed-off-by: David A. Cuadrado <krawek@gmail.com>
This page is out of date. Refresh to see the latest.
View
3  padrino-core/lib/padrino-core/reloader.rb
@@ -103,7 +103,7 @@ def changed?
# We lock dependencies sets to prevent reloading of protected constants
#
def lock!
- klasses = ObjectSpace.classes.map { |klass| klass.name.split('::')[0] }.uniq
+ klasses = ObjectSpace.classes.map { |klass| klass._orig_name.split('::')[0] }.uniq
klasses = klasses | Padrino.mounted_apps.map { |app| app.app_class }
Padrino::Reloader.exclude_constants.concat(klasses)
end
@@ -252,3 +252,4 @@ def call(env)
end
end # Reloader
end # Padrino
+
View
7 padrino-core/lib/padrino-core/support_lite.rb
@@ -194,6 +194,13 @@ def undent
I18n.load_path += Dir["#{File.dirname(__FILE__)}/locale/*.yml"] if defined?(I18n)
##
+# Make sure we can always use the class name
+#
+class Module
+ alias :_orig_name :to_s
+end
+
+##
# Used to determine if this file has already been required
#
module SupportLite; end
Something went wrong with that request. Please try again.