mtm 2.2.1 → 3.0.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 +8 -8
- data/lib/mtm/mtm.rb +39 -3
- data/lib/mtm/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZGFlZDcwMTZiOTNmMGU4MjYyMTI2MjQyYTNjOGQ4MTNjZGY4N2YxYg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MDY1OTM2YTUxYTE3YTU1MWJlZjUwNjU4YzFjZWZiNWQxNDFkYTAxMA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NWIxYmVjMGIyZDE2NmE5Y2M4Mzg1YzE5ZmEwYzhhMDI4YTZlZTkwNjE4ZTU2
|
10
|
+
NTQ2M2E2NGRhYzAxMDhjY2FmZTZlMDVhYjY3MmQ5OTM5MmMyOTg3YTRmYjU4
|
11
|
+
N2E4M2U3ZmZlNmU0YTMwOTljMmUwMTkyZWYwMDUwODg3ZTMwNGY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MDYxOWJiYzE2MmNmZWRmNGJiM2MzZjhhZWNhOGRjMGM1OWU3MDBhMjA2OWRm
|
14
|
+
MTVkNTRiMjEzMTNkOGI0Zjc0Y2JhZmFiODQyOTJkZjBjYWFlZDU2NTVhODVm
|
15
|
+
NTcyOGQ1NmQ5ZjEyMGZlYWQzZGYyMjhhNWEyMThhMjJiMmY0MTg=
|
data/lib/mtm/mtm.rb
CHANGED
@@ -5,8 +5,7 @@ require 'optparse/date'
|
|
5
5
|
require 'ruby-progressbar'
|
6
6
|
require 'utils'
|
7
7
|
require 'config'
|
8
|
-
|
9
|
-
@pb = ProgressBar.create(:title => 'Logging', :starting_at => 0, :total => 100, :progress_mark => '*', :format => '%w %%')
|
8
|
+
require 'version'
|
10
9
|
|
11
10
|
# Parse arguments
|
12
11
|
options = {}
|
@@ -58,6 +57,10 @@ op = OptionParser.new do |opts|
|
|
58
57
|
options[:tm_list] = list
|
59
58
|
end
|
60
59
|
|
60
|
+
opts.on("-L ProjectPartName", "List some specific projects and changes.") do |l|
|
61
|
+
options[:tm_s_list] = l
|
62
|
+
end
|
63
|
+
|
61
64
|
opts.on("-p ProjectName", "The project full Name or part name.") do |project|
|
62
65
|
options[:tm_project] = project
|
63
66
|
end
|
@@ -90,14 +93,25 @@ op = OptionParser.new do |opts|
|
|
90
93
|
puts op
|
91
94
|
exit
|
92
95
|
end
|
96
|
+
|
97
|
+
opts.on_tail("-v", "Show version") do
|
98
|
+
puts Mtm::VERSION
|
99
|
+
exit
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
begin
|
104
|
+
op.parse(ARGV)
|
105
|
+
rescue Exception => e
|
106
|
+
abort e.message
|
93
107
|
end
|
94
|
-
op.parse(ARGV)
|
95
108
|
|
96
109
|
if ARGV.size < 1
|
97
110
|
puts op
|
98
111
|
exit
|
99
112
|
end
|
100
113
|
|
114
|
+
@pb = ProgressBar.create(:title => 'Logging', :starting_at => 0, :total => 100, :progress_mark => '*', :format => '%w %%')
|
101
115
|
40.times { sleep(0.05); @pb.increment }
|
102
116
|
|
103
117
|
# login to salesforce.com
|
@@ -135,6 +149,28 @@ if options[:tm_list]
|
|
135
149
|
abort
|
136
150
|
end
|
137
151
|
|
152
|
+
# list some projects and its changes
|
153
|
+
if options[:tm_s_list] != nil
|
154
|
+
40.times { sleep(0.05); @pb.increment }
|
155
|
+
projects = client.query("select Id, Name, ProjectNumber__c, (select Id, Name, ChangeNumber__c from Changes__r
|
156
|
+
where Status__c != 'Closed') from MProject__c where Status__c != 'Closed' and Name like '%#{options[:tm_s_list]}%'")
|
157
|
+
if projects.size == 0
|
158
|
+
puts
|
159
|
+
abort 'No project found'
|
160
|
+
end
|
161
|
+
projects.each do |p|
|
162
|
+
puts
|
163
|
+
puts p.ProjectNumber__c + ': ' + p.Name
|
164
|
+
if p.Changes__r != nil
|
165
|
+
p.Changes__r.each do |c|
|
166
|
+
puts ' '+ c.ChangeNumber__c + ': ' + c.Name
|
167
|
+
end
|
168
|
+
end
|
169
|
+
end
|
170
|
+
@pb.finish
|
171
|
+
abort
|
172
|
+
end
|
173
|
+
|
138
174
|
msg = 'Project not found'
|
139
175
|
begin
|
140
176
|
if options[:tm_project] != ''
|
data/lib/mtm/version.rb
CHANGED