gd_bam 0.0.15 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. data/README.md +313 -5
  2. data/bin/bam +126 -48
  3. data/lib/bam/version.rb +1 -1
  4. data/lib/bam.rb +51 -0
  5. data/lib/base/errors.rb +15 -0
  6. data/lib/base/flow.rb +37 -0
  7. data/lib/base/graph.rb +23 -0
  8. data/lib/base/metadata.rb +107 -0
  9. data/lib/base/project.rb +95 -0
  10. data/lib/base/repo.rb +35 -0
  11. data/lib/base/sink.rb +44 -0
  12. data/lib/base/step.rb +47 -0
  13. data/lib/base/tap.rb +167 -0
  14. data/lib/base/taps.rb +19 -0
  15. data/lib/cloud_connect/dsl/cc.rb +42 -0
  16. data/lib/cloud_connect/dsl/es_helpers.rb +49 -0
  17. data/lib/cloud_connect/dsl/helpers.rb +199 -0
  18. data/lib/{nodes → cloud_connect/dsl}/nodes.rb +106 -16
  19. data/lib/cloud_connect/dsl/sf_helpers.rb +39 -0
  20. data/lib/cloud_connect/dsl/structure_helpers.rb +94 -0
  21. data/lib/commands/commands.rb +110 -0
  22. data/lib/commands/deployment.rb +217 -0
  23. data/lib/commands/docs_commands.rb +41 -0
  24. data/lib/commands/gd_commands.rb +95 -0
  25. data/lib/commands/scaffold_commands.rb +103 -0
  26. data/lib/commands/sf_commands.rb +37 -0
  27. data/lib/commands/validators.rb +19 -0
  28. data/lib/compatibility.rb +19 -0
  29. data/lib/compiler/compiler.rb +76 -0
  30. data/lib/compiler/etl_visitor.rb +165 -0
  31. data/lib/dsl/dsl.rb +125 -0
  32. data/lib/generators/downloaders.rb +449 -0
  33. data/lib/generators/etl.rb +261 -0
  34. data/lib/generators/validators.rb +445 -0
  35. data/lib/graphs/docentize.grf +1 -1
  36. data/lib/graphs/dummy.grf +1 -1
  37. data/lib/graphs/goodsales_v2/docentize.grf +47 -0
  38. data/lib/graphs/goodsales_v2/dummy.grf +46 -0
  39. data/lib/graphs/goodsales_v2/load_history.grf +579 -0
  40. data/lib/graphs/goodsales_v2/process_account.grf +47 -0
  41. data/lib/graphs/goodsales_v2/process_activity.grf +222 -0
  42. data/lib/graphs/goodsales_v2/process_activity_dim.grf +88 -0
  43. data/lib/graphs/goodsales_v2/process_activity_owner.grf +48 -0
  44. data/lib/graphs/goodsales_v2/process_forecast.grf +20 -0
  45. data/lib/graphs/goodsales_v2/process_opp_records.grf +84 -0
  46. data/lib/graphs/goodsales_v2/process_opportunity.grf +46 -0
  47. data/lib/graphs/goodsales_v2/process_opportunity_line_item.grf +171 -0
  48. data/lib/graphs/goodsales_v2/process_opportunity_snapshot.grf +94 -0
  49. data/lib/graphs/goodsales_v2/process_owner.grf +48 -0
  50. data/lib/graphs/goodsales_v2/process_stage.grf +51 -0
  51. data/lib/graphs/goodsales_v2/process_stage_history.grf +184 -0
  52. data/lib/graphs/goodsales_v2/process_velocity_duration.grf +140 -0
  53. data/lib/graphs/process_account.grf +1 -1
  54. data/lib/graphs/process_activity.grf +1 -1
  55. data/lib/graphs/process_activity_dim.grf +1 -1
  56. data/lib/graphs/process_activity_owner.grf +1 -1
  57. data/lib/graphs/process_forecast.grf +1 -1
  58. data/lib/graphs/process_opp_records.grf +1 -1
  59. data/lib/graphs/process_opportunity.grf +1 -1
  60. data/lib/graphs/process_opportunity_line_item.grf +1 -1
  61. data/lib/graphs/process_opportunity_snapshot.grf +1 -1
  62. data/lib/graphs/process_owner.grf +1 -1
  63. data/lib/graphs/process_stage.grf +1 -1
  64. data/lib/graphs/process_stage_history.grf +1 -1
  65. data/lib/graphs/process_velocity_duration.grf +1 -1
  66. data/lib/nodes/clover_gen.rb +59 -946
  67. data/lib/nodes/dependency.rb +95 -96
  68. data/lib/runtime.rb +7 -648
  69. data/lib/utils/utils.rb +66 -0
  70. data/templates/flow.rb.erb +7 -6
  71. data/templates/join_template.grf.erb +1 -1
  72. data/templates/reformat_template.grf.erb +1 -1
  73. data/templates/sink.json.erb +28 -0
  74. data/templates/tap.json.erb +3 -5
  75. data/templates/workspace.prm.erb +4 -0
  76. metadata +50 -8
  77. data/lib/contract_checkers/contract_checkers.rb +0 -53
  78. data/lib/dsl/project_dsl.rb +0 -259
  79. data/lib/repo/1_config.json +0 -8
  80. data/templates/dataset.json.erb +0 -13
  81. data/templates/source.json.erb +0 -22
