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 +4 -4
- data/README.md +2 -0
- data/lib/dcgen/plugins/workflowfieldupdate.rb +42 -0
- data/lib/dcgen/version.rb +1 -1
- data/tpl/destructiveChanges.xml.erb +8 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 007d3cbe573d018be1307626636b62f32f113de3
|
4
|
+
data.tar.gz: c3377590ffa6b6fc3af72f31db439a8bb1063d3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d895a93f5fa8fdcc176abb5c60da1ed5803b1f4895c28a944bfac64a9f70d87172a43f8a6edc855afd6a2ab61e3a4144092c9b9dd65f6bfe4fffbfa9fdebd557
|
7
|
+
data.tar.gz: 1563b59688bdddd99cb51734c851ba245c5145ce5145b2a490ee3838460cace1cc43aaaefeb6d12ae00362e111f8ee9309e07edb89aaf87c540acca8a8980a0f
|
data/README.md
CHANGED
@@ -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
@@ -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.
|
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-
|
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
|