sequel 0.2.0 → 0.2.0.1

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/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ === 0.2.0.1 (2007-09-04)
2
+
3
+ * Improved support for invoking methods with inline procs inside block filters.
4
+
1
5
  === 0.2.0 (2007-09-02)
2
6
 
3
7
  * Fixed Model.drop_table (thanks Duane Johnson.)
data/Rakefile CHANGED
@@ -6,7 +6,7 @@ require 'fileutils'
6
6
  include FileUtils
7
7
 
8
8
  NAME = "sequel"
9
- VERS = "0.2.0"
9
+ VERS = "0.2.0.1"
10
10
  CLEAN.include ['**/.*.sw?', 'pkg/*', '.config', 'doc/*', 'coverage/*']
11
11
  RDOC_OPTS = ['--quiet', '--title', "Sequel: Concise ORM for Ruby",
12
12
  "--opname", "index.html",
@@ -182,7 +182,11 @@ class Sequel::Dataset
182
182
  r = eval_expr(e[1], b)
183
183
  compare_expr(l, r)
184
184
  when :iter
185
- eval_expr(e[3], b)
185
+ if e[1] == [:fcall, :proc]
186
+ eval_expr(e[3], b) # inline proc
187
+ else
188
+ ext_expr(e, b) # method call with inline proc
189
+ end
186
190
  when :dasgn, :dasgn_curr
187
191
  # assignment
188
192
  l = e[1]
@@ -178,16 +178,27 @@ context "Proc#to_sql" do
178
178
  end
179
179
 
180
180
  specify "should support comparison to sub-queries" do
181
- @ds2 = DB[:test].select(:node_id)
182
-
183
- proc {:id == @ds2}.to_sql.should == \
184
- "(id IN (SELECT node_id FROM test))"
181
+ # @ds2 = DB[:test].select(:node_id)
182
+ #
183
+ # proc {:id == @ds2}.to_sql.should == \
184
+ # "(id IN (SELECT node_id FROM test))"
185
+ #
186
+ # proc {:id == DB[:test].select(:node_id)}.to_sql.should == \
187
+ # "(id IN (SELECT node_id FROM test))"
188
+
189
+ proc {:id == DB[:test].select(:node_id).filter {:active == true}}.to_sql.should == \
190
+ "(id IN (SELECT node_id FROM test WHERE (active = 't')))"
185
191
  end
186
192
 
187
193
  specify "should support comparison to arrays" do
188
194
  proc {:id == [1, 3, 7, 15]}.to_sql.should == \
189
195
  "(id IN (1, 3, 7, 15))"
190
196
  end
197
+
198
+ specify "should not literalize String#expr and String#lit" do
199
+ proc {'x'.lit == 1}.to_sql.should == "(x = 1)"
200
+ proc {'x.y'.expr == 1}.to_sql.should == "(x.y = 1)"
201
+ end
191
202
 
192
203
  specify "should support in/in? operator" do
193
204
  proc {:x.in [3, 4, 5]}.to_sql.should == "(x IN (3, 4, 5))"
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.2
2
+ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: sequel
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.2.0
7
- date: 2007-09-03 00:00:00 +03:00
6
+ version: 0.2.0.1
7
+ date: 2007-09-04 00:00:00 +03:00
8
8
  summary: Lightweight ORM library for Ruby
9
9
  require_paths:
10
10
  - lib
@@ -33,46 +33,47 @@ files:
33
33
  - README
34
34
  - Rakefile
35
35
  - bin/sequel
36
- - spec/dataset_spec.rb
36
+ - doc/rdoc
37
+ - spec/adapters
37
38
  - spec/connection_pool_spec.rb
38
- - spec/database_spec.rb
39
39
  - spec/core_ext_spec.rb
40
- - spec/adapters
41
- - spec/adapters/sqlite_spec.rb
42
- - spec/adapters/mysql_spec.rb
43
- - spec/adapters/postgres_spec.rb
40
+ - spec/database_spec.rb
41
+ - spec/dataset_spec.rb
44
42
  - spec/migration_spec.rb
45
- - spec/schema_spec.rb
46
- - spec/schema_generator_spec.rb
47
- - spec/pretty_table_spec.rb
48
- - spec/spec_helper.rb
49
43
  - spec/model_spec.rb
44
+ - spec/pretty_table_spec.rb
45
+ - spec/schema_generator_spec.rb
46
+ - spec/schema_spec.rb
50
47
  - spec/sequelizer_spec.rb
48
+ - spec/spec_helper.rb
49
+ - spec/adapters/mysql_spec.rb
50
+ - spec/adapters/postgres_spec.rb
51
+ - spec/adapters/sqlite_spec.rb
51
52
  - lib/sequel
52
- - lib/sequel/pretty_table.rb
53
- - lib/sequel/model.rb
54
- - lib/sequel/schema.rb
55
- - lib/sequel/sqlite.rb
56
- - lib/sequel/database.rb
57
- - lib/sequel/dataset.rb
58
- - lib/sequel/mysql.rb
59
- - lib/sequel/postgres.rb
53
+ - lib/sequel.rb
54
+ - lib/sequel/ado.rb
60
55
  - lib/sequel/connection_pool.rb
61
56
  - lib/sequel/core_ext.rb
57
+ - lib/sequel/database.rb
58
+ - lib/sequel/dataset
59
+ - lib/sequel/dataset.rb
60
+ - lib/sequel/dbi.rb
62
61
  - lib/sequel/error.rb
63
62
  - lib/sequel/expressions.rb
64
- - lib/sequel/dbi.rb
65
- - lib/sequel/odbc.rb
66
- - lib/sequel/dataset
67
- - lib/sequel/dataset/sql.rb
68
- - lib/sequel/dataset/sequelizer.rb
69
- - lib/sequel/dataset/convenience.rb
70
63
  - lib/sequel/migration.rb
64
+ - lib/sequel/model.rb
65
+ - lib/sequel/mysql.rb
66
+ - lib/sequel/odbc.rb
67
+ - lib/sequel/postgres.rb
68
+ - lib/sequel/pretty_table.rb
71
69
  - lib/sequel/schema
72
- - lib/sequel/schema/schema_sql.rb
70
+ - lib/sequel/schema.rb
71
+ - lib/sequel/sqlite.rb
72
+ - lib/sequel/dataset/convenience.rb
73
+ - lib/sequel/dataset/sequelizer.rb
74
+ - lib/sequel/dataset/sql.rb
73
75
  - lib/sequel/schema/schema_generator.rb
74
- - lib/sequel/ado.rb
75
- - lib/sequel.rb
76
+ - lib/sequel/schema/schema_sql.rb
76
77
  - CHANGELOG
77
78
  test_files: []
78
79