zaikio-mission_control 0.4.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) 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/card.rb +9 -0
  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/parts/card.rb +8 -0
  32. data/lib/zaikio/mission_control/version.rb +1 -1
  33. data/lib/zaikio/mission_control.rb +8 -2
  34. metadata +4 -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: 136658da8920f1f89098081df396db1f36b51300c81f7c16735134efc56a9460
4
+ data.tar.gz: 1d48fe6659e51df7791b295915488b8520f2148e8fd07f0b8ffef1e09ee3015f
5
5
  SHA512:
6
- metadata.gz: 550e7a36d124f9568550a27b2f4aa62d986d42d302ea11876211a4c529509a6c5b4f66a3605649464d2dafb613c96c8fca1b66a9f735eb9d9bdb1350bea986e2
7
- data.tar.gz: 9acfdec46b419dcef973692885428ae8972509478905d1b85fb4bb666490ec43d8a38cda0757d4eb86432a5263083cf2ed6adc5304d723540532c5c44fcfa366
6
+ metadata.gz: 51a80bcaef7e2f1420a3a556eb8d67132f5296a76c58312d45244edfaecd1cfe10cdb6be0fe0f273a5530d0146ccbf883b9c42ce2b9c6a4ea70024f79e657896
7
+ data.tar.gz: 84be42211e18a86ca9d8cf2b6864801f16b6276522232a40e418dd7161d3a19d35ae9ab76f54f0d04bf274da184135920f3740c4bc9046e618f46b55f3cd4d7d
@@ -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
@@ -0,0 +1,9 @@
1
+ module Zaikio
2
+ module MissionControl
3
+ module Jobs
4
+ class Card < Base
5
+ @parts = { card: { required: true, multiple: true } }
6
+ end
7
+ end
8
+ end
9
+ 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
@@ -0,0 +1,8 @@
1
+ module Zaikio
2
+ module MissionControl
3
+ module Parts
4
+ class Card < Base
5
+ end
6
+ end
7
+ end
8
+ end
@@ -1,5 +1,5 @@
1
1
  module Zaikio
2
2
  module MissionControl
3
- VERSION = "0.4.1".freeze
3
+ VERSION = "0.5.0".freeze
4
4
  end
5
5
  end
@@ -7,6 +7,7 @@ require "zaikio/mission_control/configuration"
7
7
  require "zaikio/mission_control/base"
8
8
  require "zaikio/mission_control/jobs/base"
9
9
  require "zaikio/mission_control/jobs/booklet"
10
+ require "zaikio/mission_control/jobs/card"
10
11
  require "zaikio/mission_control/jobs/carton"
11
12
  require "zaikio/mission_control/jobs/carton_two_piece"
12
13
  require "zaikio/mission_control/jobs/brochure"
@@ -17,6 +18,8 @@ require "zaikio/mission_control/jobs/continuation_sheet"
17
18
  require "zaikio/mission_control/jobs/cover_letter"
18
19
  require "zaikio/mission_control/jobs/envelope"
19
20
  require "zaikio/mission_control/jobs/flyer"
21
+ require "zaikio/mission_control/jobs/folder"
22
+ require "zaikio/mission_control/jobs/folding_card"
20
23
  require "zaikio/mission_control/jobs/hardcover_book"
21
24
  require "zaikio/mission_control/jobs/label"
22
25
  require "zaikio/mission_control/jobs/leaflet"
@@ -38,6 +41,7 @@ require "zaikio/mission_control/parts/content"
38
41
  require "zaikio/mission_control/parts/cover"
39
42
  require "zaikio/mission_control/parts/insert"
40
43
  require "zaikio/mission_control/parts/outsert"
44
+ require "zaikio/mission_control/parts/card"
41
45
  require "zaikio/mission_control/parts/carton"
42
46
  require "zaikio/mission_control/parts/lid"
43
47
  require "zaikio/mission_control/parts/business_card"
@@ -46,6 +50,8 @@ require "zaikio/mission_control/parts/continuation_sheet"
46
50
  require "zaikio/mission_control/parts/cover_letter"
47
51
  require "zaikio/mission_control/parts/envelope"
48
52
  require "zaikio/mission_control/parts/flyer"
53
+ require "zaikio/mission_control/parts/folder"
54
+ require "zaikio/mission_control/parts/folding_card"
49
55
  require "zaikio/mission_control/parts/case"
50
56
  require "zaikio/mission_control/parts/endpaper"
51
57
  require "zaikio/mission_control/parts/jacket"
@@ -124,13 +130,13 @@ module Zaikio
124
130
  @job_klasses ||= Zaikio::MissionControl::Jobs
125
131
  .constants.sort
126
132
  .map { |c| Zaikio::MissionControl::Jobs.const_get(c) }
127
- .select { |c| c.is_a?(Class) } - [Zaikio::MissionControl::Jobs::Base]
133
+ .select { |c| c.is_a?(Class) && !(c < ActiveSupport::TestCase) } - [Zaikio::MissionControl::Jobs::Base]
128
134
  end
129
135
 
130
136
  def part_klasses
131
137
  @part_klasses ||= Zaikio::MissionControl::Parts.constants.sort
132
138
  .map { |c| Zaikio::MissionControl::Parts.const_get(c) }
133
- .select { |c| c.is_a?(Class) }
139
+ .select { |c| c.is_a?(Class) } - [Zaikio::MissionControl::Parts::Base]
134
140
  end
135
141
 
136
142
  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.5.0
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
@@ -139,6 +139,7 @@ files:
139
139
  - lib/zaikio/mission_control/jobs/box.rb
140
140
  - lib/zaikio/mission_control/jobs/brochure.rb
141
141
  - lib/zaikio/mission_control/jobs/business_card.rb
142
+ - lib/zaikio/mission_control/jobs/card.rb
142
143
  - lib/zaikio/mission_control/jobs/carton.rb
143
144
  - lib/zaikio/mission_control/jobs/carton_two_piece.rb
144
145
  - lib/zaikio/mission_control/jobs/compliment_slip.rb
@@ -169,6 +170,7 @@ files:
169
170
  - lib/zaikio/mission_control/parts/back.rb
170
171
  - lib/zaikio/mission_control/parts/base.rb
171
172
  - lib/zaikio/mission_control/parts/business_card.rb
173
+ - lib/zaikio/mission_control/parts/card.rb
172
174
  - lib/zaikio/mission_control/parts/carton.rb
173
175
  - lib/zaikio/mission_control/parts/case.rb
174
176
  - lib/zaikio/mission_control/parts/compliment_slip.rb