sequel 2.11.0 → 2.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (162) hide show
  1. data/CHANGELOG +168 -0
  2. data/README.rdoc +77 -95
  3. data/Rakefile +100 -80
  4. data/bin/sequel +2 -1
  5. data/doc/advanced_associations.rdoc +23 -32
  6. data/doc/cheat_sheet.rdoc +23 -40
  7. data/doc/dataset_filtering.rdoc +6 -6
  8. data/doc/prepared_statements.rdoc +22 -22
  9. data/doc/release_notes/2.12.0.txt +534 -0
  10. data/doc/schema.rdoc +3 -1
  11. data/doc/sharding.rdoc +8 -8
  12. data/doc/virtual_rows.rdoc +65 -0
  13. data/lib/sequel.rb +1 -1
  14. data/lib/{sequel_core → sequel}/adapters/ado.rb +3 -3
  15. data/lib/{sequel_core → sequel}/adapters/db2.rb +0 -0
  16. data/lib/{sequel_core → sequel}/adapters/dbi.rb +1 -1
  17. data/lib/{sequel_core → sequel}/adapters/do.rb +9 -5
  18. data/lib/{sequel_core → sequel}/adapters/do/mysql.rb +1 -1
  19. data/lib/{sequel_core → sequel}/adapters/do/postgres.rb +1 -1
  20. data/lib/{sequel_core → sequel}/adapters/do/sqlite.rb +1 -1
  21. data/lib/{sequel_core → sequel}/adapters/firebird.rb +84 -80
  22. data/lib/{sequel_core → sequel}/adapters/informix.rb +1 -1
  23. data/lib/{sequel_core → sequel}/adapters/jdbc.rb +21 -14
  24. data/lib/{sequel_core → sequel}/adapters/jdbc/h2.rb +14 -13
  25. data/lib/{sequel_core → sequel}/adapters/jdbc/mysql.rb +1 -1
  26. data/lib/{sequel_core → sequel}/adapters/jdbc/oracle.rb +1 -1
  27. data/lib/{sequel_core → sequel}/adapters/jdbc/postgresql.rb +1 -1
  28. data/lib/{sequel_core → sequel}/adapters/jdbc/sqlite.rb +1 -1
  29. data/lib/{sequel_core → sequel}/adapters/mysql.rb +60 -39
  30. data/lib/{sequel_core → sequel}/adapters/odbc.rb +8 -4
  31. data/lib/{sequel_core → sequel}/adapters/openbase.rb +0 -0
  32. data/lib/{sequel_core → sequel}/adapters/oracle.rb +38 -7
  33. data/lib/{sequel_core → sequel}/adapters/postgres.rb +24 -24
  34. data/lib/{sequel_core → sequel}/adapters/shared/mssql.rb +5 -5
  35. data/lib/{sequel_core → sequel}/adapters/shared/mysql.rb +126 -71
  36. data/lib/{sequel_core → sequel}/adapters/shared/oracle.rb +7 -10
  37. data/lib/{sequel_core → sequel}/adapters/shared/postgres.rb +159 -125
  38. data/lib/{sequel_core → sequel}/adapters/shared/progress.rb +1 -2
  39. data/lib/{sequel_core → sequel}/adapters/shared/sqlite.rb +72 -67
  40. data/lib/{sequel_core → sequel}/adapters/sqlite.rb +11 -7
  41. data/lib/{sequel_core → sequel}/adapters/utils/date_format.rb +0 -0
  42. data/lib/{sequel_core → sequel}/adapters/utils/stored_procedures.rb +0 -0
  43. data/lib/{sequel_core → sequel}/adapters/utils/unsupported.rb +19 -0
  44. data/lib/{sequel_core → sequel}/connection_pool.rb +7 -5
  45. data/lib/sequel/core.rb +221 -0
  46. data/lib/{sequel_core → sequel}/core_sql.rb +91 -49
  47. data/lib/{sequel_core → sequel}/database.rb +264 -149
  48. data/lib/{sequel_core/schema/generator.rb → sequel/database/schema_generator.rb} +6 -2
  49. data/lib/{sequel_core/database/schema.rb → sequel/database/schema_methods.rb} +12 -12
  50. data/lib/sequel/database/schema_sql.rb +224 -0
  51. data/lib/{sequel_core → sequel}/dataset.rb +78 -236
  52. data/lib/{sequel_core → sequel}/dataset/convenience.rb +99 -61
  53. data/lib/{sequel_core/object_graph.rb → sequel/dataset/graph.rb} +16 -14
  54. data/lib/{sequel_core → sequel}/dataset/prepared_statements.rb +1 -1
  55. data/lib/{sequel_core → sequel}/dataset/sql.rb +150 -99
  56. data/lib/sequel/deprecated.rb +593 -0
  57. data/lib/sequel/deprecated_migration.rb +91 -0
  58. data/lib/sequel/exceptions.rb +48 -0
  59. data/lib/sequel/extensions/blank.rb +42 -0
  60. data/lib/{sequel_model → sequel/extensions}/inflector.rb +8 -1
  61. data/lib/{sequel_core → sequel/extensions}/migration.rb +1 -1
  62. data/lib/{sequel_core/dataset → sequel/extensions}/pagination.rb +0 -0
  63. data/lib/{sequel_core → sequel/extensions}/pretty_table.rb +7 -0
  64. data/lib/{sequel_core/dataset → sequel/extensions}/query.rb +7 -0
  65. data/lib/sequel/extensions/string_date_time.rb +47 -0
  66. data/lib/sequel/metaprogramming.rb +43 -0
  67. data/lib/sequel/model.rb +110 -0
  68. data/lib/sequel/model/associations.rb +1300 -0
  69. data/lib/sequel/model/base.rb +937 -0
  70. data/lib/sequel/model/deprecated.rb +204 -0
  71. data/lib/sequel/model/deprecated_hooks.rb +103 -0
  72. data/lib/sequel/model/deprecated_inflector.rb +335 -0
  73. data/lib/sequel/model/deprecated_validations.rb +388 -0
  74. data/lib/sequel/model/errors.rb +39 -0
  75. data/lib/{sequel_model → sequel/model}/exceptions.rb +4 -4
  76. data/lib/sequel/model/inflections.rb +208 -0
  77. data/lib/sequel/model/plugins.rb +76 -0
  78. data/lib/sequel/plugins/caching.rb +122 -0
  79. data/lib/sequel/plugins/hook_class_methods.rb +122 -0
  80. data/lib/sequel/plugins/schema.rb +53 -0
  81. data/lib/sequel/plugins/serialization.rb +117 -0
  82. data/lib/sequel/plugins/single_table_inheritance.rb +63 -0
  83. data/lib/sequel/plugins/validation_class_methods.rb +384 -0
  84. data/lib/sequel/plugins/validation_helpers.rb +150 -0
  85. data/lib/{sequel_core → sequel}/sql.rb +125 -190
  86. data/lib/{sequel_core → sequel}/version.rb +2 -1
  87. data/lib/sequel_core.rb +1 -172
  88. data/lib/sequel_model.rb +1 -91
  89. data/spec/adapters/firebird_spec.rb +5 -5
  90. data/spec/adapters/informix_spec.rb +1 -1
  91. data/spec/adapters/mysql_spec.rb +128 -42
  92. data/spec/adapters/oracle_spec.rb +47 -19
  93. data/spec/adapters/postgres_spec.rb +64 -52
  94. data/spec/adapters/spec_helper.rb +1 -1
  95. data/spec/adapters/sqlite_spec.rb +12 -17
  96. data/spec/{sequel_core → core}/connection_pool_spec.rb +10 -10
  97. data/spec/{sequel_core → core}/core_ext_spec.rb +19 -19
  98. data/spec/{sequel_core → core}/core_sql_spec.rb +68 -71
  99. data/spec/{sequel_core → core}/database_spec.rb +135 -99
  100. data/spec/{sequel_core → core}/dataset_spec.rb +398 -242
  101. data/spec/{sequel_core → core}/expression_filters_spec.rb +13 -13
  102. data/spec/core/migration_spec.rb +263 -0
  103. data/spec/{sequel_core → core}/object_graph_spec.rb +10 -10
  104. data/spec/{sequel_core → core}/pretty_table_spec.rb +2 -2
  105. data/spec/{sequel_core → core}/schema_generator_spec.rb +0 -0
  106. data/spec/{sequel_core → core}/schema_spec.rb +8 -10
  107. data/spec/{sequel_core → core}/spec_helper.rb +29 -2
  108. data/spec/{sequel_core → core}/version_spec.rb +0 -0
  109. data/spec/extensions/blank_spec.rb +67 -0
  110. data/spec/extensions/caching_spec.rb +201 -0
  111. data/spec/{sequel_model/hooks_spec.rb → extensions/hook_class_methods_spec.rb} +8 -23
  112. data/spec/{sequel_model → extensions}/inflector_spec.rb +3 -0
  113. data/spec/{sequel_core → extensions}/migration_spec.rb +4 -4
  114. data/spec/extensions/pagination_spec.rb +99 -0
  115. data/spec/extensions/pretty_table_spec.rb +91 -0
  116. data/spec/extensions/query_spec.rb +85 -0
  117. data/spec/{sequel_model → extensions}/schema_spec.rb +22 -1
  118. data/spec/extensions/serialization_spec.rb +109 -0
  119. data/spec/extensions/single_table_inheritance_spec.rb +53 -0
  120. data/spec/{sequel_model → extensions}/spec_helper.rb +13 -4
  121. data/spec/extensions/string_date_time_spec.rb +93 -0
  122. data/spec/{sequel_model/validations_spec.rb → extensions/validation_class_methods_spec.rb} +15 -103
  123. data/spec/extensions/validation_helpers_spec.rb +291 -0
  124. data/spec/integration/dataset_test.rb +31 -0
  125. data/spec/integration/eager_loader_test.rb +17 -30
  126. data/spec/integration/schema_test.rb +8 -5
  127. data/spec/integration/spec_helper.rb +17 -0
  128. data/spec/integration/transaction_test.rb +68 -0
  129. data/spec/{sequel_model → model}/association_reflection_spec.rb +0 -0
  130. data/spec/{sequel_model → model}/associations_spec.rb +23 -10
  131. data/spec/{sequel_model → model}/base_spec.rb +29 -20
  132. data/spec/{sequel_model → model}/caching_spec.rb +16 -14
  133. data/spec/{sequel_model → model}/dataset_methods_spec.rb +0 -0
  134. data/spec/{sequel_model → model}/eager_loading_spec.rb +8 -8
  135. data/spec/model/hooks_spec.rb +472 -0
  136. data/spec/model/inflector_spec.rb +126 -0
  137. data/spec/{sequel_model → model}/model_spec.rb +25 -20
  138. data/spec/model/plugins_spec.rb +142 -0
  139. data/spec/{sequel_model → model}/record_spec.rb +121 -62
  140. data/spec/model/schema_spec.rb +92 -0
  141. data/spec/model/spec_helper.rb +124 -0
  142. data/spec/model/validations_spec.rb +1080 -0
  143. metadata +136 -107
  144. data/lib/sequel_core/core_ext.rb +0 -217
  145. data/lib/sequel_core/dataset/callback.rb +0 -13
  146. data/lib/sequel_core/dataset/schema.rb +0 -15
  147. data/lib/sequel_core/deprecated.rb +0 -26
  148. data/lib/sequel_core/exceptions.rb +0 -44
  149. data/lib/sequel_core/schema.rb +0 -2
  150. data/lib/sequel_core/schema/sql.rb +0 -325
  151. data/lib/sequel_model/association_reflection.rb +0 -267
  152. data/lib/sequel_model/associations.rb +0 -499
  153. data/lib/sequel_model/base.rb +0 -539
  154. data/lib/sequel_model/caching.rb +0 -82
  155. data/lib/sequel_model/dataset_methods.rb +0 -26
  156. data/lib/sequel_model/eager_loading.rb +0 -370
  157. data/lib/sequel_model/hooks.rb +0 -101
  158. data/lib/sequel_model/plugins.rb +0 -62
  159. data/lib/sequel_model/record.rb +0 -568
  160. data/lib/sequel_model/schema.rb +0 -49
  161. data/lib/sequel_model/validations.rb +0 -429
  162. 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.11.0
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-02 00:00:00 -08:00
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/sequel_core
97
- - spec/sequel_core/connection_pool_spec.rb
98
- - spec/sequel_core/core_ext_spec.rb
99
- - spec/sequel_core/core_sql_spec.rb
100
- - spec/sequel_core/database_spec.rb
101
- - spec/sequel_core/dataset_spec.rb
102
- - spec/sequel_core/expression_filters_spec.rb
103
- - spec/sequel_core/migration_spec.rb
104
- - spec/sequel_core/object_graph_spec.rb
105
- - spec/sequel_core/pretty_table_spec.rb
106
- - spec/sequel_core/schema_generator_spec.rb
107
- - spec/sequel_core/schema_spec.rb
108
- - spec/sequel_core/spec_helper.rb
109
- - spec/sequel_core/version_spec.rb
110
- - spec/sequel_model
111
- - spec/sequel_model/association_reflection_spec.rb
112
- - spec/sequel_model/associations_spec.rb
113
- - spec/sequel_model/base_spec.rb
114
- - spec/sequel_model/caching_spec.rb
115
- - spec/sequel_model/dataset_methods_spec.rb
116
- - spec/sequel_model/eager_loading_spec.rb
117
- - spec/sequel_model/hooks_spec.rb
118
- - spec/sequel_model/inflector_spec.rb
119
- - spec/sequel_model/model_spec.rb
120
- - spec/sequel_model/plugins_spec.rb
121
- - spec/sequel_model/record_spec.rb
122
- - spec/sequel_model/schema_spec.rb
123
- - spec/sequel_model/spec_helper.rb
124
- - spec/sequel_model/validations_spec.rb
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/sequel_model
194
- - lib/sequel_model/association_reflection.rb
195
- - lib/sequel_model/associations.rb
196
- - lib/sequel_model/base.rb
197
- - lib/sequel_model/caching.rb
198
- - lib/sequel_model/dataset_methods.rb
199
- - lib/sequel_model/eager_loading.rb
200
- - lib/sequel_model/hooks.rb
201
- - lib/sequel_model/inflector.rb
202
- - lib/sequel_model/plugins.rb
203
- - lib/sequel_model/record.rb
204
- - lib/sequel_model/schema.rb
205
- - lib/sequel_model/validations.rb
206
- - lib/sequel_model/exceptions.rb
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:
@@ -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