gd_bam 0.0.11 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -5,10 +5,13 @@ BAM is a tool that helps you be more productive while creating and maintaining p
5
5
 
6
6
  ##Installation
7
7
 
8
- make sure you have ruby (1.9 and 1.8.7 is currently supported) and that you have gem installed. On mac this is already on your machine.
8
+ make sure you have ruby (1.9 and 1.8.7 is currently supported) and that you have gem installed.
9
9
 
10
10
  `gem install gd_bam`
11
11
 
12
+ Notes: Mac
13
+ On mac ruby is already on your machine but you have to provide it with root access privileges. You can do it by running `sudo gem install gd_bam`. On top of that some C libraries are going to be installed your machine to make this work you need to install XCode on your computer (We are working on making this one easier).
14
+
12
15
  Done.
13
16
 
14
17
  ##Sample project -- GoodSales
@@ -40,7 +43,7 @@ If everything is ok go ahead and generate the downloaders.
40
43
 
41
44
  `bam generate_downloaders`
42
45
 
43
- We will talk in detail why we split etl for project into downloaders and rest of the ETL. Now just trust us. By default it is generated into downloader_project folder. You can go ahead and run it on platform.
46
+ We will talk in detail why we split etl for project into downloaders and rest of the ETL. Now just trust us. By default it is generated into downloader-project folder. You can go ahead and run it on platform.
44
47
 
45
48
  `bam run downloader-project --email joe@example.com`
46
49
 
@@ -50,7 +53,7 @@ Now generate the etl.
50
53
 
51
54
  `bam generate`
52
55
 
53
- This works the same as with downloaders but its default target is clover_project
56
+ This works the same as with downloaders but its default target is clover-project
54
57
 
55
58
  `bam run clover-project --email joe@example.com`
56
59
 
@@ -309,4 +312,4 @@ Bam is working with something that is called Incremental metadata. Metadata is n
309
312
  You have a conceptual picture of a simple transformation. You get a Tap that downloads FirstName and LastName somewhere. Obviously you would like to join them together to form a name. Exactly this happens in the second box the transformer. You would like to sink the only field and that is name. So on the next edge what you say is "I am adding Name and removing FirstName and LastName". So far so good. What is elegant about this approach is that how it copes with change. Imagine that the tap gets not only FirstName and LastName but also Age. Now what you need to change? If you would do it the old way You would have to change metadata on both edges, tap transformer and sink. With incremental metadata you need to change tap and sink nothing else. Since I claim that dealing with metadata was the biggest pain this is a lot of work (and errors) that you just saved.
310
313
 
311
314
  ###Types or not?
312
- Clover engine is built on Java and it shows. It is statically typed and CTL Clover transformation language resembles Java a lot. While it helps speed and many people claim it prevents errors it also causes more work and helps metadata explosion. Sometimes you need to translate an field into another field becuase you need to do something specific or the component needs it. It is not problem per se but it is important to see the tradeoffs and push the functionality into the components that should work for you and not against you. It is also important to do certain tasks at certain phases. If you do this you found out that certain parts are easier to automate or you can easily reuse work that you did somewhere else.
315
+ Clover engine is built on Java and it shows. It is statically typed and CTL Clover transformation language resembles Java a lot. While it helps speed and many people claim it prevents errors it also causes more work and helps metadata explosion. Sometimes you need to translate an field into another field becuase you need to do something specific or the component needs it. It is not problem per se but it is important to see the tradeoffs and push the functionality into the components that should work for you and not against you. It is also important to do certain tasks at certain phases. If you do this you found out that certain parts are easier to automate or you can easily reuse work that you did somewhere else.
data/bin/bam CHANGED
@@ -22,7 +22,7 @@ arg_name 'logger'
22
22
  switch [:l,:logger]
23
23
 
24
24
 
25
- desc 'Generates clover project based on information in current directory. The default ouptut is the directory ./clover_project'
25
+ desc 'Generates clover project based on information in current directory. The default ouptut is the directory ./clover-project'
26
26
  # arg_name 'Describe arguments to new here'
27
27
  command :generate do |c|
28
28
 
@@ -32,7 +32,7 @@ command :generate do |c|
32
32
 
33
33
  c.action do |global_options,options,args|
34
34
  GoodData::CloverGenerator.clobber_clover_project
35
- GoodData::CloverGenerator.run(options)
35
+ GoodData::CloverGenerator.generate(options)
36
36
  end
37
37
  end
38
38
 
