rdf-vocab 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +2 -0
- data/Rakefile +7 -0
- data/lib/rdf-vocab.rb +17 -1
- data/lib/rdf-vocab/config/vocab.yml +36 -0
- data/lib/rdf-vocab/tasks/vocab.rake +16 -0
- data/lib/rdf-vocab/version.rb +1 -1
- data/lib/rdf-vocab/vocab/mads.rb +726 -0
- data/lib/rdf-vocab/vocab/mods.rb +787 -0
- data/lib/rdf-vocab/vocab/premis.rb +1135 -437
- data/rdf-vocab.gemspec +3 -1
- data/spec/fixtures/dcterms.rdf +1077 -0
- data/spec/spec_helper.rb +88 -0
- data/spec/unit/rdf_vocab_spec.rb +27 -0
- metadata +39 -14
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
require "rdf-vocab"
|
2
|
+
|
3
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
4
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
5
|
+
# The generated `.rspec` file contains `--require spec_helper` which will cause this
|
6
|
+
# file to always be loaded, without a need to explicitly require it in any files.
|
7
|
+
#
|
8
|
+
# Given that it is always loaded, you are encouraged to keep this file as
|
9
|
+
# light-weight as possible. Requiring heavyweight dependencies from this file
|
10
|
+
# will add to the boot time of your test suite on EVERY test run, even for an
|
11
|
+
# individual file that may not need all of that loaded. Instead, consider making
|
12
|
+
# a separate helper file that requires the additional dependencies and performs
|
13
|
+
# the additional setup, and require it from the spec files that actually need it.
|
14
|
+
#
|
15
|
+
# The `.rspec` file also contains a few flags that are not defaults but that
|
16
|
+
# users commonly want.
|
17
|
+
#
|
18
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
19
|
+
RSpec.configure do |config|
|
20
|
+
# rspec-expectations config goes here. You can use an alternate
|
21
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
22
|
+
# assertions if you prefer.
|
23
|
+
config.expect_with :rspec do |expectations|
|
24
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
25
|
+
# and `failure_message` of custom matchers include text for helper methods
|
26
|
+
# defined using `chain`, e.g.:
|
27
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
28
|
+
# # => "be bigger than 2 and smaller than 4"
|
29
|
+
# ...rather than:
|
30
|
+
# # => "be bigger than 2"
|
31
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
32
|
+
end
|
33
|
+
|
34
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
35
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
36
|
+
config.mock_with :rspec do |mocks|
|
37
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
38
|
+
# a real object. This is generally recommended, and will default to
|
39
|
+
# `true` in RSpec 4.
|
40
|
+
mocks.verify_partial_doubles = true
|
41
|
+
end
|
42
|
+
|
43
|
+
# These two settings work together to allow you to limit a spec run
|
44
|
+
# to individual examples or groups you care about by tagging them with
|
45
|
+
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
46
|
+
# get run.
|
47
|
+
config.filter_run :focus
|
48
|
+
config.run_all_when_everything_filtered = true
|
49
|
+
|
50
|
+
# Limits the available syntax to the non-monkey patched syntax that is recommended.
|
51
|
+
# For more details, see:
|
52
|
+
# - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
|
53
|
+
# - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
54
|
+
# - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
|
55
|
+
config.disable_monkey_patching!
|
56
|
+
|
57
|
+
# This setting enables warnings. It's recommended, but in some cases may
|
58
|
+
# be too noisy due to issues in dependencies.
|
59
|
+
# config.warnings = true
|
60
|
+
|
61
|
+
# Many RSpec users commonly either run the entire suite or an individual
|
62
|
+
# file, and it's useful to allow more verbose output when running an
|
63
|
+
# individual spec file.
|
64
|
+
if config.files_to_run.one?
|
65
|
+
# Use the documentation formatter for detailed output,
|
66
|
+
# unless a formatter has already been configured
|
67
|
+
# (e.g. via a command-line flag).
|
68
|
+
config.default_formatter = 'doc'
|
69
|
+
end
|
70
|
+
|
71
|
+
# Print the 10 slowest examples and example groups at the
|
72
|
+
# end of the spec run, to help surface which specs are running
|
73
|
+
# particularly slow.
|
74
|
+
config.profile_examples = 10
|
75
|
+
|
76
|
+
# Run specs in random order to surface order dependencies. If you find an
|
77
|
+
# order dependency and want to debug it, you can fix the order by providing
|
78
|
+
# the seed, which is printed after each run.
|
79
|
+
# --seed 1234
|
80
|
+
config.order = :random
|
81
|
+
|
82
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
83
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
84
|
+
# test failures related to randomization by passing the same `--seed` value
|
85
|
+
# as the one that triggered the failure.
|
86
|
+
Kernel.srand config.seed
|
87
|
+
|
88
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
RSpec.describe RDF::Vocab do
|
2
|
+
|
3
|
+
describe ".generate" do
|
4
|
+
let(:source) { File.expand_path("../../fixtures/dcterms.rdf", __FILE__) }
|
5
|
+
before do
|
6
|
+
allow(RDF::Vocab).to receive(:config) do
|
7
|
+
{ "test" => {
|
8
|
+
"class_name" => "Test",
|
9
|
+
"source" => source,
|
10
|
+
"uri" => "http://purl.org/dc/terms/"
|
11
|
+
}
|
12
|
+
}
|
13
|
+
end
|
14
|
+
StringIO.open do |strio|
|
15
|
+
RDF::Vocab.generate("test", strio)
|
16
|
+
strio.rewind
|
17
|
+
eval(strio.read)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
after { RDF.send(:remove_const, :Test) }
|
21
|
+
it "should generate the vocabulary based on the config" do
|
22
|
+
expect(RDF::Test < ::RDF::StrictVocabulary("http://purl.org/dc/terms/")).to be true
|
23
|
+
expect(RDF::Test.creator).to be_a(RDF::Term)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
metadata
CHANGED
@@ -1,57 +1,71 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rdf-vocab
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Chandek-Stark
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: linkeddata
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '1.
|
33
|
+
version: '1.7'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '1.
|
40
|
+
version: '1.7'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3.1'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3.1'
|
55
69
|
description: A library of RDF vocabularies and vocabulary-building tools
|
56
70
|
email:
|
57
71
|
- dchandekstark@gmail.com
|
@@ -59,18 +73,26 @@ executables: []
|
|
59
73
|
extensions: []
|
60
74
|
extra_rdoc_files: []
|
61
75
|
files:
|
62
|
-
- .gitignore
|
76
|
+
- ".gitignore"
|
77
|
+
- ".rspec"
|
63
78
|
- Gemfile
|
64
79
|
- LICENSE
|
65
80
|
- README.md
|
66
81
|
- Rakefile
|
67
82
|
- lib/rdf-vocab.rb
|
83
|
+
- lib/rdf-vocab/config/vocab.yml
|
84
|
+
- lib/rdf-vocab/tasks/vocab.rake
|
68
85
|
- lib/rdf-vocab/version.rb
|
86
|
+
- lib/rdf-vocab/vocab/mads.rb
|
69
87
|
- lib/rdf-vocab/vocab/marc_relators.rb
|
88
|
+
- lib/rdf-vocab/vocab/mods.rb
|
70
89
|
- lib/rdf-vocab/vocab/premis.rb
|
71
90
|
- lib/rdf-vocab/vocab/preservation.rb
|
72
91
|
- lib/rdf-vocab/vocab/preservation/event_type.rb
|
73
92
|
- rdf-vocab.gemspec
|
93
|
+
- spec/fixtures/dcterms.rdf
|
94
|
+
- spec/spec_helper.rb
|
95
|
+
- spec/unit/rdf_vocab_spec.rb
|
74
96
|
homepage: https://github.com/projecthydra-labs/rdf-vocab
|
75
97
|
licenses:
|
76
98
|
- APACHE2
|
@@ -81,12 +103,12 @@ require_paths:
|
|
81
103
|
- lib
|
82
104
|
required_ruby_version: !ruby/object:Gem::Requirement
|
83
105
|
requirements:
|
84
|
-
- -
|
106
|
+
- - ">="
|
85
107
|
- !ruby/object:Gem::Version
|
86
108
|
version: '0'
|
87
109
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
88
110
|
requirements:
|
89
|
-
- -
|
111
|
+
- - ">="
|
90
112
|
- !ruby/object:Gem::Version
|
91
113
|
version: '0'
|
92
114
|
requirements: []
|
@@ -95,4 +117,7 @@ rubygems_version: 2.2.2
|
|
95
117
|
signing_key:
|
96
118
|
specification_version: 4
|
97
119
|
summary: A library of RDF vocabularies and vocabulary-building tools
|
98
|
-
test_files:
|
120
|
+
test_files:
|
121
|
+
- spec/fixtures/dcterms.rdf
|
122
|
+
- spec/spec_helper.rb
|
123
|
+
- spec/unit/rdf_vocab_spec.rb
|