nokogiri-diff 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +1 -1
- data/ChangeLog.md +6 -0
- data/README.md +1 -1
- data/gemspec.yml +1 -2
- data/lib/nokogiri/diff.rb +1 -0
- data/lib/nokogiri/diff/version.rb +6 -0
- data/lib/nokogiri/diff/xml/node.rb +5 -5
- data/nokogiri-diff.gemspec +38 -82
- metadata +12 -6
data/.document
CHANGED
data/ChangeLog.md
CHANGED
data/README.md
CHANGED
@@ -60,7 +60,7 @@ Only find the removed nodes:
|
|
60
60
|
## Requirements
|
61
61
|
|
62
62
|
* [ruby](http://www.ruby-lang.org/) >= 1.8.7
|
63
|
-
* [tdiff](http://github.com/postmodern/tdiff) ~> 0.3.2
|
63
|
+
* [tdiff](http://github.com/postmodern/tdiff) ~> 0.3, >= 0.3.2
|
64
64
|
* [nokogiri](http://nokogiri.rubyforge.org/) ~> 1.5
|
65
65
|
|
66
66
|
## Install
|
data/gemspec.yml
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
name: nokogiri-diff
|
2
|
-
version: 0.1.1
|
3
2
|
summary: Calculate the differences between two XML/HTML documents.
|
4
3
|
description:
|
5
4
|
Nokogiri::Diff adds the ability to calculate the differences (added
|
@@ -14,7 +13,7 @@ has_yard: true
|
|
14
13
|
required_ruby_version: ">= 1.8.7"
|
15
14
|
|
16
15
|
dependencies:
|
17
|
-
tdiff: ~> 0.3.2
|
16
|
+
tdiff: ~> 0.3, >= 0.3.2
|
18
17
|
nokogiri: ~> 1.5
|
19
18
|
|
20
19
|
development_dependencies:
|
data/lib/nokogiri/diff.rb
CHANGED
@@ -7,11 +7,10 @@ class Nokogiri::XML::Node
|
|
7
7
|
include TDiff::Unordered
|
8
8
|
|
9
9
|
#
|
10
|
-
# Compares
|
10
|
+
# Compares the XML/HTML node with another.
|
11
11
|
#
|
12
|
-
# @param [Nokogiri::XML::Node]
|
13
|
-
#
|
14
|
-
# @param [Nokogiri::XML::Node] node2
|
12
|
+
# @param [Nokogiri::XML::Node] node
|
13
|
+
# The other XMl/HTML node.
|
15
14
|
#
|
16
15
|
# @return [Boolean]
|
17
16
|
# Specifies whether the two nodes are equal.
|
@@ -34,9 +33,10 @@ class Nokogiri::XML::Node
|
|
34
33
|
end
|
35
34
|
|
36
35
|
#
|
37
|
-
# Enumerates over the children of
|
36
|
+
# Enumerates over the children of another XML/HTML node.
|
38
37
|
#
|
39
38
|
# @param [Nokogiri::XML::Node] node
|
39
|
+
# The other XMl/HTML node.
|
40
40
|
#
|
41
41
|
# @yield [child]
|
42
42
|
# The given block will be passed every child of the node.
|
data/nokogiri-diff.gemspec
CHANGED
@@ -2,103 +2,59 @@
|
|
2
2
|
|
3
3
|
require 'yaml'
|
4
4
|
|
5
|
-
Gem::Specification.new do |
|
6
|
-
|
7
|
-
lib_dir = File.join(root,'lib')
|
8
|
-
files = `git ls-files`.split($/)
|
5
|
+
Gem::Specification.new do |gem|
|
6
|
+
gemspec = YAML.load_file('gemspec.yml')
|
9
7
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
when String
|
15
|
-
Dir[paths]
|
16
|
-
end
|
17
|
-
}
|
8
|
+
gem.name = gemspec.fetch('name')
|
9
|
+
gem.version = gemspec.fetch('version') do
|
10
|
+
lib_dir = File.join(File.dirname(__FILE__),'lib')
|
11
|
+
$LOAD_PATH << lib_dir unless $LOAD_PATH.include?(lib_dir)
|
18
12
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
}
|
13
|
+
require 'nokogiri/diff/version'
|
14
|
+
Nokogiri::Diff::VERSION
|
15
|
+
end
|
23
16
|
|
24
|
-
|
25
|
-
|
26
|
-
'
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
'doc_files' => filter_files['*.{txt,rdoc,md,markdown,tt,textile}'],
|
31
|
-
'extra_doc_files' => filter_files['*.{txt,rdoc,md,markdown,tt,textile}']
|
32
|
-
}
|
17
|
+
gem.summary = gemspec['summary']
|
18
|
+
gem.description = gemspec['description']
|
19
|
+
gem.licenses = Array(gemspec['license'])
|
20
|
+
gem.authors = Array(gemspec['authors'])
|
21
|
+
gem.email = gemspec['email']
|
22
|
+
gem.homepage = gemspec['homepage']
|
33
23
|
|
34
|
-
|
24
|
+
glob = lambda { |patterns| gem.files & Dir[*patterns] }
|
35
25
|
|
36
|
-
|
37
|
-
|
38
|
-
metadata['version']
|
39
|
-
else
|
40
|
-
$LOAD_PATH << lib_dir unless $LOAD_PATH.include?(lib_dir)
|
26
|
+
gem.files = `git ls-files`.split($/)
|
27
|
+
gem.files = glob[gemspec['files']] if gemspec['files']
|
41
28
|
|
42
|
-
|
43
|
-
|
44
|
-
end
|
45
|
-
|
46
|
-
gemspec.summary = metadata.fetch('summary',metadata['description'])
|
47
|
-
gemspec.description = metadata.fetch('description',metadata['summary'])
|
48
|
-
|
49
|
-
gemspec.licenses = Array(metadata['license'])
|
50
|
-
gemspec.authors = Array(metadata['authors'])
|
51
|
-
|
52
|
-
gemspec.email = metadata['email']
|
53
|
-
gemspec.homepage = metadata['homepage']
|
54
|
-
|
55
|
-
gemspec.require_paths = Array(metadata['require_paths'])
|
56
|
-
gemspec.files = filter_files[metadata['files']]
|
57
|
-
gemspec.executables = metadata['executables']
|
58
|
-
gemspec.extensions = metadata['extensions']
|
59
|
-
|
60
|
-
if Gem::VERSION < '1.7.'
|
61
|
-
gemspec.default_executable = gemspec.executables.first
|
29
|
+
gem.executables = gemspec.fetch('executables') do
|
30
|
+
glob['bin/*'].map { |path| File.basename(path) }
|
62
31
|
end
|
32
|
+
gem.default_executable = gem.executables.first if Gem::VERSION < '1.7.'
|
63
33
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
gemspec.post_install_message = metadata['post_install_message']
|
68
|
-
gemspec.requirements = metadata['requirements']
|
34
|
+
gem.extensions = glob[gemspec['extensions'] || 'ext/**/extconf.rb']
|
35
|
+
gem.test_files = glob[gemspec['test_files'] || '{test/{**/}*_test.rb']
|
36
|
+
gem.extra_rdoc_files = glob[gemspec['extra_doc_files'] || '*.{txt,md}']
|
69
37
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
if gemspec.respond_to?(:required_rubygems_version=)
|
75
|
-
gemspec.required_rubygems_version = metadata['required_ruby_version']
|
76
|
-
end
|
38
|
+
gem.require_paths = Array(gemspec.fetch('require_paths') {
|
39
|
+
%w[ext lib].select { |dir| File.directory?(dir) }
|
40
|
+
})
|
77
41
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
when String
|
83
|
-
versions.split(/,\s*/)
|
84
|
-
end
|
85
|
-
}
|
42
|
+
gem.requirements = gemspec['requirements']
|
43
|
+
gem.required_ruby_version = gemspec['required_ruby_version']
|
44
|
+
gem.required_rubygems_version = gemspec['required_rubygems_version']
|
45
|
+
gem.post_install_message = gemspec['post_install_message']
|
86
46
|
|
87
|
-
|
88
|
-
metadata['dependencies'].each do |name,versions|
|
89
|
-
gemspec.add_dependency(name,parse_versions[versions])
|
90
|
-
end
|
91
|
-
end
|
47
|
+
split = lambda { |string| string.split(/,\s*/) }
|
92
48
|
|
93
|
-
if
|
94
|
-
|
95
|
-
|
49
|
+
if gemspec['dependencies']
|
50
|
+
gemspec['dependencies'].each do |name,versions|
|
51
|
+
gem.add_dependency(name,split[versions])
|
96
52
|
end
|
97
53
|
end
|
98
54
|
|
99
|
-
if
|
100
|
-
|
101
|
-
|
55
|
+
if gemspec['development_dependencies']
|
56
|
+
gemspec['development_dependencies'].each do |name,versions|
|
57
|
+
gem.add_development_dependency(name,split[versions])
|
102
58
|
end
|
103
59
|
end
|
104
60
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nokogiri-diff
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-05-
|
12
|
+
date: 2012-05-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: tdiff
|
@@ -17,6 +17,9 @@ dependencies:
|
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0.3'
|
22
|
+
- - ! '>='
|
20
23
|
- !ruby/object:Gem::Version
|
21
24
|
version: 0.3.2
|
22
25
|
type: :runtime
|
@@ -25,6 +28,9 @@ dependencies:
|
|
25
28
|
none: false
|
26
29
|
requirements:
|
27
30
|
- - ~>
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0.3'
|
33
|
+
- - ! '>='
|
28
34
|
- !ruby/object:Gem::Version
|
29
35
|
version: 0.3.2
|
30
36
|
- !ruby/object:Gem::Dependency
|
@@ -112,6 +118,7 @@ files:
|
|
112
118
|
- Rakefile
|
113
119
|
- gemspec.yml
|
114
120
|
- lib/nokogiri/diff.rb
|
121
|
+
- lib/nokogiri/diff/version.rb
|
115
122
|
- lib/nokogiri/diff/xml.rb
|
116
123
|
- lib/nokogiri/diff/xml/document.rb
|
117
124
|
- lib/nokogiri/diff/xml/node.rb
|
@@ -136,12 +143,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
136
143
|
requirements:
|
137
144
|
- - ! '>='
|
138
145
|
- !ruby/object:Gem::Version
|
139
|
-
version:
|
146
|
+
version: '0'
|
140
147
|
requirements: []
|
141
148
|
rubyforge_project:
|
142
|
-
rubygems_version: 1.8.
|
149
|
+
rubygems_version: 1.8.24
|
143
150
|
signing_key:
|
144
151
|
specification_version: 3
|
145
152
|
summary: Calculate the differences between two XML/HTML documents.
|
146
|
-
test_files:
|
147
|
-
- spec/diff_spec.rb
|
153
|
+
test_files: []
|