masamune 0.12.2 → 0.12.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18fd59e8bd668c7efc320ad374ef1bc96c384184
|
4
|
+
data.tar.gz: f12fa656c4136942e1d4a5a917788c2d692b7e8f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f83bd5adbc40df655a01e4a390d6435fd5bc6e26eeae21ea13898a31931ee6b878540988a0c2de02b082f7e5f86e21e53152e9f704df396f1cda7e8dba1a3cd2
|
7
|
+
data.tar.gz: af6239a670e87aa6757b6dea3c96c467b4243b7b86cbd3ce35ae46dd5e7ff1362751ede5cb1c7a9e686716ef410e5e976fe2ebe65e5c948717de24713ed44445
|
@@ -202,9 +202,9 @@ module Masamune::Schema
|
|
202
202
|
case file
|
203
203
|
when /\.rb\Z/
|
204
204
|
instance_eval(File.read(file), file)
|
205
|
-
when /\.psql
|
205
|
+
when /\.psql(\.erb)?\Z/
|
206
206
|
@stores[:postgres].extra << file
|
207
|
-
when /\.hql
|
207
|
+
when /\.hql(\.erb)?\Z/
|
208
208
|
@stores[:hive].extra << file
|
209
209
|
end
|
210
210
|
end
|
@@ -74,8 +74,9 @@ module Masamune::Transform
|
|
74
74
|
end
|
75
75
|
|
76
76
|
def template_eval(template)
|
77
|
-
return File.read(template) if File.exists?(template.to_s)
|
78
|
-
|
77
|
+
return File.read(template) if File.exists?(template.to_s) && template.to_s !~ /erb\Z/
|
78
|
+
template_file = File.exists?(template.to_s) ? template : template_file(template)
|
79
|
+
Masamune::Template.render_to_string(template_file, @locals.merge(source: source, target: target))
|
79
80
|
end
|
80
81
|
|
81
82
|
def template_file(template_prefix)
|
data/lib/masamune/version.rb
CHANGED
@@ -57,8 +57,8 @@ describe Masamune::Schema::Catalog do
|
|
57
57
|
end
|
58
58
|
|
59
59
|
context '#load' do
|
60
|
-
let(:postgres_extra) { %w(/tmp/schema.psql /tmp/00_schema.psql /tmp/20_schema.psql) }
|
61
|
-
let(:hive_extra) { %w(/tmp/schema.hql /tmp/00_schema.hql /tmp/20_schema.hql) }
|
60
|
+
let(:postgres_extra) { %w(/tmp/schema.psql /tmp/00_schema.psql /tmp/20_schema.psql /tmp/40_schema.psql.erb) }
|
61
|
+
let(:hive_extra) { %w(/tmp/schema.hql /tmp/00_schema.hql /tmp/20_schema.hql /tmp/40_schema.hql.erb) }
|
62
62
|
let(:extra) { postgres_extra + hive_extra }
|
63
63
|
|
64
64
|
before do
|
@@ -70,13 +70,13 @@ describe Masamune::Schema::Catalog do
|
|
70
70
|
it 'should load postgres extra in order' do
|
71
71
|
expect(instance.postgres.extra).to eq(postgres_extra)
|
72
72
|
expect(instance.postgres.extra(:pre).size).to eq(2)
|
73
|
-
expect(instance.postgres.extra(:post).size).to eq(
|
73
|
+
expect(instance.postgres.extra(:post).size).to eq(2)
|
74
74
|
end
|
75
75
|
|
76
76
|
it 'should load hive extra in order' do
|
77
77
|
expect(instance.hive.extra).to eq(hive_extra)
|
78
78
|
expect(instance.hive.extra(:pre).size).to eq(2)
|
79
|
-
expect(instance.hive.extra(:post).size).to eq(
|
79
|
+
expect(instance.hive.extra(:post).size).to eq(2)
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: masamune
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.12.
|
4
|
+
version: 0.12.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Andrews
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|