Method: Diffy::Diff#initialize
- Defined in:
- lib/diffy/diff.rb
#initialize(string1, string2, options = {}) ⇒ Diff
supported options
:diff-
A cli options string passed to diff
:source-
Either strings or files. Determines whether string1 and string2 should be interpreted as strings or file paths.
:include_diff_info-
Include diff header info
:include_plus_and_minus_in_html-
Show the +, -, ‘ ’ at the beginning of lines in html output.
35 36 37 38 39 40 41 |
# File 'lib/diffy/diff.rb', line 35 def initialize(string1, string2, = {}) @options = self.class..merge() if ! ['strings', 'files'].include?(@options[:source]) raise ArgumentError, "Invalid :source option #{@options[:source].inspect}. Supported options are 'strings' and 'files'." end @string1, @string2 = string1, string2 end |