From 6dac4f21b4823663d2e779fe8199cdf6fa76caf4 Mon Sep 17 00:00:00 2001 From: Sumit M Date: Sat, 16 Apr 2016 22:53:45 +0530 Subject: [PATCH 1/5] updated gitignore file --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 7403f78..b065bd1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ *.gem .guard-jruby-spec -Gemfile.lock \ No newline at end of file +Gemfile.lock +.idea/ From a0f01dc302bc7d147ee01ab82361692df17c5818 Mon Sep 17 00:00:00 2001 From: Sumit M Date: Sat, 16 Apr 2016 23:36:34 +0530 Subject: [PATCH 2/5] Added customer reloaders for run all --- lib/guard/jruby-rspec.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/guard/jruby-rspec.rb b/lib/guard/jruby-rspec.rb index 676eff6..9c07f12 100644 --- a/lib/guard/jruby-rspec.rb +++ b/lib/guard/jruby-rspec.rb @@ -17,7 +17,8 @@ def initialize(watchers = [], options = {}) :spec_file_suffix => "_spec.rb", :run_all => {}, :monitor_file => ".guard-jruby-rspec", - :custom_reloaders => [] + :custom_reloaders => [], + :custom_reloaders_for_run_all => [] }.merge(options) @last_failed = false @failed_paths = [] @@ -43,7 +44,8 @@ def initialize(watchers = [], options = {}) @inspector = Inspector.new(@options) @runner = Runner.new(@options) - @reloaders = set_up_reloaders(@options) + @reloaders = set_up_reloaders(@options[:custom_reloaders], [:reload_rails, :reload_paths, :reload_factory_girl]) + @runall_reloaders = set_up_reloaders(@options[:custom_reloaders_for_run_all]) end # Call once when guard starts @@ -54,6 +56,7 @@ def start def run_all unload_previous_examples + @runall_reloaders.reload super end @@ -114,11 +117,10 @@ def reload_paths(paths) private - def set_up_reloaders(options) + def set_up_reloaders(custom_reloaders, reloader_methods=[]) reloaders = Reloaders.new - reloader_methods = [:reload_rails, :reload_paths, :reload_factory_girl] reloader_procs = reloader_methods.map { |name| method(name) } - reloader_procs += options[:custom_reloaders] + reloader_procs += custom_reloaders reloader_procs.each { |reloader| reloaders.register &reloader } reloaders From fd35399e7083aa45a818974465c41f8214d794f7 Mon Sep 17 00:00:00 2001 From: Sumit M Date: Sun, 17 Apr 2016 14:22:03 +0530 Subject: [PATCH 3/5] Run reloaders before running reloader methods --- .bundle/config | 3 +++ .gitignore | 1 + lib/guard/jruby-rspec.rb | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 .bundle/config diff --git a/.bundle/config b/.bundle/config new file mode 100644 index 0000000..372a70d --- /dev/null +++ b/.bundle/config @@ -0,0 +1,3 @@ +--- +BUNDLE_PATH: "./vendor" +BUNDLE_DISABLE_SHARED_GEMS: '1' diff --git a/.gitignore b/.gitignore index b065bd1..782721b 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ .guard-jruby-spec Gemfile.lock .idea/ +vendor/ diff --git a/lib/guard/jruby-rspec.rb b/lib/guard/jruby-rspec.rb index 9c07f12..b5eecb7 100644 --- a/lib/guard/jruby-rspec.rb +++ b/lib/guard/jruby-rspec.rb @@ -119,8 +119,8 @@ def reload_paths(paths) def set_up_reloaders(custom_reloaders, reloader_methods=[]) reloaders = Reloaders.new - reloader_procs = reloader_methods.map { |name| method(name) } - reloader_procs += custom_reloaders + reloader_procs = custom_reloaders + reloader_procs += reloader_methods.map { |name| method(name) } reloader_procs.each { |reloader| reloaders.register &reloader } reloaders From 3850f042b7f2b9ec8e49a84dae35ab07d18c229c Mon Sep 17 00:00:00 2001 From: Sumit M Date: Sun, 17 Apr 2016 16:18:43 +0530 Subject: [PATCH 4/5] Fixed specs --- spec/guard/jruby-rspec_spec.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/guard/jruby-rspec_spec.rb b/spec/guard/jruby-rspec_spec.rb index 7f096b7..f16f0ad 100644 --- a/spec/guard/jruby-rspec_spec.rb +++ b/spec/guard/jruby-rspec_spec.rb @@ -11,7 +11,8 @@ :spec_file_suffix => "_spec.rb", :run_all => {}, :monitor_file => ".guard-jruby-rspec", - :custom_reloaders => [] + :custom_reloaders => [], + :custom_reloaders_for_run_all=>[] } end From 2161d6aadd098d104ec3014ae5cd8a483b697d83 Mon Sep 17 00:00:00 2001 From: Sumit M Date: Wed, 20 Apr 2016 14:53:44 +0530 Subject: [PATCH 5/5] Updated gitignore and removed bundle/config --- .bundle/config | 3 --- .gitignore | 2 -- 2 files changed, 5 deletions(-) delete mode 100644 .bundle/config diff --git a/.bundle/config b/.bundle/config deleted file mode 100644 index 372a70d..0000000 --- a/.bundle/config +++ /dev/null @@ -1,3 +0,0 @@ ---- -BUNDLE_PATH: "./vendor" -BUNDLE_DISABLE_SHARED_GEMS: '1' diff --git a/.gitignore b/.gitignore index 782721b..488916a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,3 @@ *.gem .guard-jruby-spec Gemfile.lock -.idea/ -vendor/