lightrdf 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,7 @@
1
+ === 0.4.1 2011-11-24
2
+
3
+ * Update to latest JSON parsing
4
+
1
5
  === 0.4.0 2011-07-08
2
6
 
3
7
  * SPARQL support in repository
@@ -2,7 +2,7 @@ $:.unshift(File.dirname(__FILE__)) unless
2
2
  $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
3
 
4
4
  module RDF
5
- VERSION = '0.4.0'
5
+ VERSION = '0.4.1'
6
6
  end
7
7
 
8
8
  require 'rubygems'
@@ -95,7 +95,7 @@ module RDF
95
95
  if level == base_level
96
96
  nodes << if line =~ /\A(".*")\Z/ # Literal
97
97
  i += 1
98
- ActiveSupport::JSON.decode($1)
98
+ parse_string($1)
99
99
  elsif line =~ /\A(.+):\Z/ # Node with relations
100
100
  node = Node(ID($1, ns), graph)
101
101
  i, relations = parse_yarf_relations(lines, graph, ns, level+1, i+1)
@@ -122,7 +122,7 @@ module RDF
122
122
  if level == base_level
123
123
  relations += if line =~ /\A(.+):\s+(".+")\Z/ # Predicate and literal
124
124
  i += 1
125
- [[Node(ID($1, ns), graph), ActiveSupport::JSON.decode($2)]]
125
+ [[Node(ID($1, ns), graph), parse_string($2)]]
126
126
  elsif line =~ /\A(.+):\s+(.+)\Z/ # Predicate and node
127
127
  i += 1
128
128
  [[Node(ID($1, ns), graph), Node(ID($2, ns), graph)]]
@@ -226,7 +226,7 @@ module RDF
226
226
  end
227
227
  when '_' then Node c
228
228
  when '"' then
