smqacloud 0.0.3 → 0.0.4

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/smqacloud.rb +20 -8
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 35c54ce2de5c390b1da148c960fe76a7c47057db
4
- data.tar.gz: bd5b217f6b28ee5c54becaa04d97434067228390
3
+ metadata.gz: 863f963a39be4083e8e11e91eb29e9268127c126
4
+ data.tar.gz: 1e753e9b9905039ee85c802687e4e9d34767a834
5
5
  SHA512:
6
- metadata.gz: 40eefa8a186f8222ae91ea92d1782d136a4d7ffd6dae484fcb9c6adc1de72cd57123848c49c74e038b91f6a24dc45622e691e0252cd56ac8283e0da399245d3b
7
- data.tar.gz: eb16c0b79f1cebcdb6cf4c94c73ac30993bc5e4faf0f119d076212e04b4cb4972c854f18bd17a5bfbbfa14aadc37d8fb354093cf1b224628f55cb846c749988b
6
+ metadata.gz: 4fbec3da936a9fb67da332fcbb3a11f21977534632c3f5954da43c92b642c26792658958cf8024dc4b9140ae01354ecd2251f7871bd1175e16e1284a8be070c1
7
+ data.tar.gz: d72fac33538270f74c477bc8f70b8bed648d4e083f1c9dc08ef646e7ec226e406a56cfb000da51d6f38b8e35c352664bfcf6db1b39e25179d1eb483bf27aecff
data/lib/smqacloud.rb CHANGED
@@ -10,6 +10,7 @@ require 'smapisatqacloud'
10
10
  # playlistID = ARGV[0]
11
11
  # = "your token id"
12
12
  # $add_variable = Hash.new
13
+ $fullTaskName = nil
13
14
 
14
15
  def self.req_all_scripts(path)
15
16
  Dir.log("#{path}/**/*.rb") do |req_all|
@@ -17,6 +18,13 @@ def self.req_all_scripts(path)
17
18
  end
18
19
  end
19
20
 
21
+ def self.get_file_full_path(taskname)
22
+ Dir.log("#{path}/**/*.rb") do |rb_file|
23
+ filename = File.basename(rb_file,File.extname(rb_file))
24
+ if filename == taskname then
25
+ $fullTaskName = rb_file
26
+ end
27
+ end
20
28
 
21
29
  def self.playlist(playlistID)
22
30
  $add_variable = Hash.new
@@ -36,9 +44,9 @@ $add_variable = Hash.new
36
44
  task_id = taskhash["body"]["task_id"]
37
45
  $var = taskhash["body"]["task_variables"]
38
46
  $env = taskhash["body"]["environment"]
39
- puts "Workflow: #{$workflow_name}"
47
+ puts "\e[1mWorkflow:\e[0m #{$workflow_name}"
40
48
  $workflow_status = taskhash["body"]["test"]
41
- puts "Now Starting Task: #{$task_name}"
49
+ puts "\e[1mNow Starting Task:\e[0m #{$task_name}"
42
50
 
43
51
  begin
44
52
 
@@ -52,12 +60,14 @@ $add_variable = Hash.new
52
60
  req_all_scripts(path)
53
61
  dur1 = Time.now
54
62
  taskName = $task_name
55
- load "#{taskName}.rb"
63
+ get_file_full_path(taskName)
64
+ task_to_load = $fullTaskName
65
+ load "#{task_to_load}"
56
66
  # send($task_name)
57
67
 
58
68
  rescue Exception => e
59
69
 
60
- puts "Exception occured, Checkpoint should have more info."
70
+ puts "\e[31Exception occured, Checkpoint should have more info.\e[0m"
61
71
  @erro_line = e.backtrace[0].split(":")
62
72
  @error_line = @erro_line[1]
63
73
  @error_message = "#{$!}"
@@ -101,8 +111,8 @@ $add_variable = Hash.new
101
111
  # else
102
112
  # $get_variable.merge!($add_variable)
103
113
  # end
104
- puts "Workflow: #{$workflow_name}"
105
- puts "Now Starting Task: #{$task_name}"
114
+ puts "\e[1mWorkflow:\e[0m #{$workflow_name}"
115
+ puts "\e[1mNow Starting Task:\e[0m #{$task_name}"
106
116
  begin
107
117
  if $var.has_key?("path") == true then
108
118
  if $var["path"].empty? == false then
@@ -114,11 +124,13 @@ $add_variable = Hash.new
114
124
  req_all_scripts(path)
115
125
  dur1 = Time.now
116
126
  taskName = $task_name
117
- load "#{taskName}.rb"
127
+ get_file_full_path(taskName)
128
+ task_to_load = $fullTaskName
129
+ load "#{task_to_load}"
118
130
  # send($task_name)
119
131
 
120
132
  rescue Exception => e
121
- puts "Exception occured, Checkpoint should have more info."
133
+ puts "\e[31Exception occured, Checkpoint should have more info.\e[0m"
122
134
  @erro_line = e.backtrace[0].split(":")
123
135
  @error_line = @erro_line[1]
124
136
  @error_message = "#{$!}"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smqacloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ravi Trivedi