active_annotations 0.1.0 → 0.2.1

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: 355f86d0f2d32d10bcfedc91df427f21870de457
4
- data.tar.gz: e63e3874afdd33b7c85e5d20011cf8ec7cad5d97
3
+ metadata.gz: 52ae7a0a34d21abfc1295d7a5311ed47a6482369
4
+ data.tar.gz: 4656eff871f1a2e24b3ebf9088565ab24e6c7b06
5
5
  SHA512:
6
- metadata.gz: 8378e0252e6b6431f3871c8a8a949a289ec64580f81d5beb391ad446a3d07c3f36fea9d0d4a52a28cea2b0782e7d072e0c1d0c23ba11ecc5dff084d932b50c89
7
- data.tar.gz: 079841e779a5ae75c668c0cf004a02e31830960d2652e16724695db19e32f9113dafe5f1c488c025ed2b2c1e6b19452cb673eaa7ba331826bf7a53e5f6349c87
6
+ metadata.gz: 3940874d99c750eab2c7831c5c28c6704afb2ace6eb97ed1ad8204520e3616ab26da0bae6e8c7a37fcc58cbe1244f7190b274155c00a3e09f92f980417fa5ac7
7
+ data.tar.gz: 86368778105c204ca48fb0b99c84c65cad01e45587630b12b738f59b7269f516ac5f467b642fc6bf9ea9a1ad2d13798273cd9671fb97fbf093b07b67eaf5c787
data/.travis.yml CHANGED
@@ -1,16 +1,14 @@
1
1
  language: ruby
2
2
  sudo: false
3
3
  rvm:
4
- - 2.1
5
- - 2.2
4
+ - 2.2.5
5
+ - 2.3.1
6
6
  env:
7
7
  global:
8
8
  - NOKOGIRI_USE_SYSTEM_LIBRARIES=true
9
9
  matrix:
10
- - RAILS_VERSION='~>4.1.10' RDF_GEM_VERSION='~>1.1.0'
11
- - RAILS_VERSION='~>4.1.10' RDF_GEM_VERSION='~>2.0.0'
12
- - RAILS_VERSION='~>4.2.5' RDF_GEM_VERSION='~>1.1.0'
13
- - RAILS_VERSION='~>4.2.5' RDF_GEM_VERSION='~>2.0.0'
10
+ - RAILS_VERSION='~>4.1.10'
11
+ - RAILS_VERSION='~>4.2.5'
14
12
 
15
13
  before_install:
16
14
  - gem install bundler
data/Gemfile CHANGED
@@ -2,17 +2,11 @@ source 'https://rubygems.org'
2
2
  # Specify your gem's dependencies in active_annotations.gemspec
3
3
  gemspec
4
4
 
5
- if ENV["RDF_GEM_VERSION"]
6
- gem 'rdf', ENV["RDF_GEM_VERSION"]
7
- else
8
- gem 'rdf'
9
- end
10
-
11
5
  # BEGIN ENGINE_CART BLOCK
12
- # engine_cart: 0.8.2
13
- # engine_cart stanza: 0.8.0
6
+ # engine_cart: 1.0.1
7
+ # engine_cart stanza: 0.10.0
14
8
  # the below comes from engine_cart, a gem used to test this Rails engine gem in the context of a Rails app.
15
- file = File.expand_path("Gemfile", ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path(".internal_test_app", File.dirname(__FILE__)))
9
+ file = File.expand_path('Gemfile', ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path('.internal_test_app', File.dirname(__FILE__)))
16
10
  if File.exist?(file)
17
11
  begin
18
12
  eval_gemfile file
@@ -26,19 +20,19 @@ else
26
20
  if ENV['RAILS_VERSION']
27
21
  if ENV['RAILS_VERSION'] == 'edge'
28
22
  gem 'rails', github: 'rails/rails'
29
- ENV['ENGINE_CART_RAILS_OPTIONS']= "--edge --skip-turbolinks"
23
+ ENV['ENGINE_CART_RAILS_OPTIONS'] = '--edge --skip-turbolinks'
30
24
  else
31
25
  gem 'rails', ENV['RAILS_VERSION']
32
26
  end
33
27
  end
34
28
 
35
- if ENV['RAILS_VERSION'].nil? || ENV['RAILS_VERSION'] =~ /^4.2/
36
- gem 'responders', "~> 2.0"
37
- gem 'sass-rails', ">= 5.0"
38
- elsif ENV['RAILS_VERSION'] =~ /^5.0/ || ENV['RAILS_VERSION'] == 'edge'
39
- # nop
40
- else
41
- gem 'sass-rails', "< 5.0"
29
+ case ENV['RAILS_VERSION']
30
+ when /^4.2/
31
+ gem 'responders', '~> 2.0'
32
+ gem 'sass-rails', '>= 5.0'
33
+ gem 'coffee-rails', '~> 4.1.0'
34
+ when /^4.[01]/
35
+ gem 'sass-rails', '< 5.0'
42
36
  end
43
37
  end
