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 CHANGED
@@ -1,3 +1,3 @@
1
1
  -
2
- ChangeLog.*
2
+ ChangeLog.md
3
3
  LICENSE.txt
@@ -1,3 +1,9 @@
1
+ ### 0.1.2 / 2012-05-28
2
+
3
+ * Require tdiff ~> 0.3, >= 0.3.2.
4
+ * Replaced ore-tasks with
5
+ [rubygems-tasks](https://github.com/postmodern/rubygems-tasks#readme).
6
+
1
7
  ### 0.1.1 / 2012-05-09
2
8
 
3
9
  * Require nokogiri ~> 1.5.
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
@@ -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:
@@ -1 +1,2 @@
1
1
  require 'nokogiri/diff/xml'
2
+ require 'nokogiri/diff/version'
@@ -0,0 +1,6 @@
1
+ module Nokogiri
2
+ module Diff
3
+ # nokogiri-diff version
4
+ VERSION = '0.1.2'
5
+ end
6
+ end
@@ -7,11 +7,10 @@ class Nokogiri::XML::Node
7
7
  include TDiff::Unordered
8
8
 
9
9
  #
10
- # Compares two XML/HTML nodes.
10
+ # Compares the XML/HTML node with another.
11
11
  #
12
- # @param [Nokogiri::XML::Node] node1
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 a XML/HTML node.
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.
@@ -2,103 +2,59 @@
2
2
 
3
3
  require 'yaml'
4
4
 
5
- Gem::Specification.new do |gemspec|
6
- root = File.dirname(__FILE__)
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
- filter_files = lambda { |paths|
11
- files & case paths
12
- when Array
13
- paths
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
- version = {
20
- :file => 'nokogiri/diff/version',
21
- :constant => 'Nokogiri::Diff::VERSION'
22
- }
13
+ require 'nokogiri/diff/version'
14
+ Nokogiri::Diff::VERSION
15
+ end
23
16
 
24
- defaults = {
25
- 'name' => File.basename(root),
26
- 'files' => files,
27
- 'require_paths' => ['ext', 'lib'].select { |dir| File.directory?(dir) },
28
- 'executables' => filter_files['bin/*'].map { |path| File.basename(path) },
29
- 'test_files' => filter_files['{test/{**/}*_test.rb,spec/{**/}*_spec.rb}'],
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
- metadata = defaults.merge(YAML.load_file('gemspec.yml'))
24
+ glob = lambda { |patterns| gem.files & Dir[*patterns] }
35
25
 
36
- gemspec.name = metadata['name']
37
- gemspec.version = if metadata['version']
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
- require version[:file]
43
- eval(version[:constant])
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
- gemspec.test_files = filter_files[metadata['test_files']]
65
- gemspec.extra_rdoc_files = Array(metadata['extra_doc_files'])
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
- if gemspec.respond_to?(:required_ruby_version=)
71
- gemspec.required_ruby_version = metadata['required_ruby_version']
72
- end
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
- parse_versions = lambda { |versions|
79
- case versions
80
- when Array
81
- versions.map { |v| v.to_s }
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
- if metadata['dependencies']
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 metadata['runtime_dependencies']
94
- metadata['runtime_dependencies'].each do |name,versions|
95
- gemspec.add_runtime_dependency(name,parse_versions[versions])
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 metadata['development_dependencies']
100
- metadata['development_dependencies'].each do |name,versions|
101
- gemspec.add_development_dependency(name,parse_versions[versions])
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.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-10 00:00:00.000000000 Z
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: 1.8.7
146
+ version: '0'
140
147
  requirements: []
141
148
  rubyforge_project:
142
- rubygems_version: 1.8.23
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: []