disposable_db 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module DisposableDB
2
- VERSION = '0.0.6' unless defined? DisposableDB::VERSION
2
+ VERSION = '0.0.7' unless defined? DisposableDB::VERSION
3
3
  end
data/lib/disposable_db.rb CHANGED
@@ -7,7 +7,7 @@ require 'disposable_db/database'
7
7
  require 'disposable_db/databases/sqlite'
8
8
  require 'disposable_db/disposable_model'
9
9
 
10
- Sequel.extension(:pagination, :query)
10
+ Sequel.extension(:pagination, :query, :sql_expr)
11
11
 
12
12
  module DisposableDB
13
13
  class << self
@@ -52,4 +52,18 @@ describe DisposableModel do
52
52
  m.paginate(1, 50).page_count == 0
53
53
  end
54
54
 
55
+ it "can divide" do
56
+ columns = []
57
+ columns << TableTemplate::Column.new('t1', Integer)
58
+
59
+ tt = TableTemplate.new('foo', columns)
60
+
61
+ database = Databases::SQLite.new
62
+ database.create_table! tt
63
+ m = DisposableModel.factory(:database => database, :table_name => tt.name)
64
+ m.create(:t1 => 10)
65
+ m.count.should == 1
66
+ m.dataset.select((50.sql_expr / :t1).as(:result)).first.values[:result].should == 5
67
+ end
68
+
55
69
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: disposable_db
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-15 00:00:00.000000000Z
12
+ date: 2012-04-24 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &80200130 !ruby/object:Gem::Requirement
16
+ requirement: &73296120 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 2.9.0
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *80200130
24
+ version_requirements: *73296120
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: bundler
27
- requirement: &80199870 !ruby/object:Gem::Requirement
27
+ requirement: &73295900 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *80199870
35
+ version_requirements: *73295900
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: ffaker
38
- requirement: &80199450 !ruby/object:Gem::Requirement
38
+ requirement: &73295480 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 1.13.0
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *80199450
46
+ version_requirements: *73295480
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: ruby-prof
49
- requirement: &80199070 !ruby/object:Gem::Requirement
49
+ requirement: &73295160 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *80199070
57
+ version_requirements: *73295160
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: sequel
60
- requirement: &80198670 !ruby/object:Gem::Requirement
60
+ requirement: &73294730 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - =
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 3.33.0
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *80198670
68
+ version_requirements: *73294730
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: sqlite3
71
- requirement: &80198400 !ruby/object:Gem::Requirement
71
+ requirement: &73294390 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,7 +76,7 @@ dependencies:
76
76
  version: '0'
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *80198400
79
+ version_requirements: *73294390
80
80
  description: A utility that makes it easy to create "on-the-fly databases"
81
81
  email:
82
82
  - keithlarrimore@icehook.com
@@ -118,7 +118,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
118
118
  version: '0'
119
119
  segments:
120
120
  - 0
121
- hash: 555394131
121
+ hash: 860357517
122
122
  required_rubygems_version: !ruby/object:Gem::Requirement
123
123
  none: false
124
124
  requirements:
@@ -127,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
127
  version: '0'
128
128
  segments:
129
129
  - 0
130
- hash: 555394131
130
+ hash: 860357517
131
131
  requirements: []
132
132
  rubyforge_project:
133
133
  rubygems_version: 1.8.10