zaikio-mission_control 0.4.0 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/lib/zaikio/mission_control/execution.rb +2 -0
  3. data/lib/zaikio/mission_control/jobs/base.rb +1 -11
  4. data/lib/zaikio/mission_control/jobs/booklet.rb +6 -4
  5. data/lib/zaikio/mission_control/jobs/box.rb +4 -2
  6. data/lib/zaikio/mission_control/jobs/brochure.rb +6 -4
  7. data/lib/zaikio/mission_control/jobs/business_card.rb +1 -1
  8. data/lib/zaikio/mission_control/jobs/carton.rb +1 -1
  9. data/lib/zaikio/mission_control/jobs/carton_two_piece.rb +4 -2
  10. data/lib/zaikio/mission_control/jobs/compliment_slip.rb +3 -1
  11. data/lib/zaikio/mission_control/jobs/continuation_sheet.rb +1 -1
  12. data/lib/zaikio/mission_control/jobs/cover_letter.rb +1 -1
  13. data/lib/zaikio/mission_control/jobs/envelope.rb +1 -1
  14. data/lib/zaikio/mission_control/jobs/flyer.rb +1 -1
  15. data/lib/zaikio/mission_control/jobs/folder.rb +1 -1
  16. data/lib/zaikio/mission_control/jobs/folding_card.rb +1 -1
  17. data/lib/zaikio/mission_control/jobs/hardcover_book.rb +6 -4
  18. data/lib/zaikio/mission_control/jobs/label.rb +1 -1
  19. data/lib/zaikio/mission_control/jobs/leaflet.rb +1 -1
  20. data/lib/zaikio/mission_control/jobs/letter_head.rb +1 -1
  21. data/lib/zaikio/mission_control/jobs/magazine.rb +6 -4
  22. data/lib/zaikio/mission_control/jobs/map.rb +4 -2
  23. data/lib/zaikio/mission_control/jobs/ncr_pad.rb +5 -3
  24. data/lib/zaikio/mission_control/jobs/newspaper.rb +4 -2
  25. data/lib/zaikio/mission_control/jobs/notebook.rb +5 -3
  26. data/lib/zaikio/mission_control/jobs/postcard.rb +1 -1
  27. data/lib/zaikio/mission_control/jobs/poster.rb +1 -1
  28. data/lib/zaikio/mission_control/jobs/self_mailer.rb +1 -1
  29. data/lib/zaikio/mission_control/jobs/sheet.rb +1 -1
  30. data/lib/zaikio/mission_control/jobs/softcover_book.rb +4 -2
  31. data/lib/zaikio/mission_control/version.rb +1 -1
  32. data/lib/zaikio/mission_control.rb +6 -2
  33. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9ec4c85ff7c3aa05190a167ebc7ff944cd5866fcd596d973f620204a9dc587c8
4
- data.tar.gz: b122daaaef138decc91215afcd7919a39ffb72aa8e8bb998e8c1d2beac086f12
3
+ metadata.gz: 3ec2b2f9a8626f157b22e432e3b353d734895757ec5e9ad02a2b49cc7991cdab
4
+ data.tar.gz: e0ceeca9509dbf8e8da1e3bef18139a365a129be45b536eeeda6228ba02f965a
5
5
  SHA512:
6
- metadata.gz: 8ab1fcbb36d06feb296df7a3a0bfc853ed4bc340f397594c35bf4d8e33de8e75030c20316b99d880fdef1d1d1eb073cde04b74b944288c147d68674daa954da0
7
- data.tar.gz: 6c93a4a3791fbfe1214027be00f5d0f9c60c5cf65752ef904327552cae76b883718f6196b23caa66fa9e04154de4a0a07119fad1f027c19100a192cf3faf672f
6
+ metadata.gz: 36ca6a3eb8dd29a0c057971acc279e2d023861445dc032c89f78a8aee3f36aba9f1c9f3d033fced38bb23fe3cdfa2c700b7a4d1dc517e66a3b915553133a419a
7
+ data.tar.gz: 53bdd5da1c3fdfe96febe1e6e9f1723f851c79811bcfdc7c30cde41540c2cdd0df1799cd477ecbe9d4723ca0e3b7a78c5fac6b5b06e444ca4b34df154432dcd7
@@ -5,6 +5,8 @@ module Zaikio
5
5
 
6
6
  attributes :id, :operator_id, :machine_id, :workstep_id, :quantity, :waste, :started_at, :ended_at, :phase,
7
7
  :created_at, :updated_at
8
+
9
+ belongs_to :workstep, class_name: "Zaikio::MissionControl::Workstep"
8
10
  end
9
11
  end
10
12
  end
@@ -3,16 +3,6 @@ module Zaikio
3
3
  module Jobs
