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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e699a3cc4e7b1bcfb20fceb193ee0d7b1e805d62b70f79bfbc2d528a77e7d4b7
4
- data.tar.gz: 46d2140d1b30ce7ff8533c85e941cde449d92432a77c147cb59709aaed2492af
3
+ metadata.gz: 3baff1b3b492e527ba747ef3d8535458633c8edd5970e94167ed5bb3a9952f98
4
+ data.tar.gz: b565d3598731d849dbda805051e20fbe00fdf8df01c95b7fe90fab628b3a9acf
5
5
  SHA512:
6
- metadata.gz: e77b10bca5337de9917267ee5197f1452a4a24bfde5aa9999b0e3e187f37eb15bee77defd9a5f4285b20a30ab1c030835aacf10dd0d9d08b72006f5b07eb71ce
7
- data.tar.gz: 43ddb567994a3c91e95d0f22f3d444074b8d889b5ac1ed2b6285c0d2c78a67512024a880b2c9f7b61869f0bd19b59c555babea878367a946fe4e592236716296
6
+ metadata.gz: e5dc4ac74b81eb7f43ccd782cf4d72cc63f3381ad279ad6850e299a20ff405f3560e6d04d6ef034bb032ae6e11602cc526373a564df3fb4700b82997142cc68f
7
+ data.tar.gz: 8eca1e652d8ee8247c616db8b526dab31d14a717f8a6ba775c9b42df68ee7107326fa39347fdd2e1c063d3920fbc613ece8da9e224db7355684553519ebc7f51
@@ -1,5 +1,5 @@
1
1
  require "base64"
2
- module Dbt
2
+ module Rdt
3
3
  class Mermaid
4
4
  class << self
5
5
  def markdown_for(dag)
@@ -1,4 +1,4 @@
1
- module Dbt
1
+ module Rdt
2
2
  class Model
3
3
  include SqlTemplateHelpers
4
4
 
@@ -1,8 +1,8 @@
1
- module Dbt
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 || Dbt.settings["schema"] || Dbt::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 = Dbt.settings["schema"] || Dbt::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}"
@@ -1,4 +1,4 @@
1
- module Dbt
1
+ module Rdt
2
2
  module SqlTemplateHelpers
3
3
 
4
4
  def star relation, *exclued_columns
@@ -4,12 +4,14 @@ loader.setup
4
4
 
5
5
  require "dagwood"
6
6
 
7
- module Dbt
8
- SCHEMA = "felipe_dbt"
7
+ module Rdt
8
+ SCHEMA = "rdt"
9
9
 
10
10
  def self.settings
11
11
  @settings ||= begin
12
- path = Rails.root.join("config", "dbt.yml").to_s
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.9
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/dbt.rb
61
- - lib/dbt/mermaid.rb
62
- - lib/dbt/model.rb
63
- - lib/dbt/runner.rb
64
- - lib/dbt/sql_template_helpers.rb
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