diffed 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/diffed.rb +43 -7
- data/lib/diffed/version.rb +1 -1
- data/spec/diffed_spec.rb +6 -0
- data/testdata/git-show.diff +90 -0
- data/testdata/git-show.styled.html +72 -0
- metadata +19 -7
data/lib/diffed.rb
CHANGED
@@ -87,19 +87,34 @@ module Diffed
|
|
87
87
|
|
88
88
|
def parse(lines)
|
89
89
|
@sections = []
|
90
|
-
curr_header, curr_lines = nil, []
|
90
|
+
curr_header, curr_lines, left_counter, right_counter = nil, [], 0, 0
|
91
91
|
|
92
92
|
lines.each do |line|
|
93
93
|
if DiffHeaderLine.is_header?(line)
|
94
94
|
unless curr_header.nil?
|
95
|
-
|
95
|
+
raise "Found a header while still processing a section! #{line}"
|
96
96
|
end
|
97
97
|
|
98
98
|
curr_header, curr_lines = DiffHeaderLine.new(line), []
|
99
|
+
elsif curr_header.nil?
|
100
|
+
# Do nothing. We haven't started yet.
|
101
|
+
# puts "Ignoring line: #{line}"
|
99
102
|
elsif line =~ /\/
|
100
|
-
curr_lines.
|
103
|
+
if curr_lines.empty?
|
104
|
+
@sections.last.no_new_line = true
|
105
|
+
else
|
106
|
+
curr_lines.last.no_new_line = true
|
107
|
+
end
|
101
108
|
else
|
102
|
-
|
109
|
+
diff_line = DiffLine.new(line)
|
110
|
+
curr_lines << diff_line
|
111
|
+
left_counter += 1 if diff_line.left?
|
112
|
+
right_counter += 1 if diff_line.right?
|
113
|
+
|
114
|
+
if curr_header.section_complete? left_counter, right_counter
|
115
|
+
@sections << DiffSection.new(curr_header, curr_lines)
|
116
|
+
curr_header, curr_lines, left_counter, right_counter = nil, [], 0, 0
|
117
|
+
end
|
103
118
|
end
|
104
119
|
end
|
105
120
|
end
|
@@ -129,6 +144,14 @@ module Diffed
|
|
129
144
|
|
130
145
|
@text = line
|
131
146
|
@no_new_line = false
|
147
|
+
end
|
148
|
+
|
149
|
+
def left?
|
150
|
+
@type == :left || @type == :both
|
151
|
+
end
|
152
|
+
|
153
|
+
def right?
|
154
|
+
@type == :right || @type == :both
|
132
155
|
end
|
133
156
|
|
134
157
|
def no_new_line= bool
|
@@ -141,16 +164,29 @@ module Diffed
|
|
141
164
|
attr_reader :line_nums, :text
|
142
165
|
|
143
166
|
def initialize(line)
|
144
|
-
|
145
|
-
|
146
|
-
|
167
|
+
@text = line
|
168
|
+
|
169
|
+
if line =~ /^@@ -(\d+),(\d+) \+(\d+),(\d+) @@/
|
170
|
+
@line_nums = {left: {from: $1.to_i, lines: $2.to_i}, right: {from: $3.to_i, lines: $4.to_i}}
|
171
|
+
elsif line =~ /^@@ -(\d+) \+(\d+) @@/
|
172
|
+
@line_nums = {left: {from: $1.to_i, lines: $1.to_i}, right: {from: $2.to_i, lines: $2.to_i}}
|
147
173
|
else
|
148
174
|
raise "Unparseable header line: #{line}"
|
149
175
|
end
|
176
|
+
|
177
|
+
if @line_nums[:right][:lines] > @line_nums[:left][:lines]
|
178
|
+
@side_to_count = :right
|
179
|
+
else
|
180
|
+
@side_to_count = :left
|
181
|
+
end
|
150
182
|
end
|
151
183
|
|
152
184
|
def self.is_header?(line)
|
153
185
|
line.start_with? "@@ "
|
154
186
|
end
|
187
|
+
|
188
|
+
def section_complete?(left_count, right_count)
|
189
|
+
left_count >= @line_nums[:left][:lines] && right_count >= @line_nums[:right][:lines]
|
190
|
+
end
|
155
191
|
end
|
156
192
|
end
|
data/lib/diffed/version.rb
CHANGED
data/spec/diffed_spec.rb
CHANGED
@@ -7,6 +7,12 @@ describe "Diffed::Diff.as_html_table" do
|
|
7
7
|
output.strip == File.read("testdata/diff1.styled.html").strip
|
8
8
|
end
|
9
9
|
|
10
|
+
it "produces an html table representation of the diff portions of the output of 'git show', with CSS styles inline" do
|
11
|
+
diff = Diffed::Diff.new(File.read("testdata/git-show.diff"))
|
12
|
+
output = diff.as_html_table
|
13
|
+
output.strip == File.read("testdata/git-show.styled.html").strip
|
14
|
+
end
|
15
|
+
|
10
16
|
it "produces an html table representation of a diff, with CSS classes" do
|
11
17
|
diff = Diffed::Diff.new(File.read("testdata/diff1.diff"))
|
12
18
|
output = diff.as_html_table(false)
|
@@ -0,0 +1,90 @@
|
|
1
|
+
commit fc8d95f7e0b577a7a0d11d9f66bd5fd2b2596618
|
2
|
+
Author: Ilya Sabanin <ilya@sabanin.ru>
|
3
|
+
Date: Fri Apr 5 11:15:25 2013 -0400
|
4
|
+
|
5
|
+
Ruby 1.9 compat and version bump
|
6
|
+
|
7
|
+
diff --git a/VERSION b/VERSION
|
8
|
+
index f76f913..b3ec163 100644
|
9
|
+
--- a/VERSION
|
10
|
+
+++ b/VERSION
|
11
|
+
@@ -1 +1 @@
|
12
|
+
-0.9.2
|
13
|
+
|
14
|
+
+0.9.3
|
15
|
+
|
16
|
+
diff --git a/lib/pretty_diff/html_generators/diff_generator.rb b/lib/pretty_diff/html_generators/diff_generator.rb
|
17
|
+
index 2bec9dc..e073125 100644
|
18
|
+
--- a/lib/pretty_diff/html_generators/diff_generator.rb
|
19
|
+
+++ b/lib/pretty_diff/html_generators/diff_generator.rb
|
20
|
+
@@ -7,7 +7,7 @@ class PrettyDiff::DiffGenerator
|
21
|
+
end
|
22
|
+
|
23
|
+
def generate
|
24
|
+
- diff.chunks.map{|c| c.to_html}.to_s
|
25
|
+
+ diff.chunks.map{|c| c.to_html}.join('')
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
diff --git a/pretty_diff.gemspec b/pretty_diff.gemspec
|
30
|
+
index 8239303..5ee8bad 100644
|
31
|
+
--- a/pretty_diff.gemspec
|
32
|
+
+++ b/pretty_diff.gemspec
|
33
|
+
@@ -4,16 +4,14 @@
|
34
|
+
# -*- encoding: utf-8 -*-
|
35
|
+
|
36
|
+
Gem::Specification.new do |s|
|
37
|
+
- s.name = %q{pretty_diff}
|
38
|
+
- s.version = "0.9.2"
|
39
|
+
+ s.name = "pretty_diff"
|
40
|
+
+ s.version = "0.9.3"
|
41
|
+
|
42
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
43
|
+
s.authors = ["Ilya Sabanin"]
|
44
|
+
- s.date = %q{2012-05-04}
|
45
|
+
- s.description = %q{PrettyDiff is a highly customizable library for creating fully featured HTML
|
46
|
+
- listings out of unified diff format strings.
|
47
|
+
- Include copy/paste-safe line numbers and built-in syntax highlighting.}
|
48
|
+
- s.email = %q{ilya.sabanin@gmail.com}
|
49
|
+
+ s.date = "2013-04-05"
|
50
|
+
+ s.description = "PrettyDiff is a highly customizable library for creating fully featured HTML\n listings out of unified diff format strings.\n Include copy/paste-safe line numbers and built-in syntax highlighting."
|
51
|
+
+ s.email = "ilya.sabanin@gmail.com"
|
52
|
+
s.extra_rdoc_files = [
|
53
|
+
"LICENSE",
|
54
|
+
"README.rdoc"
|
55
|
+
@@ -42,28 +40,23 @@ Gem::Specification.new do |s|
|
56
|
+
"test/html_generator_test.rb",
|
57
|
+
"test/line_test.rb"
|
58
|
+
]
|
59
|
+
- s.homepage = %q{http://github.com/isabanin/pretty_diff}
|
60
|
+
+ s.homepage = "http://github.com/isabanin/pretty_diff"
|
61
|
+
s.require_paths = ["lib"]
|
62
|
+
- s.rubygems_version = %q{1.3.7}
|
63
|
+
- s.summary = %q{Library for converting unified diff format into HTML listings.}
|
64
|
+
- s.test_files = [
|
65
|
+
- "test/chunk_test.rb",
|
66
|
+
- "test/diff_test.rb",
|
67
|
+
- "test/helper.rb",
|
68
|
+
- "test/html_generator_test.rb",
|
69
|
+
- "test/line_test.rb"
|
70
|
+
- ]
|
71
|
+
+ s.rubygems_version = "2.0.3"
|
72
|
+
+ s.summary = "Library for converting unified diff format into HTML listings."
|
73
|
+
|
74
|
+
if s.respond_to? :specification_version then
|
75
|
+
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
76
|
+
- s.specification_version = 3
|
77
|
+
+ s.specification_version = 4
|
78
|
+
|
79
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
80
|
+
+ s.add_development_dependency(%q<jeweler>, [">= 0"])
|
81
|
+
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
82
|
+
else
|
83
|
+
+ s.add_dependency(%q<jeweler>, [">= 0"])
|
84
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
85
|
+
end
|
86
|
+
else
|
87
|
+
+ s.add_dependency(%q<jeweler>, [">= 0"])
|
88
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
89
|
+
end
|
90
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
<table cellpadding="5" style="border-collapse: collapse; border: 1px solid #CCC; font-family: Consolas, courier, monospace; font-size: 13px; color: #888">
|
2
|
+
<tr style="background-color: #F0F0FF"><td style="border-left: 1px solid #CCC">...</td><td style="border-left: 1px solid #CCC">...</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #888"><pre>@@ -1 +1 @@</pre></td></tr>
|
3
|
+
<tr style="background-color: #FDD"><td style="border-left: 1px solid #CCC">1</td><td style="border-left: 1px solid #CCC">.</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre>-0.9.2</pre></td></tr>
|
4
|
+
<tr style="background-color: #DFD"><td style="border-left: 1px solid #CCC">.</td><td style="border-left: 1px solid #CCC">1</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre>+0.9.3</pre></td></tr>
|
5
|
+
<tr style="background-color: #F0F0FF"><td style="border-left: 1px solid #CCC">...</td><td style="border-left: 1px solid #CCC">...</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #888"><pre>@@ -7,7 +7,7 @@ class PrettyDiff::DiffGenerator</pre></td></tr>
|
6
|
+
<tr><td style="border-left: 1px solid #CCC">7</td><td style="border-left: 1px solid #CCC">7</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre> end</pre></td></tr>
|
7
|
+
<tr><td style="border-left: 1px solid #CCC">8</td><td style="border-left: 1px solid #CCC">8</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre> </pre></td></tr>
|
8
|
+
<tr><td style="border-left: 1px solid #CCC">9</td><td style="border-left: 1px solid #CCC">9</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre> def generate</pre></td></tr>
|
9
|
+
<tr style="background-color: #FDD"><td style="border-left: 1px solid #CCC">10</td><td style="border-left: 1px solid #CCC">.</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre>- diff.chunks.map{|c| c.to_html}.to_s</pre></td></tr>
|
10
|
+
<tr style="background-color: #DFD"><td style="border-left: 1px solid #CCC">.</td><td style="border-left: 1px solid #CCC">10</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre>+ diff.chunks.map{|c| c.to_html}.join('')</pre></td></tr>
|
11
|
+
<tr><td style="border-left: 1px solid #CCC">11</td><td style="border-left: 1px solid #CCC">11</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre> end</pre></td></tr>
|
12
|
+
<tr><td style="border-left: 1px solid #CCC">12</td><td style="border-left: 1px solid #CCC">12</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre> </pre></td></tr>
|
13
|
+
<tr><td style="border-left: 1px solid #CCC">13</td><td style="border-left: 1px solid #CCC">13</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre> end</pre></td></tr>
|
14
|
+
<tr style="background-color: #F0F0FF"><td style="border-left: 1px solid #CCC">...</td><td style="border-left: 1px solid #CCC">...</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #888"><pre>@@ -4,16 +4,14 @@</pre></td></tr>
|
15
|
+
<tr><td style="border-left: 1px solid #CCC">4</td><td style="border-left: 1px solid #CCC">4</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre> # -*- encoding: utf-8 -*-</pre></td></tr>
|
16
|
+
<tr><td style="border-left: 1px solid #CCC">5</td><td style="border-left: 1px solid #CCC">5</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre> </pre></td></tr>
|
17
|
+
<tr><td style="border-left: 1px solid #CCC">6</td><td style="border-left: 1px solid #CCC">6</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre> Gem::Specification.new do |s|</pre></td></tr>
|
18
|
+
<tr style="background-color: #FDD"><td style="border-left: 1px solid #CCC">7</td><td style="border-left: 1px solid #CCC">.</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre>- s.name = %q{pretty_diff}</pre></td></tr>
|
19
|
+
<tr style="background-color: #FDD"><td style="border-left: 1px solid #CCC">8</td><td style="border-left: 1px solid #CCC">.</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre>- s.version = "0.9.2"</pre></td></tr>
|
20
|
+
<tr style="background-color: #DFD"><td style="border-left: 1px solid #CCC">.</td><td style="border-left: 1px solid #CCC">7</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre>+ s.name = "pretty_diff"</pre></td></tr>
|
21
|
+
<tr style="background-color: #DFD"><td style="border-left: 1px solid #CCC">.</td><td style="border-left: 1px solid #CCC">8</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre>+ s.version = "0.9.3"</pre></td></tr>
|
22
|
+
<tr><td style="border-left: 1px solid #CCC">9</td><td style="border-left: 1px solid #CCC">9</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre> </pre></td></tr>
|
23
|
+
<tr><td style="border-left: 1px solid #CCC">10</td><td style="border-left: 1px solid #CCC">10</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre> s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=</pre></td></tr>
|
24
|
+
<tr><td style="border-left: 1px solid #CCC">11</td><td style="border-left: 1px solid #CCC">11</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre> s.authors = ["Ilya Sabanin"]</pre></td></tr>
|
25
|
+
<tr style="background-color: #FDD"><td style="border-left: 1px solid #CCC">12</td><td style="border-left: 1px solid #CCC">.</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre>- s.date = %q{2012-05-04}</pre></td></tr>
|
26
|
+
<tr style="background-color: #FDD"><td style="border-left: 1px solid #CCC">13</td><td style="border-left: 1px solid #CCC">.</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre>- s.description = %q{PrettyDiff is a highly customizable library for creating fully featured HTML</pre></td></tr>
|
27
|
+
<tr style="background-color: #FDD"><td style="border-left: 1px solid #CCC">14</td><td style="border-left: 1px solid #CCC">.</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre>- listings out of unified diff format strings.</pre></td></tr>
|
28
|
+
<tr style="background-color: #FDD"><td style="border-left: 1px solid #CCC">15</td><td style="border-left: 1px solid #CCC">.</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre>- Include copy/paste-safe line numbers and built-in syntax highlighting.}</pre></td></tr>
|
29
|
+
<tr style="background-color: #FDD"><td style="border-left: 1px solid #CCC">16</td><td style="border-left: 1px solid #CCC">.</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre>- s.email = %q{ilya.sabanin@gmail.com}</pre></td></tr>
|
30
|
+
<tr style="background-color: #DFD"><td style="border-left: 1px solid #CCC">.</td><td style="border-left: 1px solid #CCC">12</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre>+ s.date = "2013-04-05"</pre></td></tr>
|
31
|
+
<tr style="background-color: #DFD"><td style="border-left: 1px solid #CCC">.</td><td style="border-left: 1px solid #CCC">13</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre>+ s.description = "PrettyDiff is a highly customizable library for creating fully featured HTML\n listings out of unified diff format strings.\n Include copy/paste-safe line numbers and built-in syntax highlighting."</pre></td></tr>
|
32
|
+
<tr style="background-color: #DFD"><td style="border-left: 1px solid #CCC">.</td><td style="border-left: 1px solid #CCC">14</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre>+ s.email = "ilya.sabanin@gmail.com"</pre></td></tr>
|
33
|
+
<tr><td style="border-left: 1px solid #CCC">17</td><td style="border-left: 1px solid #CCC">15</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre> s.extra_rdoc_files = [</pre></td></tr>
|
34
|
+
<tr><td style="border-left: 1px solid #CCC">18</td><td style="border-left: 1px solid #CCC">16</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre> "LICENSE",</pre></td></tr>
|
35
|
+
<tr><td style="border-left: 1px solid #CCC">19</td><td style="border-left: 1px solid #CCC">17</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre> "README.rdoc"</pre></td></tr>
|
36
|
+
<tr style="background-color: #F0F0FF"><td style="border-left: 1px solid #CCC">...</td><td style="border-left: 1px solid #CCC">...</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #888"><pre>@@ -42,28 +40,23 @@ Gem::Specification.new do |s|</pre></td></tr>
|
37
|
+
<tr><td style="border-left: 1px solid #CCC">42</td><td style="border-left: 1px solid #CCC">40</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre> "test/html_generator_test.rb",</pre></td></tr>
|
38
|
+
<tr><td style="border-left: 1px solid #CCC">43</td><td style="border-left: 1px solid #CCC">41</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre> "test/line_test.rb"</pre></td></tr>
|
39
|
+
<tr><td style="border-left: 1px solid #CCC">44</td><td style="border-left: 1px solid #CCC">42</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre> ]</pre></td></tr>
|
40
|
+
<tr style="background-color: #FDD"><td style="border-left: 1px solid #CCC">45</td><td style="border-left: 1px solid #CCC">.</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre>- s.homepage = %q{http://github.com/isabanin/pretty_diff}</pre></td></tr>
|
41
|
+
<tr style="background-color: #DFD"><td style="border-left: 1px solid #CCC">.</td><td style="border-left: 1px solid #CCC">43</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre>+ s.homepage = "http://github.com/isabanin/pretty_diff"</pre></td></tr>
|
42
|
+
<tr><td style="border-left: 1px solid #CCC">46</td><td style="border-left: 1px solid #CCC">44</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre> s.require_paths = ["lib"]</pre></td></tr>
|
43
|
+
<tr style="background-color: #FDD"><td style="border-left: 1px solid #CCC">47</td><td style="border-left: 1px solid #CCC">.</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre>- s.rubygems_version = %q{1.3.7}</pre></td></tr>
|
44
|
+
<tr style="background-color: #FDD"><td style="border-left: 1px solid #CCC">48</td><td style="border-left: 1px solid #CCC">.</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre>- s.summary = %q{Library for converting unified diff format into HTML listings.}</pre></td></tr>
|
45
|
+
<tr style="background-color: #FDD"><td style="border-left: 1px solid #CCC">49</td><td style="border-left: 1px solid #CCC">.</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre>- s.test_files = [</pre></td></tr>
|
46
|
+
<tr style="background-color: #FDD"><td style="border-left: 1px solid #CCC">50</td><td style="border-left: 1px solid #CCC">.</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre>- "test/chunk_test.rb",</pre></td></tr>
|
47
|
+
<tr style="background-color: #FDD"><td style="border-left: 1px solid #CCC">51</td><td style="border-left: 1px solid #CCC">.</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre>- "test/diff_test.rb",</pre></td></tr>
|
48
|
+
<tr style="background-color: #FDD"><td style="border-left: 1px solid #CCC">52</td><td style="border-left: 1px solid #CCC">.</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre>- "test/helper.rb",</pre></td></tr>
|
49
|
+
<tr style="background-color: #FDD"><td style="border-left: 1px solid #CCC">53</td><td style="border-left: 1px solid #CCC">.</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre>- "test/html_generator_test.rb",</pre></td></tr>
|
50
|
+
<tr style="background-color: #FDD"><td style="border-left: 1px solid #CCC">54</td><td style="border-left: 1px solid #CCC">.</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre>- "test/line_test.rb"</pre></td></tr>
|
51
|
+
<tr style="background-color: #FDD"><td style="border-left: 1px solid #CCC">55</td><td style="border-left: 1px solid #CCC">.</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre>- ]</pre></td></tr>
|
52
|
+
<tr style="background-color: #DFD"><td style="border-left: 1px solid #CCC">.</td><td style="border-left: 1px solid #CCC">45</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre>+ s.rubygems_version = "2.0.3"</pre></td></tr>
|
53
|
+
<tr style="background-color: #DFD"><td style="border-left: 1px solid #CCC">.</td><td style="border-left: 1px solid #CCC">46</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre>+ s.summary = "Library for converting unified diff format into HTML listings."</pre></td></tr>
|
54
|
+
<tr><td style="border-left: 1px solid #CCC">56</td><td style="border-left: 1px solid #CCC">47</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre> </pre></td></tr>
|
55
|
+
<tr><td style="border-left: 1px solid #CCC">57</td><td style="border-left: 1px solid #CCC">48</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre> if s.respond_to? :specification_version then</pre></td></tr>
|
56
|
+
<tr style="background-color: #FDD"><td style="border-left: 1px solid #CCC">58</td><td style="border-left: 1px solid #CCC">.</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre>- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION</pre></td></tr>
|
57
|
+
<tr style="background-color: #FDD"><td style="border-left: 1px solid #CCC">59</td><td style="border-left: 1px solid #CCC">.</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre>- s.specification_version = 3</pre></td></tr>
|
58
|
+
<tr style="background-color: #DFD"><td style="border-left: 1px solid #CCC">.</td><td style="border-left: 1px solid #CCC">49</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre>+ s.specification_version = 4</pre></td></tr>
|
59
|
+
<tr><td style="border-left: 1px solid #CCC">60</td><td style="border-left: 1px solid #CCC">50</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre> </pre></td></tr>
|
60
|
+
<tr><td style="border-left: 1px solid #CCC">61</td><td style="border-left: 1px solid #CCC">51</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre> if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then</pre></td></tr>
|
61
|
+
<tr style="background-color: #DFD"><td style="border-left: 1px solid #CCC">.</td><td style="border-left: 1px solid #CCC">52</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre>+ s.add_development_dependency(%q<jeweler>, [">= 0"])</pre></td></tr>
|
62
|
+
<tr><td style="border-left: 1px solid #CCC">62</td><td style="border-left: 1px solid #CCC">53</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre> s.add_development_dependency(%q<shoulda>, [">= 0"])</pre></td></tr>
|
63
|
+
<tr><td style="border-left: 1px solid #CCC">63</td><td style="border-left: 1px solid #CCC">54</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre> else</pre></td></tr>
|
64
|
+
<tr style="background-color: #DFD"><td style="border-left: 1px solid #CCC">.</td><td style="border-left: 1px solid #CCC">55</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre>+ s.add_dependency(%q<jeweler>, [">= 0"])</pre></td></tr>
|
65
|
+
<tr><td style="border-left: 1px solid #CCC">64</td><td style="border-left: 1px solid #CCC">56</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre> s.add_dependency(%q<shoulda>, [">= 0"])</pre></td></tr>
|
66
|
+
<tr><td style="border-left: 1px solid #CCC">65</td><td style="border-left: 1px solid #CCC">57</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre> end</pre></td></tr>
|
67
|
+
<tr><td style="border-left: 1px solid #CCC">66</td><td style="border-left: 1px solid #CCC">58</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre> else</pre></td></tr>
|
68
|
+
<tr style="background-color: #DFD"><td style="border-left: 1px solid #CCC">.</td><td style="border-left: 1px solid #CCC">59</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre>+ s.add_dependency(%q<jeweler>, [">= 0"])</pre></td></tr>
|
69
|
+
<tr><td style="border-left: 1px solid #CCC">67</td><td style="border-left: 1px solid #CCC">60</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre> s.add_dependency(%q<shoulda>, [">= 0"])</pre></td></tr>
|
70
|
+
<tr><td style="border-left: 1px solid #CCC">68</td><td style="border-left: 1px solid #CCC">61</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre> end</pre></td></tr>
|
71
|
+
<tr><td style="border-left: 1px solid #CCC">69</td><td style="border-left: 1px solid #CCC">62</td><td style="border-left: 1px solid #CCC; border-right: 1px solid #CCC; color: #000"><pre> end</pre></td></tr>
|
72
|
+
</table>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: diffed
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-07-
|
12
|
+
date: 2013-07-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,15 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
31
|
name: rspec
|
27
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
35
|
- - ! '>='
|
@@ -32,7 +37,12 @@ dependencies:
|
|
32
37
|
version: '0'
|
33
38
|
type: :development
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
36
46
|
description: This is a library for creating HTML from a unified diff string, built
|
37
47
|
specifically for the diff section output by "perforce describe -du", but with an
|
38
48
|
eye towards solving a more general problem.
|
@@ -56,6 +66,8 @@ files:
|
|
56
66
|
- testdata/diff1.classed.html
|
57
67
|
- testdata/diff1.diff
|
58
68
|
- testdata/diff1.styled.html
|
69
|
+
- testdata/git-show.diff
|
70
|
+
- testdata/git-show.styled.html
|
59
71
|
homepage: http://github.com/Jun-Dai/diffed
|
60
72
|
licenses: []
|
61
73
|
post_install_message:
|
@@ -76,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
76
88
|
version: '0'
|
77
89
|
requirements: []
|
78
90
|
rubyforge_project:
|
79
|
-
rubygems_version: 1.8.
|
91
|
+
rubygems_version: 1.8.24
|
80
92
|
signing_key:
|
81
93
|
specification_version: 3
|
82
94
|
summary: This is a library for creating HTML from a unified diff string
|