rjobs 0.3.2.alpha → 0.3.3.alpha

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/bin/rjharvest +10 -5
  2. data/bin/rjsubmit +20 -2
  3. data/lib/rjobs/version.rb +1 -1
  4. metadata +19 -19
@@ -19,6 +19,8 @@ where [options] are:
19
19
 
20
20
  p = parser(banner)
21
21
 
22
+ p.opt :separate, "colect output in separate file", :default=> false
23
+
22
24
  opts = Trollop::with_standard_exception_handling p do
23
25
  o = p.parse ARGV
24
26
  raise Trollop::HelpNeeded if ARGV.empty? # show help screen
@@ -33,16 +35,19 @@ raise "The file \"#{jobs_file}\" must exist." unless File.exist?(jobs_file)
33
35
 
34
36
 
35
37
  jobs = get_jobs_info(jobs_file)
36
- jobs.each do |job|
37
- Rjobs::JobHandler.get_job_results(job, true)
38
- end
39
38
 
39
+ if opts[:separate]
40
+ jobs.each do |job|
41
+ Rjobs::JobHandler.get_job_results(job, true)
42
+ end
43
+ end
40
44
 
41
- File.open("#{File.basename(jobs_file,File.extname(jobs_file))}.out", 'w') do |file|
45
+ outputFile = "#{File.basename(jobs_file,File.extname(jobs_file))}.out"
46
+ File.open(outputFile, 'w') do |file|
42
47
  jobs.each do |job|
43
48
  file.puts Rjobs::JobHandler.get_job_results(job, false)
44
49
  end
45
50
  end
46
51
 
47
52
 
48
- puts "#{jobs.count} jobs was collected.".green
53
+ puts "#{jobs.count} jobs was collected in \"#{outputFile}\"".green
@@ -19,6 +19,9 @@ where [options] are:
19
19
  "
20
20
 
21
21
  p = parser(banner)
22
+ p.opt :outputFile , "The file that store the mapping between JobName and JobId",
23
+ :type => String,
24
+ :default => ""
22
25
 
23
26
  opts = Trollop::with_standard_exception_handling p do
24
27
  o = p.parse ARGV
@@ -34,6 +37,21 @@ raise "The file \"#{jobs_input_file}\" must exist." unless File.exist?(jobs_inpu
34
37
 
35
38
 
36
39
  jif = Rjobs::JobInputFile.new(jobs_input_file)
40
+
41
+ outputFile = opts[:outputFile].empty? ? "#{jif.jobName}.rjobs" : opts[:outputFile];
42
+ if File.exist?(outputFile)
43
+ continue = true
44
+ while continue
45
+ print "File #{outputFile} exists. Would you like to overwrite it? [y/n]: "
46
+ case STDIN.gets
47
+ when /^[Yy](es)?$/
48
+ continue = false
49
+ when /^[nN]o?$/ #n or no
50
+ Process.exit
51
+ end
52
+ end
53
+ end
54
+
37
55
  jobs = []
38
56
  length = jif.jobIdTo.length
39
57
  (jif.jobIdFrom .. jif.jobIdTo).each do |id|
@@ -48,6 +66,6 @@ jobs.each do |job|
48
66
  end
49
67
 
50
68
  jf = Rjobs::JobsFile.new()
51
- jf.write(jif.jobName+".rjobs",jobs)
69
+ jf.write(outputFile, jobs)
70
+ puts "#{jobs.count} job(s) submited.".green
52
71
 
53
- puts "#{jobs.count} job(s) submited.".green
@@ -1,3 +1,3 @@
1
1
  module Rjobs
2
- VERSION = "0.3.2.alpha"
2
+ VERSION = "0.3.3.alpha"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rjobs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2.alpha
4
+ version: 0.3.3.alpha
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-12-01 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70177246447460 !ruby/object:Gem::Requirement
16
+ requirement: &70168098688540 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70177246447460
24
+ version_requirements: *70168098688540
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: cucumber
27
- requirement: &70177246445320 !ruby/object:Gem::Requirement
27
+ requirement: &70168098688120 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70177246445320
35
+ version_requirements: *70168098688120
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: aruba
38
- requirement: &70177246444900 !ruby/object:Gem::Requirement
38
+ requirement: &70168098685140 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70177246444900
46
+ version_requirements: *70168098685140
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: guard
49
- requirement: &70177246444480 !ruby/object:Gem::Requirement
49
+ requirement: &70168098684580 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70177246444480
57
+ version_requirements: *70168098684580
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: growl_notify
60
- requirement: &70177246443860 !ruby/object:Gem::Requirement
60
+ requirement: &70168098683960 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70177246443860
68
+ version_requirements: *70168098683960
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: guard-rspec
71
- requirement: &70177246443360 !ruby/object:Gem::Requirement
71
+ requirement: &70168098683340 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *70177246443360
79
+ version_requirements: *70168098683340
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: plist
82
- requirement: &70177246442940 !ruby/object:Gem::Requirement
82
+ requirement: &70168098682700 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '0'
88
88
  type: :runtime
89
89
  prerelease: false
90
- version_requirements: *70177246442940
90
+ version_requirements: *70168098682700
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: colorize
93
- requirement: &70177246442520 !ruby/object:Gem::Requirement
93
+ requirement: &70168098682280 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: '0'
99
99
  type: :runtime
100
100
  prerelease: false
101
- version_requirements: *70177246442520
101
+ version_requirements: *70168098682280
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: trollop
104
- requirement: &70177246442080 !ruby/object:Gem::Requirement
104
+ requirement: &70168098681860 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ! '>='
@@ -109,7 +109,7 @@ dependencies:
109
109
  version: '0'
110
110
  type: :runtime
111
111
  prerelease: false
112
- version_requirements: *70177246442080
112
+ version_requirements: *70168098681860
113
113
  description: Gem to handle Jobs for XGrid
114
114
  email:
115
115
  - merlinvn@gmail.com