zaikio-mission_control 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/lib/zaikio/mission_control/jobs/base.rb +1 -11
  3. data/lib/zaikio/mission_control/jobs/booklet.rb +6 -4
  4. data/lib/zaikio/mission_control/jobs/box.rb +4 -2
  5. data/lib/zaikio/mission_control/jobs/brochure.rb +6 -4
  6. data/lib/zaikio/mission_control/jobs/business_card.rb +1 -1
  7. data/lib/zaikio/mission_control/jobs/carton.rb +1 -1
  8. data/lib/zaikio/mission_control/jobs/carton_two_piece.rb +4 -2
  9. data/lib/zaikio/mission_control/jobs/compliment_slip.rb +3 -1
  10. data/lib/zaikio/mission_control/jobs/continuation_sheet.rb +1 -1
  11. data/lib/zaikio/mission_control/jobs/cover_letter.rb +1 -1
  12. data/lib/zaikio/mission_control/jobs/envelope.rb +1 -1
  13. data/lib/zaikio/mission_control/jobs/flyer.rb +1 -1
  14. data/lib/zaikio/mission_control/jobs/folder.rb +1 -1
  15. data/lib/zaikio/mission_control/jobs/folding_card.rb +1 -1
  16. data/lib/zaikio/mission_control/jobs/hardcover_book.rb +6 -4
  17. data/lib/zaikio/mission_control/jobs/label.rb +1 -1
  18. data/lib/zaikio/mission_control/jobs/leaflet.rb +1 -1
  19. data/lib/zaikio/mission_control/jobs/letter_head.rb +1 -1
  20. data/lib/zaikio/mission_control/jobs/magazine.rb +6 -4
  21. data/lib/zaikio/mission_control/jobs/map.rb +4 -2
  22. data/lib/zaikio/mission_control/jobs/ncr_pad.rb +5 -3
  23. data/lib/zaikio/mission_control/jobs/newspaper.rb +4 -2
  24. data/lib/zaikio/mission_control/jobs/notebook.rb +5 -3
  25. data/lib/zaikio/mission_control/jobs/postcard.rb +1 -1
  26. data/lib/zaikio/mission_control/jobs/poster.rb +1 -1
  27. data/lib/zaikio/mission_control/jobs/self_mailer.rb +1 -1
  28. data/lib/zaikio/mission_control/jobs/sheet.rb +1 -1
  29. data/lib/zaikio/mission_control/jobs/softcover_book.rb +4 -2
  30. data/lib/zaikio/mission_control/version.rb +1 -1
  31. data/lib/zaikio/mission_control.rb +6 -2
  32. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 24a0d4a1c00c27cd0b387f98ce2b45f42d86cb811ebc2bc1bd9039bbbc29b532
4
- data.tar.gz: 2b0ba09a07d4caa2196e77fd6f25978b22cde97f2153aecf2eae83376fe062c8
3
+ metadata.gz: 3ec2b2f9a8626f157b22e432e3b353d734895757ec5e9ad02a2b49cc7991cdab
4
+ data.tar.gz: e0ceeca9509dbf8e8da1e3bef18139a365a129be45b536eeeda6228ba02f965a
5
5
  SHA512:
6
- metadata.gz: 550e7a36d124f9568550a27b2f4aa62d986d42d302ea11876211a4c529509a6c5b4f66a3605649464d2dafb613c96c8fca1b66a9f735eb9d9bdb1350bea986e2
7
- data.tar.gz: 9acfdec46b419dcef973692885428ae8972509478905d1b85fb4bb666490ec43d8a38cda0757d4eb86432a5263083cf2ed6adc5304d723540532c5c44fcfa366
6
+ metadata.gz: 36ca6a3eb8dd29a0c057971acc279e2d023861445dc032c89f78a8aee3f36aba9f1c9f3d033fced38bb23fe3cdfa2c700b7a4d1dc517e66a3b915553133a419a
7
+ data.tar.gz: 53bdd5da1c3fdfe96febe1e6e9f1723f851c79811bcfdc7c30cde41540c2cdd0df1799cd477ecbe9d4723ca0e3b7a78c5fac6b5b06e444ca4b34df154432dcd7
@@ -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.1".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.1
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-08 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