salesforce-dcgen 0.0.5 → 0.0.6
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/lib/dcgen/plugins/workflowrule.rb +38 -0
- data/lib/dcgen/version.rb +1 -1
- data/tpl/destructiveChanges.xml.erb +4 -4
- metadata +3 -3
- data/lib/dcgen/plugins/workflow.rb +0 -38
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f95ebb03e8268b14d48158046322b0c3999b147f
|
4
|
+
data.tar.gz: d53c5db88b4bf669196ce14708ede23080acf9ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b73779d583d9a16e6014287f7b5b3682cd5c02ec9060250aca270c731a0b0654e1d2ddd5250a43162823339c0960e2dc9e29bcdd9021719f6107f173a9c4cb01
|
7
|
+
data.tar.gz: 30a969e973b15fc38e69c0f9bfc72c4d755fb6fd8ca9f14bcac8c886e6825f4fbed247d724cb88d5589cc1607c37697a6a26aa1357ff8dba05282dcb53bc940c
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'nokogiri'
|
2
|
+
|
3
|
+
module Dcgen
|
4
|
+
|
5
|
+
def self.workflowrule master , destination
|
6
|
+
|
7
|
+
remove_workflowrules = []
|
8
|
+
|
9
|
+
master_workflowrules = Dir.glob(master + '/workflows/*workflow').map {|c| c.match(/^.*\/(.*).workflow$/)[1] }
|
10
|
+
|
11
|
+
master_workflowrules.each do |workflowrule|
|
12
|
+
|
13
|
+
master_workflowrules_file = File.join(master,'workflows',workflowrule + '.workflow')
|
14
|
+
destination_workflowrules_file = File.join(destination,'workflows',workflowrule + '.workflow')
|
15
|
+
|
16
|
+
if File.exists? destination_workflowrules_file
|
17
|
+
|
18
|
+
master_workflowrules_xml = File.open(master_workflowrules_file).read
|
19
|
+
destination_workflowrules_xml = File.open(destination_workflowrules_file).read
|
20
|
+
|
21
|
+
master_doc = Nokogiri::XML(master_workflowrules_xml).remove_namespaces!
|
22
|
+
destination_doc = Nokogiri::XML(destination_workflowrules_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('//rules/fullName').each do |rule|
|
27
|
+
remove_workflowrules << "#{workflowrule}.#{rule.text}" if master_doc.xpath("//rules[fullName=\"#{rule.text}\"]").empty?
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
|
34
|
+
remove_workflowrules
|
35
|
+
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
data/lib/dcgen/version.rb
CHANGED
@@ -48,12 +48,12 @@
|
|
48
48
|
<name>PermissionSet</name>
|
49
49
|
</types>
|
50
50
|
<% end %>
|
51
|
-
<% if not @metadata[:
|
51
|
+
<% if not @metadata[:workflowrule].empty? %>
|
52
52
|
<types>
|
53
|
-
<% for @
|
54
|
-
<members><%= @
|
53
|
+
<% for @workflowrule in @metadata[:workflowrule] %>
|
54
|
+
<members><%= @workflowrule %></members>
|
55
55
|
<% end %>
|
56
|
-
<name>
|
56
|
+
<name>WorkflowRule</name>
|
57
57
|
</types>
|
58
58
|
<% end %>
|
59
59
|
</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.0.
|
4
|
+
version: 0.0.6
|
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-10-
|
11
|
+
date: 2014-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -60,7 +60,7 @@ files:
|
|
60
60
|
- lib/dcgen/plugins/customfield.rb
|
61
61
|
- lib/dcgen/plugins/group.rb
|
62
62
|
- lib/dcgen/plugins/permissionset.rb
|
63
|
-
- lib/dcgen/plugins/
|
63
|
+
- lib/dcgen/plugins/workflowrule.rb
|
64
64
|
- lib/dcgen/version.rb
|
65
65
|
- salesforce-dcgen.gemspec
|
66
66
|
- tpl/destructiveChanges.xml.erb
|
@@ -1,38 +0,0 @@
|
|
1
|
-
require 'nokogiri'
|
2
|
-
|
3
|
-
module Dcgen
|
4
|
-
|
5
|
-
def self.workflow master , destination
|
6
|
-
|
7
|
-
remove_workflows = []
|
8
|
-
|
9
|
-
master_workflows = Dir.glob(master + '/workflows/*workflow').map {|c| c.match(/^.*\/(.*).workflow$/)[1] }
|
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!
|
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
|
37
|
-
end
|
38
|
-
|