iq_rdf 0.1.8 → 0.1.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -29,6 +29,7 @@ Gem::Specification.new do |s|
29
29
 
30
30
  s.add_dependency "bundler"
31
31
  s.add_dependency "builder"
32
+ s.add_dependency "activesupport"
32
33
 
33
34
  s.files = %w(LICENSE README.md Rakefile iq_rdf.gemspec) + Dir.glob("{lib,rails,test}/**/*")
34
35
  s.test_files = Dir.glob("{test}/**/*")
@@ -12,6 +12,8 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
+ require 'active_support'
16
+
15
17
  module IqRdf
16
18
  class Literal
17
19
 
@@ -50,7 +52,7 @@ module IqRdf
50
52
  end
51
53
 
52
54
  def to_ntriples(parent_lang = nil)
53
- quote = @obj.to_s.include?("\n") ? '"""' : '"'
55
+ additional_quote = @obj.to_s.include?("\n") ? '""' : ''
54
56
  suffix = if @datatype.is_a?(::URI)
55
57
  "^^<#{@datatype.to_s}>"
56
58
  elsif @datatype.is_a?(IqRdf::Uri)
@@ -60,7 +62,7 @@ module IqRdf
60
62
  (lang && lang != :none) ? "@#{lang}" : ""
61
63
  end
62
64
 
63
- "#{quote}#{@obj.to_s.gsub("\\", "\\\\\\\\").gsub(/"/, "\\\"")}#{quote}#{suffix}"
65
+ "#{additional_quote}#{ActiveSupport::JSON.encode(@obj.to_s).gsub('\\n', "\n")}#{additional_quote}#{suffix}"
64
66
  end
65
67
 
66
68
  def build_xml(xml, &block)
@@ -13,5 +13,5 @@
13
13
  # limitations under the License.
14
14
 
15
15
  module IqRdf
16
- VERSION = "0.1.8"
16
+ VERSION = "0.1.10"
17
17
  end
@@ -1,3 +1,5 @@
1
+ # -*- encoding : utf-8 -*-
2
+ #
1
3
  # Copyright 2011 innoQ Deutschland GmbH
2
4
  #
3
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -178,7 +180,7 @@ _:b2 <http://www.umweltprobenbank.de/title> "blubb"@de .
178
180
  document << IqRdf::testemann do |t|
179
181
  t.Foaf::knows(:testefrau)
180
182
  t.Foaf.nick("Testy")
181
- t.Foaf.lastname("Testemann", :lang => :none)
183
+ t.Foaf.lastname("Tästämann", :lang => :none)
182
184
  t.age(32)
183
185
  t.married(false)
184
186
  t.weight(65.8)
@@ -192,7 +194,7 @@ _:b2 <http://www.umweltprobenbank.de/title> "blubb"@de .
192
194
  assert_equal(<<rdf.strip, document.to_ntriples.strip)
193
195
  <http://www.test.de/testemann> <http://xmlns.com/foaf/0.1/knows> <http://www.test.de/testefrau> .
194
196
  <http://www.test.de/testemann> <http://xmlns.com/foaf/0.1/nick> "Testy"@de .
195
- <http://www.test.de/testemann> <http://xmlns.com/foaf/0.1/lastname> "Testemann" .
197
+ <http://www.test.de/testemann> <http://xmlns.com/foaf/0.1/lastname> "T\\u00e4st\\u00e4mann" .
196
198
  <http://www.test.de/testemann> <http://www.test.de/age> "32"^^<http://www.w3.org/2001/XMLSchema#integer> .
197
199
  <http://www.test.de/testemann> <http://www.test.de/married> "false"^^<http://www.w3.org/2001/XMLSchema#boolean> .
198
200
  <http://www.test.de/testemann> <http://www.test.de/weight> "65.8"^^<http://www.w3.org/2001/XMLSchema#decimal> .
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iq_rdf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-18 00:00:00.000000000Z
12
+ date: 2013-01-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
16
- requirement: &2161452060 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,15 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2161452060
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: builder
27
- requirement: &2161451340 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ! '>='
@@ -32,7 +37,28 @@ dependencies:
32
37
  version: '0'
33
38
  type: :runtime
34
39
  prerelease: false
35
- version_requirements: *2161451340
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: activesupport
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
36
62
  description: IqRdf - A builder like rdf library for ruby and rails
37
63
  email:
38
64
  - till.schulte-coerne@innoq.com
@@ -80,21 +106,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
80
106
  - - ! '>='
81
107
  - !ruby/object:Gem::Version
82
108
  version: '0'
83
- segments:
84
- - 0
85
- hash: 3133402933398086512
86
109
  required_rubygems_version: !ruby/object:Gem::Requirement
87
110
  none: false
88
111
  requirements:
89
112
  - - ! '>='
90
113
  - !ruby/object:Gem::Version
91
114
  version: '0'
92
- segments:
93
- - 0
94
- hash: 3133402933398086512
95
115
  requirements: []
96
116
  rubyforge_project:
97
- rubygems_version: 1.8.10
117
+ rubygems_version: 1.8.23
98
118
  signing_key:
99
119
  specification_version: 3
100
120
  summary: IqRdf - A builder like rdf library for ruby and rails