mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-23 06:16:50 +00:00
Escape paths in rake isolated for directory with spaces and parens
This commit is contained in:
parent
b2314017c6
commit
042ec38b40
7
Rakefile
7
Rakefile
@ -50,8 +50,10 @@ namespace :test do
|
|||||||
namespace :isolated do
|
namespace :isolated do
|
||||||
desc 'Run isolated tests for Railtie'
|
desc 'Run isolated tests for Railtie'
|
||||||
task :railtie do
|
task :railtie do
|
||||||
|
require 'shellwords'
|
||||||
dir = File.dirname(__FILE__)
|
dir = File.dirname(__FILE__)
|
||||||
file = "#{dir}/test/active_model_serializers/railtie_test_isolated.rb"
|
file = Shellwords.shellescape("#{dir}/test/active_model_serializers/railtie_test_isolated.rb")
|
||||||
|
dir = Shellwords.shellescape(dir)
|
||||||
|
|
||||||
# https://github.com/rails/rails/blob/3d590add45/railties/lib/rails/generators/app_base.rb#L345-L363
|
# https://github.com/rails/rails/blob/3d590add45/railties/lib/rails/generators/app_base.rb#L345-L363
|
||||||
_bundle_command = Gem.bin_path('bundler', 'bundle')
|
_bundle_command = Gem.bin_path('bundler', 'bundle')
|
||||||
@ -59,7 +61,8 @@ namespace :test do
|
|||||||
Bundler.with_clean_env do
|
Bundler.with_clean_env do
|
||||||
command = "-w -I#{dir}/lib -I#{dir}/test #{file}"
|
command = "-w -I#{dir}/lib -I#{dir}/test #{file}"
|
||||||
full_command = %("#{Gem.ruby}" #{command})
|
full_command = %("#{Gem.ruby}" #{command})
|
||||||
system(full_command) or fail 'Failures' # rubocop:disable Style/AndOr
|
system(full_command) or # rubocop:disable Style/AndOr
|
||||||
|
fail 'Failures'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user