salesforce-dcgen 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f3355f8b878e2babaed9dca52bef60c9bdee6c85
4
- data.tar.gz: ca467a14226ef724097eeb6dc8a6a2423fcb8a22
3
+ metadata.gz: f95ebb03e8268b14d48158046322b0c3999b147f
4
+ data.tar.gz: d53c5db88b4bf669196ce14708ede23080acf9ea
5
5
  SHA512:
6
- metadata.gz: 48a65550b24befa6c037ad3f7ccf92955d8a1477491174e91bdee7aeb103663bf23e040c72b7e0897641971dbc1f4b6a30c9eaf6d89a6a29e3ea8e3b944e8c78
7
- data.tar.gz: a9c73b0ced60500efd94ce7f0f949caaf530c92030f3e79abb99e08103f6d9c22fc9e508465c09ae35dab0ca5d282937759d47b7497ef995f74a26767e761d94
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
@@ -1,3 +1,3 @@
1
1
  module Dcgen
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -48,12 +48,12 @@
48
48
  <name>PermissionSet</name>
49
49
  </types>
50
50
  <% end %>
51
- <% if not @metadata[:workflow].empty? %>
51
+ <% if not @metadata[:workflowrule].empty? %>
52
52
  <types>
53
- <% for @workflow in @metadata[:workflow] %>
54
- <members><%= @workflow %></members>
53
+ <% for @workflowrule in @metadata[:workflowrule] %>
54
+ <members><%= @workflowrule %></members>
55
55
  <% end %>
56
- <name>Workflow</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.5
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-28 00:00:00.000000000 Z
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/workflow.rb
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
-