do not load test-case in development #28

Merged
merged 2 commits into from Jan 8, 2014

Projects

None yet

3 participants

@grosser
grosser commented Dec 27, 2013

can you also pick this to the rails 3 branch ?

@grosser
grosser commented Jan 2, 2014

bump

@rafaelfranca rafaelfranca commented on an outdated diff Jan 2, 2014
lib/prototype-rails/on_load_action_view.rb
@@ -14,9 +14,11 @@
include ActionView::Helpers::ScriptaculousHelper
end
-ActionView::TestCase.class_eval do
- include ActionView::Helpers::PrototypeHelper
- include ActionView::Helpers::ScriptaculousHelper
+if Rails.env.test?
@rafaelfranca
rafaelfranca Jan 2, 2014 Ruby on Rails member

This entire code should be inside the Railtie

@grosser
grosser commented Jan 2, 2014

better ?

@rafaelfranca rafaelfranca and 1 other commented on an outdated diff Jan 3, 2014
lib/prototype-rails.rb
+ require 'action_view/helpers/scriptaculous_helper'
+ require 'action_view/template/handlers/rjs'
+ require 'prototype-rails/javascript_helper'
+ require 'prototype-rails/rendering'
+
+ ActionView::Base.class_eval do
+ cattr_accessor :debug_rjs
+ self.debug_rjs = false
+ end
+
+ ActionView::Base.class_eval do
+ include ActionView::Helpers::PrototypeHelper
+ include ActionView::Helpers::ScriptaculousHelper
+ end
+
+ if Rails.env.test? # do not trigger test-case autoload in development/production
@rafaelfranca
rafaelfranca Jan 3, 2014 Ruby on Rails member

Sorry. I was talking about only the Rails.env check and the conditional inclusion of modules at TestCase. The rest of the code is fine to be in that file

@grosser
grosser Jan 3, 2014

Ok, more like this ?

On Thu, Jan 2, 2014 at 5:33 PM, Rafael Mendonça França <
notifications@github.com> wrote:

In lib/prototype-rails.rb:

  •    require 'action_view/helpers/scriptaculous_helper'
    
  •    require 'action_view/template/handlers/rjs'
    
  •    require 'prototype-rails/javascript_helper'
    
  •    require 'prototype-rails/rendering'
    
  •    ActionView::Base.class_eval do
    
  •      cattr_accessor :debug_rjs
    
  •      self.debug_rjs = false
    
  •    end
    
  •    ActionView::Base.class_eval do
    
  •      include ActionView::Helpers::PrototypeHelper
    
  •      include ActionView::Helpers::ScriptaculousHelper
    
  •    end
    
  •    if Rails.env.test? # do not trigger test-case autoload in development/production
    

Sorry. I was talking about only the Rails.env check and the conditional
inclusion of modules at TestCase. The rest of the code is fine to be in
that file


Reply to this email directly or view it on GitHubhttps://github.com/rails/prototype-rails/pull/28/files#r8628297
.

@rafaelfranca
Member

👍

@grosser
grosser commented Jan 3, 2014

Can you also merge and release this?

@rafaelfranca
Member

Sure! It is in my TODO list. Will be the first thing I'll do tomorrow

@grosser
grosser commented Jan 6, 2014

Hmm tomorrow is gone :)

@rafaelfranca
Member

yes, yes. Sorry I have a lot of work to do.

But you can always install a gem pointing to your fork using bundler if you have hurry 😉

@grosser
grosser commented Jan 6, 2014

pff you only maintain like 2 or 300 projects, how hard can that be ;)
I already did the git dependency, but would love to make it a real gem :>

On Mon, Jan 6, 2014 at 9:23 AM, Rafael Mendonça França <
notifications@github.com> wrote:

yes, yes. Sorry I have a lot of work to do.

But you can always install a gem pointing to your fork using bundler if
you have hurry [image: 😉]


Reply to this email directly or view it on GitHubhttps://github.com/rails/prototype-rails/pull/28#issuecomment-31667105
.

@rafaelfranca rafaelfranca merged commit 3f512ec into rails:master Jan 8, 2014
@rafaelfranca
Member

Now I can work on this. Thanks ❤️

@grosser
grosser commented Jan 13, 2014

bump :)
(please also release for the rails 3 branch/tag, I can make a PR if that helps, just picking the commit on the latest rails 3 tag)

@rafaelfranca
Member

Really sorry but before releasing the gem I want to do some work. Like I said we don't need to hurry to release the gem since you can always use bundler.

@grosser
grosser commented Jan 13, 2014

Sure, take your time :)

On Mon, Jan 13, 2014 at 9:19 AM, Rafael Mendonça França <
notifications@github.com> wrote:

Really sorry but before releasing the gem I want to do some work. Like I
said we don't need to hurry to release the gem since you can always use
bundler.


Reply to this email directly or view it on GitHubhttps://github.com/rails/prototype-rails/pull/28#issuecomment-32190147
.

@rafaelfranca
Member

I want to review all the open PR and issues and see if I can merge/fix something else before releasing, so the release will help more people

@grosser
grosser commented Jan 21, 2014

no more PR's left except some 6month + olds, ready to release ?

@rafaelfranca rafaelfranca pushed a commit that referenced this pull request Feb 6, 2014
Rafael Mendonça França Revert "Merge pull request #28 from grosser/grosser/test-load"
This reverts commit 3f512ec, reversing
changes made to 2841450.

Reason: I'll use the solution in
#23 that doesn't check the
Rails environment
bc80415
@guigs
guigs commented Dec 8, 2014

This would solve #32 on Rails 4.2.

@guigs guigs added a commit to guigs/prototype-rails that referenced this pull request Dec 8, 2014
@guigs guigs Revert "Revert "Merge pull request #28 from grosser/grosser/test-load""
This reverts commit bc80415.
e454a7a
@grosser grosser added a commit to grosser/prototype-rails that referenced this pull request Dec 13, 2014
@grosser grosser Revert "Revert "Merge pull request #28 from grosser/grosser/test-load""
This reverts commit bc80415.
e423f5a
@grosser grosser added a commit to grosser/prototype-rails that referenced this pull request Dec 13, 2014
@grosser grosser Revert "Revert "Merge pull request #28 from grosser/grosser/test-load""
This reverts commit bc80415.
d77027c
@grosser grosser added a commit to grosser/prototype-rails that referenced this pull request Jan 21, 2015
@grosser grosser Revert "Revert "Merge pull request #28 from grosser/grosser/test-load""
This reverts commit bc80415.
f047d9f
@pixeltrix pixeltrix added a commit that referenced this pull request Dec 2, 2016
@grosser grosser Revert "Revert "Merge pull request #28 from grosser/grosser/test-load""
This reverts commit bc80415.
de7c86c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment