packs 0.0.37 → 0.0.38

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 61faca4f667524b1ad3ac80486441315601f3ceda6ff04c413a1412b943e7df4
4
- data.tar.gz: 347f3a70a95fb188497f7056f88925a5c9ecc409fc0b9561d35ce8fbe13ca191
3
+ metadata.gz: 876b307fd78af1128f0404e37f792d5b249b77ccba825fcd8afc3729ac77c242
4
+ data.tar.gz: 39b947778eda7ce4aadd58830bb8abf320c3b1cf3f09327b503a24b93ea43add
5
5
  SHA512:
6
- metadata.gz: 11de5f83297dce2506a151ceb9f6e18d2a7bdfdfb0086f3ac05b2136f2530b638817d5eea079342265102e2e652c6264f6b31df9fd58e9a1bc61a15f0d47eae9
7
- data.tar.gz: ab4bd4f5e89f880ada5f0d9bf7d4a25119a8e3b9ca1158be241cb3b9530b6470ddf6cf817d3c2930afd53b2c0ddd17821d0ee9b42a61547d0578402f581ce87e
6
+ metadata.gz: 7aecd7614772de0eb3166954887d9012161697f355cd852a12d652f745c5bd424ac52839204762067fbb27d48ea8ffd56551f1c4eb6597fa50099cfd43f22070
7
+ data.tar.gz: dbc2223fe7612e204f59548136bfc8b8f77355f321cfee17d25766a94ba7fb473be9fe47f2db9d95138a746dba1a7ce687c60befba05f481cfa4b2603f2bc547
data/lib/packs/cli.rb CHANGED
@@ -7,12 +7,16 @@ module Packs
7
7
  extend T::Sig
8
8
 
9
9
  desc 'create packs/your_pack', 'Create pack with name packs/your_pack'
10
+ option :enforce_dependencies, type: :boolean, default: nil, aliases: :d, banner: 'Enforce dependencies'
10
11
  option :enforce_privacy, type: :boolean, default: true, aliases: :p, banner: 'Enforce privacy'
12
+ option :enforce_architecture, type: :boolean, default: true, aliases: :a, banner: 'Enforce architecture'
11
13
  sig { params(pack_name: String).void }
12
14
  def create(pack_name)
13
15
  Packs.create_pack!(
14
16
  pack_name: pack_name,
15
- enforce_privacy: options[:enforce_privacy]
17
+ enforce_dependencies: options[:enforce_dependencies],
18
+ enforce_privacy: options[:enforce_privacy],
19
+ enforce_architecture: options[:enforce_architecture]
16
20
  )
17
21
  exit_successfully
18
22
  end
data/lib/packs/private.rb CHANGED
@@ -47,12 +47,13 @@ module Packs
47
47
  sig do
48
48
  params(
49
49
  pack_name: String,
50
- enforce_privacy: T::Boolean,
51
50
  enforce_dependencies: T.nilable(T::Boolean),
51
+ enforce_privacy: T::Boolean,
52
+ enforce_architecture: T::Boolean,
52
53
  team: T.nilable(CodeTeams::Team)
53
54
  ).void
54
55
  end
55
- def self.create_pack!(pack_name:, enforce_privacy:, enforce_dependencies:, team:)
56
+ def self.create_pack!(pack_name:, enforce_dependencies:, enforce_privacy:, enforce_architecture:, team:)
56
57
  Logging.section('👋 Hi!') do
57
58
  intro = Packs.config.user_event_logger.before_create_pack(pack_name)
58
59
  Logging.print_bold_green(intro)
@@ -60,7 +61,13 @@ module Packs
60
61
 
61
62
  pack_name = Private.clean_pack_name(pack_name)
62
63
 
63
- package = create_pack_if_not_exists!(pack_name: pack_name, enforce_privacy: enforce_privacy, enforce_dependencies: enforce_dependencies, team: team)
64
+ package = create_pack_if_not_exists!(
65
+ pack_name: pack_name,
66
+ enforce_dependencies: enforce_dependencies,
67
+ enforce_privacy: enforce_privacy,
68
+ enforce_architecture: enforce_architecture,
69
+ team: team
70
+ )
64
71
  add_public_directory(package) if package.enforce_privacy
65
72
  add_readme_todo(package)
66
73
 
@@ -160,8 +167,9 @@ module Packs
160
167
 
