rtm-rails 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/DISCLAIMER +3 -1
- data/README +0 -0
- data/lib/rtm/rails.rb +4 -4
- data/lib/rtm/rails/rake_tasks.rb +33 -2
- data/rails_generators/templates/README.txt +4 -3
- data/rails_generators/templates/topicmaps.example.yml +3 -3
- data/rails_generators/templates/topicmaps.rake +1 -1
- metadata +62 -62
data/DISCLAIMER
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
Copyright 2006-2008 Benjamin Bock
|
2
|
+
|
1
3
|
Copyright 2008-2010 Topic Maps Lab, University of Leipzig.
|
2
4
|
|
3
5
|
Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -10,4 +12,4 @@ Unless required by applicable law or agreed to in writing, software
|
|
10
12
|
distributed under the License is distributed on an "AS IS" BASIS,
|
11
13
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
14
|
See the License for the specific language governing permissions and limitations
|
13
|
-
under the License.
|
15
|
+
under the License.
|
data/README
CHANGED
File without changes
|
data/lib/rtm/rails.rb
CHANGED
@@ -73,7 +73,7 @@ module RTM
|
|
73
73
|
def self.run(configuration = Configuration.new)
|
74
74
|
yield configuration if block_given?
|
75
75
|
initializer = new configuration
|
76
|
-
initializer.process
|
76
|
+
initializer.process unless RTM::Rails.initialized?
|
77
77
|
initializer
|
78
78
|
end
|
79
79
|
|
@@ -181,7 +181,7 @@ module RTM
|
|
181
181
|
failed_connections = RTM.connections.reject { |identifier,con| con.check }
|
182
182
|
unless failed_connections.empty?
|
183
183
|
puts "Warning: The following topicmap connection(s) are not properly prepared: #{failed_connections.map{|identifier,con| identifier}.to_sentence}"
|
184
|
-
puts " Maybe you added them recently to your config but forgot 'rake topicmaps:
|
184
|
+
puts " Maybe you added them recently to your config but forgot 'rake topicmaps:migrate'?"
|
185
185
|
end
|
186
186
|
end
|
187
187
|
|
@@ -196,7 +196,7 @@ module RTM
|
|
196
196
|
RTM.connections[con_spec.to_sym]
|
197
197
|
when Hash # inline config given
|
198
198
|
c = connect_anonymous(con_spec)
|
199
|
-
puts "Warning: The connection for topicmap '#{identifier}' is not yet prepared. Please run the topicmaps:
|
199
|
+
puts "Warning: The connection for topicmap '#{identifier}' is not yet prepared. Please run the topicmaps:migrate rake task." unless c.check
|
200
200
|
c
|
201
201
|
else
|
202
202
|
raise "Cannot determine connection for #{con_spec.inspect}"
|
@@ -244,7 +244,7 @@ module RTM
|
|
244
244
|
|
245
245
|
def register_map(identifier, map)
|
246
246
|
raise "A topic map with the identifier #{identifier.inspect} is already registered" if @topic_maps.keys.include?(identifier)
|
247
|
-
# TODO maybe we should allow to connect here?
|
247
|
+
# TODO: maybe we should allow to connect here?
|
248
248
|
@topic_maps[identifier] = map
|
249
249
|
end
|
250
250
|
|
data/lib/rtm/rails/rake_tasks.rb
CHANGED
@@ -11,7 +11,7 @@ namespace :topicmaps do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
desc "Migrate RTM Backends to prepare them for storing topic maps"
|
14
|
-
task :
|
14
|
+
task :migrate => :load_config do
|
15
15
|
RTM.connections.each do |identifier, con|
|
16
16
|
unless con.check
|
17
17
|
print "Migrating #{identifier}..."
|
@@ -21,6 +21,37 @@ namespace :topicmaps do
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
+
desc "Migrate RTM Backends DOWN to remove all topic maps"
|
25
|
+
task :migrate_down => :load_config do
|
26
|
+
RTM.connections.each do |identifier, con|
|
27
|
+
print "Migrating down #{identifier}..."
|
28
|
+
con.migrate_down
|
29
|
+
puts "done"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
desc "Migrate RTM Backends DOWN to remove all topic maps (forced)"
|
34
|
+
task :migrate_force_down => :load_config do
|
35
|
+
RTM.connections.each do |identifier, con|
|
36
|
+
print "Migrating down (forced) #{identifier}..."
|
37
|
+
con.migrate_force_down
|
38
|
+
puts "done"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
task :migrate_custom => :load_config do
|
43
|
+
script_fragment = ENV['TM_MIGRATE_CUSTOM'] || raise("Please provide environment variable TM_MIGRATE_CUSTOM")
|
44
|
+
RTM.connections.each do |identifier, con|
|
45
|
+
print "Migrating #{identifier}... using (#{script_fragment})"
|
46
|
+
con.migrate_custom script_fragment
|
47
|
+
puts "done. Please use '#{$0} topicmaps:check' to see if everything is OK."
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
task :migrate_backends => :migrate
|
52
|
+
task :migrate_backend => :migrate
|
53
|
+
task :migrate_up => :migrate
|
54
|
+
|
24
55
|
desc "Check if all RTM Backends are properly set up"
|
25
56
|
task :check => :load_config do
|
26
57
|
fine, failed = RTM.connections.partition { |identifier,con| con.check }
|
@@ -29,7 +60,7 @@ namespace :topicmaps do
|
|
29
60
|
else
|
30
61
|
puts "The following #{fine.size} topicmap connections are OK: #{fine.map{|identifier,con| identifier}.to_sentence}"
|
31
62
|
puts "The following #{failed.size} topicmap connections are NOT properly prepared: #{failed.map{|identifier,con| identifier}.to_sentence}"
|
32
|
-
puts "Run '#{$0} topicmaps:
|
63
|
+
puts "Run '#{$0} topicmaps:migrate' to prepare them."
|
33
64
|
end
|
34
65
|
end
|
35
66
|
end
|
@@ -8,7 +8,7 @@ rtm-rails Gem.
|
|
8
8
|
|
9
9
|
2. Migrate your backends to make them ready for your topic maps:
|
10
10
|
|
11
|
-
jruby -S rake topicmaps:
|
11
|
+
jruby -S rake topicmaps:migrate
|
12
12
|
|
13
13
|
|
14
14
|
3. Use your topic maps in your application code:
|
@@ -19,8 +19,8 @@ rtm-rails Gem.
|
|
19
19
|
end
|
20
20
|
|
21
21
|
TM[:another_map].get("xsd:integer") # get an existing topic
|
22
|
-
|
23
|
-
TM[:some_map].get!("
|
22
|
+
|
23
|
+
TM[:some_map].get!("http://example.org/topics/b") # get topic (or create it if it does not exist)
|
24
24
|
|
25
25
|
|
26
26
|
See http://rubygems.org/gems/rtm-rails for information about the Gem.
|
@@ -31,3 +31,4 @@ See http://www.topicmapslab.de/ for general information about Topic Maps.
|
|
31
31
|
==== License for RTM and RTM-Rails
|
32
32
|
Copyright 2009 Topic Maps Lab, University of Leipzig.
|
33
33
|
Apache License, Version 2.0
|
34
|
+
|
@@ -4,7 +4,7 @@
|
|
4
4
|
#
|
5
5
|
# === Default Environment
|
6
6
|
# Most people want the same topic maps in all environments. The special
|
7
|
-
# environment "default" is the basis for all other
|
7
|
+
# environment "default" is the basis for all other environments. The simplest
|
8
8
|
# configuration is
|
9
9
|
#
|
10
10
|
default:
|
@@ -47,7 +47,7 @@ development:
|
|
47
47
|
# RTM allows to connect to multiple backends at the same time. To connect to
|
48
48
|
# multiple backends use the connections keyword. Each connection specified
|
49
49
|
# here must have a name to identify the connection. The following example
|
50
|
-
# creates
|
50
|
+
# creates three connections for the production environment: one persistent
|
51
51
|
# (called primary) using mysql and one temporary (called tmp) in memory.
|
52
52
|
# As with the topic maps, the names are arbitrary.
|
53
53
|
#
|
@@ -110,7 +110,7 @@ production:
|
|
110
110
|
# Some backends, like the Ontopia backend support additional settings which
|
111
111
|
# can also be provided here.
|
112
112
|
#
|
113
|
-
# All connections are migrated using the rake task topicmaps:
|
113
|
+
# All connections are migrated using the rake task topicmaps:migrate
|
114
114
|
# and checked with the rake task topicmaps:check. The default connection is
|
115
115
|
# only included there if it is used by at least one topicmap or the property
|
116
116
|
# use_for_topicmaps is set:
|
metadata
CHANGED
@@ -3,51 +3,51 @@ name: rtm-rails
|
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
version: 0.3.
|
6
|
+
- 0
|
7
|
+
- 3
|
8
|
+
- 1
|
9
|
+
version: 0.3.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
|
-
- Benjamin Bock
|
13
|
-
- Arnim Bleier
|
14
|
-
- Uta Schulze
|
15
|
-
- Daniel Exner
|
12
|
+
- Benjamin Bock
|
13
|
+
- Arnim Bleier
|
14
|
+
- Uta Schulze
|
15
|
+
- Daniel Exner
|
16
16
|
autorequire:
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date: 2010-
|
20
|
+
date: 2010-09-28 00:00:00 +02:00
|
21
21
|
default_executable:
|
22
22
|
dependencies:
|
23
|
-
- !ruby/object:Gem::Dependency
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
23
|
+
- !ruby/object:Gem::Dependency
|
24
|
+
name: rtm-javatmapi
|
25
|
+
prerelease: false
|
26
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
27
|
+
requirements:
|
28
|
+
- - ">="
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
- 3
|
33
|
+
- 1
|
34
|
+
version: 0.3.1
|
35
|
+
type: :runtime
|
36
|
+
version_requirements: *id001
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: rtm-ontopia
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
segments:
|
45
|
+
- 0
|
46
|
+
- 3
|
47
|
+
- 1
|
48
|
+
version: 0.3.1
|
49
|
+
type: :runtime
|
50
|
+
version_requirements: *id002
|
51
51
|
description: |
|
52
52
|
==== Topic Maps for Rails (rtm-rails)
|
53
53
|
RTM-Rails is the Rails-Adapter for Ruby Topic Maps. It allows simple configuration of topicmaps in config/topicmaps.yml.
|
@@ -134,7 +134,7 @@ description: |
|
|
134
134
|
Copyright 2009 Topic Maps Lab, University of Leipzig.
|
135
135
|
Apache License, Version 2.0
|
136
136
|
|
137
|
-
email: rtm+rtm-rails-gem-
|
137
|
+
email: rtm+rtm-rails-gem-20100928@topicmapslab.de
|
138
138
|
executables: []
|
139
139
|
|
140
140
|
extensions: []
|
@@ -142,19 +142,19 @@ extensions: []
|
|
142
142
|
extra_rdoc_files: []
|
143
143
|
|
144
144
|
files:
|
145
|
-
- lib/rtm
|
146
|
-
- lib/rtm/rails.rb
|
147
|
-
- lib/rtm
|
148
|
-
- rails/init.rb
|
149
|
-
- rails_generators/topicmaps_generator.rb
|
150
|
-
- rails_generators/templates/topicmaps.rake
|
151
|
-
- tasks/topicmaps_tasks.rake
|
152
|
-
- rails_generators/templates/README.txt
|
153
|
-
- rails_generators/templates/topicmaps.example.yml
|
154
|
-
- rails_generators/templates/topicmaps.yml
|
155
|
-
- LICENSE
|
156
|
-
- DISCLAIMER
|
157
|
-
- README
|
145
|
+
- lib/rtm-rails.rb
|
146
|
+
- lib/rtm/rails.rb
|
147
|
+
- lib/rtm/rails/rake_tasks.rb
|
148
|
+
- rails/init.rb
|
149
|
+
- rails_generators/topicmaps_generator.rb
|
150
|
+
- rails_generators/templates/topicmaps.rake
|
151
|
+
- tasks/topicmaps_tasks.rake
|
152
|
+
- rails_generators/templates/README.txt
|
153
|
+
- rails_generators/templates/topicmaps.example.yml
|
154
|
+
- rails_generators/templates/topicmaps.yml
|
155
|
+
- LICENSE
|
156
|
+
- DISCLAIMER
|
157
|
+
- README
|
158
158
|
has_rdoc: true
|
159
159
|
homepage: http://rtm.topicmapslab.de/
|
160
160
|
licenses: []
|
@@ -163,21 +163,21 @@ post_install_message:
|
|
163
163
|
rdoc_options: []
|
164
164
|
|
165
165
|
require_paths:
|
166
|
-
- lib
|
166
|
+
- lib
|
167
167
|
required_ruby_version: !ruby/object:Gem::Requirement
|
168
168
|
requirements:
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
169
|
+
- - ">="
|
170
|
+
- !ruby/object:Gem::Version
|
171
|
+
segments:
|
172
|
+
- 0
|
173
|
+
version: "0"
|
174
174
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
175
175
|
requirements:
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
176
|
+
- - ">="
|
177
|
+
- !ruby/object:Gem::Version
|
178
|
+
segments:
|
179
|
+
- 0
|
180
|
+
version: "0"
|
181
181
|
requirements: []
|
182
182
|
|
183
183
|
rubyforge_project: rtm
|