229
- ActiveSupport::JSON.decode(c.match(/\A(\".*\")(@\w+)?\Z/).captures.first)
229
+ parse_string(c.match(/\A(\".*\")(@\w+)?\Z/).captures.first)
230
230
  else
231
231
  raise Exception, "Parsing error: #{c}"
232
232
  end
@@ -243,5 +243,9 @@ module RDF
243
243
  @num_tempfile += 1
244
244
  File.join(Dir.tmpdir, "lightrdf-#{@num_tempfile}-#{$$}#{Thread.current.object_id}")
245
245
  end
246
+
247
+ def self.parse_string string
248
+ ActiveSupport::JSON.decode("[#{string}]").first
249
+ end
246
250
  end
247
251
  end
@@ -1,32 +1,30 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
 
3
3
  Gem::Specification.new do |s|
4
- s.name = %q{lightrdf}
5
- s.version = "0.4.0"
4
+ s.name = "lightrdf"
5
+ s.version = "0.4.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Jose Ignacio"]
9
- s.date = %q{2011-07-08}
10
- s.default_executable = %q{yarfp}
11
- s.description = %q{RDF library}
12
- s.email = %q{joseignacio.fernandez@gmail.com}
9
+ s.date = "2011-11-24"
10
+ s.description = "RDF library"
11
+ s.email = "joseignacio.fernandez@gmail.com"
13
12
  s.executables = ["yarfp"]
14
13
  s.extra_rdoc_files = ["README.rdoc", "bin/yarfp", "lib/lightrdf.rb", "lib/lightrdf/graph.rb", "lib/lightrdf/node.rb", "lib/lightrdf/node_proxy.rb", "lib/lightrdf/parser.rb", "lib/lightrdf/repository.rb", "lib/lightrdf/id.rb"]
15
14
  s.files = ["History.txt", "Manifest", "README.rdoc", "Rakefile", "bin/yarfp", "lib/lightrdf.rb", "lib/lightrdf/graph.rb", "lib/lightrdf/node.rb", "lib/lightrdf/node_proxy.rb", "lib/lightrdf/parser.rb", "lib/lightrdf/repository.rb", "lib/lightrdf/id.rb", "test/test_helper.rb", "test/test_lightrdf.rb", "lightrdf.gemspec"]
16
- s.homepage = %q{http://github.com/josei/lighrdf}
17
- s.post_install_message = %q{**Remember to install raptor RDF tools and (optionally for RDF PNG output) Graphviz**}
15
+ s.homepage = "http://github.com/josei/lighrdf"
16
+ s.post_install_message = "**Remember to install raptor RDF tools and (optionally for RDF PNG output) Graphviz**"
18
17
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Lightrdf", "--main", "README.rdoc"]
19
18
  s.require_paths = ["lib"]
20
- s.rubyforge_project = %q{lightrdf}
21
- s.rubygems_version = %q{1.3.6}
22
- s.summary = %q{Light and easy library for managing RDF data and graphs}
19
+ s.rubyforge_project = "lightrdf"
20
+ s.rubygems_version = "1.8.10"
21
+ s.summary = "Light and easy library for managing RDF data and graphs"
23
22
  s.test_files = ["test/test_lightrdf.rb", "test/test_helper.rb"]
24
23
 
25
24
  if s.respond_to? :specification_version then
26
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
27
25
  s.specification_version = 3
28
26
 
29
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
27
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
30
28
  s.add_runtime_dependency(%q<activesupport>, [">= 2.0.2"])
31
29
  s.add_runtime_dependency(%q<rest-client>, [">= 1.6.1"])
32
30
  s.add_runtime_dependency(%q<nokogiri>, [">= 1.4.1"])
metadata CHANGED
@@ -1,71 +1,55 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: lightrdf
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 4
8
- - 0
9
- version: 0.4.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.4.1
5
+ prerelease:
10
6
  platform: ruby
11
- authors:
7
+ authors:
12
8
  - Jose Ignacio
13
9
  autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
-
17
- date: 2011-07-08 00:00:00 +02:00
18
- default_executable:
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2011-11-24 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: activesupport
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- requirements:
25
- - - ">="
26
- - !ruby/object:Gem::Version
27
- segments:
28
- - 2
29
- - 0
30
- - 2
16
+ requirement: &77839540 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
31
21
  version: 2.0.2
32
22
  type: :runtime
33
- version_requirements: *id001
34
- - !ruby/object:Gem::Dependency
35
- name: rest-client
36
23
  prerelease: false
37
- requirement: &id002 !ruby/object:Gem::Requirement
38
- requirements:
39
- - - ">="
40
- - !ruby/object:Gem::Version
41
- segments:
42
- - 1
43
- - 6
44
- - 1
24
+ version_requirements: *77839540
25
+ - !ruby/object:Gem::Dependency
26
+ name: rest-client
27
+ requirement: &77839300 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
45
32
  version: 1.6.1
46
33
  type: :runtime
47
- version_requirements: *id002
48
- - !ruby/object:Gem::Dependency
49
- name: nokogiri
50
34
  prerelease: false
51
- requirement: &id003 !ruby/object:Gem::Requirement
52
- requirements:
53
- - - ">="
54
- - !ruby/object:Gem::Version
55
- segments:
56
- - 1
57
- - 4
58
- - 1
35
+ version_requirements: *77839300
36
+ - !ruby/object:Gem::Dependency
37
+ name: nokogiri
38
+ requirement: &77839080 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
59
43
  version: 1.4.1
60
44
  type: :runtime
61
- version_requirements: *id003
45
+ prerelease: false
46
+ version_requirements: *77839080
62
47
  description: RDF library
63
48
  email: joseignacio.fernandez@gmail.com
64
- executables:
49
+ executables:
65
50
  - yarfp
66
51
  extensions: []
67
-
68
- extra_rdoc_files:
52
+ extra_rdoc_files:
69
53
  - README.rdoc
70
54
  - bin/yarfp
71
55
  - lib/lightrdf.rb
@@ -75,7 +59,7 @@ extra_rdoc_files:
75
59
  - lib/lightrdf/parser.rb
76
60
  - lib/lightrdf/repository.rb
77
61
  - lib/lightrdf/id.rb
78
- files:
62
+ files:
79
63
  - History.txt
80
64
  - Manifest
81
65
  - README.rdoc
@@ -91,42 +75,37 @@ files:
91
75
  - test/test_helper.rb
92
76
  - test/test_lightrdf.rb
93
77
  - lightrdf.gemspec
94
- has_rdoc: true
95
78
  homepage: http://github.com/josei/lighrdf
96
79
  licenses: []
97
-
98
- post_install_message: "**Remember to install raptor RDF tools and (optionally for RDF PNG output) Graphviz**"
99
- rdoc_options:
80
+ post_install_message: ! '**Remember to install raptor RDF tools and (optionally for
81
+ RDF PNG output) Graphviz**'
82
+ rdoc_options:
100
83
  - --line-numbers
101
84
  - --inline-source
102
85
  - --title
103
86
  - Lightrdf
104
87
  - --main
105
88
  - README.rdoc
106
- require_paths:
89
+ require_paths:
107
90
  - lib
108
- required_ruby_version: !ruby/object:Gem::Requirement
109
- requirements:
110
- - - ">="
111
- - !ruby/object:Gem::Version
112
- segments:
113
- - 0
114
- version: "0"
115
- required_rubygems_version: !ruby/object:Gem::Requirement
116
- requirements:
117
- - - ">="
118
- - !ruby/object:Gem::Version
119
- segments:
120
- - 1
121
- - 2
122
- version: "1.2"
91
+ required_ruby_version: !ruby/object:Gem::Requirement
92
+ none: false
93
+ requirements:
94
+ - - ! '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ required_rubygems_version: !ruby/object:Gem::Requirement
98
+ none: false
99
+ requirements:
100
+ - - ! '>='
101
+ - !ruby/object:Gem::Version
102
+ version: '1.2'
123
103
  requirements: []
124
-
125
104
  rubyforge_project: lightrdf
126
- rubygems_version: 1.3.6
105
+ rubygems_version: 1.8.10
127
106
  signing_key:
128
107
  specification_version: 3
129
108
  summary: Light and easy library for managing RDF data and graphs
130
- test_files:
109
+ test_files:
131
110
  - test/test_lightrdf.rb
132
111
  - test/test_helper.rb