4
4
  class Base < Zaikio::MissionControl::Base
5
5
  class << self
6
- def has_one_part(name, required: false) # rubocop:disable Naming/PredicateName
7
- @parts ||= {}
8
- @parts[name] = { required: required, multiples: false }
9
- end
10
-
11
- def has_many_parts(name, required: false) # rubocop:disable Naming/PredicateName
12
- @parts ||= {}
13
- @parts[name.to_s.singularize.to_sym] = { required: required, multiples: true }
14
- end
15
-
16
6
  def parts
17
7
  @parts ||= {}
18
8
  @parts.keys
@@ -36,7 +26,7 @@ module Zaikio
36
26
  end
37
27
 
38
28
  def multiples?(part_name_or_klass)
39
- part_config(part_name_or_klass)[:multiples]
29
+ part_config(part_name_or_klass)[:multiple]
40
30
  end
41
31
 
42
32
  def required?(part_name_or_klass)
@@ -2,10 +2,12 @@ module Zaikio
2
2
  module MissionControl
3
3
  module Jobs
4
4
  class Booklet < Base
5
- has_many_parts :contents, required: true
6
- has_one_part :cover
7
- has_many_parts :inserts
8
- has_many_parts :outserts
5
+ @parts = {
6
+ cover: { required: true, multiple: false },
7
+ content: { required: true, multiple: true },
8
+ insert: { required: false, multiple: true },
9
+ outsert: { required: false, multiple: true }
10
+ }
9
11
  end
10
12
  end
11
13
  end
@@ -2,8 +2,10 @@ module Zaikio
2
2
  module MissionControl
3
3
  module Jobs
4
4
  class Box < Base
5
- has_one_part :base, required: true
6
- has_one_part :lid, required: true
5
+ @parts = {
6
+ base: { required: true, multiple: false },
7
+ lid: { required: true, multiple: false }
8
+ }
7
9
  end
8
10
  end
9
11
  end
@@ -2,10 +2,12 @@ module Zaikio
2
2
  module MissionControl
3
3
  module Jobs
4
4
  class Brochure < Base
5
- has_many_parts :contents, required: true
6
- has_one_part :cover, required: true
7
- has_many_parts :inserts
8
- has_many_parts :outserts
5
+ @parts = {
6
+ content: { required: true, multiple: true },
7
+ cover: { required: false, multiple: false },
8
+ insert: { required: false, multiple: false },
9
+ outsert: { required: false, multiple: false }
10
+ }
9
11
  end
10
12
  end
11
13
  end
@@ -2,7 +2,7 @@ module Zaikio
2
2
  module MissionControl
3
3
  module Jobs
4
4
  class BusinessCard < Base
5
- has_many_parts :business_cards, required: true
5
+ @parts = { business_card: { required: true, multiple: true } }
6
6
  end
7
7
  end
8
8
  end
@@ -2,7 +2,7 @@ module Zaikio
2
2
  module MissionControl
3
3
  module Jobs
4
4
  class Carton < Base
5
- has_one_part :carton, required: true
5
+ @parts = { carton: { required: true, multiple: false } }
6
6
  end
7
7
  end
8
8
  end
@@ -2,8 +2,10 @@ module Zaikio
2
2
  module MissionControl
3
3
  module Jobs
4
4
  class CartonTwoPiece < Base
5
- has_one_part :base, required: true
6
- has_one_part :lid, required: true
5
+ @parts = {
6
+ base: { required: true, multiple: false },
7
+ lid: { required: true, multiple: false }
8
+ }
7
9
  end
8
10
  end
9
11
  end
@@ -2,7 +2,9 @@ module Zaikio
2
2
  module MissionControl
3
3
  module Jobs
4
4
  class ComplimentSlip < Base
5
- has_one_part :compliment_slip, required: true
5
+ @parts = {
6
+ compliment_slip: { required: true, multiple: false }
7
+ }
6
8
  end
7
9
  end
8
10
  end
@@ -2,7 +2,7 @@ module Zaikio
2
2
  module MissionControl
3
3
  module Jobs
4
4
  class ContinuationSheet < Base
5
- has_one_part :continuation_sheet, required: true
5
+ @parts = { continuation_sheet: { required: true, multiple: false } }
6
6
  end
7
7
  end
8
8
  end
@@ -2,7 +2,7 @@ module Zaikio
2
2
  module MissionControl
3
3
  module Jobs
4
4
  class CoverLetter < Base
5
- has_one_part :cover_letter, required: true
5
+ @parts = { cover_letter: { required: true, multiple: false } }
6
6
  end
7
7
  end
8
8
  end
@@ -2,7 +2,7 @@ module Zaikio
2
2
  module MissionControl
