salesforce-dcgen 0.2.0 → 0.3.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
  SHA1:
3
- metadata.gz: dd35866e61b10e61b4496d16db62bacf1a589398
4
- data.tar.gz: 2ddb0ce67d03279f5d5590381b8a7943a9f8f8d2
3
+ metadata.gz: 007d3cbe573d018be1307626636b62f32f113de3
4
+ data.tar.gz: c3377590ffa6b6fc3af72f31db439a8bb1063d3d
5
5
  SHA512:
6
- metadata.gz: 4e7e9efc15035b18978ebf51c1ff1c95c4118f27267544f4f39795797e20ee954bfbec1bb26edeaf418427fa9e27345bd2e8eafa585efceb480acd27810c5464
7
- data.tar.gz: cbc4fbae60233262b35c571741003fd8f54b7fcc10ee4e37de276e47111953c17354e529090d101423aa40b3069ce4470c830d0d2f3b3c1fc25e18057846dcda
6
+ metadata.gz: d895a93f5fa8fdcc176abb5c60da1ed5803b1f4895c28a944bfac64a9f70d87172a43f8a6edc855afd6a2ab61e3a4144092c9b9dd65f6bfe4fffbfa9fdebd557
7
+ data.tar.gz: 1563b59688bdddd99cb51734c851ba245c5145ce5145b2a490ee3838460cace1cc43aaaefeb6d12ae00362e111f8ee9309e07edb89aaf87c540acca8a8980a0f
data/README.md CHANGED
@@ -27,12 +27,14 @@ At the moment the following metadata is supported:
27
27
 
28
28
  apexclass
29
29
  apexpage
30
+ apextrigger
30
31
  approvalprocess
31
32
  customfield
32
33
  group
33
34
  permissionset
34
35
  workflowrule
35
36
  labels
37
+ workflow field update
36
38
 
37
39
  More to come...
38
40
 
@@ -0,0 +1,42 @@
1
+ require 'nokogiri'
2
+
3
+ module Dcgen
4
+
5
+ def self.workflowfieldupdate master , destination
6
+
7
+ remove_fieldupdates = []
8
+
9
+ master_objects = Dir.glob(master + '/workflows/*workflow').map {|c| c.match(/^.*\/(.*).workflow$/)[1] }
10
+
11
+ master_objects.each do |obj|
12
+
13
+ master_obj_file = File.join(master,'workflows',obj + '.workflow')
14
+ destination_obj_file = File.join(destination,'workflows',obj + '.workflow')
15
+
16
+ if File.exists? destination_obj_file
17
+
18
+ master_obj_xml = File.open(master_obj_file).read
19
+ destination_obj_xml = File.open(destination_obj_file).read
20
+
21
+ master_doc = Nokogiri::XML(master_obj_xml).remove_namespaces!
22
+ destination_doc = Nokogiri::XML(destination_obj_xml).remove_namespaces!
23
+
24
+ # Find all the customfields that are in destination, if they are not present in
25
+ # master, then they have to be in the remove list
26
+ destination_doc.xpath('//fieldUpdates/fullName').each do |field|
27
+ remove_fieldupdates << "#{obj}.#{field.text}" if master_doc.xpath("//fieldUpdates[fullName=\"#{field.text}\"]").empty?
28
+ end
29
+
30
+ end
31
+
32
+ end
33
+
34
+ puts "FieldUpdates:" if not remove_fieldupdates.empty?
35
+ remove_fieldupdates.each do |fieldupdate|
36
+ puts " #{fieldupdate}"
37
+ end
38
+
39
+ remove_fieldupdates
40
+
41
+ end
42
+ end
data/lib/dcgen/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Dcgen
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -72,4 +72,12 @@
72
72
  <name>CustomLabel</name>
73
73
  </types>
74
74
  <% end %>
75
+ <% if not @metadata[:workflowfieldupdate].empty? %>
76
+ <types>
77
+ <% for @workflowfieldupdate in @metadata[:workflowfieldupdate] %>
78
+ <members><%= @workflowfieldupdate %></members>
79
+ <% end %>
80
+ <name>WorkflowFieldUpdate</name>
81
+ </types>
82
+ <% end %>
75
83
  </Package>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: salesforce-dcgen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Breinlinger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-03 00:00:00.000000000 Z
11
+ date: 2014-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -76,6 +76,7 @@ files:
76
76
  - lib/dcgen/plugins/group.rb
77
77
  - lib/dcgen/plugins/label.rb
78
78
  - lib/dcgen/plugins/permissionset.rb
79
+ - lib/dcgen/plugins/workflowfieldupdate.rb
79
80
  - lib/dcgen/plugins/workflowrule.rb
80
81
  - lib/dcgen/version.rb
81
82
  - salesforce-dcgen.gemspec