rdf-edtf 0.1.0 → 1.0.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: ce99d4757012d81466654f14a746edf6b1af5094
4
- data.tar.gz: 631e8d3b07ee24555c790af3106464e983a0c623
3
+ metadata.gz: 570882065ce26c6c0e5a70752f0a229903e89b2a
4
+ data.tar.gz: 217a59395f8c109e766ad5c72c459f61b25eea75
5
5
  SHA512:
6
- metadata.gz: d9d9a547ae659cf53239a790e7cf7dbfacc457aa56e16dc0ad4a7cbe8ed82e6ace879946696f18d05768d45a32a35701b99a0baea11dd62eb70d829920566caa
7
- data.tar.gz: 39f5ddb16660031cc928335b48c35e8642aab8d785ed7d95cc6cf219eb3ecaf5cdbc28e91f4e7f4a0a9f6bd91b1cf53ce145faf7b2c4ed45c7511565d6fde8a9
6
+ metadata.gz: 2560fdc0066b271b4e1472652bf9ed6e31d20a04b69a8919e5a893281830534a1e622df2fc23c44822f1c017d5b55835330077718df3504488527a0af29abbcb
7
+ data.tar.gz: 1919c2332cb35b0da4968dcc5301b24595fb7ff40c8fa444392771131924aa62f6845337cb16c2bcffa7116ff09f73c7c5f0ca3ff2ff782f93d7a57de7d166c8
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
1
  #*#
2
2
  *~
3
- Gemfile.lock
3
+ Gemfile.lock
4
+ *.gem
data/.travis.yml ADDED
@@ -0,0 +1,17 @@
1
+ anguage: ruby
2
+ bundler_args: --without debug
3
+ script: "bundle exec rspec spec"
4
+ sudo: false
5
+ cache: bundler
6
+ rvm:
7
+ - 2.0.0
8
+ - 2.1.0
9
+ - 2.1.1
10
+ - 2.2.1
11
+ - ruby-head
12
+ - jruby
13
+ - rbx-2
14
+ matrix:
15
+ allow_failures:
16
+ - rvm: jruby
17
+ - rvm: rbx-2
data/Gemfile CHANGED
@@ -1,3 +1,6 @@
1
1
  source "https://rubygems.org"
2
2
 
3
3
  gemspec
4
+
5
+ # always use latest RDF.rb shared examples
6
+ gem 'rdf-spec', github: 'ruby-rdf/rdf-spec', branch: 'develop'
data/README.md CHANGED
@@ -19,14 +19,6 @@ RDF::EDTF::Literal.new('1076?')
19
19
  RDF::Literal('1076?', datatype: RDF::EDTF::Literal::DATATYPE)