@@ -1,96 +1,95 @@
1
- require 'rgl/adjacency'
2
- require 'rgl/dot'
3
- require 'rgl/topsort'
4
-
5
- require 'repository/repo'
6
-
7
- module GoodData
8
- module CloverGenerator
9
- module Dependency
10
-
11
-
12
- class Visitor
13
-
14
- def accept(node)
15
- # puts node
16
- if node.type == "ldm"
17
- puts "LDM #{node.to_s}"
18
- else
19
- puts "doing something on #{node.to_s}"
20
- end
21
- end
22
-
23
- end
24
-
25
- class N
26
- def initialize(x)
27
- @x = x
28
- end
29
-
30
- def to_s
31
- "#{@x[:type]}-#{@x[:name]}"
32
- end
33
-
34
- def type
35
- @x[:type]
36
- end
37
-
38
- def provides
39
- @x[:provides]
40
- end
41
-
42
- def requires
43
- @x[:requires]
44
- end
45
-
46
- def package
47
- @x[:package]
48
- end
49
-
50
- def visit(v)
51
- v.accept(self)
52
- end
53
-
54
- end
55
-
56
-
57
- def resolve(repo, you)
58
- repo << you
59
-
60
- providers = repo.reduce({}) do |memo, mod|
61
- package = mod.package
62
- mod.provides.each do |providee|
63
- memo[[package, providee].join('/')] = mod
64
- end
65
- memo
66
- end
67
-
68
- vertices = repo.reduce([]) do |memo, mod|
69
- package = mod.package
70
- reqs = mod.requires
71
- len = reqs.length
72
- req_modules = reqs.map do |m|
73
- if providers[m].nil?
74
- fail "Dependency not met. Looking for #{m} and could not find it"
75
- else
76
- providers[m]
77
- end
78
- end
79
- memo.concat([mod].cycle().take(len).zip(req_modules).flatten)
80
- end
81
-
82
- x = RGL::DirectedAdjacencyGraph[*vertices]
83
- fail "Graph is cyclic" unless x.acyclic?
84
- x
85
- end
86
-
87
- def get_dependent(graph, you)
88
- graph.bfs_search_tree_from(you)
89
- end
90
-
91
- def to_dot(graph)
92
- graph.write_to_graphic_file('jpg')
93
- end
94
- end
95
- end
96
- end
1
+ # require 'rgl/adjacency'
2
+ # require 'rgl/dot'
3
+ # require 'rgl/topsort'
4
+ #
5
+ # require 'repository/repo'
6
+ #
7
+ # module GoodData
8
+ # module CloverGenerator
9
+ # module Dependency
10
+ #
11
+ # class Visitor
12
+ #
13
+ # def accept(node)
14
+ # # puts node
15
+ # if node.type == "ldm"
16
+ # puts "LDM #{node.to_s}"
17
+ # else
18
+ # puts "doing something on #{node.to_s}"
19
+ # end
20
+ # end
21
+ #
22
+ # end
23
+ #
24
+ # class N
25
+ # def initialize(x)
26
+ # @x = x
27
+ # end
28
+ #
29
+ # def to_s
30
+ # "#{@x[:type]}-#{@x[:name]}"
31
+ # end
32
+ #
33
+ # def type
34
+ # @x[:type]
35
+ # end
36
+ #
37
+ # def provides
38
+ # @x[:provides]
39
+ # end
40
+ #
41
+ # def requires
42
+ # @x[:requires]
43
+ # end
44
+ #
45
+ # def package
46
+ # @x[:package]
47
+ # end
48
+ #
49
+ # def visit(v)
50
+ # v.accept(self)
51
+ # end
52
+ #
53
+ # end
54
+ #
55
+ #
56
+ # def resolve(repo, you)
57
+ # repo << you
58
+ #
59
+ # providers = repo.reduce({}) do |memo, mod|
60
+ # package = mod.package
61
+ # mod.provides.each do |providee|
62
+ # memo[[package, providee].join('/')] = mod
63
+ # end
64
+ # memo
65
+ # end
66
+ #
67
+ # vertices = repo.reduce([]) do |memo, mod|
68
+ # package = mod.package
69
+ # reqs = mod.requires
70
+ # len = reqs.length
71
+ # req_modules = reqs.map do |m|
72
+ # if providers[m].nil?
73
+ # fail "Dependency not met. Looking for #{m} and could not find it"
74
+ # else
75
+ # providers[m]
76
+ # end
77
+ # end
78
+ # memo.concat([mod].cycle().take(len).zip(req_modules).flatten)
79
+ # end
80
+ #
81
+ # x = RGL::DirectedAdjacencyGraph[*vertices]
82
+ # fail "Graph is cyclic" unless x.acyclic?
83
+ # x
84
+ # end
85
+ #
86
+ # def get_dependent(graph, you)
87
+ # graph.bfs_search_tree_from(you)
88
+ # end
89
+ #
90
+ # def to_dot(graph)
91
+ # graph.write_to_graphic_file('jpg')
92
+ # end
93
+ # end
94
+ # end
95
+ # end