diffy 3.0.2 → 3.0.3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of diffy might be problematic. Click here for more details.
- data/lib/diffy/diff.rb +13 -0
- data/lib/diffy/version.rb +1 -1
- data/spec/diffy_spec.rb +15 -0
- metadata +68 -48
- checksums.yaml +0 -7
data/lib/diffy/diff.rb
CHANGED
@@ -63,6 +63,19 @@ module Diffy
|
|
63
63
|
end
|
64
64
|
diff
|
65
65
|
end
|
66
|
+
ensure
|
67
|
+
# unlink the tempfiles explicitly now that the diff is generated
|
68
|
+
Array(@tempfiles).each do |t|
|
69
|
+
begin
|
70
|
+
# check that the path is not nil and file still exists.
|
71
|
+
# REE seems to be very agressive with when it magically removes
|
72
|
+
# tempfiles
|
73
|
+
t.unlink if t.path && File.exist?(t.path)
|
74
|
+
rescue => e
|
75
|
+
warn "#{e.class}: #{e}"
|
76
|
+
warn e.backtrace.join("\n")
|
77
|
+
end
|
78
|
+
end
|
66
79
|
end
|
67
80
|
|
68
81
|
def each
|
data/lib/diffy/version.rb
CHANGED
data/spec/diffy_spec.rb
CHANGED
@@ -112,6 +112,21 @@ describe Diffy::Diff do
|
|
112
112
|
|
113
113
|
end
|
114
114
|
|
115
|
+
describe "handling temp files" do
|
116
|
+
it "should unlink tempfiles after generating the diff" do
|
117
|
+
before_tmpfiles = Dir.entries(Dir.tmpdir)
|
118
|
+
d = ::Diffy::Diff.new("a", "b").to_s
|
119
|
+
after_tmpfiles = Dir.entries(Dir.tmpdir)
|
120
|
+
before_tmpfiles.should =~ after_tmpfiles
|
121
|
+
end
|
122
|
+
|
123
|
+
it "should still be able to generate multiple diffs" do
|
124
|
+
d = ::Diffy::Diff.new("a", "b")
|
125
|
+
d.to_s.should be_a String
|
126
|
+
d.to_s(:html).should be_a String
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
115
130
|
describe "options[:context]" do
|
116
131
|
it "should limit context lines to 1" do
|
117
132
|
diff = Diffy::Diff.new("foo\nfoo\nBAR\nbang\nbaz", "foo\nfoo\nbar\nbang\nbaz", :context => 1)
|
metadata
CHANGED
@@ -1,53 +1,64 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: diffy
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 1
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 3
|
8
|
+
- 0
|
9
|
+
- 3
|
10
|
+
version: 3.0.3
|
5
11
|
platform: ruby
|
6
|
-
authors:
|
12
|
+
authors:
|
7
13
|
- Sam Goldstein
|
8
14
|
autorequire:
|
9
15
|
bindir: bin
|
10
16
|
cert_chain: []
|
11
|
-
|
12
|
-
|
13
|
-
|
17
|
+
|
18
|
+
date: 2014-03-16 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
14
21
|
name: rake
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :development
|
21
22
|
prerelease: false
|
22
|
-
|
23
|
-
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
24
26
|
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '2.0'
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 3
|
29
|
+
segments:
|
30
|
+
- 0
|
31
|
+
version: "0"
|
34
32
|
type: :development
|
33
|
+
version_requirements: *id001
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
name: rspec
|
35
36
|
prerelease: false
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
38
|
+
none: false
|
39
|
+
requirements:
|
40
|
+
- - ~>
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
hash: 3
|
43
|
+
segments:
|
44
|
+
- 2
|
45
|
+
- 0
|
46
|
+
version: "2.0"
|
47
|
+
type: :development
|
48
|
+
version_requirements: *id002
|
41
49
|
description: Convenient diffing in ruby
|
42
|
-
email:
|
50
|
+
email:
|
43
51
|
- sgrock@gmail.org
|
44
52
|
executables: []
|
53
|
+
|
45
54
|
extensions: []
|
55
|
+
|
46
56
|
extra_rdoc_files: []
|
47
|
-
|
48
|
-
|
49
|
-
-
|
50
|
-
-
|
57
|
+
|
58
|
+
files:
|
59
|
+
- .gitignore
|
60
|
+
- .rspec
|
61
|
+
- .travis.yml
|
51
62
|
- CHANGELOG
|
52
63
|
- CONTRIBUTORS
|
53
64
|
- Gemfile
|
@@ -64,29 +75,38 @@ files:
|
|
64
75
|
- spec/demo_app.rb
|
65
76
|
- spec/diffy_spec.rb
|
66
77
|
homepage: http://github.com/samg/diffy
|
67
|
-
licenses:
|
78
|
+
licenses:
|
68
79
|
- MIT
|
69
|
-
metadata: {}
|
70
80
|
post_install_message:
|
71
81
|
rdoc_options: []
|
72
|
-
|
82
|
+
|
83
|
+
require_paths:
|
73
84
|
- lib
|
74
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
75
|
-
|
85
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
86
|
+
none: false
|
87
|
+
requirements:
|
76
88
|
- - ">="
|
77
|
-
- !ruby/object:Gem::Version
|
78
|
-
|
79
|
-
|
80
|
-
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
hash: 3
|
91
|
+
segments:
|
92
|
+
- 0
|
93
|
+
version: "0"
|
94
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
|
+
none: false
|
96
|
+
requirements:
|
81
97
|
- - ">="
|
82
|
-
- !ruby/object:Gem::Version
|
83
|
-
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
hash: 3
|
100
|
+
segments:
|
101
|
+
- 0
|
102
|
+
version: "0"
|
84
103
|
requirements: []
|
104
|
+
|
85
105
|
rubyforge_project:
|
86
|
-
rubygems_version:
|
106
|
+
rubygems_version: 1.8.15
|
87
107
|
signing_key:
|
88
|
-
specification_version:
|
108
|
+
specification_version: 3
|
89
109
|
summary: A convenient way to diff string in ruby
|
90
|
-
test_files:
|
110
|
+
test_files:
|
91
111
|
- spec/demo_app.rb
|
92
112
|
- spec/diffy_spec.rb
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: 2b046b2d411fcf289de53a9f8fde302d1d7ab5a5
|
4
|
-
data.tar.gz: d0b6638a247807c18afefef9f8cb9414581b1fc3
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: 8266ca734ad349afd9728e12b3d34ac226e6c993bd79bba16481018ec5d03836c9edb8d9f4bc93a845adbfd52c56bab8118259304d57ed37e70399472f5493cf
|
7
|
-
data.tar.gz: 0d3cf9397e5fba6d42fb9f60514a537a1003210695a5dd5eefd5ad15b69f55aa06f027ac5a83400badbf20dd2a8d4b24b92667178a472d4f907999831a5d9ab6
|