rubysdk 0.0.1.pre2 → 0.0.1.pre3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rubysdk.rb +8 -10
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fede86adc91e4d4bb40b8dd9e16da4d831c1ad84187226fd4b3b89983047eaea
4
- data.tar.gz: dd866d6e4565f9f37a566d5ca2234733e512e3f53e97bbf5747b920f2a7fd612
3
+ metadata.gz: ea5938a9b099b67aeb5149413a472d157b152e9c592cbc2c525ba19a7ccafcbe
4
+ data.tar.gz: a3494af531353b4571b26b1bfbd5e037015ea9ad9ccc34a632a2c490bb68cc58
5
5
  SHA512:
6
- metadata.gz: 0a1d80c474ecc9632fe2c507d0beaee5ab76dadf0e2a2e80620b0dd61d0b98a84b6f754d977bbed72bf07db2560555e337e5c13475fb784963c1f98238100c44
7
- data.tar.gz: e1f52e4129b4918886542c03758f945fc8769325a89f7da16431dfb0e00c756f47e379d26e5aaf6245e01fabe2e44e5feb35dffc66e2de1d5f2c86d39433635a
6
+ metadata.gz: 2d65bda402f49c51ddb493b9808320e44f07f2455ed316b0378cd52a5fc5fe29ccf6834c2a073b8602dbed8c5c06b3bfeed4ba30163c2eeb7c122e12d47e4bad
7
+ data.tar.gz: e5c77d6ad58a0a1365b9042d8202421a4e7406891ccd2ce94a2d9607d9bc08e0f532162a655939a19614ab713558db1f91129f310337fdcdb06a6a2bdb08f703
data/lib/rubysdk.rb CHANGED
@@ -28,7 +28,7 @@ module RubySDK
28
28
  cjob = cached_job unless cached_job.unique_id == job.unique_id
29
29
  end
30
30
  if cjob == nil
31
- JobResult.new(failed: true,
31
+ Proto::JobResult.new(failed: true,
32
32
  exit_pipeline: true,
33
33
  message: "job not found in plugin " + job.title)
34
34
  return
@@ -43,7 +43,7 @@ module RubySDK
43
43
  end
44
44
 
45
45
  # Execute job
46
- job_result = JobResult.new
46
+ job_result = Proto::JobResult.new
47
47
  begin
48
48
  job.handler.call(args)
49
49
  rescue => e
@@ -62,8 +62,6 @@ module RubySDK
62
62
  # Serve caches the given jobs and starts the gRPC server.
63
63
  # This function should be last called in the plugin main function.
64
64
  def Serve(jobs)
65
- include Interface
66
-
67
65
  # Cache the jobs for later processing.
68
66
  # We have to transform given jobs into suitable proto models.
69
67
  cached_jobs = []
@@ -71,7 +69,7 @@ module RubySDK
71
69
  # Transform manual interaction
72
70
  manual_interaction = nil
73
71
  if job.interaction != nil
74
- manual_interaction = ManualInteraction.new(description: job.interaction.desc,
72
+ manual_interaction = Interface::ManualInteraction.new(description: job.interaction.desc,
75
73
  type: job.interaction.type,
76
74
  value: job.interaction.value)
77
75
  end
@@ -114,7 +112,7 @@ module RubySDK
114
112
  end
115
113
 
116
114
  # Create wrapper object
117
- wrapper_job = JobsWrapper.new(handler: job.handler,
115
+ wrapper_job = Interface::JobsWrapper.new(handler: job.handler,
118
116
  job: proto_job)
119
117
  cached_jobs.push wrapper_job
120
118
  end
@@ -122,11 +120,11 @@ module RubySDK
122
120
  # Check if two jobs have the same title which is restricted.
123
121
  #dup_map = {}
124
122
  cached_jobs.each do |job|
125
- #dup_map[job.job.unique_id] = (map[job.job.unique_id] || 0) + 1
123
+ dup_map[job.job.unique_id] = (map[job.job.unique_id] || 0) + 1
126
124
 
127
- #if dup_map[job.job.unique_id] > 1
128
- # raise "duplicate job with the title #{job.title} found which is not allowed"
129
- #end
125
+ if dup_map[job.job.unique_id] > 1
126
+ raise "duplicate job with the title #{job.title} found which is not allowed"
127
+ end
130
128
  end
131
129
 
132
130
  # Get certificates path from env variables.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubysdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.pre2
4
+ version: 0.0.1.pre3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michel Vocks