Module: Igniter::Extensions::Contracts::CreatorPack

Defined in:
lib/igniter/extensions/contracts/creator_pack.rb

Class Method Summary collapse

Class Method Details

.available_profilesObject



28
29
30
# File 'lib/igniter/extensions/contracts/creator_pack.rb', line 28

def available_profiles
  Creator::Profile.available
end

.available_scopesObject



32
33
34
# File 'lib/igniter/extensions/contracts/creator_pack.rb', line 32

def available_scopes
  Creator::Scope.available
end

.install_into(kernel) ⇒ Object



24
25
26
# File 'lib/igniter/extensions/contracts/creator_pack.rb', line 24

def install_into(kernel)
  kernel
end

.manifestObject



16
17
18
19
20
21
22
# File 'lib/igniter/extensions/contracts/creator_pack.rb', line 16

def manifest
  Igniter::Contracts::PackManifest.new(
    name: :extensions_creator,
    requires_packs: [DebugPack],
    metadata: { category: :developer }
  )
end

.report(name:, kind: nil, namespace: "MyCompany::IgniterPacks", profile: nil, capabilities: nil, scope: :monorepo_package, pack: nil, target_profile: nil) ⇒ Object



49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/igniter/extensions/contracts/creator_pack.rb', line 49

def report(name:, kind: nil, namespace: "MyCompany::IgniterPacks", profile: nil, capabilities: nil,
           scope: :monorepo_package, pack: nil, target_profile: nil)
  generated = scaffold(
    name: name,
    kind: kind,
    namespace: namespace,
    profile: profile,
    capabilities: capabilities,
    scope: scope
  )
  audit = pack ? DebugPack.audit(pack, profile: target_profile) : nil

  Creator::Report.new(scaffold: generated, audit: audit)
end

.scaffold(name:, kind: nil, namespace: "MyCompany::IgniterPacks", profile: nil, capabilities: nil, scope: :monorepo_package) ⇒ Object



36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/igniter/extensions/contracts/creator_pack.rb', line 36

def scaffold(name:, kind: nil, namespace: "MyCompany::IgniterPacks", profile: nil, capabilities: nil,
             scope: :monorepo_package)
  authoring_profile = Creator::Profile.build(profile: profile, kind: kind, capabilities: capabilities)
  target_scope = Creator::Scope.build(scope)
  Creator::Scaffold.new(
    name: name,
    kind: authoring_profile.kind,
    namespace: namespace,
    profile: authoring_profile,
    scope: target_scope
  )
end

.wizard(name: nil, kind: nil, namespace: "MyCompany::IgniterPacks", profile: nil, capabilities: nil, scope: nil, root: nil, mode: :skip_existing, pack: nil, target_profile: nil) ⇒ Object



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/igniter/extensions/contracts/creator_pack.rb', line 80

def wizard(name: nil, kind: nil, namespace: "MyCompany::IgniterPacks", profile: nil, capabilities: nil,
           scope: nil, root: nil, mode: :skip_existing, pack: nil, target_profile: nil)
  Creator::Wizard.new(
    name: name,
    kind: kind,
    namespace: namespace,
    profile: profile,
    capabilities: capabilities,
    scope: scope,
    root: root,
    mode: mode,
    pack: pack,
    target_profile: target_profile
  )
end

.workflow(name:, kind: nil, namespace: "MyCompany::IgniterPacks", profile: nil, capabilities: nil, scope: :monorepo_package, pack: nil, target_profile: nil) ⇒ Object



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/igniter/extensions/contracts/creator_pack.rb', line 64

def workflow(name:, kind: nil, namespace: "MyCompany::IgniterPacks", profile: nil, capabilities: nil,
             scope: :monorepo_package, pack: nil, target_profile: nil)
  Creator::Workflow.new(
    report: report(
      name: name,
      kind: kind,
      namespace: namespace,
      profile: profile,
      capabilities: capabilities,
      scope: scope,
      pack: pack,
      target_profile: target_profile
    )
  )
end

.write(name:, root:, kind: nil, namespace: "MyCompany::IgniterPacks", profile: nil, capabilities: nil, scope: :monorepo_package, pack: nil, target_profile: nil, mode: :skip_existing) ⇒ Object



110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/igniter/extensions/contracts/creator_pack.rb', line 110

def write(name:, root:, kind: nil, namespace: "MyCompany::IgniterPacks", profile: nil, capabilities: nil,
          scope: :monorepo_package, pack: nil, target_profile: nil, mode: :skip_existing)
  writer(
    name: name,
    kind: kind,
    namespace: namespace,
    profile: profile,
    capabilities: capabilities,
    scope: scope,
    pack: pack,
    target_profile: target_profile,
    root: root,
    mode: mode
  ).write
end

.writer(name:, root:, kind: nil, namespace: "MyCompany::IgniterPacks", profile: nil, capabilities: nil, scope: :monorepo_package, pack: nil, target_profile: nil, mode: :skip_existing) ⇒ Object



96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/igniter/extensions/contracts/creator_pack.rb', line 96

def writer(name:, root:, kind: nil, namespace: "MyCompany::IgniterPacks", profile: nil, capabilities: nil,
           scope: :monorepo_package, pack: nil, target_profile: nil, mode: :skip_existing)
  workflow(
    name: name,
    kind: kind,
    namespace: namespace,
    profile: profile,
    capabilities: capabilities,
    scope: scope,
    pack: pack,
    target_profile: target_profile
  ).writer(root: root, mode: mode)
end