use_packs 0.0.13 → 0.0.14

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: e860d861797457083f35ab124de8f1b2417ab092772f4bb094622dfacda64cef
4
- data.tar.gz: 7349fe62972a5423fd14a99b367eaf8eede053085a3be7afe08ae2de8556e804
3
+ metadata.gz: fb4b5cfe33a3c5881971d27c78fefe591378e9728baf6513beffc14058ef23d6
4
+ data.tar.gz: 15144da46c38e628af6bfc3c5243d8d0c42a46b2fa739b66339fb120e31c6d36
5
5
  SHA512:
6
- metadata.gz: 8a41d04d25654c0d31ef45ff37fc3a87ff9373e52d29f0b2848dc4cb0fcd55a4425d5a6de91bab60484258b0093ba1e463785cbba972435076756501ac0259e3
7
- data.tar.gz: 0b285e3a349ee94ac6983e1546a17d09633ed6a49ac72e55b608cdc7d1a7f01a345ebaf1f8c0204922199c93abc9c4590b25a30745aa17995ef08b7902b29a2c
6
+ metadata.gz: ce3dbd0c9c3b103887e0ff3e84421396cc3e711b4cac3626e34e622d403ab806eb63ec50e3bb4daf64b647d7f991d940e5973e60cd28e1a8b1a4880635be2525
7
+ data.tar.gz: 9f38e2e00c87dc857a279a726bd7539d5344a0a51dbd5acfeac4153194dcaef5bcab1e577c9a11417963602f652d7559e33a9dba5a77f6372bec066e8ac058c2
data/README.md CHANGED
@@ -50,16 +50,16 @@ Releases happen automatically through github actions once a version update is co
50
50
  To keep things organized, here are some recommended homes:
51
51
 
52
52
  ### Issues:
53
- https://github.com/Gusto/use_packs/issues
53
+ https://github.com/rubyatscale/use_packs/issues
54
54
 
55
55
  ### Questions:
56
- https://github.com/Gusto/use_packs/discussions/categories/q-a
56
+ https://github.com/rubyatscale/use_packs/discussions/categories/q-a
57
57
 
58
58
  ### General discussions:
59
- https://github.com/Gusto/use_packs/discussions/categories/general
59
+ https://github.com/rubyatscale/use_packs/discussions/categories/general
60
60
 
61
61
  ### Ideas, new features, requests for change:
62
- https://github.com/Gusto/use_packs/discussions/categories/ideas
62
+ https://github.com/rubyatscale/use_packs/discussions/categories/ideas
63
63
 
64
64
  ### Showcasing your work:
65
- https://github.com/Gusto/use_packs/discussions/categories/show-and-tell
65
+ https://github.com/rubyatscale/use_packs/discussions/categories/show-and-tell
@@ -17,14 +17,13 @@ module UsePacks
17
17
  relative_path_to_destination = file_move_operation.destination_pathname
18
18
 
19
19
  code_owners_allow_list_file = Pathname.new('config/code_ownership.yml')
20
+ return if !code_owners_allow_list_file.exist?
20
21
 
21
- if code_owners_allow_list_file.exist?
22
- UsePacks.replace_in_file(
23
- file: code_owners_allow_list_file.to_s,
24
- find: relative_path_to_origin,
25
- replace_with: relative_path_to_destination
26
- )
27
- end
22
+ UsePacks.replace_in_file(
23
+ file: code_owners_allow_list_file.to_s,
24
+ find: relative_path_to_origin,
25
+ replace_with: relative_path_to_destination
26
+ )
28
27
 
29
28
  team = CodeOwnership.for_file(relative_path_to_origin.to_s)
30
29
 
@@ -6,9 +6,10 @@ module UsePacks
6
6
  class TeamSelector
7
7
  extend T::Sig
8
8
 
9
- sig { params(prompt: TTY::Prompt, question_text: String).returns(CodeTeams::Team) }
9
+ sig { params(prompt: TTY::Prompt, question_text: String).returns(T.nilable(CodeTeams::Team)) }
10
10
  def self.single_select(prompt, question_text: 'Please use space to select a team owner')
11
11
  teams = CodeTeams.all.sort_by(&:name).to_h { |t| [t.name, t] }
12
+ return nil if teams.count == 0
12
13
 
13
14
  team_selection = T.let(prompt.select(
14
15
  question_text,
@@ -366,13 +366,21 @@ module UsePacks
366
366
  if existing_package.nil?
367
367
  should_enforce_dependenceies = enforce_dependencies.nil? ? UsePacks.config.enforce_dependencies : enforce_dependencies
368
368
 
369
+ # TODO: This should probably be `if defined?(CodeOwnership) && CodeOwnership.configured?`
370
+ # but we'll need to add an API to CodeOwnership to do this
371
+ if Pathname.new('config/code_ownership.yml').exist?
372
+ metadata = {
373
+ 'owner' => team.nil? ? 'MyTeam' : team.name
374
+ }
375
+ else
376
+ metadata = {}
377
+ end
378
+
369
379
  package = ParsePackwerk::Package.new(
370
380
  enforce_dependencies: should_enforce_dependenceies,
371
381
  enforce_privacy: enforce_privacy,
372
382
  dependencies: [],
373
- metadata: {
374
- 'owner' => team.nil? ? 'MyTeam' : team.name
375
- },
383
+ metadata: metadata,
376
384
  name: pack_name,
377
385
  config: {}
378
386
  )
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: use_packs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gusto Engineers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-29 00:00:00.000000000 Z
11
+ date: 2023-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: code_ownership