diff-lcs 1.4 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8d49f14f7f3242c9aa114b5352864185acb447e05775f21292907f30944a4e57
4
- data.tar.gz: f72bf7376cb029d39e9fea818361afa99dea8c27440d483a2de04ee3b8864c6b
3
+ metadata.gz: e25465dc42f53e6fbecbb5f1d5fb9507b4e8687aee1b5bd010b456ca409b559d
4
+ data.tar.gz: 0c5618a13890bc917f81b9f52053945f3aa0a8c5e2c1d07bb47559f5dd0b1e62
5
5
  SHA512:
6
- metadata.gz: 9a217015cd26e5ca24d9398f9497c119bfd7251290f20f30e8a30ba880ed1f12fdf669fe8d0a019273fbe7e8e6362de67351f799a1d3ac3c0e9ef91c078609a6
7
- data.tar.gz: ebc14cb8fb1e0c949fcfce752da8c30c6005dbc62c62b371e6a520b7a485d16e7b36d2aa44dc7e395abca16fd3498c4aab154e2d880392d655abb613d5951185
6
+ metadata.gz: '07578eb0c1c939b9f45a0b8dbc53576d13a04f72c4ecccf52d79fe5d984d41c1f8cdf58471de228bc76af6898bc1ed6ebddc58df04068c901653600b6670f003'
7
+ data.tar.gz: d4ace7d0c9b03c518a2ce1b7537da8c767f1cfd3f3d025a7bf5206df61b6c44863239a8cbf4601f5464a3a35115a4891bca665b1792f1cb860b2cde3103b43bb
data/Rakefile CHANGED
@@ -24,22 +24,11 @@ _spec = Hoe.spec 'diff-lcs' do
24
24
  extra_dev_deps << ['hoe-gemspec2', '~> 1.1']
25
25
  extra_dev_deps << ['hoe-git', '~> 1.6']
26
26
  extra_dev_deps << ['hoe-rubygems', '~> 1.0']
27
- extra_dev_deps << ['hoe-travis', '~> 1.2']
28
27
  extra_dev_deps << ['rspec', '>= 2.0', '< 4']
29
28
  extra_dev_deps << ['rake', '>= 10.0', '< 14']
30
29
  extra_dev_deps << ['rdoc', '>= 0']
31
30
  end
32
31
 
33
- require "rspec/core/rake_task"
34
-
35
- desc "Run all specifications"
36
- RSpec::Core::RakeTask.new(:spec) do |t|
37
- rspec_dirs = %w(spec lib)
38
- t.rspec_opts = []
39
- t.rspec_opts << "-I#{rspec_dirs.join(":")}" unless rspec_dirs.empty?
40
- end
41
- task :default => :spec
42
-
43
32
  if RUBY_VERSION >= '2.0' && RUBY_ENGINE == 'ruby'
44
33
  namespace :spec do
45
34
  desc "Runs test coverage. Only works Ruby 2.0+ and assumes 'simplecov' is installed."
@@ -49,7 +49,7 @@ module Diff; end unless defined? Diff # rubocop:disable Style/Documentation
49
49
  # a x b y c z p d q
50
50
  # a b c a x b y c z
51
51
  module Diff::LCS
52
- VERSION = '1.4'
52
+ VERSION = '1.4.1'
53
53
  end
54
54
 
55
55
  require 'diff/lcs/callbacks'
@@ -19,7 +19,7 @@ class Diff::LCS::Block
19
19
  end
20
20
 
21
21
  def diff_size
22
- @insert.size - @remove.size
22
+ (@insert.size - @remove.size).abs
23
23
  end
24
24
 
25
25
  def op
@@ -54,4 +54,14 @@ describe 'Diff::LCS Issues' do
54
54
  ]
55
55
  end
56
56
  end
57
+
58
+ describe "issue #57" do
59
+ it 'should fail with a correct error' do
60
+ expect {
61
+ actual = {:category=>"app.rack.request"}
62
+ expected = {:category=>"rack.middleware", :title=>"Anonymous Middleware"}
63
+ expect(actual).to eq(expected)
64
+ }.to raise_error(RSpec::Expectations::ExpectationNotMetError)
65
+ end
66
+ end
57
67
  end
@@ -36,12 +36,14 @@ RSpec.describe 'bin/ldiff' do
36
36
  end
37
37
 
38
38
  def clean_data(data, flag)
39
- case flag
40
- when '-c', '-u'
41
- clean_output_timestamp(data)
42
- else
43
- data
44
- end
39
+ data =
40
+ case flag
41
+ when '-c', '-u'
42
+ clean_output_timestamp(data)
43
+ else
44
+ data
45
+ end
46
+ data.gsub(/\r\n?/, "\n")
45
47
  end
46
48
 
47
49
  def clean_output_timestamp(data)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: diff-lcs
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.4'
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Austin Ziegler
@@ -66,20 +66,6 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '1.0'
69
- - !ruby/object:Gem::Dependency
70
- name: hoe-travis
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '1.2'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: '1.2'
83
69
  - !ruby/object:Gem::Dependency
84
70
  name: rspec
85
71
  requirement: !ruby/object:Gem::Requirement