161
168
  new_package = ParsePackwerk::Package.new(
162
169
  name: new_package_name,
163
- enforce_privacy: package.enforce_privacy,
164
170
  enforce_dependencies: package.enforce_dependencies,
171
+ enforce_privacy: package.enforce_privacy,
172
+ enforce_architecture: package.enforce_architecture,
165
173
  dependencies: package.dependencies,
166
174
  violations: package.violations,
167
175
  metadata: package.metadata,
@@ -196,8 +204,9 @@ module Packs
196
204
 
197
205
  new_other_package = ParsePackwerk::Package.new(
198
206
  name: other_package.name,
199
- enforce_privacy: other_package.enforce_privacy,
200
207
  enforce_dependencies: other_package.enforce_dependencies,
208
+ enforce_privacy: other_package.enforce_privacy,
209
+ enforce_architecture: other_package.enforce_architecture,
201
210
  dependencies: new_dependencies.uniq.sort,
202
211
  violations: other_package.violations,
203
212
  metadata: other_package.metadata,
@@ -238,7 +247,12 @@ module Packs
238
247
  parent_name = Private.clean_pack_name(parent_name)
239
248
  parent_package = ParsePackwerk.all.find { |p| p.name == parent_name }
240
249
  if parent_package.nil?
241
- parent_package = create_pack_if_not_exists!(pack_name: parent_name, enforce_privacy: true, enforce_dependencies: true)
250
+ parent_package = create_pack_if_not_exists!(
251
+ pack_name: parent_name,
252
+ enforce_dependencies: true,
253
+ enforce_privacy: true,
254
+ enforce_architecture: true
255
+ )
242
256
  end
243
257
 
244
258
  # First we create a new pack that has the exact same properties of the old one!
@@ -249,6 +263,7 @@ module Packs
249
263
  name: new_package_name,
250
264
  enforce_privacy: package.enforce_privacy,
251
265
  enforce_dependencies: package.enforce_dependencies,
266
+ enforce_architecture: package.enforce_architecture,
252
267
  dependencies: package.dependencies,
253
268
  violations: package.violations,
254
269
  metadata: package.metadata,
@@ -289,8 +304,9 @@ module Packs
289
304
 
290
305
  new_other_package = ParsePackwerk::Package.new(
291
306
  name: other_package.name,
292
- enforce_privacy: other_package.enforce_privacy,
293
307
  enforce_dependencies: other_package.enforce_dependencies,
308
+ enforce_privacy: other_package.enforce_privacy,
309
+ enforce_architecture: other_package.enforce_architecture,
294
310
  dependencies: new_dependencies.uniq.sort,
295
311
  violations: other_package.violations,
296
312
  metadata: other_package.metadata,
@@ -382,6 +398,7 @@ module Packs
382
398
  name: pack_name,
383
399
  dependencies: (package.dependencies + [dependency_name]).uniq.sort,
384
400
  enforce_privacy: package.enforce_privacy,
401
+ enforce_architecture: package.enforce_architecture,
385
402
  enforce_dependencies: package.enforce_dependencies,
386
403
  violations: package.violations,
387
404
  metadata: package.metadata,
@@ -447,12 +464,13 @@ module Packs
447
464
  sig do
448
465
  params(
449
466
  pack_name: String,
450
- enforce_privacy: T::Boolean,
451
467
  enforce_dependencies: T.nilable(T::Boolean),
468
+ enforce_privacy: T::Boolean,
469
+ enforce_architecture: T::Boolean,
452
470
  team: T.nilable(CodeTeams::Team)
453
471
  ).returns(ParsePackwerk::Package)
454
472
  end
455
- def self.create_pack_if_not_exists!(pack_name:, enforce_privacy:, enforce_dependencies:, team: nil)
473
+ def self.create_pack_if_not_exists!(pack_name:, enforce_dependencies:, enforce_privacy:, enforce_architecture:, team: nil)
456
474
  allowed_locations = Packs::Specification.config.pack_paths
457
475
  if allowed_locations.none? { |location| File.fnmatch(location, pack_name) }
458
476
  raise StandardError, "Packs only supports packages in the the following directories: #{allowed_locations}. Please make sure to pass in the name of the pack including the full directory path, e.g. `packs/my_pack`."
@@ -475,6 +493,7 @@ module Packs
475
493
  package = ParsePackwerk::Package.new(
476
494
  enforce_dependencies: should_enforce_dependencies || false,
477
495
  enforce_privacy: enforce_privacy,
496
+ enforce_architecture: enforce_architecture,
478
497
  dependencies: [],
479
498
  violations: [],
480
499
  metadata: {},
data/lib/packs.rb CHANGED
@@ -49,6 +49,7 @@ module Packs
49
49
  params(
50
50
  pack_name: String,
51
51
  enforce_privacy: T::Boolean,
52
+ enforce_architecture: T::Boolean,
52
53
  enforce_dependencies: T.nilable(T::Boolean),
53
54
  team: T.nilable(CodeTeams::Team)
54
55
  ).void
@@ -56,6 +57,7 @@ module Packs
56
57
  def self.create_pack!(
57
58
  pack_name:,
58
59
  enforce_privacy: true,
60
+ enforce_architecture: true,
59
61
  enforce_dependencies: nil,
60
62
  team: nil
61
63
  )
@@ -63,6 +65,7 @@ module Packs
63
65
  pack_name: pack_name,
64
66
  enforce_privacy: enforce_privacy,
65
67
  enforce_dependencies: enforce_dependencies,
68
+ enforce_architecture: enforce_architecture,
66
69
  team: team
67
70
  )
68
71
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: packs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.37
4
+ version: 0.0.38
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gusto Engineers
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-12 00:00:00.000000000 Z
11
+ date: 2023-12-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: code_ownership
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: 0.22.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: 0.22.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rainbow
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -314,7 +314,7 @@ metadata:
314
314
  source_code_uri: https://github.com/rubyatscale/packs
315
315
  changelog_uri: https://github.com/rubyatscale/packs/releases
316
316
  allowed_push_host: https://rubygems.org
317
- post_install_message:
317
+ post_install_message:
318
318
  rdoc_options: []
319
319
  require_paths:
320
320
  - lib
@@ -329,8 +329,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
329
329
  - !ruby/object:Gem::Version
330
330
  version: '0'
331
331
  requirements: []
332
- rubygems_version: 3.1.6
333
- signing_key:
332
+ rubygems_version: 3.4.10
333
+ signing_key:
334
334
  specification_version: 4
335
335
  summary: Provides CLI tools for working with ruby packs.
336
336
  test_files: []