44
38
  # END ENGINE_CART BLOCK
data/README.md CHANGED
@@ -48,7 +48,7 @@ Output:
48
48
  "@context": "http://www.w3.org/ns/oa.jsonld",
49
49
  "@id": "urn:uuid:cac68351-a920-47d5-8c7c-9820e2f4d3bd",
50
50
  "@type": "oa:Annotation",
51
- "annotatedBy": {
51
+ "dcterms:creator": {
52
52
  "@id": "https://github.com/mbklein/",
53
53
  "@type": "foaf:Person"
54
54
  },
@@ -75,7 +75,7 @@ Output:
75
75
  }
76
76
  },
77
77
  "label": "This is the annotation label",
78
- "oa:annotatedAt": {
78
+ "dcterms:modified": {
79
79
  "@value": "2016-04-22T12:59:31Z",
80
80
  "@type": "xsd:dateTime"
81
81
  }
@@ -20,11 +20,11 @@ Gem::Specification.new do |spec|
20
20
  spec.require_paths = ["lib"]
21
21
 
22
22
  spec.add_dependency "json-ld"
23
- spec.add_dependency "rdf-vocab"
23
+ spec.add_dependency "rdf-vocab", "~> 2.1.0"
24
24
  spec.add_development_dependency "bundler", "~> 1.11"
25
- spec.add_development_dependency "rake", "~> 10.0"
25
+ spec.add_development_dependency "rake", "~> 11.0"
26
26
  spec.add_development_dependency "rspec", "~> 3.0"
27
- spec.add_development_dependency "engine_cart"
27
+ spec.add_development_dependency "engine_cart", "~> 1.0.1"
28
28
  spec.add_development_dependency "faker"
29
29
  spec.add_development_dependency "coveralls"
30
30
  spec.add_development_dependency "simplecov"
@@ -13,6 +13,10 @@ module ActiveAnnotations
13
13
  RDF::Vocab::DC = RDF::DC unless defined?(RDF::Vocab::DC)
14
14
  RDF::Vocab::FOAF = RDF::FOAF unless defined?(RDF::Vocab::FOAF)
15
15
 
16
+ # Support reading legacy properties
17
+ RDF::Vocab::OA.property 'annotatedAt'
18
+ RDF::Vocab::OA.property 'annotatedBy'
19
+
16
20
  attr_reader :graph
17
21
  CONTEXT_URI = 'http://www.w3.org/ns/oa.jsonld'
18
22
 
@@ -68,7 +72,7 @@ module ActiveAnnotations
68
72
  aid = new_id
69
73
  add_statements(
70
74
  RDF::Statement.new(aid, RDF.type, RDF::Vocab::OA.Annotation),
71
- RDF::Statement.new(aid, RDF::Vocab::OA.annotatedAt, DateTime.now)
75
+ RDF::Statement.new(aid, RDF::Vocab::DC.created, DateTime.now)
72
76
  )
73
77
  end
74
78
 
@@ -172,7 +176,7 @@ module ActiveAnnotations
172
176
  end
173
177
 
174
178
  def annotated_by
175
- get_value(annotation_id, RDF::Vocab::OA.annotatedBy)
179
+ get_value(annotation_id, RDF::Vocab::DC.creator) || get_value(annotation_id, RDF::Vocab::OA.annotatedBy)
176
180
  end
177
181
 
178
182
  def annotated_by=(value)
@@ -181,16 +185,16 @@ module ActiveAnnotations
181
185
  end
182
186
 
183
187
  value = value.nil? ? nil : RDF::URI(value)
184
- set_value(annotation_id, RDF::Vocab::OA.annotatedBy, value)
188
+ set_value(annotation_id, RDF::Vocab::DC.creator, value)
185
189
  set_value(value, RDF.type, RDF::Vocab::FOAF.Person)
186
190
  end
187
191
 
188
192
  def annotated_at
189
- get_value(annotation_id, RDF::Vocab::OA.annotatedAt)
193
+ get_value(annotation_id, RDF::Vocab::DC.modified) || get_value(annotation_id, RDF::Vocab::OA.annotatedAt)
190
194
  end
191
195
 
192
196
  def annotated_at=(value)
193
- set_value(annotation_id, RDF::Vocab::OA.annotatedAt, value)
197
+ set_value(annotation_id, RDF::Vocab::DC.modified, value)
194
198
  end
195
199
 
196
200
  def source
@@ -1,3 +1,3 @@
1
1
  module ActiveAnnotations
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_annotations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael B. Klein
@@ -28,16 +28,16 @@ dependencies:
28
28
  name: rdf-vocab
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: 2.1.0
34
34
  type: :runtime
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: '0'
40
+ version: 2.1.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '10.0'
61
+ version: '11.0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '10.0'
68
+ version: '11.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -84,16 +84,16 @@ dependencies:
84
84
  name: engine_cart
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '0'
89
+ version: 1.0.1
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '0'
96
+ version: 1.0.1
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: faker
99
99
  requirement: !ruby/object:Gem::Requirement