3
3
  module Jobs
4
4
  class Envelope < Base
5
- has_one_part :envelope, required: true
5
+ @parts = { envelope: { required: true, multiple: false } }
6
6
  end
7
7
  end
8
8
  end
@@ -2,7 +2,7 @@ module Zaikio
2
2
  module MissionControl
3
3
  module Jobs
4
4
  class Flyer < Base
5
- has_one_part :flyer, required: true
5
+ @parts = { flyer: { required: true, multiple: false } }
6
6
  end
7
7
  end
8
8
  end
@@ -2,7 +2,7 @@ module Zaikio
2
2
  module MissionControl
3
3
  module Jobs
4
4
  class Folder < Base
5
- has_many_parts :folders, required: true
5
+ @parts = { folder: { required: true, multiple: true } }
6
6
  end
7
7
  end
8
8
  end
@@ -2,7 +2,7 @@ module Zaikio
2
2
  module MissionControl
3
3
  module Jobs
4
4
  class FoldingCard < Base
5
- has_many_parts :folding_cards, required: true
5
+ @parts = { folding_card: { required: true, multiple: true } }
6
6
  end
7
7
  end
8
8
  end
@@ -2,10 +2,12 @@ module Zaikio
2
2
  module MissionControl
3
3
  module Jobs
4
4
  class HardcoverBook < Base
5
- has_many_parts :contents, required: true
6
- has_one_part :case, required: true
7
- has_many_parts :endpapers, required: true
8
- has_one_part :jacket
5
+ @parts = {
6
+ case: { required: true, multiple: false },
7
+ content: { required: true, multiple: true },
8
+ endpaper: { required: true, multiple: true },
9
+ jacket: { required: false, multiple: false }
10
+ }
9
11
  end
10
12
  end
11
13
  end
@@ -2,7 +2,7 @@ module Zaikio
2
2
  module MissionControl
3
3
  module Jobs
4
4
  class Label < Base
5
- has_one_part :label, required: true
5
+ @parts = { label: { required: true, multiple: false } }
6
6
  end
7
7
  end
8
8
  end
@@ -2,7 +2,7 @@ module Zaikio
2
2
  module MissionControl
3
3
  module Jobs
4
4
  class Leaflet < Base
5
- has_one_part :leaflet, required: true
5
+ @parts = { leaflet: { required: true, multiple: false } }
6
6
  end
7
7
  end
8
8
  end
@@ -2,7 +2,7 @@ module Zaikio
2
2
  module MissionControl
3
3
  module Jobs
4
4
  class LetterHead < Base
5
- has_one_part :letter_head, required: true
5
+ @parts = { letter_head: { required: true, multiple: false } }
6
6
  end
7
7
  end
8
8
  end
@@ -2,10 +2,12 @@ module Zaikio
2
2
  module MissionControl
3
3
  module Jobs
4
4
  class Magazine < Base
5
- has_one_part :content, required: true
6
- has_one_part :cover
7
- has_many_parts :inserts
8
- has_many_parts :outserts
5
+ @parts = {
6
+ content: { required: true, multiple: true },
7
+ cover: { required: true, multiple: false },
8
+ insert: { required: false, multiple: false },
9
+ outsert: { required: false, multiple: false }
10
+ }
9
11
  end
10
12
  end
11
13
  end
@@ -2,8 +2,10 @@ module Zaikio
2
2
  module MissionControl
3
3
  module Jobs
4
4
  class Map < Base
5
- has_one_part :map_sheet, required: true
6
- has_one_part :cover
5
+ @parts = {
6
+ cover: { required: false, multiple: false },
7
+ map_sheet: { required: true, multiple: false }
8
+ }
7
9
  end
8
10
  end
9
11
  end
@@ -2,9 +2,11 @@ module Zaikio
2
2
  module MissionControl
3
3
  module Jobs
4
4
  class NcrPad < Base
5
- has_many_parts :content, required: true
6
- has_one_part :back, required: true
7
- has_one_part :cover
5
+ @parts = {
6
+ content: { required: true, multiple: true },
7
+ back: { required: true, multiple: false },
8
+ cover: { required: false, multiple: false }
9
+ }
8
10
  end
9
11
  end
10
12
  end
@@ -2,8 +2,10 @@ module Zaikio
2
2
  module MissionControl
3
3
  module Jobs
4
4
  class Newspaper < Base
5
- has_one_part :content, required: true
6
- has_many_parts :inserts
5
+ @parts = {
6
+ content: { required: true, multiple: true },
7
+ insert: { required: false, multiple: true }
8
+ }
7
9
  end
8
10
  end
9
11
  end
@@ -2,9 +2,11 @@ module Zaikio
2
2
  module MissionControl
