instance method
identical?
Ruby on Rails 2.3.18
Since v2.2.3 Last seen in v2.3.18Available in: v2.2.3 v2.3.18
Signature
identical?(source, destination, &block)
Checks if the source and the destination file are identical. If passed a block then the source file is a template that needs to first be evaluated before being compared to the destination.
Parameters
-
sourcereq -
destinationreq -
blockblock
Source
# File railties/lib/rails_generator/commands.rb, line 276
def identical?(source, destination, &block)
return false if File.directory? destination
source = block_given? ? File.open(source) {|sf| yield(sf)} : IO.read(source)
destination = IO.read(destination)
source == destination
end
Defined in railties/lib/rails_generator/commands.rb line 276
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Rails::Generator::Commands::Create