sequel_migration_builder 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,5 +1,9 @@
1
1
  CHANGELOG
2
2
 
3
+ == 0.3.1
4
+
5
+ * Bug fix - decimal defaults are output correctly
6
+
3
7
  == 0.2.2
4
8
 
5
9
  * Bug fix - decimal defaults are compared correctly.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.3.1
@@ -167,7 +167,13 @@ module Sequel
167
167
 
168
168
  # Sets column option name to a value.
169
169
  def set(name, value)
170
- @opts << "#{name.inspect} => #{value.inspect}"
170
+ output_value = if value.kind_of?(BigDecimal)
171
+ "BigDecimal.new('#{value.to_f.to_s}')"
172
+ else
173
+ value.inspect
174
+ end
175
+
176
+ @opts << "#{name.inspect} => #{output_value}"
171
177
  end
172
178
 
173
179
  # Renders the column option hash in a pretty format.
@@ -1,55 +1,53 @@
1
1
  # Generated by jeweler
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{sequel_migration_builder}
8
- s.version = "0.3.0"
8
+ s.version = "0.3.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Roland Swingler"]
12
- s.date = %q{2011-02-15}
12
+ s.date = %q{2011-03-01}
13
13
  s.description = %q{Build Sequel Migrations based on the differences between two schemas}
14
14
  s.email = %q{roland.swingler@gmail.com}
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE",
17
- "README.rdoc"
17
+ "README.rdoc"
18
18
  ]
19
19
  s.files = [
20
20
  ".document",
21
- ".gitignore",
22
- "CHANGELOG",
23
- "LICENSE",
24
- "README.rdoc",
25
- "Rakefile",
26
- "VERSION",
27
- "lib/sequel/migration_builder.rb",
28
- "lib/sequel/schema/alter_table_operations.rb",
29
- "lib/sequel/schema/db_column.rb",
30
- "lib/sequel/schema/db_index.rb",
31
- "lib/sequel/schema/db_schema_parser.rb",
32
- "sequel_migration_builder.gemspec",
33
- "spec/alter_table_operations_spec.rb",
34
- "spec/db_column_spec.rb",
35
- "spec/db_index_spec.rb",
36
- "spec/db_schema_parser_spec.rb",
37
- "spec/migration_builder_spec.rb",
38
- "spec/spec.opts",
39
- "spec/spec_helper.rb"
21
+ "CHANGELOG",
22
+ "LICENSE",
23
+ "README.rdoc",
24
+ "Rakefile",
25
+ "VERSION",
26
+ "lib/sequel/migration_builder.rb",
27
+ "lib/sequel/schema/alter_table_operations.rb",
28
+ "lib/sequel/schema/db_column.rb",
29
+ "lib/sequel/schema/db_index.rb",
30
+ "lib/sequel/schema/db_schema_parser.rb",
31
+ "sequel_migration_builder.gemspec",
32
+ "spec/alter_table_operations_spec.rb",
33
+ "spec/db_column_spec.rb",
34
+ "spec/db_index_spec.rb",
35
+ "spec/db_schema_parser_spec.rb",
36
+ "spec/migration_builder_spec.rb",
37
+ "spec/spec.opts",
38
+ "spec/spec_helper.rb"
40
39
  ]
41
40
  s.homepage = %q{http://github.com/knaveofdiamonds/sequel_migration_builder}
42
- s.rdoc_options = ["--charset=UTF-8"]
43
41
  s.require_paths = ["lib"]
44
42
  s.rubygems_version = %q{1.3.7}
45
43
  s.summary = %q{Build Sequel Migrations based on the differences between two schemas}
46
44
  s.test_files = [
47
45
  "spec/alter_table_operations_spec.rb",
48
- "spec/db_column_spec.rb",
49
- "spec/db_index_spec.rb",
50
- "spec/db_schema_parser_spec.rb",
51
- "spec/migration_builder_spec.rb",
52
- "spec/spec_helper.rb"
46
+ "spec/db_column_spec.rb",
47
+ "spec/db_index_spec.rb",
48
+ "spec/db_schema_parser_spec.rb",
49
+ "spec/migration_builder_spec.rb",
50
+ "spec/spec_helper.rb"
53
51
  ]
54
52
 
55
53
  if s.respond_to? :specification_version then
@@ -106,6 +106,11 @@ describe Sequel::Schema::DbColumn do
106
106
  a.diff(b).should == Set.new
107
107
  b.diff(a).should == Set.new
108
108
  end
109
+
110
+ it "should output BigDecimal correctly in a #define_statement" do
111
+ Sequel::Schema::DbColumn.new(:foo, :decimal, false, '1.1', true, [4,2], nil).
112
+ define_statement.should == "decimal :foo, :null => false, :default => BigDecimal.new('1.1'), :unsigned => true, :size => [4, 2]"
113
+ end
109
114
 
110
115
  it "should be buildable from a Hash" do
111
116
  Sequel::Schema::DbColumn.build_from_hash(:name => "foo",
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sequel_migration_builder
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 0
10
- version: 0.3.0
9
+ - 1
10
+ version: 0.3.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Roland Swingler
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-15 00:00:00 +00:00
18
+ date: 2011-03-01 00:00:00 +00:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -61,7 +61,6 @@ extra_rdoc_files:
61
61
  - README.rdoc
62
62
  files:
63
63
  - .document
64
- - .gitignore
65
64
  - CHANGELOG
66
65
  - LICENSE
67
66
  - README.rdoc
@@ -85,8 +84,8 @@ homepage: http://github.com/knaveofdiamonds/sequel_migration_builder
85
84
  licenses: []
86
85
 
87
86
  post_install_message:
88
- rdoc_options:
89
- - --charset=UTF-8
87
+ rdoc_options: []
88
+
90
89
  require_paths:
91
90
  - lib
92
91
  required_ruby_version: !ruby/object:Gem::Requirement
data/.gitignore DELETED
@@ -1,21 +0,0 @@
1
- ## MAC OS
2
- .DS_Store
3
-
4
- ## TEXTMATE
5
- *.tmproj
6
- tmtags
7
-
8
- ## EMACS
9
- *~
10
- \#*
11
- .\#*
12
-
13
- ## VIM
14
- *.swp
15
-
16
- ## PROJECT::GENERAL
17
- coverage
18
- rdoc
19
- pkg
20
-
21
- ## PROJECT::SPECIFIC