rdt 0.0.9 → 0.1.0
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/{dbt → rdt}/mermaid.rb +1 -1
- data/lib/{dbt → rdt}/model.rb +1 -1
- data/lib/{dbt → rdt}/runner.rb +3 -3
- data/lib/{dbt → rdt}/sql_template_helpers.rb +1 -1
- data/lib/{dbt.rb → rdt.rb} +7 -3
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3baff1b3b492e527ba747ef3d8535458633c8edd5970e94167ed5bb3a9952f98
|
4
|
+
data.tar.gz: b565d3598731d849dbda805051e20fbe00fdf8df01c95b7fe90fab628b3a9acf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5dc4ac74b81eb7f43ccd782cf4d72cc63f3381ad279ad6850e299a20ff405f3560e6d04d6ef034bb032ae6e11602cc526373a564df3fb4700b82997142cc68f
|
7
|
+
data.tar.gz: 8eca1e652d8ee8247c616db8b526dab31d14a717f8a6ba775c9b42df68ee7107326fa39347fdd2e1c063d3920fbc613ece8da9e224db7355684553519ebc7f51
|
data/lib/{dbt → rdt}/mermaid.rb
RENAMED
data/lib/{dbt → rdt}/model.rb
RENAMED
data/lib/{dbt → rdt}/runner.rb
RENAMED
@@ -1,8 +1,8 @@
|
|
1
|
-
module
|
1
|
+
module Rdt
|
2
2
|
class Runner
|
3
3
|
class << self
|
4
4
|
def run(custom_schema = nil, glob_path = "app/sql/**/*.sql")
|
5
|
-
schema = custom_schema ||
|
5
|
+
schema = custom_schema || Rdt.settings["schema"] || Rdt::SCHEMA
|
6
6
|
ActiveRecord::Base.connection.execute "CREATE SCHEMA IF NOT EXISTS #{schema}"
|
7
7
|
file_paths = Dir.glob(glob_path)
|
8
8
|
models = file_paths.map { |fp| Model.new(fp, schema) }
|
@@ -19,7 +19,7 @@ module Dbt
|
|
19
19
|
|
20
20
|
def test
|
21
21
|
puts "Running tests..."
|
22
|
-
schema =
|
22
|
+
schema = Rdt.settings["schema"] || Rdt::SCHEMA
|
23
23
|
tables = run(schema, "app/sql_test/**/*.sql")
|
24
24
|
tables.each do |table|
|
25
25
|
puts "TEST #{table}"
|
data/lib/{dbt.rb → rdt.rb}
RENAMED
@@ -4,12 +4,14 @@ loader.setup
|
|
4
4
|
|
5
5
|
require "dagwood"
|
6
6
|
|
7
|
-
module
|
8
|
-
SCHEMA = "
|
7
|
+
module Rdt
|
8
|
+
SCHEMA = "rdt"
|
9
9
|
|
10
10
|
def self.settings
|
11
11
|
@settings ||= begin
|
12
|
-
|
12
|
+
rdt_path = Rails.root.join("config", "rdt.yml").to_s
|
13
|
+
dbt_path = Rails.root.join("config", "dbt.yml").to_s
|
14
|
+
path = File.exist?(rdt_path) ? rdt_path : dbt_path
|
13
15
|
if File.exist?(path)
|
14
16
|
YAML.safe_load(ERB.new(File.read(path)).result, aliases: true)
|
15
17
|
else
|
@@ -26,3 +28,5 @@ module Dbt
|
|
26
28
|
Runner.test(...)
|
27
29
|
end
|
28
30
|
end
|
31
|
+
|
32
|
+
Dbt = Rdt
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rdt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Felipe Mesquita
|
@@ -57,11 +57,11 @@ executables: []
|
|
57
57
|
extensions: []
|
58
58
|
extra_rdoc_files: []
|
59
59
|
files:
|
60
|
-
- lib/
|
61
|
-
- lib/
|
62
|
-
- lib/
|
63
|
-
- lib/
|
64
|
-
- lib/
|
60
|
+
- lib/rdt.rb
|
61
|
+
- lib/rdt/mermaid.rb
|
62
|
+
- lib/rdt/model.rb
|
63
|
+
- lib/rdt/runner.rb
|
64
|
+
- lib/rdt/sql_template_helpers.rb
|
65
65
|
homepage: https://github.com/felipedmesquita/dbt
|
66
66
|
licenses:
|
67
67
|
- MIT
|