og 0.31.0 → 0.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/doc/{AUTHORS → CONTRIBUTORS} +26 -10
- data/doc/LICENSE +2 -3
- data/doc/RELEASES +56 -7
- data/doc/tutorial.txt +15 -15
- data/lib/glue/cacheable.rb +2 -5
- data/lib/glue/hierarchical.rb +1 -4
- data/lib/glue/optimistic_locking.rb +0 -2
- data/lib/glue/orderable.rb +79 -75
- data/lib/glue/revisable.rb +19 -24
- data/lib/glue/searchable.rb +0 -2
- data/lib/glue/taggable.rb +31 -29
- data/lib/glue/timestamped.rb +4 -2
- data/lib/og.rb +50 -29
- data/lib/og/adapter.rb +19 -0
- data/lib/og/adapter/mysql.rb +212 -0
- data/lib/og/adapter/mysql/override.rb +34 -0
- data/lib/og/adapter/mysql/script.rb +15 -0
- data/lib/og/adapter/mysql/utils.rb +40 -0
- data/lib/og/adapter/postgresql.rb +231 -0
- data/lib/og/adapter/postgresql/override.rb +117 -0
- data/lib/og/adapter/postgresql/script.rb +15 -0
- data/lib/og/adapter/postgresql/utils.rb +35 -0
- data/lib/og/adapter/sqlite.rb +132 -0
- data/lib/og/adapter/sqlite/override.rb +33 -0
- data/lib/og/adapter/sqlite/script.rb +15 -0
- data/lib/og/collection.rb +35 -7
- data/lib/og/{evolution.rb → dump.rb} +4 -5
- data/lib/og/entity.rb +102 -173
- data/lib/og/entity/clone.rb +119 -0
- data/lib/og/errors.rb +0 -2
- data/lib/og/manager.rb +85 -37
- data/lib/og/relation.rb +52 -34
- data/lib/og/relation/belongs_to.rb +0 -2
- data/lib/og/relation/has_many.rb +27 -4
- data/lib/og/relation/joins_many.rb +41 -14
- data/lib/og/relation/many_to_many.rb +10 -0
- data/lib/og/relation/refers_to.rb +22 -5
- data/lib/og/store.rb +80 -86
- data/lib/og/store/sql.rb +710 -713
- data/lib/og/store/sql/evolution.rb +119 -0
- data/lib/og/store/sql/join.rb +155 -0
- data/lib/og/store/sql/utils.rb +149 -0
- data/lib/og/test/assertions.rb +1 -3
- data/lib/og/test/testcase.rb +0 -2
- data/lib/og/types.rb +2 -5
- data/lib/og/validation.rb +6 -9
- data/test/{og/mixin → glue}/tc_hierarchical.rb +3 -13
- data/test/glue/tc_og_paginate.rb +47 -0
- data/test/{og/mixin → glue}/tc_optimistic_locking.rb +2 -12
- data/test/{og/mixin → glue}/tc_orderable.rb +15 -23
- data/test/glue/tc_orderable2.rb +47 -0
- data/test/glue/tc_revisable.rb +3 -3
- data/test/{og/mixin → glue}/tc_taggable.rb +20 -10
- data/test/{og/mixin → glue}/tc_timestamped.rb +2 -12
- data/test/glue/tc_webfile.rb +36 -0
- data/test/og/CONFIG.rb +8 -11
- data/test/og/multi_validations_model.rb +14 -0
- data/test/og/store/tc_filesys.rb +3 -1
- data/test/og/store/tc_kirby.rb +16 -13
- data/test/og/store/tc_sti.rb +11 -11
- data/test/og/store/tc_sti2.rb +79 -0
- data/test/og/tc_build.rb +41 -0
- data/test/og/tc_cacheable.rb +3 -2
- data/test/og/tc_has_many.rb +96 -0
- data/test/og/tc_inheritance.rb +6 -4
- data/test/og/tc_joins_many.rb +93 -0
- data/test/og/tc_multi_validations.rb +5 -7
- data/test/og/tc_multiple.rb +7 -6
- data/test/og/tc_override.rb +13 -7
- data/test/og/tc_primary_key.rb +30 -0
- data/test/og/tc_relation.rb +8 -14
- data/test/og/tc_reldelete.rb +163 -0
- data/test/og/tc_reverse.rb +17 -14
- data/test/og/tc_scoped.rb +3 -11
- data/test/og/tc_setup.rb +13 -11
- data/test/og/tc_store.rb +21 -28
- data/test/og/tc_validation2.rb +2 -2
- data/test/og/tc_validation_loop.rb +17 -15
- metadata +109 -103
- data/INSTALL +0 -91
- data/ProjectInfo +0 -51
- data/README +0 -177
- data/doc/config.txt +0 -28
- data/examples/README +0 -23
- data/examples/mysql_to_psql.rb +0 -71
- data/examples/run.rb +0 -271
- data/lib/glue/tree.rb +0 -218
- data/lib/og/store/alpha/filesys.rb +0 -110
- data/lib/og/store/alpha/memory.rb +0 -295
- data/lib/og/store/alpha/sqlserver.rb +0 -256
- data/lib/og/store/kirby.rb +0 -490
- data/lib/og/store/mysql.rb +0 -415
- data/lib/og/store/psql.rb +0 -875
- data/lib/og/store/sqlite.rb +0 -348
- data/lib/og/store/sqlite2.rb +0 -241
- data/setup.rb +0 -1585
- data/test/og/tc_sti_find.rb +0 -35
data/test/og/tc_store.rb
CHANGED
@@ -69,21 +69,16 @@ class TCOgStore < Test::Unit::TestCase # :nodoc: all
|
|
69
69
|
$og1.manage_classes(User, Category, Article, NewArticle, Comment, Bugger)
|
70
70
|
|
71
71
|
def setup
|
72
|
-
@og = $og1
|
72
|
+
@og = $og1.store
|
73
73
|
end
|
74
74
|
|
75
|
-
def
|
76
|
-
features_test
|
77
|
-
# conversions_test
|
78
|
-
end
|
79
|
-
|
80
|
-
def features_test
|
75
|
+
def test_og_features
|
81
76
|
u = User.create('gmosx')
|
82
77
|
|
83
78
|
a1 = Article.new('Article 1')
|
84
|
-
@og.
|
79
|
+
@og.save(a1)
|
85
80
|
|
86
|
-
a2 = @og.
|
81
|
+
a2 = @og.load(1, Article)
|
87
82
|
|
88
83
|
assert_equal a1.body, a2.body
|
89
84
|
|
@@ -127,10 +122,10 @@ class TCOgStore < Test::Unit::TestCase # :nodoc: all
|
|
127
122
|
|
128
123
|
a0 = Article.one(:condition => "body='Article 3'")
|
129
124
|
assert_equal 'Article 3', a0.body
|
130
|
-
|
131
|
-
@og.store.delete(a3)
|
132
125
|
|
133
|
-
|
126
|
+
@og.delete(a3)
|
127
|
+
|
128
|
+
assert @og.load(1, Article)
|
134
129
|
assert !Article[2]
|
135
130
|
assert Article.load(1)
|
136
131
|
|
@@ -164,8 +159,8 @@ class TCOgStore < Test::Unit::TestCase # :nodoc: all
|
|
164
159
|
|
165
160
|
# count
|
166
161
|
|
167
|
-
assert_equal 4, @og.
|
168
|
-
assert_equal 1, @og.
|
162
|
+
assert_equal 4, @og.count(:class => Comment)
|
163
|
+
assert_equal 1, @og.count(:class => Comment, :condition => "body = 'Comment 4'")
|
169
164
|
assert_equal 4, Comment.count
|
170
165
|
assert_equal 1, Comment.count(:condition => "body = 'Comment 2'")
|
171
166
|
|
@@ -220,7 +215,7 @@ class TCOgStore < Test::Unit::TestCase # :nodoc: all
|
|
220
215
|
a4.comments.delete(c1)
|
221
216
|
assert_equal 3, a4.comments.size
|
222
217
|
|
223
|
-
assert_equal 3, @og.
|
218
|
+
assert_equal 3, @og.count(:class => Comment)
|
224
219
|
|
225
220
|
a4.comments.delete_all
|
226
221
|
assert_equal 0, a4.comments.size
|
@@ -286,25 +281,23 @@ class TCOgStore < Test::Unit::TestCase # :nodoc: all
|
|
286
281
|
# assert_equal 1, $schema_after
|
287
282
|
end
|
288
283
|
|
289
|
-
def
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
assert_equal '13.23', store.quote(13.23)
|
294
|
-
assert_equal "'can''t quote'", store.quote("can't quote")
|
284
|
+
def test_og_conversions
|
285
|
+
assert_equal '13', @og.quote(13)
|
286
|
+
assert_equal '13.23', @og.quote(13.23)
|
287
|
+
assert_match /'can[\\']'t quote'/, @og.quote("can't quote")
|
295
288
|
|
296
289
|
t = Time.now
|
297
290
|
|
298
|
-
assert_equal t.day,
|
299
|
-
assert_equal t.year,
|
300
|
-
assert_equal t.month,
|
301
|
-
assert_equal t.hour,
|
302
|
-
assert_equal t.min,
|
303
|
-
assert_equal t.sec,
|
291
|
+
assert_equal t.day, @og.parse_timestamp(@og.timestamp(t)).day
|
292
|
+
assert_equal t.year, @og.parse_timestamp(@og.timestamp(t)).year
|
293
|
+
assert_equal t.month, @og.parse_timestamp(@og.timestamp(t)).month
|
294
|
+
assert_equal t.hour, @og.parse_timestamp(@og.timestamp(t)).hour
|
295
|
+
assert_equal t.min, @og.parse_timestamp(@og.timestamp(t)).min
|
296
|
+
assert_equal t.sec, @og.parse_timestamp(@og.timestamp(t)).sec
|
304
297
|
|
305
298
|
d = Date.new
|
306
299
|
|
307
|
-
assert_equal d,
|
300
|
+
assert_equal d, @og.parse_date(@og.date(d))
|
308
301
|
end
|
309
302
|
|
310
303
|
end
|
data/test/og/tc_validation2.rb
CHANGED
@@ -53,12 +53,12 @@ module UnitTestClasses
|
|
53
53
|
property :prop, Fixnum
|
54
54
|
validate_numeric :prop, :integer => true
|
55
55
|
|
56
|
-
|
56
|
+
attr_accessor :prop2, Float
|
57
57
|
validate_numeric :prop2
|
58
58
|
end
|
59
59
|
|
60
60
|
class RelatedClass
|
61
|
-
|
61
|
+
attr_accessor :test, String
|
62
62
|
belongs_to :relation_validation, RelationValidation
|
63
63
|
end
|
64
64
|
|
@@ -1,33 +1,35 @@
|
|
1
|
-
|
1
|
+
require File.join(File.dirname(__FILE__), 'CONFIG.rb')
|
2
|
+
|
2
3
|
require 'test/unit'
|
3
4
|
|
4
5
|
require 'rubygems'
|
5
|
-
|
6
6
|
require 'og'
|
7
7
|
|
8
|
-
class ManagedClass
|
9
|
-
prop_accessor :thing
|
10
|
-
|
11
|
-
validate_unique :thing
|
12
|
-
end
|
13
|
-
|
14
8
|
class TC_Loop < Test::Unit::TestCase
|
9
|
+
class ManagedClass
|
10
|
+
attr_accessor :thing, String
|
11
|
+
|
12
|
+
validate_unique :thing
|
13
|
+
end
|
14
|
+
|
15
|
+
$og1.manage_class ManagedClass
|
16
|
+
|
15
17
|
def setup
|
16
18
|
@thing_1 = ManagedClass.new
|
17
19
|
@thing_1.thing = 'thing'
|
18
20
|
@thing_1.save
|
19
21
|
end
|
22
|
+
|
23
|
+
def teardown
|
24
|
+
ManagedClass.delete_all
|
25
|
+
end
|
20
26
|
|
21
27
|
def test_loop
|
22
28
|
thing_2 = ManagedClass.new
|
23
29
|
thing_2.thing = @thing_1.thing
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
# }
|
30
|
+
|
31
|
+
thing_2.valid?
|
32
|
+
assert thing_2.errors
|
28
33
|
end
|
29
34
|
|
30
35
|
end
|
31
|
-
|
32
|
-
# * Bryan Soto <bryan.a.soto@gmail.com>
|
33
|
-
=end
|
metadata
CHANGED
@@ -3,15 +3,15 @@ rubygems_version: 0.9.0
|
|
3
3
|
specification_version: 1
|
4
4
|
name: og
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.
|
7
|
-
date: 2006-
|
8
|
-
summary: State of the art object-relational mapping system
|
6
|
+
version: 0.40.0
|
7
|
+
date: 2006-11-13 10:56:16 +02:00
|
8
|
+
summary: State of the art object-relational mapping system
|
9
9
|
require_paths:
|
10
10
|
- lib
|
11
|
-
email:
|
11
|
+
email:
|
12
12
|
homepage: http://www.nitroproject.org
|
13
13
|
rubyforge_project:
|
14
|
-
description:
|
14
|
+
description: Object Graph (Og) is a state of the art ORM system. Og serializes standard Ruby objects to Mysql, Postgres, Sqlite, KirbyBase, Filesystem and more.
|
15
15
|
autorequire:
|
16
16
|
default_executable:
|
17
17
|
bindir: bin
|
@@ -27,118 +27,124 @@ signing_key:
|
|
27
27
|
cert_chain:
|
28
28
|
post_install_message:
|
29
29
|
authors:
|
30
|
-
- George Moschovitis
|
30
|
+
- George K. Moschovitis
|
31
31
|
files:
|
32
|
-
- doc
|
33
|
-
- lib
|
34
|
-
- test
|
35
|
-
- .
|
36
|
-
- examples
|
37
|
-
- lib/og
|
38
32
|
- lib/glue
|
33
|
+
- lib/og
|
34
|
+
- lib/og.rb
|
35
|
+
- lib/glue/cacheable.rb
|
36
|
+
- lib/glue/hierarchical.rb
|
37
|
+
- lib/glue/optimistic_locking.rb
|
38
|
+
- lib/glue/orderable.rb
|
39
|
+
- lib/glue/revisable.rb
|
40
|
+
- lib/glue/searchable.rb
|
41
|
+
- lib/glue/taggable.rb
|
42
|
+
- lib/glue/timestamped.rb
|
43
|
+
- lib/og/adapter
|
44
|
+
- lib/og/adapter.rb
|
45
|
+
- lib/og/collection.rb
|
46
|
+
- lib/og/dump.rb
|
47
|
+
- lib/og/entity
|
48
|
+
- lib/og/entity.rb
|
49
|
+
- lib/og/errors.rb
|
39
50
|
- lib/og/ez
|
40
|
-
- lib/og/
|
51
|
+
- lib/og/manager.rb
|
52
|
+
- lib/og/markers.rb
|
41
53
|
- lib/og/relation
|
54
|
+
- lib/og/relation.rb
|
42
55
|
- lib/og/store
|
56
|
+
- lib/og/store.rb
|
57
|
+
- lib/og/test
|
58
|
+
- lib/og/test.rb
|
59
|
+
- lib/og/types.rb
|
60
|
+
- lib/og/validation.rb
|
43
61
|
- lib/og/vendor
|
44
|
-
- lib/og/
|
45
|
-
-
|
46
|
-
-
|
47
|
-
-
|
48
|
-
-
|
49
|
-
-
|
50
|
-
-
|
51
|
-
-
|
52
|
-
-
|
53
|
-
-
|
54
|
-
-
|
55
|
-
- lib/og/
|
56
|
-
- lib/og/
|
57
|
-
- lib/og/
|
58
|
-
-
|
59
|
-
-
|
60
|
-
- doc/RELEASES
|
61
|
-
- test/og/tc_cacheable.rb
|
62
|
-
- lib/og/store/alpha/sqlserver.rb
|
63
|
-
- INSTALL
|
64
|
-
- test/og/tc_relation.rb
|
65
|
-
- examples/README
|
66
|
-
- lib/og/relation/has_many.rb
|
67
|
-
- lib/glue/optimistic_locking.rb
|
68
|
-
- test/og/tc_scoped.rb
|
69
|
-
- examples/run.rb
|
70
|
-
- test/og/multi_validations_model.rb
|
62
|
+
- lib/og/adapter/mysql
|
63
|
+
- lib/og/adapter/mysql.rb
|
64
|
+
- lib/og/adapter/postgresql
|
65
|
+
- lib/og/adapter/postgresql.rb
|
66
|
+
- lib/og/adapter/sqlite
|
67
|
+
- lib/og/adapter/sqlite.rb
|
68
|
+
- lib/og/adapter/mysql/override.rb
|
69
|
+
- lib/og/adapter/mysql/script.rb
|
70
|
+
- lib/og/adapter/mysql/utils.rb
|
71
|
+
- lib/og/adapter/postgresql/override.rb
|
72
|
+
- lib/og/adapter/postgresql/script.rb
|
73
|
+
- lib/og/adapter/postgresql/utils.rb
|
74
|
+
- lib/og/adapter/sqlite/override.rb
|
75
|
+
- lib/og/adapter/sqlite/script.rb
|
76
|
+
- lib/og/entity/clone.rb
|
77
|
+
- lib/og/ez/clause.rb
|
71
78
|
- lib/og/ez/condition.rb
|
72
|
-
- lib/og/store/psql.rb
|
73
|
-
- lib/og/relation.rb
|
74
|
-
- lib/og/validation.rb
|
75
|
-
- test/og/tc_multi_validations.rb
|
76
|
-
- lib/og/vendor/README
|
77
|
-
- test/og/tc_resolve.rb
|
78
|
-
- doc/LICENSE
|
79
|
-
- test/og/tc_validation_loop.rb
|
80
|
-
- lib/og/collection.rb
|
81
|
-
- lib/og/store/sqlite2.rb
|
82
|
-
- test/og/tc_join.rb
|
83
|
-
- lib/glue/hierarchical.rb
|
84
|
-
- lib/og/store/mysql.rb
|
85
|
-
- lib/og/relation/joins_many.rb
|
86
|
-
- lib/og/store/kirby.rb
|
87
|
-
- test/og/tc_select.rb
|
88
|
-
- doc/config.txt
|
89
|
-
- lib/og/test.rb
|
90
|
-
- lib/og/evolution.rb
|
91
79
|
- lib/og/relation/all.rb
|
92
|
-
- lib/og/relation/has_one.rb
|
93
|
-
- lib/og/store/alpha/filesys.rb
|
94
80
|
- lib/og/relation/belongs_to.rb
|
95
|
-
-
|
96
|
-
-
|
97
|
-
-
|
98
|
-
- test/og/tc_delete_all.rb
|
99
|
-
- doc/tutorial.txt
|
100
|
-
- test/glue/tc_revisable.rb
|
101
|
-
- test/og/tc_setup.rb
|
102
|
-
- test/og/tc_override.rb
|
103
|
-
- doc/AUTHORS
|
104
|
-
- README
|
105
|
-
- lib/glue/taggable.rb
|
106
|
-
- test/og/store/tc_sti.rb
|
107
|
-
- lib/og/errors.rb
|
108
|
-
- test/og/tc_polymorphic.rb
|
109
|
-
- lib/glue/timestamped.rb
|
110
|
-
- lib/og/entity.rb
|
111
|
-
- setup.rb
|
112
|
-
- test/og/tc_inheritance2.rb
|
113
|
-
- ProjectInfo
|
114
|
-
- lib/glue/tree.rb
|
81
|
+
- lib/og/relation/has_many.rb
|
82
|
+
- lib/og/relation/has_one.rb
|
83
|
+
- lib/og/relation/joins_many.rb
|
115
84
|
- lib/og/relation/many_to_many.rb
|
85
|
+
- lib/og/relation/refers_to.rb
|
86
|
+
- lib/og/store/sql
|
116
87
|
- lib/og/store/sql.rb
|
117
|
-
- lib/
|
118
|
-
-
|
119
|
-
-
|
120
|
-
- test/og/tc_aggregations_calculations.rb
|
121
|
-
- lib/og/vendor/mysql.rb
|
122
|
-
- test/og/tc_camel_case_join.rb
|
123
|
-
- lib/og/store.rb
|
124
|
-
- lib/og/types.rb
|
125
|
-
- test/og/mixin/tc_taggable.rb
|
126
|
-
- test/og/mixin/tc_optimistic_locking.rb
|
127
|
-
- test/og/tc_sti_find.rb
|
128
|
-
- lib/og/manager.rb
|
88
|
+
- lib/og/store/sql/evolution.rb
|
89
|
+
- lib/og/store/sql/join.rb
|
90
|
+
- lib/og/store/sql/utils.rb
|
129
91
|
- lib/og/test/assertions.rb
|
130
|
-
- lib/
|
92
|
+
- lib/og/test/testcase.rb
|
93
|
+
- lib/og/vendor/mysql.rb
|
94
|
+
- lib/og/vendor/README
|
95
|
+
- test/glue
|
96
|
+
- test/og
|
97
|
+
- test/glue/tc_hierarchical.rb
|
98
|
+
- test/glue/tc_og_paginate.rb
|
99
|
+
- test/glue/tc_optimistic_locking.rb
|
100
|
+
- test/glue/tc_orderable2.rb
|
101
|
+
- test/glue/tc_orderable.rb
|
102
|
+
- test/glue/tc_revisable.rb
|
103
|
+
- test/glue/tc_taggable.rb
|
104
|
+
- test/glue/tc_timestamped.rb
|
105
|
+
- test/glue/tc_webfile.rb
|
131
106
|
- test/og/CONFIG.rb
|
132
|
-
-
|
133
|
-
- test/og/
|
107
|
+
- test/og/multi_validations_model.rb
|
108
|
+
- test/og/store
|
134
109
|
- test/og/tc_accumulator.rb
|
135
|
-
-
|
136
|
-
-
|
137
|
-
- test/og/
|
110
|
+
- test/og/tc_aggregations_calculations.rb
|
111
|
+
- test/og/tc_build.rb
|
112
|
+
- test/og/tc_cacheable.rb
|
113
|
+
- test/og/tc_camel_case_join.rb
|
114
|
+
- test/og/tc_delete_all.rb
|
138
115
|
- test/og/tc_ez.rb
|
139
|
-
-
|
140
|
-
-
|
141
|
-
-
|
116
|
+
- test/og/tc_finder.rb
|
117
|
+
- test/og/tc_has_many.rb
|
118
|
+
- test/og/tc_inheritance2.rb
|
119
|
+
- test/og/tc_inheritance.rb
|
120
|
+
- test/og/tc_join.rb
|
121
|
+
- test/og/tc_joins_many.rb
|
122
|
+
- test/og/tc_multi_validations.rb
|
123
|
+
- test/og/tc_multiple.rb
|
124
|
+
- test/og/tc_override.rb
|
125
|
+
- test/og/tc_polymorphic.rb
|
126
|
+
- test/og/tc_primary_key.rb
|
127
|
+
- test/og/tc_relation.rb
|
128
|
+
- test/og/tc_reldelete.rb
|
129
|
+
- test/og/tc_resolve.rb
|
130
|
+
- test/og/tc_reverse.rb
|
131
|
+
- test/og/tc_scoped.rb
|
132
|
+
- test/og/tc_select.rb
|
133
|
+
- test/og/tc_setup.rb
|
134
|
+
- test/og/tc_store.rb
|
135
|
+
- test/og/tc_types.rb
|
136
|
+
- test/og/tc_validation_loop.rb
|
137
|
+
- test/og/tc_validation2.rb
|
138
|
+
- test/og/tc_validation.rb
|
139
|
+
- test/og/store/tc_filesys.rb
|
140
|
+
- test/og/store/tc_kirby.rb
|
141
|
+
- test/og/store/tc_sti.rb
|
142
|
+
- test/og/store/tc_sti2.rb
|
143
|
+
- doc/CHANGELOG.1
|
144
|
+
- doc/CONTRIBUTORS
|
145
|
+
- doc/LICENSE
|
146
|
+
- doc/RELEASES
|
147
|
+
- doc/tutorial.txt
|
142
148
|
test_files: []
|
143
149
|
|
144
150
|
rdoc_options: []
|
@@ -159,5 +165,5 @@ dependencies:
|
|
159
165
|
requirements:
|
160
166
|
- - "="
|
161
167
|
- !ruby/object:Gem::Version
|
162
|
-
version: 0.
|
168
|
+
version: 0.40.0
|
163
169
|
version:
|
data/INSTALL
DELETED
@@ -1,91 +0,0 @@
|
|
1
|
-
= Instalation with RubyGems
|
2
|
-
|
3
|
-
1. Download and install RubyGems:
|
4
|
-
|
5
|
-
http://rubygems.rubyforge.org
|
6
|
-
|
7
|
-
2. Install the distribution:
|
8
|
-
|
9
|
-
gem install og
|
10
|
-
|
11
|
-
(make sure you have the latest stable versions of Ruby and RubyGems
|
12
|
-
installed)
|
13
|
-
|
14
|
-
When asked about the dependencies to include, only accept
|
15
|
-
the dependencies for the RDBMS backends you are planning
|
16
|
-
to use.
|
17
|
-
|
18
|
-
3. Set environment variable (required to load RubyGems):
|
19
|
-
|
20
|
-
export RUBYOPT=-rubygems
|
21
|
-
|
22
|
-
You can add this in you .bashrc in Unix.
|
23
|
-
|
24
|
-
Alternatively you can run your applications with the -rubygem
|
25
|
-
option:
|
26
|
-
|
27
|
-
ruby -rubygem xxx.rb
|
28
|
-
|
29
|
-
= Installation without RubyGems using script.
|
30
|
-
|
31
|
-
Installation without RubyGems is *strongly* discouraged.
|
32
|
-
However, as Og is all about freedom and possibilities,
|
33
|
-
a standard installation script is provided.
|
34
|
-
|
35
|
-
1. Switch to an administrator account
|
36
|
-
|
37
|
-
For example in Unix:
|
38
|
-
|
39
|
-
$ su -
|
40
|
-
|
41
|
-
2. Run the installation script.
|
42
|
-
|
43
|
-
$ ruby setup.rb
|
44
|
-
|
45
|
-
This installation script also installs some vendor libraries
|
46
|
-
that you possibly have allready installed. Use with caution.
|
47
|
-
|
48
|
-
Dependencies needed: See 'ProjectInfo' file located in the
|
49
|
-
current directory.
|
50
|
-
|
51
|
-
Install the desired database client libraries Libraries are not
|
52
|
-
required for Og to run. If you wish to use an adapter which
|
53
|
-
uses one of the databases, then you'll need to install the
|
54
|
-
client library
|
55
|
-
|
56
|
-
Postgres, MySQL, Kirbybase
|
57
|
-
|
58
|
-
|
59
|
-
= Manual installation.
|
60
|
-
|
61
|
-
Uncompress your distribution (Unix example):
|
62
|
-
|
63
|
-
$ cd my_dir
|
64
|
-
$ tar xvfz og-x.x.x.tar.gz
|
65
|
-
|
66
|
-
Put the libray dir in the Ruby path (Unix example):
|
67
|
-
|
68
|
-
$ export RUBYOPT='-I path/to/og/lib'
|
69
|
-
|
70
|
-
|
71
|
-
= Additional libraries
|
72
|
-
|
73
|
-
Og uses a number of additional libraries. RubyGems
|
74
|
-
installs most of them, but here is the complete
|
75
|
-
list for your reference:
|
76
|
-
|
77
|
-
* Ruby-psql
|
78
|
-
http://www.postgresql.jp/interfaces/ruby/archive/ruby-postgres-0.7.1.tar.gz
|
79
|
-
Ruby interface to the PostgreSQL RDBMS.
|
80
|
-
|
81
|
-
* Ruby-mysql
|
82
|
-
http://tmtm.org/ja/ruby/mysql/README_en.html
|
83
|
-
Ruby interface to the MySQL RDBMS.
|
84
|
-
|
85
|
-
* PostgreSQL
|
86
|
-
http://www.postgres.org
|
87
|
-
Used for the Database Backend.
|
88
|
-
|
89
|
-
* MySQL
|
90
|
-
http://www.mysql.org
|
91
|
-
Used for the Database Backend.
|