20
20
  ```
21
21
 
22
- Known Issues
23
- ------------
24
-
25
- - Datetimes without a zone offset will be parsed and reserialized as UTC with
26
- `+00:00`. See: https://github.com/inukshuk/edtf-ruby/issues/14
27
- - Sets will be reserialized with spaces in their separators. See:
28
- https://github.com/inukshuk/edtf-ruby/issues/15
29
-
30
22
  Contribution Guidelines
31
23
  -----------------------
32
24
 
@@ -1,5 +1,5 @@
1
1
  module RDF
2
2
  module EDTF
3
- VERSION = '0.1.0'
3
+ VERSION = '1.0.0'
4
4
  end
5
5
  end
data/rdf-edtf.gemspec CHANGED
@@ -7,15 +7,15 @@ Gem::Specification.new do |s|
7
7
  s.version = RDF::EDTF::VERSION
8
8
  s.platform = Gem::Platform::RUBY
9
9
  s.authors = ['Tom Johnson']
10
- s.homepage = 'https://github.com/dpla/rdf-edtf'
11
- s.email = 'tom@dp.la'
10
+ s.homepage = 'https://github.com/no-reply/rdf-edtf'
11
+ s.email = 'tom@curationexperts.com'
12
12
  s.summary = %q{An `RDF::Literal` implementation around Extended Date Time Format.}
13
13
  s.description = %q{Supports serializing and parsing EDTF (all levels) as typed literals in RDF.}
14
14
  s.license = 'UNLICENSE'
15
15
  s.required_ruby_version = '>= 2.0.0'
16
16
 
17
- s.add_dependency('rdf', '~> 1.1')
18
- s.add_dependency('edtf', '~>2.1.0')
17
+ s.add_dependency('rdf', '>= 1.1', '< 3.0')
18
+ s.add_dependency('edtf', '~>2.2.0')
19
19
 
20
20
  s.add_development_dependency('pry')
21
21
  s.add_development_dependency('rspec')
data/spec/edtf_spec.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe RDF::EDTF::Literal do
4
- it_behaves_like 'RDF::Literal with datatype',
4
+ it_behaves_like 'RDF::Literal',
5
5
  EDTF.parse!('1076'),
6
6
  'http://id.loc.gov/datatypes/edtf/EDTF'
7
7
 
data/spec/spec_helper.rb CHANGED
@@ -2,6 +2,7 @@ require 'bundler/setup'
2
2
  Bundler.setup
3
3
 
4
4
  require 'rdf/edtf'
5
+ require 'rdf/spec/literal'
5
6
 
6
7
  # Load support files
7
8
  Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
metadata CHANGED
@@ -1,43 +1,49 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdf-edtf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Johnson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-30 00:00:00.000000000 Z
11
+ date: 2017-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rdf
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.1'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '3.0'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
25
28
  - !ruby/object:Gem::Version
26
29
  version: '1.1'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '3.0'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: edtf
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
31
37
  - - "~>"
32
38
  - !ruby/object:Gem::Version
33
- version: 2.1.0
39
+ version: 2.2.0
34
40
  type: :runtime
35
41
  prerelease: false
36
42
  version_requirements: !ruby/object:Gem::Requirement
37
43
  requirements:
38
44
  - - "~>"
39
45
  - !ruby/object:Gem::Version
40
- version: 2.1.0
46
+ version: 2.2.0
41
47
  - !ruby/object:Gem::Dependency
42
48
  name: pry
43
49
  requirement: !ruby/object:Gem::Requirement
@@ -82,7 +88,7 @@ dependencies:
82
88
  version: '0'
83
89
  description: Supports serializing and parsing EDTF (all levels) as typed literals
84
90
  in RDF.
85
- email: tom@dp.la
91
+ email: tom@curationexperts.com
86
92
  executables: []
87
93
  extensions: []
88
94
  extra_rdoc_files:
@@ -90,6 +96,7 @@ extra_rdoc_files:
90
96
  - README.md
91
97
  files:
92
98
  - ".gitignore"
99
+ - ".travis.yml"
93
100
  - CHANGELOG.md
94
101
  - Gemfile
95
102
  - README.md
@@ -101,8 +108,7 @@ files:
101
108
  - rdf-edtf.gemspec
102
109
  - spec/edtf_spec.rb
103
110
  - spec/spec_helper.rb
104
- - spec/support/shared_examples/literal.rb
105
- homepage: https://github.com/dpla/rdf-edtf
111
+ homepage: https://github.com/no-reply/rdf-edtf
106
112
  licenses:
107
113
  - UNLICENSE
108
114
  metadata: {}
@@ -122,9 +128,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
122
128
  version: '0'
123
129
  requirements: []
124
130
  rubyforge_project:
125
- rubygems_version: 2.2.1
131
+ rubygems_version: 2.6.13
126
132
  signing_key:
127
133
  specification_version: 4
128
134
  summary: An `RDF::Literal` implementation around Extended Date Time Format.
129
135
  test_files: []
130
- has_rdoc:
@@ -1,123 +0,0 @@
1
-
2
- shared_examples 'RDF::Literal with datatype' do |value, datatype_uri|
3
- subject { described_class.new(value) }
4
-
5
- it 'has a DATATYPE' do
6
- expect(described_class::DATATYPE).to be_a RDF::URI
7
- end
8
-
9
- it 'has a GRAMMAR' do
10
- expect(described_class::GRAMMAR).to respond_to :=~
11
- end
12
-
13
- it { is_expected.to be_literal }
14
- it { is_expected.to be_typed }
15
- it { is_expected.not_to be_plain }
16
- it { is_expected.not_to be_anonymous }
17
-
18
- it 'has correct datatype' do
19
- expect(subject.datatype).to eq datatype_uri
20
- end
21
-
22
- describe '#==' do
23
- it { is_expected.to eq subject }
24
- it { expect(subject.object).to eq value }
25
- it { is_expected.not_to eq described_class.new('OTHER') }
26
- it { is_expected.not_to eq nil }
27
- end
28
-
29
- describe '#humanize' do
30
- it 'gives a string representation' do
31
- expect(subject.humanize).to be_a String
32
- end
33
- end
34
-
35
- describe '#to_s' do
36
- it 'gives a string representation' do
37
- expect(subject.to_s).to be_a String
38
- end
39
- end
40
-
41
- describe '#object' do
42
- it 'is the given value' do
43
- expect(subject.humanize).to be_a String
44
- end
45
- end
46
- end
47
-
48
- shared_examples 'RDF::Literal lookup' do |uri_hash|
49
- uri_hash.each do |uri, klass|
50
- it "finds #{klass} for #{uri}" do
51
- expect(RDF::Literal("0", :datatype => uri).class).to eq klass
52
- end
53
- end
54
- end
55
-
56
- shared_examples 'RDF::Literal canonicalization' do |datatype, pairs|
57
- pairs.each do |value, str|
58
-
59
- klass = RDF::Literal.datatyped_class(datatype.to_s)
60
-
61
- it "does not normalize '#{value}' by default" do
62
- expect(RDF::Literal.new(value,
63
- datatype: datatype ,
64
- canonicalize: false).to_s)
65
- .to eq value
66
- end
67
-
68
- it "normalizes double '#{value}' to '#{str}'" do
69
- expect(RDF::Literal.new(value,
70
- datatype: datatype,
71
- canonicalize: true).to_s)
72
- .to eq str
73
- end
74
-
75
- it "humanizes double '#{value}' to '#{str}'" do
76
- expect(RDF::Literal.new(value,
77
- datatype: datatype,
78
- canonicalize: false).humanize)
79
- .to eq value
80
- end
81
-
82
- it "instantiates '#{value}' as #{klass}" do
83
- expect(RDF::Literal.new(value,
84
- datatype: datatype,
85
- canonicalize: true))
86
- .to be_a(klass)
87
- end
88
-
89
- it "causes normalized '#{value}' to be == '#{str}'" do
90
- expect(RDF::Literal.new(value,
91
- datatype: datatype,
92
- canonicalize: true))
93
- .to eq RDF::Literal.new(str, datatype: datatype, canonicalize: false)
94
- end
95
- end
96
- end
97
-
98
- shared_examples 'RDF::Literal validation' do |datatype,
99
- valid_values,
100
- invalid_values|
101
-
102
- klass = RDF::Literal.datatyped_class(datatype.to_s)
103
-
104
- valid_values.each do |value|
105
- it "validates #{klass} '#{value}'" do
106
- expect(RDF::Literal.new(value, datatype: datatype)).to be_valid
107
- end
108
-
109
- it "does not invalidate #{klass} '#{value}'" do
110
- expect(RDF::Literal.new(value, datatype: datatype)).not_to be_invalid
111
- end
112
- end
113
-
114
- invalid_values.each do |value|
115
- it "invalidates #{klass} '#{value}'" do
116
- expect(RDF::Literal.new(value, datatype: datatype)).to be_invalid
117
- end
118
-
119
- it "does not validate #{klass} '#{value}'" do
120
- expect(RDF::Literal.new(value, datatype: datatype)).not_to be_valid
121
- end
122
- end
123
- end