resync 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 368905af59154a0921a076c2c11083a34c61a4ed
4
- data.tar.gz: 9c0a8119216c584a5812637e372328135abf8407
3
+ metadata.gz: 268a400e2abf028847e34caa544066bb6074fcd4
4
+ data.tar.gz: 388f64d81cfb4b89554c56eb0e914a0f72d38e1b
5
5
  SHA512:
6
- metadata.gz: 1523a7fc833eda981934113b369ca1a0206bb16fbdbdfa1589e99b608d76db21cb74402832a6fb2517207c74569bd23b8530480edc2fdfc669b14eaebf29b740
7
- data.tar.gz: b740b34bcdaa4b3851095572e56e05a38a7e4a29d67873095a146ccc0d7300c6fa03338c0392365aca3c577946c1c0c9352ef1bd3b39a6d7594dad2a529a1356
6
+ metadata.gz: 0233718a39dd7da4a565d13b2ae5e4a23aac0360e43d9a720774dfaebe690cec6017a63674c511485cc0a97e1da7372cb5a7c80bfdcb9bfbd8f310b5c749b034
7
+ data.tar.gz: 4347644e13347b764654f0c670690cb84fcf9411f6f9eebd1918b145bc0c4125589d75419ac6e45e5dd9ef43cfdde11331395fad80e897821751be206101c5aa
data/.rubocop.yml CHANGED
@@ -18,3 +18,6 @@ Style/EmptyLinesAroundModuleBody:
18
18
  Style/EmptyLinesAroundBlockBody:
19
19
  Enabled: false
20
20
 
21
+ # Suppress complaints about post-2.0 syntax
22
+ AllCops:
23
+ TargetRubyVersion: 2.2
data/CHANGES.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.4.3 (25 April 2016)
2
+
3
+ - Replace all `require_relative` with absolute `require` to avoid symlink issues
4
+
1
5
  ## 0.4.2 (27 Jan 2016)
2
6
 
3
7
  - Make gemspec smart enough to handle SSH checkouts
@@ -1,5 +1,5 @@
1
- require_relative 'shared/base_resource_list'
2
- require_relative 'xml'
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
@@ -1,5 +1,5 @@
1
- require_relative 'shared/base_change_index'
2
- require_relative 'xml'
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
- require_relative 'shared/base_change_index'
2
- require_relative 'shared/sitemap_index'
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
- require_relative 'shared/base_change_list'
2
- require_relative 'xml'
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
@@ -1,5 +1,5 @@
1
- require_relative 'shared/base_change_list'
2
- require_relative 'xml'
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
- require_relative 'shared/base_change_index'
2
- require_relative 'shared/sitemap_index'
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
@@ -1,5 +1,5 @@
1
- require_relative 'shared/descriptor'
2
- require_relative 'xml'
1
+ require 'resync/shared/descriptor'
2
+ require 'resync/xml'
3
3
 
4
4
  module Resync
5
5
 
@@ -1,5 +1,5 @@
1
- require_relative 'shared/descriptor'
2
- require_relative 'xml'
1
+ require 'resync/shared/descriptor'
2
+ require 'resync/xml'
3
3
 
4
4
  module Resync
5
5
 
@@ -1,6 +1,6 @@
1
- require_relative 'shared/augmented'
2
- require_relative 'xml'
3
- require_relative 'metadata'
1
+ require 'resync/shared/augmented'
2
+ require 'resync/xml'
3
+ require 'resync/metadata'
4
4
 
5
5
  module Resync
6
6
  # A resource (i.e., +<url>+ or +<sitemap>+). See section 7,
@@ -1,5 +1,5 @@
1
- require_relative 'shared/base_resource_list'
2
- require_relative 'xml'
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
- require_relative 'shared/base_resource_list'
2
- require_relative 'shared/sitemap_index'
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
- require_relative 'shared/base_resource_list'
2
- require_relative 'xml'
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
@@ -1,5 +1,5 @@
1
- require_relative 'shared/base_resource_list'
2
- require_relative 'xml'
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
- require_relative 'shared/base_resource_list'
2
- require_relative 'shared/sitemap_index'
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,5 +1,5 @@
1
- require_relative '../link'
2
- require_relative '../metadata'
1
+ require 'resync/link'
2
+ require 'resync/metadata'
3
3
 
4
4
  module Resync
5
5
 
@@ -1,4 +1,4 @@
1
- require_relative 'sorted_resource_list'
1
+ require 'resync/shared/sorted_resource_list'
2
2
 
3
3
  module Resync
4
4
  # Adds useful methods to {ChangeListIndex}, {ChangeDumpIndex}, and {ChangeDump}.
@@ -1,4 +1,4 @@
1
- require_relative 'sorted_resource_list'
1
+ require 'resync/shared/sorted_resource_list'
2
2
 
3
3
  module Resync
4
4
  # Adds useful methods to {ChangeList} and {ChangeDumpManifest}.
@@ -1,6 +1,6 @@
1
- require_relative 'augmented'
2
- require_relative '../resource'
3
- require_relative '../metadata'
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
- require_relative '../xml'
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,5 +1,5 @@
1
1
  require 'xml/mapping'
2
- require_relative '../resource'
2
+ require 'resync/resource'
3
3
 
4
4
  module Resync
5
5
  # Base module of +<sitemapindex>+ elements, such as {ChangeDumpIndex},
@@ -1,4 +1,4 @@
1
- require_relative 'base_resource_list'
1
+ require 'resync/shared/base_resource_list'
2
2
 
3
3
  module Resync
4
4
  # An extension to +BaseResourceList+ for resource lists that
@@ -1,4 +1,4 @@
1
- require_relative 'shared/base_resource_list'
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
@@ -1,4 +1,4 @@
1
1
  module Resync
2
2
  # The version of this gem.
3
- VERSION = '0.4.2'
3
+ VERSION = '0.4.3'.freeze
4
4
  end
data/lib/resync/xml.rb CHANGED
@@ -3,7 +3,7 @@ require 'time'
3
3
  require 'xml/mapping'
4
4
  require 'xml/mapping_extensions'
5
5
 
6
- require_relative 'types'
6
+ require 'resync/types'
7
7
 
8
8
  module Resync
9
9
  # Helper methods and modules related to reading and writing XML.
@@ -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.32'
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
- if 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))
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
@@ -2,11 +2,6 @@
2
2
  # SimpleCov/CodeClimate setup
3
3
 
4
4
  if ENV['COVERAGE']
5
- if ENV['CODECLIMATE_REPO_TOKEN']
6
- require 'codeclimate-test-reporter'
7
- CodeClimate::TestReporter.start
8
- end
9
-
10
5
  require 'simplecov'
11
6
  require 'simplecov-console'
12
7
 
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.2
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-01-27 00:00:00.000000000 Z
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.32'
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.32'
136
+ version: '0.36'
137
137
  - !ruby/object:Gem::Dependency
138
138
  name: simplecov
139
139
  requirement: !ruby/object:Gem::Requirement