@@ -70,8 +70,8 @@ command :taps_validate do |c|
70
70
  result.each_pair do |obj, fields|
71
71
  if fields.empty?
72
72
  puts HighLine::color("GOOD", :green) + " #{obj}" if verbose
73
- error = true
74
73
  else
74
+ error = true
75
75
  puts HighLine::color("BAD", :red) + " #{obj} [" + fields.join(', ') + "]" if verbose
76
76
  end
77
77
  end
data/lib/bam/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Bam
2
- VERSION = '0.0.11'
2
+ VERSION = '0.0.12'
3
3
  end
@@ -989,8 +989,9 @@ HEREDOC
989
989
  end
990
990
 
991
991
  stuff = mapping + add.join(",") + "]}}"
992
-
993
- build_node2(builder, GoodData::CloverGenerator::Nodes.sfdc_reader2({:name => "#{file} SF Writer", :id => "#{file}_sf", :soql => generate_select(mod), :sfdcConnection => "SFDC", :fieldsMapping => stuff}))
992
+ mandatory_fields = fields.reject {|f| f[:is_mandatory] == false }.map {|f| f[:name] + ";"}.join
993
+
994
+ build_node2(builder, GoodData::CloverGenerator::Nodes.sfdc_reader2({:name => "#{file} SF Writer", :id => "#{file}_sf", :soql => generate_select(mod), :sfdcConnection => "SFDC", :fieldsMapping => stuff, :mandatoryFields => mandatory_fields}))
994
995
  build_node2(builder, GoodData::CloverGenerator::Nodes.edge2({:toNode => "#{file}_reformat:0", :fromNode => "#{file}_sf:0", :metadata => "#{file}_sf_metadata", :id => get_id()}))
995
996
 
996
997
  transformation_source = "function integer transform() {\n" + (transformation_acts_as(mod).map {|t| "$out.0.#{t.last} = $in.0.#{t.first};"}.join("\n")) + "\nreturn OK;\n}"
@@ -1206,8 +1207,9 @@ HEREDOC
1206
1207
  end
1207
1208
 
1208
1209
  stuff = mapping + add.join(",") + "]}}"
1210
+ mandatory_fields = fields.reject {|f| f[:is_mandatory] == false }.map {|f| f[:name] + ";"}.join
1209
1211
 
1210
- build_node2(builder, GoodData::CloverGenerator::Nodes.sfdc_reader2({:name => "#{file} SF Writer", :id => "#{file}_sf", :soql => generate_incremental_select(mod), :sfdcConnection => "SFDC", :fieldsMapping => stuff, :mandatoryFields => fields.map {|f| f[:name] + ";"}.join}))
1212
+ build_node2(builder, GoodData::CloverGenerator::Nodes.sfdc_reader2({:name => "#{file} SF Writer", :id => "#{file}_sf", :soql => generate_incremental_select(mod), :sfdcConnection => "SFDC", :fieldsMapping => stuff, :mandatoryFields => mandatory_fields}))
1211
1213
  build_node2(builder, GoodData::CloverGenerator::Nodes.edge2({:toNode => "#{file}_reformat:0", :fromNode => "#{file}_sf:0", :metadata => "#{file}_sf_metadata", :id => get_id()}))
1212
1214
 
1213
1215
  transformation_source = "function integer transform() {\n" + (transformation_acts_as(mod).map {|t| "$out.0.#{t.last} = $in.0.#{t.first};"}.join("\n")) + "\nreturn OK;\n}"
data/lib/runtime.rb CHANGED
@@ -456,7 +456,7 @@ module GoodData
456
456
  end
457
457
 
458
458
 
459
- def self.run(options)
459
+ def self.generate(options)
460
460
 
461
461
  only_flow = options[:only]
462
462
  setup_clover_project(CLOVER_PROJECT_ROOT, :name => "etl-#{PARAMS[:project_name]}")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gd_bam
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-09 00:00:00.000000000 Z
12
+ date: 2013-05-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -381,7 +381,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
381
381
  version: '0'
382
382
  segments:
383
383
  - 0
384
- hash: 3835130648573246660
384
+ hash: -1930903317867552914
385
385
  required_rubygems_version: !ruby/object:Gem::Requirement
386
386
  none: false
387
387
  requirements:
@@ -390,7 +390,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
390
390
  version: '0'
391
391
  segments:
392
392
  - 0
393
- hash: 3835130648573246660
393
+ hash: -1930903317867552914
394
394
  requirements: []
395
395
  rubyforge_project:
396
396
  rubygems_version: 1.8.25