tern 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/lib/tern.rb +1 -1
  2. data/spec/tern_spec.rb +12 -0
  3. data/tern.gemspec +1 -1
  4. metadata +4 -24
data/lib/tern.rb CHANGED
@@ -98,7 +98,7 @@ class Alteration < Change
98
98
  DB.create_table? table_name do
99
99
  column vc, :integer, :null => false
100
100
  end
101
- table.insert version_column => 0
101
+ table.insert version_column => 0 if table.count == 0
102
102
  end
103
103
 
104
104
  def version
data/spec/tern_spec.rb CHANGED
@@ -115,6 +115,18 @@ describe "tern" do
115
115
  @dev_db.tables.should include(:tern_alterations)
116
116
  end
117
117
 
118
+ it "inserts version 0 into alterations table on first run" do
119
+ tern_migrate "spec/projects/new"
120
+ @dev_db[:tern_alterations].count.should == 1
121
+ @dev_db[:tern_alterations].get(:version).should == 0
122
+ end
123
+
124
+ it "does not insert version 0 into alterations table on subsequent runs" do
125
+ tern_migrate "spec/projects/new"
126
+ tern_migrate "spec/projects/new"
127
+ @dev_db[:tern_alterations].count.should == 1
128
+ end
129
+
118
130
  it "applies alterations" do
119
131
  tern_migrate "spec/projects/alterations"
120
132
  @dev_db.tables.should include(:people, :animals, :plants)
data/tern.gemspec CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "tern"
6
- s.version = '0.6.0'
6
+ s.version = '0.6.1'
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ["Jack Christensen"]
9
9
  s.email = ["jack@jackchristensen.com"]
metadata CHANGED
@@ -1,12 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tern
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 6
8
- - 0
9
- version: 0.6.0
4
+ prerelease:
5
+ version: 0.6.1
10
6
  platform: ruby
11
7
  authors:
12
8
  - Jack Christensen
@@ -14,7 +10,7 @@ autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
12
 
17
- date: 2011-02-07 00:00:00 -06:00
13
+ date: 2011-02-22 00:00:00 -06:00
18
14
  default_executable:
19
15
  dependencies:
20
16
  - !ruby/object:Gem::Dependency
@@ -25,10 +21,6 @@ dependencies:
25
21
  requirements:
26
22
  - - ">="
27
23
  - !ruby/object:Gem::Version
28
- segments:
29
- - 3
30
- - 19
31
- - 0
32
24
  version: 3.19.0
33
25
  type: :runtime
34
26
  version_requirements: *id001
@@ -40,10 +32,6 @@ dependencies:
40
32
  requirements:
41
33
  - - ">="
42
34
  - !ruby/object:Gem::Version
43
- segments:
44
- - 0
45
- - 14
46
- - 6
47
35
  version: 0.14.6
48
36
  type: :runtime
49
37
  version_requirements: *id002
@@ -55,10 +43,6 @@ dependencies:
55
43
  requirements:
56
44
  - - ">="
57
45
  - !ruby/object:Gem::Version
58
- segments:
59
- - 2
60
- - 4
61
- - 0
62
46
  version: 2.4.0
63
47
  type: :development
64
48
  version_requirements: *id003
@@ -152,21 +136,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
152
136
  requirements:
153
137
  - - ">="
154
138
  - !ruby/object:Gem::Version
155
- segments:
156
- - 0
157
139
  version: "0"
158
140
  required_rubygems_version: !ruby/object:Gem::Requirement
159
141
  none: false
160
142
  requirements:
161
143
  - - ">="
162
144
  - !ruby/object:Gem::Version
163
- segments:
164
- - 0
165
145
  version: "0"
166
146
  requirements: []
167
147
 
168
148
  rubyforge_project:
169
- rubygems_version: 1.3.7
149
+ rubygems_version: 1.5.2
170
150
  signing_key:
171
151
  specification_version: 3
172
152
  summary: The SQL Fan's Migrator