resync 0.3.4 → 0.4.0

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: e513134c82580051f13e437b592487605f1b7c01
4
- data.tar.gz: 484f9cb6e508ec21d73890a4541a05cbc59268bb
3
+ metadata.gz: 0fd5c557e4888b8eebc73dc5ab9c0ff8d1eb2248
4
+ data.tar.gz: 68e06943de077b0e4ba6e17aecacd932406b051f
5
5
  SHA512:
6
- metadata.gz: 2cc53caa4aa86a45ea158501c9f9aa85f75dbfa4204fb2aadd25a8b65dc8d391decf2fae18f9bf67cbb1e0f846d519cb62eabf6654e43bfc227c5cba896ffb86
7
- data.tar.gz: 675a6f38381015b1fd586814d1dbabda543d7da86ddb431bf41aae2ae4821b10dc335c45147f7d492f5803f5aa36780eeacfb7d7eea60f404596be4808ed4e57
6
+ metadata.gz: e6eeee57b80d10b7bac3febe0238c6138bb4b4a6b05fda99ea1daf9b4168a4fc0fdd2854026bf7ac1a2e3bfaf0d4ad4f22c3d02680d21c92513857569d85efae
7
+ data.tar.gz: 2a16668a0b451e1e7254ba7c5334e63d907356ee6c5e8897e7b550c543e5d0f28676712c7a486486e7a1f6889cb84161cc8beb39f1190f1d472f1f4c68a17888
data/CHANGES.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.4.0
2
+
3
+ - Convert `Change` and `ChangeFrequency` from [ruby-enum](https://github.com/dblock/ruby-enum/) to
4
+ [typesafe_enum](https://github.com/dmolesUC3/typesafe_enum)
5
+
1
6
  ## 0.3.4
2
7
 
3
8
  - Fix issue where `Dir.glob` could cause files to be required in an unpredictable order (h/t [nabeta](https://github.com/CDLUC3/resync/pull/1))
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # resync [![Build Status](https://travis-ci.org/CDLUC3/resync.png?branch=master)](https://travis-ci.org/CDLUC3/resync) [![Code Climate](https://codeclimate.com/github/CDLUC3/resync.png)](https://codeclimate.com/github/CDLUC3/resync) [![Inline docs](http://inch-ci.org/github/CDLUC3/resync.png)](http://inch-ci.org/github/CDLUC3/resync)
1
+ # resync [![Build Status](https://travis-ci.org/CDLUC3/resync.png?branch=master)](https://travis-ci.org/CDLUC3/resync) [![Code Climate](https://codeclimate.com/github/CDLUC3/resync.png)](https://codeclimate.com/github/CDLUC3/resync) [![Inline docs](http://inch-ci.org/github/CDLUC3/resync.png)](http://inch-ci.org/github/CDLUC3/resync) [![Gem Version](https://img.shields.io/gem/v/resync.svg)](https://github.com/CDLUC3/resync/releases)
2
2
 
3
3
 
4
4
  A Ruby gem for working with the [ResourceSync](http://www.openarchives.org/rs/1.0/resourcesync) web synchronization framework.
@@ -36,7 +36,7 @@ module Resync
36
36
  time_node :from_time, '@from', default_value: nil
37
37
  time_node :until_time, '@until', default_value: nil
38
38
  time_node :completed_time, '@completed', default_value: nil
39
- change_node :change, '@change', default_value: nil
39
+ typesafe_enum_node :change, '@change', class: Types::Change, default_value: nil
40
40
  text_node :capability, '@capability', default_value: nil
41
41
 
42
42
  # ------------------------------------------------------------
@@ -16,7 +16,7 @@ module Resync
16
16
 
17
17
  uri_node :uri, 'loc', default_value: nil
18
18
  time_node :modified_time, 'lastmod', default_value: nil
19
- changefreq_node :changefreq, 'changefreq', default_value: nil
19
+ typesafe_enum_node :changefreq, 'changefreq', class: Types::ChangeFrequency, default_value: nil
20
20
  numeric_node :priority, 'priority', default_value: nil
21
21
 
22
22
  # ------------------------------------------------------------
@@ -1,15 +1,11 @@
1
- require 'ruby-enum'
1
+ require 'typesafe_enum'
2
2
 
3
3
  module Resync
4
4
  module Types
5
5
  # The type of change indicated by a reference in a {ChangeList}, {ChangeDump}, etc.
6
6
  # Values: +CREATED+, +UPDATED+, +DELETED+
7
- class Change
8
- include Ruby::Enum
9
-
10
- define :CREATED, 'created'
11
- define :UPDATED, 'updated'
12
- define :DELETED, 'deleted'
7
+ class Change < TypesafeEnum::Base
8
+ [:CREATED, :UPDATED, :DELETED].each { |c| new c }
13
9
  end
14
10
  end
15
11
  end
@@ -1,19 +1,11 @@
1
- require 'ruby-enum'
1
+ require 'typesafe_enum'
2
2
 
3
3
  module Resync
4
4
  module Types
5
5
  # The frequency of changes to a resource.
6
6
  # Values: +ALWAYS+, +HOURLY+, +DAILY+, +WEEKLY+, +MONTHLY+, +YEARLY+, +NEVER+
7
- class ChangeFrequency
8
- include Ruby::Enum
9
-
10
- define :ALWAYS, 'always'
11
- define :HOURLY, 'hourly'
12
- define :DAILY, 'daily'
13
- define :WEEKLY, 'weekly'
14
- define :MONTHLY, 'monthly'
15
- define :YEARLY, 'yearly'
16
- define :NEVER, 'never'
7
+ class ChangeFrequency < TypesafeEnum::Base
8
+ [:ALWAYS, :HOURLY, :DAILY, :WEEKLY, :MONTHLY, :YEARLY, :NEVER].each { |cf| new cf }
17
9
  end
18
10
  end
19
11
  end
@@ -1,4 +1,4 @@
1
1
  module Resync
2
2
  # The version of this gem.
3
- VERSION = '0.3.4'
3
+ VERSION = '0.4.0'
4
4
  end
data/lib/resync/xml.rb CHANGED
@@ -58,26 +58,6 @@ module Resync
58
58
  end
59
59
  private_class_method :can_parse
60
60
 
61
- # ------------------------------------------------------------
62
- # Resync::Types::Change
63
-
64
- # Maps +Resync::Types::Change+ values.
65
- class ChangeNode < ::XML::MappingExtensions::EnumNodeBase
66
- ENUM_CLASS = Resync::Types::Change
67
- end
68
-
69
- ::XML::Mapping.add_node_class ChangeNode
70
-
71
- # ------------------------------------------------------------
72
- # Resync::Types::Changefreq
73
-
74
- # Maps +Resync::Types::ChangeFrequency+ values.
75
- class ChangefreqNode < ::XML::MappingExtensions::EnumNodeBase
76
- ENUM_CLASS = Resync::Types::ChangeFrequency
77
- end
78
-
79
- ::XML::Mapping.add_node_class ChangefreqNode
80
-
81
61
  # ------------------------------------------------------------
82
62
  # Whitespace-separated hashcode list
83
63
 
data/resync.gemspec CHANGED
@@ -23,9 +23,9 @@ Gem::Specification.new do |spec|
23
23
  spec.require_paths = ['lib']
24
24
 
25
25
  spec.add_dependency 'mime-types', '~> 2.5'
26
- spec.add_dependency 'ruby-enum', '~> 0.4'
26
+ spec.add_dependency 'typesafe_enum', '~> 0.1', '>= 0.1.1'
27
27
  spec.add_dependency 'xml-mapping', '~> 0.10'
28
- spec.add_dependency 'xml-mapping_extensions', '~> 0.1.0'
28
+ spec.add_dependency 'xml-mapping_extensions', '~> 0.3.0'
29
29
 
30
30
  spec.add_development_dependency 'equivalent-xml', '~> 0.6.0'
31
31
  spec.add_development_dependency 'rake', '~> 10.4'
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.3.4
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Moles
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-14 00:00:00.000000000 Z
11
+ date: 2015-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mime-types
@@ -25,19 +25,25 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '2.5'
27
27
  - !ruby/object:Gem::Dependency
28
- name: ruby-enum
28
+ name: typesafe_enum
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.4'
33
+ version: '0.1'
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: 0.1.1
34
37
  type: :runtime
35
38
  prerelease: false
36
39
  version_requirements: !ruby/object:Gem::Requirement
37
40
  requirements:
38
41
  - - "~>"
39
42
  - !ruby/object:Gem::Version
40
- version: '0.4'
43
+ version: '0.1'
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: 0.1.1
41
47
  - !ruby/object:Gem::Dependency
42
48
  name: xml-mapping
43
49
  requirement: !ruby/object:Gem::Requirement
@@ -58,14 +64,14 @@ dependencies:
58
64
  requirements:
59
65
  - - "~>"
60
66
  - !ruby/object:Gem::Version
61
- version: 0.1.0
67
+ version: 0.3.0
62
68
  type: :runtime
63
69
  prerelease: false
64
70
  version_requirements: !ruby/object:Gem::Requirement
65
71
  requirements:
66
72
  - - "~>"
67
73
  - !ruby/object:Gem::Version
68
- version: 0.1.0
74
+ version: 0.3.0
69
75
  - !ruby/object:Gem::Dependency
70
76
  name: equivalent-xml
71
77
  requirement: !ruby/object:Gem::Requirement