kalimba-redlander 0.0.1 → 0.0.2

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: 45a19d6326c2d8dca3240b19980c34f25d4c51cc
4
- data.tar.gz: 3d8efb8bc5173956a0ecac4a75bf28452cc4fff8
3
+ metadata.gz: 5f334dd20b43f4ce21786b1a96300c0738fd6f74
4
+ data.tar.gz: c7d5319d17aceaff07abd672ccd21092c21bfa8f
5
5
  SHA512:
6
- metadata.gz: d82e2a8077e043f9d37cc15c2e1b3da5bdff50f707fe484e5869792c521ad9b229a02585d15022e8bc167b62b2257efa9cef6b274ec2e563f72d1533d714ccfd
7
- data.tar.gz: 74fd9991804fbfa4cb9f30a1fcd65cb8d259e9cf10850be9f184a092b79a0fed4e0d4ba5ad5c65f2fc39e7b1df64568001adf9716ed02aa4b26b8bb88b2a99d1
6
+ metadata.gz: 0492b159a22ee99d07716b38260a29d5d0cfb3517bccfedd770403d2326ef30fc7973007d37e2261e42313259a736ebc7ae607f08635f68842077ef4a20af673
7
+ data.tar.gz: a500b81ae68939bb4e1d48e2fd1bb2c166522c536dbc06d69792a8abe94dedced554855561f72b6726f938da7188343b1ca9b0ddada608569f6ca20cc294e17b
@@ -227,14 +227,21 @@ module Kalimba
227
227
  end
228
228
 
229
229
  def store_single_value(value, predicate, datatype, options = {})
230
- value =
231
- # TODO: check for the types that are acceptable by the property,
232
- # not the types of values themselves!
233
- if value.is_a?(Kalimba::Resource)
234
- store_single_resource(value, options)
230
+ # TODO: check for the types that are acceptable by the property,
231
+ # not the types of values themselves!
232
+ if value.is_a?(Kalimba::Resource)
233
+ if store_single_resource(value, options)
234
+ # proceed with the saved association
235
+ value = value.subject
235
236
  else
236
- type_cast_to_rdf(value, datatype)
237
+ # could not save the association, bail out
238
+ return false
237
239
  end
240
+ else
241
+ value = type_cast_to_rdf(value, datatype)
242
+ end
243
+
244
+ # TODO: This doesn't persist "false". Should it?
238
245
  if value
239
246
  statement = ::Redlander::Statement.new(:subject => subject, :predicate => predicate, :object => ::Redlander::Node.new(value))
240
247
  Kalimba.repository.statements.add(statement)
@@ -250,6 +257,9 @@ module Kalimba
250
257
  if options[:parent_subject] != resource.subject &&
251
258
  must_be_persisted?(resource)
252
259
  resource.save(:parent_subject => subject)
260
+ else
261
+ # no save was required and that's not an error
262
+ true
253
263
  end
254
264
  end
255
265
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kalimba-redlander
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Slava Kravchenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-03-13 00:00:00.000000000 Z
11
+ date: 2013-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kalimba
@@ -68,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
68
68
  version: '0'
69
69
  requirements: []
70
70
  rubyforge_project:
71
- rubygems_version: 2.0.0.rc.2
71
+ rubygems_version: 2.0.3
72
72
  signing_key:
73
73
  specification_version: 4
74
74
  summary: Redlander adapter for Kalimba