salesforce-dcgen 0.7.0 → 0.8.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: 2e8743250fb9cace705b986b6fa4aff38d306d8a
4
- data.tar.gz: c55c7f1f4462a5fa91032ce2a0b4c38bb1e144f2
3
+ metadata.gz: a8e9c1a880499f45d94f9373bb6064c23c4bdb3d
4
+ data.tar.gz: c969eb11a2e19239d941b5b7d4100197c6f81531
5
5
  SHA512:
6
- metadata.gz: 95a455bf2e1751ea014ac098ed3202ea50f8716091a295749271f8569dff65adb37106235741c2fc432968dd94a077ecbab69c64a3e16b4c06f06b3fd0e88336
7
- data.tar.gz: 806c107741fb409bf288ff4f79d59babcfcb1c207a3fdff55358c39c6d88e5063acfeab01d8359c2f7df2ccbd647eeca6e09a721408cd96cb1137cd28294b366
6
+ metadata.gz: f20ac238234b35e6c7c749dcff76f8410f162ca206a8b66bc1305348e2d092b47fcf0a13acc186bbfd27e491e98c92e9271aae5a57bcc98fdbc57438482e19db
7
+ data.tar.gz: a2a2e25fe95d54f0ee149e915fb6a16bd14262b7f8a54bff9cbd863620383c107a41f254ff756ae4a60043f3ee1c9dc5e50fee1a5a9244bf6aa6e8820ff3d987
data/bin/dcgen CHANGED
@@ -30,6 +30,10 @@ parser = OptionParser.new do |opts|
30
30
  options[:exclude] = exclude.split(',')
31
31
  end
32
32
 
33
+ opts.on('-i', '--include CSV_METADATA_LIST', 'a CSV list of metadata to destroy only') do |include|
34
+ options[:include] = include.split(',')
35
+ end
36
+
33
37
  opts.on('-v', '--version', 'Show current version') do
34
38
  puts Dcgen::VERSION
35
39
  exit 0
@@ -54,7 +58,6 @@ rescue => e
54
58
  exit 1
55
59
  end
56
60
 
57
-
58
61
  if options[:master].nil?
59
62
  puts "error: you must specify master dir"
60
63
  exit 1
@@ -73,6 +76,7 @@ begin
73
76
  dcgen.destination = options[:destination]
74
77
  dcgen.output = options[:output] if not options[:output].nil?
75
78
  dcgen.exclude = options[:exclude] if not options[:exclude].nil?
79
+ dcgen.include = options[:include] if not options[:include].nil?
76
80
 
77
81
  dcgen.generate_destructive_changes
78
82
 
@@ -1,13 +1,14 @@
1
1
  module Dcgen
2
2
  class App
3
3
 
4
- attr_accessor :master, :destination, :output, :exclude, :verbose
4
+ attr_accessor :master, :destination, :output, :exclude, :verbose, :include
5
5
 
6
6
  def initialize
7
7
 
8
8
  @verbose = true
9
9
  @metadata = {}
10
10
  @exclude = []
11
+ @include = []
11
12
 
12
13
  end
13
14
 
@@ -51,6 +52,7 @@ Diff between:
51
52
  master: #{master}
52
53
  destination: #{destination}:
53
54
  excluded: #{@exclude.join(' ')}
55
+ included: #{@include.join(' ')}
54
56
 
55
57
  Changes detected:
56
58
  =================
@@ -68,15 +70,20 @@ Changes detected:
68
70
  print_header if @verbose
69
71
 
70
72
  # Load plugins and build metadata variables
71
- plugins = Dir.glob(File.dirname(__FILE__) + "/plugins/*" )
73
+ plugins = Dir.glob(File.dirname(__FILE__) + "/plugins/*")
72
74
 
73
75
  plugins.each do |plugin|
74
76
 
75
77
  require_relative plugin
76
78
 
77
79
  plugin_name = plugin.match(/^.*\/(.*).rb$/)[1]
78
- plugin_metadata = eval "Dcgen::#{plugin_name} @master, @destination, @verbose"
79
- @metadata[plugin_name.to_sym] = plugin_metadata - @exclude unless plugin_metadata.nil?
80
+
81
+ if @include.include?(plugin_name) || @include.empty?
82
+ plugin_metadata = eval "Dcgen::#{plugin_name} @master, @destination, @verbose"
83
+ @metadata[plugin_name.to_sym] = plugin_metadata - @exclude unless plugin_metadata.nil?
84
+ else
85
+ @metadata[plugin_name.to_sym] = []
86
+ end
80
87
 
81
88
  end
82
89
 
@@ -1,3 +1,3 @@
1
1
  module Dcgen
2
- VERSION = "0.7.0"
2
+ VERSION = "0.8.0"
3
3
  end
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.7.0
4
+ version: 0.8.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: 2015-04-22 00:00:00.000000000 Z
11
+ date: 2015-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler