ridgepole 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ridgepole/diff.rb +6 -4
- data/lib/ridgepole/dumper.rb +4 -2
- data/lib/ridgepole/version.rb +1 -1
- data/spec/spec_helper.rb +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e76552f3870c883c466187a33c21c8d1b22c4bad
|
4
|
+
data.tar.gz: fee7cdd8d0dd112d033500907d9f468718fd139c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0fddcb88ff0e7c8357536f746c732ebea7ef276321462992830031e078ce18933f5a76c4f4ecd0832a71f0d24a96e9c2b88a5aba4678483192467ecb80b6e8eb
|
7
|
+
data.tar.gz: d3c94e687f7b28d0b7cd13c75fd6ab473743c5c834b757289c05b244340e836d0a52c7b4e55ec22f3a8396473fc70624d5735b267476d9ddab80303c9d5bab27
|
data/lib/ridgepole/diff.rb
CHANGED
@@ -94,10 +94,12 @@ class Ridgepole::Diff
|
|
94
94
|
definition_delta[:add] ||= {}
|
95
95
|
to_attrs[:options] ||= {}
|
96
96
|
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
97
|
+
unless @options[:merge]
|
98
|
+
if priv_column_name
|
99
|
+
to_attrs[:options][:after] = priv_column_name
|
100
|
+
else
|
101
|
+
to_attrs[:options][:first] = true
|
102
|
+
end
|
101
103
|
end
|
102
104
|
|
103
105
|
definition_delta[:add][column_name] = to_attrs
|
data/lib/ridgepole/dumper.rb
CHANGED
@@ -6,9 +6,9 @@ class Ridgepole::Dumper
|
|
6
6
|
def dump
|
7
7
|
stream = StringIO.new
|
8
8
|
conn = ActiveRecord::Base.connection
|
9
|
-
target_tables = @options
|
9
|
+
target_tables = @options[:tables]
|
10
10
|
|
11
|
-
|
11
|
+
if target_tables
|
12
12
|
conn.tables.each do |tbl|
|
13
13
|
next if target_tables.include?(tbl)
|
14
14
|
ActiveRecord::SchemaDumper.ignore_tables << tbl
|
@@ -17,6 +17,8 @@ class Ridgepole::Dumper
|
|
17
17
|
|
18
18
|
ActiveRecord::SchemaDumper.dump(conn, stream)
|
19
19
|
|
20
|
+
ActiveRecord::SchemaDumper.ignore_tables.clear if target_tables
|
21
|
+
|
20
22
|
dsl = stream.string.lines.select {|line|
|
21
23
|
line !~ /\A#/ &&
|
22
24
|
line !~ /\AActiveRecord::Schema\.define/ &&
|
data/lib/ridgepole/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ridgepole
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Genki Sugawara
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|