3
3
  module Jobs
4
4
  class Notebook < Base
5
- has_many_parts :contents, required: true
6
- has_one_part :cover, required: true
7
- has_one_part :back
5
+ @parts = {
6
+ content: { required: true, multiple: true },
7
+ cover: { required: true, multiple: false },
8
+ back: { required: false, multiple: false }
9
+ }
8
10
  end
9
11
  end
10
12
  end
@@ -2,7 +2,7 @@ module Zaikio
2
2
  module MissionControl
3
3
  module Jobs
4
4
  class Postcard < Base
5
- has_one_part :postcard, required: true
5
+ @parts = { postcard: { required: true, multiple: false } }
6
6
  end
7
7
  end
8
8
  end
@@ -2,7 +2,7 @@ module Zaikio
2
2
  module MissionControl
3
3
  module Jobs
4
4
  class Poster < Base
5
- has_one_part :poster, required: true
5
+ @parts = { poster: { required: true, multiple: false } }
6
6
  end
7
7
  end
8
8
  end
@@ -2,7 +2,7 @@ module Zaikio
2
2
  module MissionControl
3
3
  module Jobs
4
4
  class SelfMailer < Base
5
- has_one_part :self_mailer, required: true
5
+ @parts = { self_mailer: { required: true, multiple: false } }
6
6
  end
7
7
  end
8
8
  end
@@ -2,7 +2,7 @@ module Zaikio
2
2
  module MissionControl
3
3
  module Jobs
4
4
  class Sheet < Base
5
- has_one_part :sheet, required: true
5
+ @parts = { sheet: { required: true, multiple: false } }
6
6
  end
7
7
  end
8
8
  end
@@ -2,8 +2,10 @@ module Zaikio
2
2
  module MissionControl
3
3
  module Jobs
4
4
  class SoftcoverBook < Base
5
- has_one_part :content, required: true
6
- has_one_part :cover, required: true
5
+ @parts = {
6
+ content: { required: true, multiple: true },
7
+ cover: { required: true, multiple: false }
8
+ }
7
9
  end
8
10
  end
9
11
  end
@@ -1,5 +1,5 @@
1
1
  module Zaikio
2
2
  module MissionControl
3
- VERSION = "0.4.0".freeze
3
+ VERSION = "0.4.2".freeze
4
4
  end
5
5
  end
@@ -17,6 +17,8 @@ require "zaikio/mission_control/jobs/continuation_sheet"
17
17
  require "zaikio/mission_control/jobs/cover_letter"
18
18
  require "zaikio/mission_control/jobs/envelope"
19
19
  require "zaikio/mission_control/jobs/flyer"
20
+ require "zaikio/mission_control/jobs/folder"
21
+ require "zaikio/mission_control/jobs/folding_card"
20
22
  require "zaikio/mission_control/jobs/hardcover_book"
21
23
  require "zaikio/mission_control/jobs/label"
22
24
  require "zaikio/mission_control/jobs/leaflet"
@@ -46,6 +48,8 @@ require "zaikio/mission_control/parts/continuation_sheet"
46
48
  require "zaikio/mission_control/parts/cover_letter"
47
49
  require "zaikio/mission_control/parts/envelope"
48
50
  require "zaikio/mission_control/parts/flyer"
51
+ require "zaikio/mission_control/parts/folder"
52
+ require "zaikio/mission_control/parts/folding_card"
49
53
  require "zaikio/mission_control/parts/case"
50
54
  require "zaikio/mission_control/parts/endpaper"
51
55
  require "zaikio/mission_control/parts/jacket"
@@ -124,13 +128,13 @@ module Zaikio
124
128
  @job_klasses ||= Zaikio::MissionControl::Jobs
125
129
  .constants.sort
126
130
  .map { |c| Zaikio::MissionControl::Jobs.const_get(c) }
127
- .select { |c| c.is_a?(Class) } - [Zaikio::MissionControl::Jobs::Base]
131
+ .select { |c| c.is_a?(Class) && !(c < ActiveSupport::TestCase) } - [Zaikio::MissionControl::Jobs::Base]
128
132
  end
129
133
 
130
134
  def part_klasses
131
135
  @part_klasses ||= Zaikio::MissionControl::Parts.constants.sort
132
136
  .map { |c| Zaikio::MissionControl::Parts.const_get(c) }
133
- .select { |c| c.is_a?(Class) }
137
+ .select { |c| c.is_a?(Class) } - [Zaikio::MissionControl::Parts::Base]
134
138
  end
135
139
 
136
140
  def finishing_klasses
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zaikio-mission_control
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zaikio GmbH
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-07 00:00:00.000000000 Z
11
+ date: 2023-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby