Skip to content

Commit fe64ede

Browse files
committed
Merge pull request rails#12728 from arunagw/aa-warnings-removed-ruby-trunk
More Warnings removed for ruby trunk
2 parents 09ce1df + dbdb254 commit fe64ede

File tree

19 files changed

+31
-31
lines changed

19 files changed

+31
-31
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ gem 'dalli', '>= 2.2.1'
3030

3131
# Add your own local bundler stuff
3232
local_gemfile = File.dirname(__FILE__) + "/.Gemfile"
33-
instance_eval File.read local_gemfile if File.exists? local_gemfile
33+
instance_eval File.read local_gemfile if File.exist? local_gemfile
3434

3535
group :test do
3636
platforms :mri_19 do

activerecord/test/cases/tasks/postgresql_rake_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def test_structure_dump
206206
@connection.expects(:schema_search_path).returns("foo")
207207

208208
ActiveRecord::Tasks::DatabaseTasks.structure_dump(@configuration, filename)
209-
assert File.exists?(filename)
209+
assert File.exist?(filename)
210210
ensure
211211
FileUtils.rm(filename)
212212
end

railties/bin/rails

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
git_path = File.join(File.expand_path('../../..', __FILE__), '.git')
44

5-
if File.exists?(git_path)
5+
if File.exist?(git_path)
66
railties_path = File.expand_path('../../lib', __FILE__)
77
$:.unshift(railties_path)
88
end

railties/lib/rails/app_rails_loader.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def self.exec_app_rails
5555
end
5656

5757
def self.find_executable
58-
EXECUTABLES.find { |exe| File.exists?(exe) }
58+
EXECUTABLES.find { |exe| File.exist?(exe) }
5959
end
6060
end
6161
end

railties/lib/rails/commands/commands_tasks.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def generate_or_destroy(command)
139139
# This allows us to run `rails server` from other directories, but still get
140140
# the main config.ru and properly set the tmp directory.
141141
def set_application_directory!
142-
Dir.chdir(File.expand_path('../../', APP_PATH)) unless File.exists?(File.expand_path("config.ru"))
142+
Dir.chdir(File.expand_path('../../', APP_PATH)) unless File.exist?(File.expand_path("config.ru"))
143143
end
144144

145145
def require_application_and_environment!

railties/lib/rails/generators/base.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ def self.default_source_root
212212
return unless base_name && generator_name
213213
return unless default_generator_root
214214
path = File.join(default_generator_root, 'templates')
215-
path if File.exists?(path)
215+
path if File.exist?(path)
216216
end
217217

218218
# Returns the base root for a common set of generators. This is used to dynamically
@@ -369,12 +369,12 @@ def self.usage_path
369369
source_root && File.expand_path("../USAGE", source_root),
370370
default_generator_root && File.join(default_generator_root, "USAGE")
371371
]
372-
paths.compact.detect { |path| File.exists? path }
372+
paths.compact.detect { |path| File.exist? path }
373373
end
374374

375375
def self.default_generator_root
376376
path = File.expand_path(File.join(base_name, generator_name), base_root)
377-
path if File.exists?(path)
377+
path if File.exist?(path)
378378
end
379379

380380
end

railties/lib/rails/generators/rails/app/app_generator.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ def handle_rails_rc!(argv)
349349
if argv.find { |arg| arg == '--no-rc' }
350350
argv.reject { |arg| arg == '--no-rc' }
351351
else
352-
railsrc(argv) { |argv, rc| insert_railsrc_into_argv!(argv, rc) }
352+
railsrc(argv) { |rc_argv, rc| insert_railsrc_into_argv!(rc_argv, rc) }
353353
end
354354
end
355355

@@ -369,7 +369,7 @@ def read_rc_file(railsrc)
369369
end
370370

371371
def insert_railsrc_into_argv!(argv, railsrc)
372-
return argv unless File.exists?(railsrc)
372+
return argv unless File.exist?(railsrc)
373373
extra_args = read_rc_file railsrc
374374
argv.take(1) + extra_args + argv.drop(1)
375375
end
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Set up gems listed in the Gemfile.
22
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
33

4-
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
4+
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])

railties/lib/rails/generators/rails/plugin/plugin_generator.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ def application_definition
319319
@application_definition ||= begin
320320

321321
dummy_application_path = File.expand_path("#{dummy_path}/config/application.rb", destination_root)
322-
unless options[:pretend] || !File.exists?(dummy_application_path)
322+
unless options[:pretend] || !File.exist?(dummy_application_path)
323323
contents = File.read(dummy_application_path)
324324
contents[(contents.index(/module ([\w]+)\n(.*)class Application/m))..-1]
325325
end
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Set up gems listed in the Gemfile.
22
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
33

4-
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
4+
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
55
$LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)

0 commit comments

Comments
 (0)