From beb194dfa240c3d90aacc571fadba19c46ae0027 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=C3=B3rio=20Kusowski?= Date: Wed, 30 Sep 2015 16:15:14 -0300 Subject: [PATCH 1/2] Removing the test_case require based on Rails.env The test env doesn't means that the Apotomo test_case should be loaded. Leaving it for users that use the apotomo/test_case would be better, so they can require only if they need it. --- lib/apotomo.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/apotomo.rb b/lib/apotomo.rb index 82db695..0cd72f8 100644 --- a/lib/apotomo.rb +++ b/lib/apotomo.rb @@ -4,9 +4,9 @@ def js_framework=(js_framework) @js_framework = js_framework @js_generator = JavascriptGenerator.new(js_framework) end - + attr_reader :js_generator, :js_framework - + # Apotomo setup/configuration helper for initializer. # # == Usage/Examples: @@ -25,6 +25,5 @@ def setup require 'apotomo/widget_shortcuts' require 'apotomo/rails/controller_methods' require 'apotomo/javascript_generator' -require 'apotomo/test_case' if Rails.env == "test" Apotomo.js_framework = :jquery ### DISCUSS: move to rails.rb From 0ce2b9870e97403707cfef0c8d8cddf94ecbbcce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=C3=B3rio=20Kusowski?= Date: Fri, 2 Oct 2015 08:41:37 -0300 Subject: [PATCH 2/2] Autoloading TestCase - thanks @apotonick for the tip --- lib/apotomo.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/apotomo.rb b/lib/apotomo.rb index 0cd72f8..34063e5 100644 --- a/lib/apotomo.rb +++ b/lib/apotomo.rb @@ -1,4 +1,6 @@ module Apotomo + autoload :TestCase, 'apotomo/test_case' + class << self def js_framework=(js_framework) @js_framework = js_framework