salesforce-dcgen 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dcgen/plugins/workflow.rb +30 -4
- data/lib/dcgen/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f3355f8b878e2babaed9dca52bef60c9bdee6c85
|
4
|
+
data.tar.gz: ca467a14226ef724097eeb6dc8a6a2423fcb8a22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48a65550b24befa6c037ad3f7ccf92955d8a1477491174e91bdee7aeb103663bf23e040c72b7e0897641971dbc1f4b6a30c9eaf6d89a6a29e3ea8e3b944e8c78
|
7
|
+
data.tar.gz: a9c73b0ced60500efd94ce7f0f949caaf530c92030f3e79abb99e08103f6d9c22fc9e508465c09ae35dab0ca5d282937759d47b7497ef995f74a26767e761d94
|
@@ -1,12 +1,38 @@
|
|
1
|
+
require 'nokogiri'
|
2
|
+
|
1
3
|
module Dcgen
|
2
4
|
|
3
5
|
def self.workflow master , destination
|
4
6
|
|
5
|
-
|
6
|
-
destination_workflow = Dir.glob(destination + '/workflows/*workflow').map {|c| c.match(/^.*\/(.*).workflow$/)[1] }
|
7
|
+
remove_workflows = []
|
7
8
|
|
8
|
-
|
9
|
+
master_workflows = Dir.glob(master + '/workflows/*workflow').map {|c| c.match(/^.*\/(.*).workflow$/)[1] }
|
9
10
|
|
10
|
-
|
11
|
+
master_workflows.each do |workflow|
|
12
|
+
|
13
|
+
master_workflows_file = File.join(master,'workflows',workflow + '.workflow')
|
14
|
+
destination_workflows_file = File.join(destination,'workflows',workflow + '.workflow')
|
15
|
+
|
16
|
+
if File.exists? destination_workflows_file
|
17
|
+
|
18
|
+
master_workflows_xml = File.open(master_workflows_file).read
|
19
|
+
destination_workflows_xml = File.open(destination_workflows_file).read
|
20
|
+
|
21
|
+
master_doc = Nokogiri::XML(master_workflows_xml).remove_namespaces!
|
22
|
+
destination_doc = Nokogiri::XML(destination_workflows_xml).remove_namespaces!
|
11
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('//rules/fullName').each do |rule|
|
27
|
+
remove_workflows << "#{workflow}.#{rule.text}" if master_doc.xpath("//rules[fullName=\"#{rule.text}\"]").empty?
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
|
34
|
+
remove_workflows
|
35
|
+
|
36
|
+
end
|
12
37
|
end
|
38
|
+
|
data/lib/dcgen/version.rb
CHANGED