sequel 2.11.0 → 2.12.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +168 -0
- data/README.rdoc +77 -95
- data/Rakefile +100 -80
- data/bin/sequel +2 -1
- data/doc/advanced_associations.rdoc +23 -32
- data/doc/cheat_sheet.rdoc +23 -40
- data/doc/dataset_filtering.rdoc +6 -6
- data/doc/prepared_statements.rdoc +22 -22
- data/doc/release_notes/2.12.0.txt +534 -0
- data/doc/schema.rdoc +3 -1
- data/doc/sharding.rdoc +8 -8
- data/doc/virtual_rows.rdoc +65 -0
- data/lib/sequel.rb +1 -1
- data/lib/{sequel_core → sequel}/adapters/ado.rb +3 -3
- data/lib/{sequel_core → sequel}/adapters/db2.rb +0 -0
- data/lib/{sequel_core → sequel}/adapters/dbi.rb +1 -1
- data/lib/{sequel_core → sequel}/adapters/do.rb +9 -5
- data/lib/{sequel_core → sequel}/adapters/do/mysql.rb +1 -1
- data/lib/{sequel_core → sequel}/adapters/do/postgres.rb +1 -1
- data/lib/{sequel_core → sequel}/adapters/do/sqlite.rb +1 -1
- data/lib/{sequel_core → sequel}/adapters/firebird.rb +84 -80
- data/lib/{sequel_core → sequel}/adapters/informix.rb +1 -1
- data/lib/{sequel_core → sequel}/adapters/jdbc.rb +21 -14
- data/lib/{sequel_core → sequel}/adapters/jdbc/h2.rb +14 -13
- data/lib/{sequel_core → sequel}/adapters/jdbc/mysql.rb +1 -1
- data/lib/{sequel_core → sequel}/adapters/jdbc/oracle.rb +1 -1
- data/lib/{sequel_core → sequel}/adapters/jdbc/postgresql.rb +1 -1
- data/lib/{sequel_core → sequel}/adapters/jdbc/sqlite.rb +1 -1
- data/lib/{sequel_core → sequel}/adapters/mysql.rb +60 -39
- data/lib/{sequel_core → sequel}/adapters/odbc.rb +8 -4
- data/lib/{sequel_core → sequel}/adapters/openbase.rb +0 -0
- data/lib/{sequel_core → sequel}/adapters/oracle.rb +38 -7
- data/lib/{sequel_core → sequel}/adapters/postgres.rb +24 -24
- data/lib/{sequel_core → sequel}/adapters/shared/mssql.rb +5 -5
- data/lib/{sequel_core → sequel}/adapters/shared/mysql.rb +126 -71
- data/lib/{sequel_core → sequel}/adapters/shared/oracle.rb +7 -10
- data/lib/{sequel_core → sequel}/adapters/shared/postgres.rb +159 -125
- data/lib/{sequel_core → sequel}/adapters/shared/progress.rb +1 -2
- data/lib/{sequel_core → sequel}/adapters/shared/sqlite.rb +72 -67
- data/lib/{sequel_core → sequel}/adapters/sqlite.rb +11 -7
- data/lib/{sequel_core → sequel}/adapters/utils/date_format.rb +0 -0
- data/lib/{sequel_core → sequel}/adapters/utils/stored_procedures.rb +0 -0
- data/lib/{sequel_core → sequel}/adapters/utils/unsupported.rb +19 -0
- data/lib/{sequel_core → sequel}/connection_pool.rb +7 -5
- data/lib/sequel/core.rb +221 -0
- data/lib/{sequel_core → sequel}/core_sql.rb +91 -49
- data/lib/{sequel_core → sequel}/database.rb +264 -149
- data/lib/{sequel_core/schema/generator.rb → sequel/database/schema_generator.rb} +6 -2
- data/lib/{sequel_core/database/schema.rb → sequel/database/schema_methods.rb} +12 -12
- data/lib/sequel/database/schema_sql.rb +224 -0
- data/lib/{sequel_core → sequel}/dataset.rb +78 -236
- data/lib/{sequel_core → sequel}/dataset/convenience.rb +99 -61
- data/lib/{sequel_core/object_graph.rb → sequel/dataset/graph.rb} +16 -14
- data/lib/{sequel_core → sequel}/dataset/prepared_statements.rb +1 -1
- data/lib/{sequel_core → sequel}/dataset/sql.rb +150 -99
- data/lib/sequel/deprecated.rb +593 -0
- data/lib/sequel/deprecated_migration.rb +91 -0
- data/lib/sequel/exceptions.rb +48 -0
- data/lib/sequel/extensions/blank.rb +42 -0
- data/lib/{sequel_model → sequel/extensions}/inflector.rb +8 -1
- data/lib/{sequel_core → sequel/extensions}/migration.rb +1 -1
- data/lib/{sequel_core/dataset → sequel/extensions}/pagination.rb +0 -0
- data/lib/{sequel_core → sequel/extensions}/pretty_table.rb +7 -0
- data/lib/{sequel_core/dataset → sequel/extensions}/query.rb +7 -0
- data/lib/sequel/extensions/string_date_time.rb +47 -0
- data/lib/sequel/metaprogramming.rb +43 -0
- data/lib/sequel/model.rb +110 -0
- data/lib/sequel/model/associations.rb +1300 -0
- data/lib/sequel/model/base.rb +937 -0
- data/lib/sequel/model/deprecated.rb +204 -0
- data/lib/sequel/model/deprecated_hooks.rb +103 -0
- data/lib/sequel/model/deprecated_inflector.rb +335 -0
- data/lib/sequel/model/deprecated_validations.rb +388 -0
- data/lib/sequel/model/errors.rb +39 -0
- data/lib/{sequel_model → sequel/model}/exceptions.rb +4 -4
- data/lib/sequel/model/inflections.rb +208 -0
- data/lib/sequel/model/plugins.rb +76 -0
- data/lib/sequel/plugins/caching.rb +122 -0
- data/lib/sequel/plugins/hook_class_methods.rb +122 -0
- data/lib/sequel/plugins/schema.rb +53 -0
- data/lib/sequel/plugins/serialization.rb +117 -0
- data/lib/sequel/plugins/single_table_inheritance.rb +63 -0
- data/lib/sequel/plugins/validation_class_methods.rb +384 -0
- data/lib/sequel/plugins/validation_helpers.rb +150 -0
- data/lib/{sequel_core → sequel}/sql.rb +125 -190
- data/lib/{sequel_core → sequel}/version.rb +2 -1
- data/lib/sequel_core.rb +1 -172
- data/lib/sequel_model.rb +1 -91
- data/spec/adapters/firebird_spec.rb +5 -5
- data/spec/adapters/informix_spec.rb +1 -1
- data/spec/adapters/mysql_spec.rb +128 -42
- data/spec/adapters/oracle_spec.rb +47 -19
- data/spec/adapters/postgres_spec.rb +64 -52
- data/spec/adapters/spec_helper.rb +1 -1
- data/spec/adapters/sqlite_spec.rb +12 -17
- data/spec/{sequel_core → core}/connection_pool_spec.rb +10 -10
- data/spec/{sequel_core → core}/core_ext_spec.rb +19 -19
- data/spec/{sequel_core → core}/core_sql_spec.rb +68 -71
- data/spec/{sequel_core → core}/database_spec.rb +135 -99
- data/spec/{sequel_core → core}/dataset_spec.rb +398 -242
- data/spec/{sequel_core → core}/expression_filters_spec.rb +13 -13
- data/spec/core/migration_spec.rb +263 -0
- data/spec/{sequel_core → core}/object_graph_spec.rb +10 -10
- data/spec/{sequel_core → core}/pretty_table_spec.rb +2 -2
- data/spec/{sequel_core → core}/schema_generator_spec.rb +0 -0
- data/spec/{sequel_core → core}/schema_spec.rb +8 -10
- data/spec/{sequel_core → core}/spec_helper.rb +29 -2
- data/spec/{sequel_core → core}/version_spec.rb +0 -0
- data/spec/extensions/blank_spec.rb +67 -0
- data/spec/extensions/caching_spec.rb +201 -0
- data/spec/{sequel_model/hooks_spec.rb → extensions/hook_class_methods_spec.rb} +8 -23
- data/spec/{sequel_model → extensions}/inflector_spec.rb +3 -0
- data/spec/{sequel_core → extensions}/migration_spec.rb +4 -4
- data/spec/extensions/pagination_spec.rb +99 -0
- data/spec/extensions/pretty_table_spec.rb +91 -0
- data/spec/extensions/query_spec.rb +85 -0
- data/spec/{sequel_model → extensions}/schema_spec.rb +22 -1
- data/spec/extensions/serialization_spec.rb +109 -0
- data/spec/extensions/single_table_inheritance_spec.rb +53 -0
- data/spec/{sequel_model → extensions}/spec_helper.rb +13 -4
- data/spec/extensions/string_date_time_spec.rb +93 -0
- data/spec/{sequel_model/validations_spec.rb → extensions/validation_class_methods_spec.rb} +15 -103
- data/spec/extensions/validation_helpers_spec.rb +291 -0
- data/spec/integration/dataset_test.rb +31 -0
- data/spec/integration/eager_loader_test.rb +17 -30
- data/spec/integration/schema_test.rb +8 -5
- data/spec/integration/spec_helper.rb +17 -0
- data/spec/integration/transaction_test.rb +68 -0
- data/spec/{sequel_model → model}/association_reflection_spec.rb +0 -0
- data/spec/{sequel_model → model}/associations_spec.rb +23 -10
- data/spec/{sequel_model → model}/base_spec.rb +29 -20
- data/spec/{sequel_model → model}/caching_spec.rb +16 -14
- data/spec/{sequel_model → model}/dataset_methods_spec.rb +0 -0
- data/spec/{sequel_model → model}/eager_loading_spec.rb +8 -8
- data/spec/model/hooks_spec.rb +472 -0
- data/spec/model/inflector_spec.rb +126 -0
- data/spec/{sequel_model → model}/model_spec.rb +25 -20
- data/spec/model/plugins_spec.rb +142 -0
- data/spec/{sequel_model → model}/record_spec.rb +121 -62
- data/spec/model/schema_spec.rb +92 -0
- data/spec/model/spec_helper.rb +124 -0
- data/spec/model/validations_spec.rb +1080 -0
- metadata +136 -107
- data/lib/sequel_core/core_ext.rb +0 -217
- data/lib/sequel_core/dataset/callback.rb +0 -13
- data/lib/sequel_core/dataset/schema.rb +0 -15
- data/lib/sequel_core/deprecated.rb +0 -26
- data/lib/sequel_core/exceptions.rb +0 -44
- data/lib/sequel_core/schema.rb +0 -2
- data/lib/sequel_core/schema/sql.rb +0 -325
- data/lib/sequel_model/association_reflection.rb +0 -267
- data/lib/sequel_model/associations.rb +0 -499
- data/lib/sequel_model/base.rb +0 -539
- data/lib/sequel_model/caching.rb +0 -82
- data/lib/sequel_model/dataset_methods.rb +0 -26
- data/lib/sequel_model/eager_loading.rb +0 -370
- data/lib/sequel_model/hooks.rb +0 -101
- data/lib/sequel_model/plugins.rb +0 -62
- data/lib/sequel_model/record.rb +0 -568
- data/lib/sequel_model/schema.rb +0 -49
- data/lib/sequel_model/validations.rb +0 -429
- data/spec/sequel_model/plugins_spec.rb +0 -80
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sequel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Evans
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-03
|
12
|
+
date: 2009-04-03 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -29,6 +29,7 @@ extra_rdoc_files:
|
|
29
29
|
- doc/prepared_statements.rdoc
|
30
30
|
- doc/schema.rdoc
|
31
31
|
- doc/sharding.rdoc
|
32
|
+
- doc/virtual_rows.rdoc
|
32
33
|
- doc/release_notes/2.10.0.txt
|
33
34
|
- doc/release_notes/2.9.0.txt
|
34
35
|
- doc/release_notes/2.8.0.txt
|
@@ -46,6 +47,7 @@ extra_rdoc_files:
|
|
46
47
|
- doc/release_notes/1.3.txt
|
47
48
|
- doc/release_notes/1.0.txt
|
48
49
|
- doc/release_notes/2.11.0.txt
|
50
|
+
- doc/release_notes/2.12.0.txt
|
49
51
|
files:
|
50
52
|
- COPYING
|
51
53
|
- CHANGELOG
|
@@ -76,6 +78,8 @@ files:
|
|
76
78
|
- doc/release_notes/1.3.txt
|
77
79
|
- doc/release_notes/1.0.txt
|
78
80
|
- doc/release_notes/2.11.0.txt
|
81
|
+
- doc/release_notes/2.12.0.txt
|
82
|
+
- doc/virtual_rows.rdoc
|
79
83
|
- spec/adapters
|
80
84
|
- spec/adapters/ado_spec.rb
|
81
85
|
- spec/adapters/informix_spec.rb
|
@@ -92,118 +96,143 @@ files:
|
|
92
96
|
- spec/integration/schema_test.rb
|
93
97
|
- spec/integration/spec_helper.rb
|
94
98
|
- spec/integration/type_test.rb
|
99
|
+
- spec/integration/transaction_test.rb
|
95
100
|
- spec/rcov.opts
|
96
|
-
- spec/
|
97
|
-
- spec/
|
98
|
-
- spec/
|
99
|
-
- spec/
|
100
|
-
- spec/
|
101
|
-
- spec/
|
102
|
-
- spec/
|
103
|
-
- spec/
|
104
|
-
- spec/
|
105
|
-
- spec/
|
106
|
-
- spec/
|
107
|
-
- spec/
|
108
|
-
- spec/
|
109
|
-
- spec/
|
110
|
-
- spec/
|
111
|
-
- spec/
|
112
|
-
- spec/
|
113
|
-
- spec/
|
114
|
-
- spec/
|
115
|
-
- spec/
|
116
|
-
- spec/
|
117
|
-
- spec/
|
118
|
-
- spec/
|
119
|
-
- spec/
|
120
|
-
- spec/
|
121
|
-
- spec/
|
122
|
-
- spec/
|
123
|
-
- spec/
|
124
|
-
- spec/
|
101
|
+
- spec/core
|
102
|
+
- spec/core/connection_pool_spec.rb
|
103
|
+
- spec/core/core_ext_spec.rb
|
104
|
+
- spec/core/core_sql_spec.rb
|
105
|
+
- spec/core/database_spec.rb
|
106
|
+
- spec/core/dataset_spec.rb
|
107
|
+
- spec/core/expression_filters_spec.rb
|
108
|
+
- spec/core/migration_spec.rb
|
109
|
+
- spec/core/object_graph_spec.rb
|
110
|
+
- spec/core/pretty_table_spec.rb
|
111
|
+
- spec/core/schema_generator_spec.rb
|
112
|
+
- spec/core/schema_spec.rb
|
113
|
+
- spec/core/spec_helper.rb
|
114
|
+
- spec/core/version_spec.rb
|
115
|
+
- spec/model
|
116
|
+
- spec/model/association_reflection_spec.rb
|
117
|
+
- spec/model/associations_spec.rb
|
118
|
+
- spec/model/base_spec.rb
|
119
|
+
- spec/model/caching_spec.rb
|
120
|
+
- spec/model/dataset_methods_spec.rb
|
121
|
+
- spec/model/eager_loading_spec.rb
|
122
|
+
- spec/model/hooks_spec.rb
|
123
|
+
- spec/model/inflector_spec.rb
|
124
|
+
- spec/model/model_spec.rb
|
125
|
+
- spec/model/plugins_spec.rb
|
126
|
+
- spec/model/record_spec.rb
|
127
|
+
- spec/model/schema_spec.rb
|
128
|
+
- spec/model/spec_helper.rb
|
129
|
+
- spec/model/validations_spec.rb
|
125
130
|
- spec/spec.opts
|
126
131
|
- spec/spec_config.rb.example
|
127
132
|
- spec/spec_config.rb
|
133
|
+
- spec/extensions
|
134
|
+
- spec/extensions/spec_helper.rb
|
135
|
+
- spec/extensions/caching_spec.rb
|
136
|
+
- spec/extensions/schema_spec.rb
|
137
|
+
- spec/extensions/inflector_spec.rb
|
138
|
+
- spec/extensions/hook_class_methods_spec.rb
|
139
|
+
- spec/extensions/string_date_time_spec.rb
|
140
|
+
- spec/extensions/single_table_inheritance_spec.rb
|
141
|
+
- spec/extensions/validation_class_methods_spec.rb
|
142
|
+
- spec/extensions/query_spec.rb
|
143
|
+
- spec/extensions/pagination_spec.rb
|
144
|
+
- spec/extensions/pretty_table_spec.rb
|
145
|
+
- spec/extensions/blank_spec.rb
|
146
|
+
- spec/extensions/migration_spec.rb
|
147
|
+
- spec/extensions/serialization_spec.rb
|
148
|
+
- spec/extensions/validation_helpers_spec.rb
|
128
149
|
- lib/sequel.rb
|
129
150
|
- lib/sequel_core.rb
|
130
|
-
- lib/sequel_core
|
131
|
-
- lib/sequel_core/adapters
|
132
|
-
- lib/sequel_core/adapters/ado.rb
|
133
|
-
- lib/sequel_core/adapters/db2.rb
|
134
|
-
- lib/sequel_core/adapters/dbi.rb
|
135
|
-
- lib/sequel_core/adapters/informix.rb
|
136
|
-
- lib/sequel_core/adapters/jdbc.rb
|
137
|
-
- lib/sequel_core/adapters/jdbc
|
138
|
-
- lib/sequel_core/adapters/jdbc/mysql.rb
|
139
|
-
- lib/sequel_core/adapters/jdbc/oracle.rb
|
140
|
-
- lib/sequel_core/adapters/jdbc/postgresql.rb
|
141
|
-
- lib/sequel_core/adapters/jdbc/sqlite.rb
|
142
|
-
- lib/sequel_core/adapters/jdbc/h2.rb
|
143
|
-
- lib/sequel_core/adapters/mysql.rb
|
144
|
-
- lib/sequel_core/adapters/odbc.rb
|
145
|
-
- lib/sequel_core/adapters/openbase.rb
|
146
|
-
- lib/sequel_core/adapters/oracle.rb
|
147
|
-
- lib/sequel_core/adapters/postgres.rb
|
148
|
-
- lib/sequel_core/adapters/shared
|
149
|
-
- lib/sequel_core/adapters/shared/mssql.rb
|
150
|
-
- lib/sequel_core/adapters/shared/mysql.rb
|
151
|
-
- lib/sequel_core/adapters/shared/oracle.rb
|
152
|
-
- lib/sequel_core/adapters/shared/postgres.rb
|
153
|
-
- lib/sequel_core/adapters/shared/sqlite.rb
|
154
|
-
- lib/sequel_core/adapters/shared/progress.rb
|
155
|
-
- lib/sequel_core/adapters/sqlite.rb
|
156
|
-
- lib/sequel_core/adapters/do.rb
|
157
|
-
- lib/sequel_core/adapters/do
|
158
|
-
- lib/sequel_core/adapters/do/mysql.rb
|
159
|
-
- lib/sequel_core/adapters/do/postgres.rb
|
160
|
-
- lib/sequel_core/adapters/do/sqlite.rb
|
161
|
-
- lib/sequel_core/adapters/firebird.rb
|
162
|
-
- lib/sequel_core/adapters/utils
|
163
|
-
- lib/sequel_core/adapters/utils/date_format.rb
|
164
|
-
- lib/sequel_core/adapters/utils/stored_procedures.rb
|
165
|
-
- lib/sequel_core/adapters/utils/unsupported.rb
|
166
|
-
- lib/sequel_core/connection_pool.rb
|
167
|
-
- lib/sequel_core/core_ext.rb
|
168
|
-
- lib/sequel_core/core_sql.rb
|
169
|
-
- lib/sequel_core/database.rb
|
170
|
-
- lib/sequel_core/database
|
171
|
-
- lib/sequel_core/database/schema.rb
|
172
|
-
- lib/sequel_core/dataset.rb
|
173
|
-
- lib/sequel_core/dataset
|
174
|
-
- lib/sequel_core/dataset/callback.rb
|
175
|
-
- lib/sequel_core/dataset/convenience.rb
|
176
|
-
- lib/sequel_core/dataset/pagination.rb
|
177
|
-
- lib/sequel_core/dataset/prepared_statements.rb
|
178
|
-
- lib/sequel_core/dataset/query.rb
|
179
|
-
- lib/sequel_core/dataset/schema.rb
|
180
|
-
- lib/sequel_core/dataset/sql.rb
|
181
|
-
- lib/sequel_core/deprecated.rb
|
182
|
-
- lib/sequel_core/exceptions.rb
|
183
|
-
- lib/sequel_core/migration.rb
|
184
|
-
- lib/sequel_core/object_graph.rb
|
185
|
-
- lib/sequel_core/pretty_table.rb
|
186
|
-
- lib/sequel_core/schema.rb
|
187
|
-
- lib/sequel_core/schema
|
188
|
-
- lib/sequel_core/schema/generator.rb
|
189
|
-
- lib/sequel_core/schema/sql.rb
|
190
|
-
- lib/sequel_core/sql.rb
|
191
|
-
- lib/sequel_core/version.rb
|
192
151
|
- lib/sequel_model.rb
|
193
|
-
- lib/
|
194
|
-
- lib/
|
195
|
-
- lib/
|
196
|
-
- lib/
|
197
|
-
- lib/
|
198
|
-
- lib/
|
199
|
-
- lib/
|
200
|
-
- lib/
|
201
|
-
- lib/
|
202
|
-
- lib/
|
203
|
-
- lib/
|
204
|
-
- lib/
|
205
|
-
- lib/
|
206
|
-
- lib/
|
152
|
+
- lib/sequel
|
153
|
+
- lib/sequel/plugins
|
154
|
+
- lib/sequel/plugins/hook_class_methods.rb
|
155
|
+
- lib/sequel/plugins/single_table_inheritance.rb
|
156
|
+
- lib/sequel/plugins/caching.rb
|
157
|
+
- lib/sequel/plugins/schema.rb
|
158
|
+
- lib/sequel/plugins/validation_class_methods.rb
|
159
|
+
- lib/sequel/plugins/serialization.rb
|
160
|
+
- lib/sequel/plugins/validation_helpers.rb
|
161
|
+
- lib/sequel/extensions
|
162
|
+
- lib/sequel/extensions/string_date_time.rb
|
163
|
+
- lib/sequel/extensions/inflector.rb
|
164
|
+
- lib/sequel/extensions/pagination.rb
|
165
|
+
- lib/sequel/extensions/query.rb
|
166
|
+
- lib/sequel/extensions/pretty_table.rb
|
167
|
+
- lib/sequel/extensions/blank.rb
|
168
|
+
- lib/sequel/extensions/migration.rb
|
169
|
+
- lib/sequel/adapters
|
170
|
+
- lib/sequel/adapters/ado.rb
|
171
|
+
- lib/sequel/adapters/db2.rb
|
172
|
+
- lib/sequel/adapters/dbi.rb
|
173
|
+
- lib/sequel/adapters/do.rb
|
174
|
+
- lib/sequel/adapters/do
|
175
|
+
- lib/sequel/adapters/do/mysql.rb
|
176
|
+
- lib/sequel/adapters/do/postgres.rb
|
177
|
+
- lib/sequel/adapters/do/sqlite.rb
|
178
|
+
- lib/sequel/adapters/firebird.rb
|
179
|
+
- lib/sequel/adapters/informix.rb
|
180
|
+
- lib/sequel/adapters/jdbc.rb
|
181
|
+
- lib/sequel/adapters/jdbc
|
182
|
+
- lib/sequel/adapters/jdbc/h2.rb
|
183
|
+
- lib/sequel/adapters/jdbc/mysql.rb
|
184
|
+
- lib/sequel/adapters/jdbc/oracle.rb
|
185
|
+
- lib/sequel/adapters/jdbc/postgresql.rb
|
186
|
+
- lib/sequel/adapters/jdbc/sqlite.rb
|
187
|
+
- lib/sequel/adapters/mysql.rb
|
188
|
+
- lib/sequel/adapters/odbc.rb
|
189
|
+
- lib/sequel/adapters/openbase.rb
|
190
|
+
- lib/sequel/adapters/oracle.rb
|
191
|
+
- lib/sequel/adapters/postgres.rb
|
192
|
+
- lib/sequel/adapters/shared
|
193
|
+
- lib/sequel/adapters/shared/mssql.rb
|
194
|
+
- lib/sequel/adapters/shared/mysql.rb
|
195
|
+
- lib/sequel/adapters/shared/oracle.rb
|
196
|
+
- lib/sequel/adapters/shared/postgres.rb
|
197
|
+
- lib/sequel/adapters/shared/progress.rb
|
198
|
+
- lib/sequel/adapters/shared/sqlite.rb
|
199
|
+
- lib/sequel/adapters/sqlite.rb
|
200
|
+
- lib/sequel/adapters/utils
|
201
|
+
- lib/sequel/adapters/utils/date_format.rb
|
202
|
+
- lib/sequel/adapters/utils/stored_procedures.rb
|
203
|
+
- lib/sequel/adapters/utils/unsupported.rb
|
204
|
+
- lib/sequel/connection_pool.rb
|
205
|
+
- lib/sequel/core.rb
|
206
|
+
- lib/sequel/core_sql.rb
|
207
|
+
- lib/sequel/database.rb
|
208
|
+
- lib/sequel/database
|
209
|
+
- lib/sequel/database/schema_generator.rb
|
210
|
+
- lib/sequel/database/schema_methods.rb
|
211
|
+
- lib/sequel/database/schema_sql.rb
|
212
|
+
- lib/sequel/dataset.rb
|
213
|
+
- lib/sequel/dataset
|
214
|
+
- lib/sequel/dataset/convenience.rb
|
215
|
+
- lib/sequel/dataset/prepared_statements.rb
|
216
|
+
- lib/sequel/dataset/sql.rb
|
217
|
+
- lib/sequel/dataset/graph.rb
|
218
|
+
- lib/sequel/deprecated.rb
|
219
|
+
- lib/sequel/exceptions.rb
|
220
|
+
- lib/sequel/metaprogramming.rb
|
221
|
+
- lib/sequel/model.rb
|
222
|
+
- lib/sequel/model
|
223
|
+
- lib/sequel/model/associations.rb
|
224
|
+
- lib/sequel/model/base.rb
|
225
|
+
- lib/sequel/model/deprecated.rb
|
226
|
+
- lib/sequel/model/deprecated_hooks.rb
|
227
|
+
- lib/sequel/model/deprecated_inflector.rb
|
228
|
+
- lib/sequel/model/deprecated_validations.rb
|
229
|
+
- lib/sequel/model/errors.rb
|
230
|
+
- lib/sequel/model/exceptions.rb
|
231
|
+
- lib/sequel/model/inflections.rb
|
232
|
+
- lib/sequel/model/plugins.rb
|
233
|
+
- lib/sequel/sql.rb
|
234
|
+
- lib/sequel/version.rb
|
235
|
+
- lib/sequel/deprecated_migration.rb
|
207
236
|
has_rdoc: true
|
208
237
|
homepage: http://sequel.rubyforge.org
|
209
238
|
post_install_message:
|
data/lib/sequel_core/core_ext.rb
DELETED
@@ -1,217 +0,0 @@
|
|
1
|
-
if RUBY_VERSION < '1.9.0'
|
2
|
-
class Hash
|
3
|
-
alias key index
|
4
|
-
end
|
5
|
-
end
|
6
|
-
|
7
|
-
class Array
|
8
|
-
# True if the array is not empty and all of its elements are
|
9
|
-
# arrays of size 2. This is used to determine if the array
|
10
|
-
# could be a specifier of conditions, used similarly to a hash
|
11
|
-
# but allowing for duplicate keys.
|
12
|
-
#
|
13
|
-
# hash.to_a.all_two_pairs? # => true unless hash is empty
|
14
|
-
def all_two_pairs?
|
15
|
-
!empty? && all?{|i| (Array === i) && (i.length == 2)}
|
16
|
-
end
|
17
|
-
|
18
|
-
# Removes and returns the last member of the array if it is a hash. Otherwise,
|
19
|
-
# an empty hash is returned This method is useful when writing methods that
|
20
|
-
# take an options hash as the last parameter. For example:
|
21
|
-
#
|
22
|
-
# def validate_each(*args, &block)
|
23
|
-
# opts = args.extract_options!
|
24
|
-
# ...
|
25
|
-
# end
|
26
|
-
def extract_options!
|
27
|
-
last.is_a?(Hash) ? pop : {}
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
module Enumerable
|
32
|
-
# Invokes the specified method for each item, along with the supplied
|
33
|
-
# arguments.
|
34
|
-
def send_each(sym, *args)
|
35
|
-
each{|i| i.send(sym, *args)}
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
class FalseClass
|
40
|
-
# false is always blank
|
41
|
-
def blank?
|
42
|
-
true
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
# Add some metaprogramming methods to avoid class << self
|
47
|
-
class Module
|
48
|
-
# Defines an instance method within a class/module
|
49
|
-
def class_def(name, &block)
|
50
|
-
class_eval{define_method(name, &block)}
|
51
|
-
end
|
52
|
-
|
53
|
-
private
|
54
|
-
|
55
|
-
# Define instance method(s) that calls class method(s) of the
|
56
|
-
# same name, caching the result in an instance variable. Define
|
57
|
-
# standard attr_writer method for modifying that instance variable
|
58
|
-
def class_attr_overridable(*meths)
|
59
|
-
meths.each{|meth| class_eval("def #{meth}; !defined?(@#{meth}) ? (@#{meth} = self.class.#{meth}) : @#{meth} end")}
|
60
|
-
attr_writer(*meths)
|
61
|
-
public(*meths)
|
62
|
-
public(*meths.collect{|m|"#{m}="})
|
63
|
-
end
|
64
|
-
|
65
|
-
# Define instance method(s) that calls class method(s) of the
|
66
|
-
# same name. Replaces the construct:
|
67
|
-
#
|
68
|
-
# define_method(meth){self.class.send(meth)}
|
69
|
-
def class_attr_reader(*meths)
|
70
|
-
meths.each{|meth| define_method(meth){self.class.send(meth)}}
|
71
|
-
end
|
72
|
-
|
73
|
-
# Create an alias for a singleton/class method.
|
74
|
-
# Replaces the construct:
|
75
|
-
#
|
76
|
-
# class << self
|
77
|
-
# alias_method to, from
|
78
|
-
# end
|
79
|
-
def metaalias(to, from)
|
80
|
-
meta_eval{alias_method to, from}
|
81
|
-
end
|
82
|
-
|
83
|
-
# Make a singleton/class attribute accessor method(s).
|
84
|
-
# Replaces the construct:
|
85
|
-
#
|
86
|
-
# class << self
|
87
|
-
# attr_accessor *meths
|
88
|
-
# end
|
89
|
-
def metaattr_accessor(*meths)
|
90
|
-
meta_eval{attr_accessor(*meths)}
|
91
|
-
end
|
92
|
-
|
93
|
-
# Make a singleton/class method(s) private.
|
94
|
-
# Make a singleton/class attribute reader method(s).
|
95
|
-
# Replaces the construct:
|
96
|
-
#
|
97
|
-
# class << self
|
98
|
-
# attr_reader *meths
|
99
|
-
# end
|
100
|
-
def metaattr_reader(*meths)
|
101
|
-
meta_eval{attr_reader(*meths)}
|
102
|
-
end
|
103
|
-
end
|
104
|
-
|
105
|
-
# Helpers from Metaid and a bit more
|
106
|
-
class Object
|
107
|
-
# Objects are blank if they respond true to empty?
|
108
|
-
def blank?
|
109
|
-
respond_to?(:empty?) && empty?
|
110
|
-
end
|
111
|
-
|
112
|
-
# Returns true if the object is an instance of one of the classes
|
113
|
-
def is_one_of?(*classes)
|
114
|
-
!!classes.find{|c| is_a?(c)}
|
115
|
-
end
|
116
|
-
|
117
|
-
# Add methods to the object's metaclass
|
118
|
-
def meta_def(name, &block)
|
119
|
-
meta_eval{define_method(name, &block)}
|
120
|
-
end
|
121
|
-
|
122
|
-
# Evaluate the block in the context of the object's metaclass
|
123
|
-
def meta_eval(&block)
|
124
|
-
metaclass.instance_eval(&block)
|
125
|
-
end
|
126
|
-
|
127
|
-
# The hidden singleton lurks behind everyone
|
128
|
-
def metaclass
|
129
|
-
class << self
|
130
|
-
self
|
131
|
-
end
|
132
|
-
end
|
133
|
-
end
|
134
|
-
|
135
|
-
class NilClass
|
136
|
-
# nil is always blank
|
137
|
-
def blank?
|
138
|
-
true
|
139
|
-
end
|
140
|
-
end
|
141
|
-
|
142
|
-
class Numeric
|
143
|
-
# Numerics are never blank (not even 0)
|
144
|
-
def blank?
|
145
|
-
false
|
146
|
-
end
|
147
|
-
end
|
148
|
-
|
149
|
-
class Range
|
150
|
-
# Returns the interval between the beginning and end of the range.
|
151
|
-
#
|
152
|
-
# For exclusive ranges, is one less than the inclusive range:
|
153
|
-
#
|
154
|
-
# (0..10).interval # => 10
|
155
|
-
# (0...10).interval # => 9
|
156
|
-
#
|
157
|
-
# Only works for numeric ranges, for other ranges the result is undefined,
|
158
|
-
# and the method may raise an error.
|
159
|
-
def interval
|
160
|
-
last - first - (exclude_end? ? 1 : 0)
|
161
|
-
end
|
162
|
-
end
|
163
|
-
|
164
|
-
class String
|
165
|
-
# Strings are blank if they are empty or include only whitespace
|
166
|
-
def blank?
|
167
|
-
strip.empty?
|
168
|
-
end
|
169
|
-
|
170
|
-
# Converts a string into a Date object.
|
171
|
-
def to_date
|
172
|
-
begin
|
173
|
-
Date.parse(self, Sequel.convert_two_digit_years)
|
174
|
-
rescue => e
|
175
|
-
raise Sequel::Error::InvalidValue, "Invalid Date value '#{self}' (#{e.message})"
|
176
|
-
end
|
177
|
-
end
|
178
|
-
|
179
|
-
# Converts a string into a DateTime object.
|
180
|
-
def to_datetime
|
181
|
-
begin
|
182
|
-
DateTime.parse(self, Sequel.convert_two_digit_years)
|
183
|
-
rescue => e
|
184
|
-
raise Sequel::Error::InvalidValue, "Invalid DateTime value '#{self}' (#{e.message})"
|
185
|
-
end
|
186
|
-
end
|
187
|
-
|
188
|
-
# Converts a string into a Time or DateTime object, depending on the
|
189
|
-
# value of Sequel.datetime_class
|
190
|
-
def to_sequel_time
|
191
|
-
begin
|
192
|
-
if Sequel.datetime_class == DateTime
|
193
|
-
DateTime.parse(self, Sequel.convert_two_digit_years)
|
194
|
-
else
|
195
|
-
Sequel.datetime_class.parse(self)
|
196
|
-
end
|
197
|
-
rescue => e
|
198
|
-
raise Sequel::Error::InvalidValue, "Invalid #{Sequel.datetime_class} value '#{self}' (#{e.message})"
|
199
|
-
end
|
200
|
-
end
|
201
|
-
|
202
|
-
# Converts a string into a Time object.
|
203
|
-
def to_time
|
204
|
-
begin
|
205
|
-
Time.parse(self)
|
206
|
-
rescue => e
|
207
|
-
raise Sequel::Error::InvalidValue, "Invalid Time value '#{self}' (#{e.message})"
|
208
|
-
end
|
209
|
-
end
|
210
|
-
end
|
211
|
-
|
212
|
-
class TrueClass
|
213
|
-
# true is never blank
|
214
|
-
def blank?
|
215
|
-
false
|
216
|
-
end
|
217
|
-
end
|