instance method identical?

Ruby on Rails 2.2.3

Since v2.2.3 Last seen in v2.3.18

Available 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

source req
destination req
block block
Source
# File railties/lib/rails_generator/commands.rb, line 271
        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 271 · View on GitHub · Improve this page · Find usages on GitHub

Defined in Rails::Generator::Commands::Create

Type at least 2 characters to search.

↑↓ navigate · open · esc close