mtm 2.2.1 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +8 -8
  2. data/lib/mtm/mtm.rb +39 -3
  3. data/lib/mtm/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MzA2ZWQ4MjUzZTU1NTY3NGViYjEzOTI5YTcyMTVmODc5ZjJkOWU3NQ==
4
+ ZGFlZDcwMTZiOTNmMGU4MjYyMTI2MjQyYTNjOGQ4MTNjZGY4N2YxYg==
5
5
  data.tar.gz: !binary |-
6
- ODllZjg0NzgyNWMwMzdlZWViNDUxOWZhM2MxZDNmNTAyYjZiMDQ3Nw==
6
+ MDY1OTM2YTUxYTE3YTU1MWJlZjUwNjU4YzFjZWZiNWQxNDFkYTAxMA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- YTIyM2RiOTk1ZmE4ZWRiNmYxZjY5ZGUwM2Q0YTY0MWMxY2RmYmFmZjY1MTY5
10
- Mzg1MGM1OGI5MmMzMzE4N2Q1ZmM3MmI4NjM2Y2M1MGZlN2E1NDQ2NWJhNjIy
11
- MGY1MGYzOTEwNmVmZTJjYmY5OGRhNmJhN2I1MmZmZDJjNTEyNzY=
9
+ NWIxYmVjMGIyZDE2NmE5Y2M4Mzg1YzE5ZmEwYzhhMDI4YTZlZTkwNjE4ZTU2
10
+ NTQ2M2E2NGRhYzAxMDhjY2FmZTZlMDVhYjY3MmQ5OTM5MmMyOTg3YTRmYjU4
11
+ N2E4M2U3ZmZlNmU0YTMwOTljMmUwMTkyZWYwMDUwODg3ZTMwNGY=
12
12
  data.tar.gz: !binary |-
13
- ZjM0NjVlYmNlZjg2MTgzZGMyN2Q5ODBhYzhkYWNlYWQwNDA4MmVkMjEzOGYy
14
- ZTEwYjY1MzM1ZGQ0YWYyN2I2ZGI5YTdlNWIwYTIxM2UwMTlkZWJkYjFiNmU2
15
- YmE2YTAxYmEzODE1OWFiNmJjYTJjMjkzNGI3MzIxMzY4YzQxMjc=
13
+ MDYxOWJiYzE2MmNmZWRmNGJiM2MzZjhhZWNhOGRjMGM1OWU3MDBhMjA2OWRm
14
+ MTVkNTRiMjEzMTNkOGI0Zjc0Y2JhZmFiODQyOTJkZjBjYWFlZDU2NTVhODVm
15
+ NTcyOGQ1NmQ5ZjEyMGZlYWQzZGYyMjhhNWEyMThhMjJiMmY0MTg=
@@ -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] != ''
@@ -1,3 +1,3 @@
1
1
  module Mtm
2
- VERSION = "2.2.1"
2
+ VERSION = "3.0.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mtm
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bruce Yue