Hello community,

here is the log from the commit of package rubygem-diffy for openSUSE:Factory 
checked in at 2019-01-21 10:53:37
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-diffy (Old)
 and      /work/SRC/openSUSE:Factory/.rubygem-diffy.new.28833 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rubygem-diffy"

Mon Jan 21 10:53:37 2019 rev:5 rq:665973 version:3.3.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/rubygem-diffy/rubygem-diffy.changes      
2018-07-18 22:49:15.799891292 +0200
+++ /work/SRC/openSUSE:Factory/.rubygem-diffy.new.28833/rubygem-diffy.changes   
2019-01-21 10:53:50.667765553 +0100
@@ -1,0 +2,9 @@
+Mon Jan 14 13:35:30 UTC 2019 - Stephan Kulow <co...@suse.com>
+
+- updated to version 3.3.0
+ see installed CHANGELOG
+
+  == 3.3.0 ==
+  Fix diff lines that begin with -- or ++. Thanks @dark-panda!
+
+-------------------------------------------------------------------

Old:
----
  diffy-3.2.1.gem

New:
----
  diffy-3.3.0.gem

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ rubygem-diffy.spec ++++++
--- /var/tmp/diff_new_pack.WVtwmy/_old  2019-01-21 10:53:51.183764929 +0100
+++ /var/tmp/diff_new_pack.WVtwmy/_new  2019-01-21 10:53:51.183764929 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package rubygem-diffy
 #
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -12,7 +12,7 @@
 # license that conforms to the Open Source Definition (Version 1.9)
 # published by the Open Source Initiative.
 
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
 
@@ -24,7 +24,7 @@
 #
 
 Name:           rubygem-diffy
-Version:        3.2.1
+Version:        3.3.0
 Release:        0
 %define mod_name diffy
 %define mod_full_name %{mod_name}-%{version}

++++++ diffy-3.2.1.gem -> diffy-3.3.0.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/CHANGELOG new/CHANGELOG
--- old/CHANGELOG       2018-05-19 23:29:41.000000000 +0200
+++ new/CHANGELOG       2018-12-30 06:04:12.000000000 +0100
@@ -1,5 +1,9 @@
+== 3.3.0 ==
+Fix diff lines that begin with -- or ++. Thanks @dark-panda!
+
 == 3.2.1 ==
 Fix default options on alpine linux.  Thanks @evgen!
+
 == 3.1.0 ==
 Side by side diffs.  Thanks Runar Skaare Tveiten!
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/CONTRIBUTORS new/CONTRIBUTORS
--- old/CONTRIBUTORS    2018-05-19 23:29:41.000000000 +0200
+++ new/CONTRIBUTORS    2018-12-30 06:04:12.000000000 +0100
@@ -12,3 +12,4 @@
 * Skye Shaw
 * Abinoam P. Marques Jr.
 * evgen
+* J Smith @dark-panda
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/diffy/diff.rb new/lib/diffy/diff.rb
--- old/lib/diffy/diff.rb       2018-05-19 23:29:41.000000000 +0200
+++ new/lib/diffy/diff.rb       2018-12-30 06:04:12.000000000 +0100
@@ -42,7 +42,7 @@
 
     def diff
       @diff ||= begin
-        paths = case options[:source]
+        @paths = case options[:source]
           when 'strings'
             [tempfile(string1), tempfile(string2)]
           when 'files'
@@ -51,10 +51,10 @@
 
         if WINDOWS
           # don't use open3 on windows
-          cmd = sprintf '"%s" %s %s', diff_bin, diff_options.join(' '), 
paths.map { |s| %("#{s}") }.join(' ')
+          cmd = sprintf '"%s" %s %s', diff_bin, diff_options.join(' '), 
@paths.map { |s| %("#{s}") }.join(' ')
           diff = `#{cmd}`
         else
-          diff = Open3.popen3(diff_bin, *(diff_options + paths)) { |i, o, e| 
o.read }
+          diff = Open3.popen3(diff_bin, *(diff_options + @paths)) { |i, o, e| 
o.read }
         end
         diff.force_encoding('ASCII-8BIT') if 
diff.respond_to?(:valid_encoding?) && !diff.valid_encoding?
         if diff =~ /\A\s*\Z/ && !options[:allow_empty_diff]
@@ -84,9 +84,20 @@
 
     def each
       lines = case @options[:include_diff_info]
-      when false then diff.split("\n").reject{|x| x =~ /^(---|\+\+\+|@@|\\\\)/ 
}.map {|line| line + "\n" }
-      when true then diff.split("\n").map {|line| line + "\n" }
+      when false
+        # this "primes" the diff and sets up the paths we'll reference below.
+        diff
+
+        # caching this regexp improves the performance of the loop by a
+        # considerable amount.
+        regexp = /^(--- "?#{@paths[0]}"?|\+\+\+ "?#{@paths[1]}"?|@@|\\\\)/
+
+        diff.split("\n").reject{|x| x =~ regexp }.map {|line| line + "\n" }
+
+      when true
+        diff.split("\n").map {|line| line + "\n" }
       end
+
       if block_given?
         lines.each{|line| yield line}
       else
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/diffy/version.rb new/lib/diffy/version.rb
--- old/lib/diffy/version.rb    2018-05-19 23:29:41.000000000 +0200
+++ new/lib/diffy/version.rb    2018-12-30 06:04:12.000000000 +0100
@@ -1,3 +1,3 @@
 module Diffy
-  VERSION = '3.2.1'
+  VERSION = '3.3.0'
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata        2018-05-19 23:29:41.000000000 +0200
+++ new/metadata        2018-12-30 06:04:12.000000000 +0100
@@ -1,14 +1,14 @@
 --- !ruby/object:Gem::Specification
 name: diffy
 version: !ruby/object:Gem::Version
-  version: 3.2.1
+  version: 3.3.0
 platform: ruby
 authors:
 - Sam Goldstein
 autorequire: 
 bindir: bin
 cert_chain: []
-date: 2018-05-19 00:00:00.000000000 Z
+date: 2018-12-30 00:00:00.000000000 Z
 dependencies:
 - !ruby/object:Gem::Dependency
   name: rake
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/spec/diffy_spec.rb new/spec/diffy_spec.rb
--- old/spec/diffy_spec.rb      2018-05-19 23:29:41.000000000 +0200
+++ new/spec/diffy_spec.rb      2018-12-30 06:04:12.000000000 +0100
@@ -585,6 +585,30 @@
         line
       end).to eq([" foo\n", " bar\n", "+baz\n"])
     end
+
+    it "should handle lines that begin with --" do
+      string1 = "a a\n-- b\nc c\n"
+      string2 = "a a\nb b\nc c\n"
+
+      expect(Diffy::Diff.new(string1, string2).to_s).to eq <<-DIFF
+ a a
+--- b
++b b
+ c c
+      DIFF
+    end
+
+    it "should handle lines that begin with ++" do
+      string1 = "a a\nb b\nc c\n"
+      string2 = "a a\n++ b\nc c\n"
+
+      expect(Diffy::Diff.new(string1, string2).to_s).to eq <<-DIFF
+ a a
+-b b
++++ b
+ c c
+      DIFF
+    end
   end
 end
 


Reply via email to