Method: Train::File#md5sum

Defined in:
lib/train/file.rb

#md5sumObject



133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# File 'lib/train/file.rb', line 133

def md5sum
  # Skip processing rest of method if fallback method is selected
  return perform_checksum_ruby(:md5) if defined?(@ruby_checksum_fallback)

  checksum = if @backend.os.family == 'windows'
               perform_checksum_windows(:md5)
             else
               @md5_command ||= case @backend.os.family
                                when 'darwin'
                                  'md5 -r'
                                when 'solaris'
                                  'digest -a md5'
                                else
                                  'md5sum'
                                end

               perform_checksum_unix(@md5_command)
             end

  checksum || perform_checksum_ruby(:md5)
end