-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #106 from insurancezebra/util-changes
Added "Referenced By" and "Depends On" section for each SQL file
- Loading branch information
Showing
19 changed files
with
306 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
addressable (2.7.0) | ||
public_suffix (>= 2.0.2, < 5.0) | ||
colorator (1.1.0) | ||
concurrent-ruby (1.1.6) | ||
em-websocket (0.5.1) | ||
eventmachine (>= 0.12.9) | ||
http_parser.rb (~> 0.6.0) | ||
eventmachine (1.2.7) | ||
ffi (1.13.1) | ||
forwardable-extended (2.6.0) | ||
http_parser.rb (0.6.0) | ||
i18n (0.9.5) | ||
concurrent-ruby (~> 1.0) | ||
jekyll (3.8.7) | ||
addressable (~> 2.4) | ||
colorator (~> 1.0) | ||
em-websocket (~> 0.5) | ||
i18n (~> 0.7) | ||
jekyll-sass-converter (~> 1.0) | ||
jekyll-watch (~> 2.0) | ||
kramdown (~> 1.14) | ||
liquid (~> 4.0) | ||
mercenary (~> 0.3.3) | ||
pathutil (~> 0.9) | ||
rouge (>= 1.7, < 4) | ||
safe_yaml (~> 1.0) | ||
jekyll-sass-converter (1.5.2) | ||
sass (~> 3.4) | ||
jekyll-watch (2.2.1) | ||
listen (~> 3.0) | ||
kramdown (1.17.0) | ||
liquid (4.0.3) | ||
listen (3.2.1) | ||
rb-fsevent (~> 0.10, >= 0.10.3) | ||
rb-inotify (~> 0.9, >= 0.9.10) | ||
mercenary (0.3.6) | ||
pathutil (0.16.2) | ||
forwardable-extended (~> 2.6) | ||
public_suffix (4.0.5) | ||
rb-fsevent (0.10.4) | ||
rb-inotify (0.10.1) | ||
ffi (~> 1.0) | ||
rouge (3.20.0) | ||
safe_yaml (1.0.5) | ||
sass (3.7.4) | ||
sass-listen (~> 4.0.0) | ||
sass-listen (4.0.0) | ||
rb-fsevent (~> 0.9, >= 0.9.4) | ||
rb-inotify (~> 0.9, >= 0.9.7) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
jekyll (~> 3.8) | ||
|
||
BUNDLED WITH | ||
2.1.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
const _ = require('underscore'); | ||
export function getReferences(project, model) { | ||
let references = _.filter(project.nodes, function(node) { | ||
if (node.depends_on && node.depends_on.nodes && node.depends_on.nodes.length) { | ||
if (_.contains(node.depends_on.nodes, model.unique_id)) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
}); | ||
|
||
return _.groupBy(references, 'resource_type'); | ||
} | ||
|
||
export function getParents (project, model) { | ||
let parents = _.filter(project.nodes, function(node) { | ||
if (model.depends_on && model.depends_on.nodes && model.depends_on.nodes.length) { | ||
if (_.contains(model.depends_on.nodes, node.unique_id)) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
}); | ||
|
||
let macroParents = _.filter(project.macros, function(macro) { | ||
if (model.depends_on && model.depends_on.macros && model.depends_on.macros.length) { | ||
if (_.contains(model.depends_on.macros, macro.unique_id)) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
}); | ||
|
||
return _.groupBy(parents.concat(macroParents), 'resource_type'); | ||
} | ||
|
||
export function getMacroReferences(project, self) { | ||
let references = _.filter(project.nodes, function(node) { | ||
if (node.depends_on && node.depends_on.macros && node.depends_on.macros.length) { | ||
if (_.contains(node.depends_on.macros, self.unique_id)) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
}); | ||
|
||
let macroReferences = _.filter(project.macros, function(macro) { | ||
if (macro.depends_on && macro.depends_on.macros && macro.depends_on.macros.length) { | ||
if (_.contains(macro.depends_on.macros, self.unique_id)) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
}); | ||
|
||
return _.groupBy(references.concat(macroReferences), 'resource_type'); | ||
} | ||
|
||
export function getMacroParents (project, self) { | ||
let macroParents = _.filter(project.macros, function(macro) { | ||
if (self.depends_on && self.depends_on.macros && self.depends_on.macros.length) { | ||
if (_.contains(self.depends_on.macros, macro.unique_id)) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
}); | ||
|
||
return _.groupBy(macroParents, 'resource_type'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.