resync 0.4.2 → 0.4.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.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/CHANGES.md +4 -0
- data/lib/resync/capability_list.rb +3 -3
- data/lib/resync/change_dump.rb +3 -3
- data/lib/resync/change_dump_index.rb +3 -3
- data/lib/resync/change_dump_manifest.rb +3 -3
- data/lib/resync/change_list.rb +3 -3
- data/lib/resync/change_list_index.rb +3 -3
- data/lib/resync/link.rb +2 -2
- data/lib/resync/metadata.rb +2 -2
- data/lib/resync/resource.rb +3 -3
- data/lib/resync/resource_dump.rb +3 -3
- data/lib/resync/resource_dump_index.rb +3 -3
- data/lib/resync/resource_dump_manifest.rb +3 -3
- data/lib/resync/resource_list.rb +3 -3
- data/lib/resync/resource_list_index.rb +3 -3
- data/lib/resync/shared/augmented.rb +2 -2
- data/lib/resync/shared/base_change_index.rb +1 -1
- data/lib/resync/shared/base_change_list.rb +1 -1
- data/lib/resync/shared/base_resource_list.rb +3 -3
- data/lib/resync/shared/descriptor.rb +10 -9
- data/lib/resync/shared/sitemap_index.rb +1 -1
- data/lib/resync/shared/sorted_resource_list.rb +1 -1
- data/lib/resync/source_description.rb +2 -2
- data/lib/resync/version.rb +1 -1
- data/lib/resync/xml.rb +1 -1
- data/lib/resync/xml_parser.rb +2 -2
- data/resync.gemspec +1 -1
- data/spec/rspec_custom_matchers.rb +3 -6
- data/spec/spec_helper.rb +0 -5
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 268a400e2abf028847e34caa544066bb6074fcd4
|
4
|
+
data.tar.gz: 388f64d81cfb4b89554c56eb0e914a0f72d38e1b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0233718a39dd7da4a565d13b2ae5e4a23aac0360e43d9a720774dfaebe690cec6017a63674c511485cc0a97e1da7372cb5a7c80bfdcb9bfbd8f310b5c749b034
|
7
|
+
data.tar.gz: 4347644e13347b764654f0c670690cb84fcf9411f6f9eebd1918b145bc0c4125589d75419ac6e45e5dd9ef43cfdde11331395fad80e897821751be206101c5aa
|
data/.rubocop.yml
CHANGED
data/CHANGES.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
require 'resync/shared/base_resource_list'
|
2
|
+
require 'resync/xml'
|
3
3
|
|
4
4
|
module Resync
|
5
5
|
# A capability list. See section 9,
|
@@ -9,7 +9,7 @@ module Resync
|
|
9
9
|
include ::XML::Mapping
|
10
10
|
|
11
11
|
# The capability provided by this type.
|
12
|
-
CAPABILITY = 'capabilitylist'
|
12
|
+
CAPABILITY = 'capabilitylist'.freeze
|
13
13
|
|
14
14
|
# ------------------------------------------------------------
|
15
15
|
# Initializer
|
data/lib/resync/change_dump.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
require 'resync/shared/base_change_index'
|
2
|
+
require 'resync/xml'
|
3
3
|
|
4
4
|
module Resync
|
5
5
|
# A change dump. See section 13.1,
|
@@ -9,7 +9,7 @@ module Resync
|
|
9
9
|
include ::XML::Mapping
|
10
10
|
|
11
11
|
# The capability provided by this type.
|
12
|
-
CAPABILITY = 'changedump'
|
12
|
+
CAPABILITY = 'changedump'.freeze
|
13
13
|
|
14
14
|
end
|
15
15
|
end
|
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
require 'resync/shared/base_change_index'
|
2
|
+
require 'resync/shared/sitemap_index'
|
3
3
|
|
4
4
|
module Resync
|
5
5
|
# A change dump index. See under section 13.1,
|
@@ -10,6 +10,6 @@ module Resync
|
|
10
10
|
include SitemapIndex
|
11
11
|
|
12
12
|
# The capability provided by this type.
|
13
|
-
CAPABILITY = 'changedump'
|
13
|
+
CAPABILITY = 'changedump'.freeze
|
14
14
|
end
|
15
15
|
end
|
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
require 'resync/shared/base_change_list'
|
2
|
+
require 'resync/xml'
|
3
3
|
|
4
4
|
module Resync
|
5
5
|
# A change dump manifest. See section 13.2,
|
@@ -9,7 +9,7 @@ module Resync
|
|
9
9
|
include ::XML::Mapping
|
10
10
|
|
11
11
|
# The capability provided by this type.
|
12
|
-
CAPABILITY = 'changedump-manifest'
|
12
|
+
CAPABILITY = 'changedump-manifest'.freeze
|
13
13
|
|
14
14
|
end
|
15
15
|
end
|
data/lib/resync/change_list.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
require 'resync/shared/base_change_list'
|
2
|
+
require 'resync/xml'
|
3
3
|
|
4
4
|
module Resync
|
5
5
|
# A change list. See section 12.1,
|
@@ -9,7 +9,7 @@ module Resync
|
|
9
9
|
include ::XML::Mapping
|
10
10
|
|
11
11
|
# The capability provided by this type.
|
12
|
-
CAPABILITY = 'changelist'
|
12
|
+
CAPABILITY = 'changelist'.freeze
|
13
13
|
|
14
14
|
end
|
15
15
|
end
|
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
require 'resync/shared/base_change_index'
|
2
|
+
require 'resync/shared/sitemap_index'
|
3
3
|
|
4
4
|
module Resync
|
5
5
|
# A change list index. See section 12.2,
|
@@ -10,6 +10,6 @@ module Resync
|
|
10
10
|
include SitemapIndex
|
11
11
|
|
12
12
|
# The capability provided by this type.
|
13
|
-
CAPABILITY = 'changelist'
|
13
|
+
CAPABILITY = 'changelist'.freeze
|
14
14
|
end
|
15
15
|
end
|
data/lib/resync/link.rb
CHANGED
data/lib/resync/metadata.rb
CHANGED
data/lib/resync/resource.rb
CHANGED
data/lib/resync/resource_dump.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
require 'resync/shared/base_resource_list'
|
2
|
+
require 'resync/xml'
|
3
3
|
|
4
4
|
module Resync
|
5
5
|
# A resource dump. See section 11.1,
|
@@ -9,7 +9,7 @@ module Resync
|
|
9
9
|
include ::XML::Mapping
|
10
10
|
|
11
11
|
# The capability provided by this type.
|
12
|
-
CAPABILITY = 'resourcedump'
|
12
|
+
CAPABILITY = 'resourcedump'.freeze
|
13
13
|
|
14
14
|
end
|
15
15
|
end
|
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
require 'resync/shared/base_resource_list'
|
2
|
+
require 'resync/shared/sitemap_index'
|
3
3
|
|
4
4
|
module Resync
|
5
5
|
# A resource dump index. See under section 11.1,
|
@@ -10,6 +10,6 @@ module Resync
|
|
10
10
|
include SitemapIndex
|
11
11
|
|
12
12
|
# The capability provided by this type.
|
13
|
-
CAPABILITY = 'resourcedump'
|
13
|
+
CAPABILITY = 'resourcedump'.freeze
|
14
14
|
end
|
15
15
|
end
|
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
require 'resync/shared/base_resource_list'
|
2
|
+
require 'resync/xml'
|
3
3
|
|
4
4
|
module Resync
|
5
5
|
# A resource dump. See section 11.2,
|
@@ -9,7 +9,7 @@ module Resync
|
|
9
9
|
include ::XML::Mapping
|
10
10
|
|
11
11
|
# The capability provided by this type.
|
12
|
-
CAPABILITY = 'resourcedump-manifest'
|
12
|
+
CAPABILITY = 'resourcedump-manifest'.freeze
|
13
13
|
|
14
14
|
end
|
15
15
|
end
|
data/lib/resync/resource_list.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
require 'resync/shared/base_resource_list'
|
2
|
+
require 'resync/xml'
|
3
3
|
|
4
4
|
module Resync
|
5
5
|
# A resource list. See section 10.1,
|
@@ -9,6 +9,6 @@ module Resync
|
|
9
9
|
include ::XML::Mapping
|
10
10
|
|
11
11
|
# The capability provided by this type.
|
12
|
-
CAPABILITY = 'resourcelist'
|
12
|
+
CAPABILITY = 'resourcelist'.freeze
|
13
13
|
end
|
14
14
|
end
|
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
require 'resync/shared/base_resource_list'
|
2
|
+
require 'resync/shared/sitemap_index'
|
3
3
|
|
4
4
|
module Resync
|
5
5
|
# A resource list index. See section 10.2,
|
@@ -10,6 +10,6 @@ module Resync
|
|
10
10
|
include SitemapIndex
|
11
11
|
|
12
12
|
# The capability provided by this type.
|
13
|
-
CAPABILITY = 'resourcelist'
|
13
|
+
CAPABILITY = 'resourcelist'.freeze
|
14
14
|
end
|
15
15
|
end
|
@@ -1,6 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
require 'resync/shared/augmented'
|
2
|
+
require 'resync/resource'
|
3
|
+
require 'resync/metadata'
|
4
4
|
|
5
5
|
module Resync
|
6
6
|
# Base class for root elements containing a list of resources
|
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'mime/types'
|
2
|
-
|
2
|
+
require 'resync/xml'
|
3
3
|
|
4
4
|
module Resync
|
5
5
|
# Base class for ResourceSync-specific elements describing a
|
@@ -95,6 +95,15 @@ module Resync
|
|
95
95
|
hashes[algorithm]
|
96
96
|
end
|
97
97
|
|
98
|
+
# ------------------------------
|
99
|
+
# Conversions
|
100
|
+
|
101
|
+
def self.hash_of_hashcodes(hashes)
|
102
|
+
return {} unless hashes
|
103
|
+
return hashes if hashes.is_a?(Hash)
|
104
|
+
hashes.split(/[[:space:]]+/).map { |hash| hash.split(':') }.to_h
|
105
|
+
end
|
106
|
+
|
98
107
|
# ------------------------------------------------------------
|
99
108
|
# Private methods
|
100
109
|
|
@@ -123,13 +132,5 @@ module Resync
|
|
123
132
|
MIME::Type.new(mime_type)
|
124
133
|
end
|
125
134
|
|
126
|
-
# ------------------------------
|
127
|
-
# Conversions
|
128
|
-
|
129
|
-
def self.hash_of_hashcodes(hashes)
|
130
|
-
return {} unless hashes
|
131
|
-
return hashes if hashes.is_a?(Hash)
|
132
|
-
hashes.split(/[[:space:]]+/).map { |hash| hash.split(':') }.to_h
|
133
|
-
end
|
134
135
|
end
|
135
136
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
require 'resync/shared/base_resource_list'
|
2
2
|
|
3
3
|
module Resync
|
4
4
|
# A change list. See section 8,
|
@@ -8,7 +8,7 @@ module Resync
|
|
8
8
|
include ::XML::Mapping
|
9
9
|
|
10
10
|
# The capability provided by this type.
|
11
|
-
CAPABILITY = 'description'
|
11
|
+
CAPABILITY = 'description'.freeze
|
12
12
|
|
13
13
|
end
|
14
14
|
end
|
data/lib/resync/version.rb
CHANGED
data/lib/resync/xml.rb
CHANGED
data/lib/resync/xml_parser.rb
CHANGED
@@ -21,10 +21,10 @@ module Resync
|
|
21
21
|
ChangeDumpIndex,
|
22
22
|
ResourceDumpIndex
|
23
23
|
]
|
24
|
-
}
|
24
|
+
}.freeze
|
25
25
|
private_constant :ROOT_TYPES
|
26
26
|
|
27
|
-
CAPABILITY_ATTRIBUTE = "/*/[namespace-uri() = 'http://www.openarchives.org/rs/terms/' and local-name() = 'md']/@capability"
|
27
|
+
CAPABILITY_ATTRIBUTE = "/*/[namespace-uri() = 'http://www.openarchives.org/rs/terms/' and local-name() = 'md']/@capability".freeze
|
28
28
|
private_constant :CAPABILITY_ATTRIBUTE
|
29
29
|
|
30
30
|
# Parses the specified ResourceSync document and returns the appropriate object
|
data/resync.gemspec
CHANGED
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
|
|
31
31
|
spec.add_development_dependency 'equivalent-xml', '~> 0.6.0'
|
32
32
|
spec.add_development_dependency 'rake', '~> 10.4'
|
33
33
|
spec.add_development_dependency 'rspec', '~> 3.2'
|
34
|
-
spec.add_development_dependency 'rubocop', '~> 0.
|
34
|
+
spec.add_development_dependency 'rubocop', '~> 0.36'
|
35
35
|
spec.add_development_dependency 'simplecov', '~> 0.9.2'
|
36
36
|
spec.add_development_dependency 'simplecov-console', '~> 0.2.0'
|
37
37
|
spec.add_development_dependency 'yard', '~> 0.8'
|
@@ -53,12 +53,9 @@ RSpec::Matchers.define :be_time do |expected|
|
|
53
53
|
end
|
54
54
|
|
55
55
|
match do |actual|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
else
|
60
|
-
return actual.nil?
|
61
|
-
end
|
56
|
+
return actual.nil? unless expected
|
57
|
+
fail "Expected value #{expected} is not a Time" unless expected.is_a?(Time)
|
58
|
+
actual.is_a?(Time) && (to_string(expected) == to_string(actual))
|
62
59
|
end
|
63
60
|
|
64
61
|
failure_message do |actual|
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: resync
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Moles
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mime-types
|
@@ -126,14 +126,14 @@ dependencies:
|
|
126
126
|
requirements:
|
127
127
|
- - "~>"
|
128
128
|
- !ruby/object:Gem::Version
|
129
|
-
version: '0.
|
129
|
+
version: '0.36'
|
130
130
|
type: :development
|
131
131
|
prerelease: false
|
132
132
|
version_requirements: !ruby/object:Gem::Requirement
|
133
133
|
requirements:
|
134
134
|
- - "~>"
|
135
135
|
- !ruby/object:Gem::Version
|
136
|
-
version: '0.
|
136
|
+
version: '0.36'
|
137
137
|
- !ruby/object:Gem::Dependency
|
138
138
|
name: simplecov
|
139
139
|
requirement: !ruby/object:Gem::Requirement
|