Sha256: 967ca207cd914022442e13e324efc37b263458508a1265e8c204aa1fcdd657ee

Contents?: true

Size: 596 Bytes

Versions: 6

Compression:

Stored size: 596 Bytes

Contents

# coding: UTF-8

module Daddy
  module Cucumber
    module Diff
      
      def git_diff(local_file, git_path)
        git = Daddy::Git.new
        a = File.read(local_file).gsub(/[<>]/, '<' => '&lt;', '>' => '&gt;')
        b = git.show_previous(git_path, true).gsub(/[<>]/, '<' => '&lt;', '>' => '&gt;')
        diff = Differ.diff(a, b)

        puts local_file
        puts "<pre>#{diff}</pre>"
      end

      def show(file)
        puts file
        puts "<pre>#{File.read(file).gsub(/[<>]/, '<' => '&lt;', '>' => '&gt;')}</pre>"
      end

    end
  end
end

World(Daddy::Cucumber::Diff)

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
daddy-0.0.17 lib/daddy/cucumber/diff.rb
daddy-0.0.16 lib/daddy/cucumber/diff.rb
daddy-0.0.15 lib/daddy/cucumber/diff.rb
daddy-0.0.14 lib/daddy/cucumber/diff.rb
daddy-0.0.13 lib/daddy/cucumber/diff.rb
daddy-0.0.12 lib/daddy/cucumber/diff.rb