ridgepole 0.3.7 → 0.3.8
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.
- checksums.yaml +4 -4
- data/lib/ridgepole/delta.rb +9 -7
- data/lib/ridgepole/version.rb +1 -1
- 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: 4c25d9aef1cc8cf9681a16b2ae0c2716ba5ea2f6
|
|
4
|
+
data.tar.gz: d1c1b753ee684549250adfad53fda34b3650755c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 63e2d23d8cf04c4fdbd66d46ddffbc37cc5371a38652372d2f9fca5f362f9d55f70e4edcb404f74c209c6b7c981689c37478a7b6076228f3b919fc06aaf52cca
|
|
7
|
+
data.tar.gz: ea794d306d4a9e3d86e7207cb0f042df1d5532e6e0c867d84196c12b0267cca7f3009b1219acd9a041483aacae0a6e5edcca0118484552e16d426cc6fe8dbbf9
|
data/lib/ridgepole/delta.rb
CHANGED
|
@@ -59,7 +59,7 @@ class Ridgepole::Delta
|
|
|
59
59
|
end
|
|
60
60
|
|
|
61
61
|
Ridgepole::ExecuteExpander.without_operation(callback) do
|
|
62
|
-
eval_script(script, buf)
|
|
62
|
+
eval_script(script, options.merge(:out => buf))
|
|
63
63
|
end
|
|
64
64
|
|
|
65
65
|
buf.string.strip
|
|
@@ -67,13 +67,13 @@ class Ridgepole::Delta
|
|
|
67
67
|
ActiveRecord::Migration.disable_logging = disable_logging_orig
|
|
68
68
|
end
|
|
69
69
|
else
|
|
70
|
-
eval_script(script)
|
|
70
|
+
eval_script(script, options)
|
|
71
71
|
end
|
|
72
72
|
end
|
|
73
73
|
|
|
74
|
-
def eval_script(script,
|
|
74
|
+
def eval_script(script, options = {})
|
|
75
75
|
begin
|
|
76
|
-
with_pre_post_query(
|
|
76
|
+
with_pre_post_query(options) do
|
|
77
77
|
ActiveRecord::Schema.new.instance_eval(script, SCRIPT_NAME, 1)
|
|
78
78
|
end
|
|
79
79
|
rescue => e
|
|
@@ -81,9 +81,11 @@ class Ridgepole::Delta
|
|
|
81
81
|
end
|
|
82
82
|
end
|
|
83
83
|
|
|
84
|
-
def with_pre_post_query(
|
|
84
|
+
def with_pre_post_query(options = {})
|
|
85
|
+
out = options[:out] || $stdout
|
|
86
|
+
|
|
85
87
|
if (pre_query = @options[:pre_query])
|
|
86
|
-
if
|
|
88
|
+
if options[:noop]
|
|
87
89
|
out.puts(pre_query)
|
|
88
90
|
else
|
|
89
91
|
ActiveRecord::Base.connection.execute(pre_query)
|
|
@@ -93,7 +95,7 @@ class Ridgepole::Delta
|
|
|
93
95
|
retval = yield
|
|
94
96
|
|
|
95
97
|
if (post_query = @options[:post_query])
|
|
96
|
-
if
|
|
98
|
+
if options[:noop]
|
|
97
99
|
out.puts(post_query)
|
|
98
100
|
else
|
|
99
101
|
ActiveRecord::Base.connection.execute(post_query)
|
data/lib/ridgepole/version.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.3.
|
|
4
|
+
version: 0.3.8
|
|
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-08-
|
|
11
|
+
date: 2014-08-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activerecord
|