packs 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/packs/private.rb +11 -7
- data/lib/packs/user_event_logger.rb +1 -24
- metadata +3 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a2fde399cc66508a90dac9a91d026179a732e2ff9675e6d385bf4981ae5fb45
|
4
|
+
data.tar.gz: 2aeb3c2b828d169a387755af328ad67b2e2133a482bed16f976e884d08e27ea8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32accbb46babdc0cf1478cd905cd95cc144f6a53d184cfc56a97cf6368a009508dcb48e8218ae680f0dcd493b08134c16786550208aa96929c4aff83792f70f1
|
7
|
+
data.tar.gz: b9932164a175a19ea41762dd2743ba080fac999e0b4393e4f9265ed68c913f54a0bb9fa59b89269619eec6daef851196a72e737e5de106d62a323c731108a3fd
|
data/lib/packs/private.rb
CHANGED
@@ -69,7 +69,7 @@ module Packs
|
|
69
69
|
team: team
|
70
70
|
)
|
71
71
|
add_public_directory(package) if package.enforce_privacy
|
72
|
-
|
72
|
+
add_readme(package)
|
73
73
|
|
74
74
|
Logging.section('Next steps') do
|
75
75
|
next_steps = Packs.config.user_event_logger.after_create_pack(pack_name)
|
@@ -140,7 +140,7 @@ module Packs
|
|
140
140
|
end
|
141
141
|
end
|
142
142
|
|
143
|
-
|
143
|
+
add_readme(package)
|
144
144
|
|
145
145
|
per_file_processors.each do |processor|
|
146
146
|
processor.after_move_files!(file_move_operations)
|
@@ -446,18 +446,22 @@ module Packs
|
|
446
446
|
|
447
447
|
if public_directory.glob('**/**.rb').none?
|
448
448
|
FileUtils.mkdir_p(public_directory)
|
449
|
-
|
450
|
-
public_directory.join(
|
449
|
+
package_name = package.directory.basename.to_s
|
450
|
+
FileUtils.mkdir_p(public_directory.join(package_name))
|
451
451
|
end
|
452
452
|
end
|
453
453
|
|
454
454
|
sig { params(package: ParsePackwerk::Package).void }
|
455
|
-
def self.
|
455
|
+
def self.add_readme(package)
|
456
456
|
pack_directory = package.directory
|
457
457
|
|
458
458
|
if !pack_directory.join('README.md').exist?
|
459
|
-
|
460
|
-
pack_directory.join('
|
459
|
+
readme_md = Packs.config.user_event_logger.on_create_readme(package.name)
|
460
|
+
pack_directory.join('README.md').write(readme_md)
|
461
|
+
|
462
|
+
if pack_directory.join('README_TODO.md').exist?
|
463
|
+
pack_directory.join('README_TODO.md').delete
|
464
|
+
end
|
461
465
|
end
|
462
466
|
end
|
463
467
|
|
@@ -124,30 +124,7 @@ module Packs
|
|
124
124
|
end
|
125
125
|
|
126
126
|
sig { params(pack_name: String).returns(String) }
|
127
|
-
def
|
128
|
-
<<~MSG
|
129
|
-
This directory holds your public API!
|
130
|
-
|
131
|
-
Any classes, constants, or modules that you want other packs to use and you intend to support should go in here.
|
132
|
-
Anything that is considered private should go in other folders.
|
133
|
-
|
134
|
-
If another pack uses classes, constants, or modules that are not in your public folder, it will be considered a "privacy violation" by packwerk.
|
135
|
-
You can prevent other packs from using private API by using packwerk.
|
136
|
-
|
137
|
-
Want to find how your private API is being used today?
|
138
|
-
Try running: `bin/packs list_top_violations privacy #{pack_name}`
|
139
|
-
|
140
|
-
Want to move something into this folder?
|
141
|
-
Try running: `bin/packs make_public #{pack_name}/path/to/file.rb`
|
142
|
-
|
143
|
-
One more thing -- feel free to delete this file and replace it with a README.md describing your package in the main package directory.
|
144
|
-
|
145
|
-
See #{documentation_link} for more info!
|
146
|
-
MSG
|
147
|
-
end
|
148
|
-
|
149
|
-
sig { params(pack_name: String).returns(String) }
|
150
|
-
def on_create_readme_todo(pack_name)
|
127
|
+
def on_create_readme(pack_name)
|
151
128
|
readme_template_pathname = Packs.config.readme_template_pathname
|
152
129
|
readme_template = readme_template_pathname.read if readme_template_pathname.exist?
|
153
130
|
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: packs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gusto Engineers
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-01-07 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: bigdecimal
|
@@ -329,7 +328,6 @@ metadata:
|
|
329
328
|
source_code_uri: https://github.com/rubyatscale/packs
|
330
329
|
changelog_uri: https://github.com/rubyatscale/packs/releases
|
331
330
|
allowed_push_host: https://rubygems.org
|
332
|
-
post_install_message:
|
333
331
|
rdoc_options: []
|
334
332
|
require_paths:
|
335
333
|
- lib
|
@@ -344,8 +342,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
344
342
|
- !ruby/object:Gem::Version
|
345
343
|
version: '0'
|
346
344
|
requirements: []
|
347
|
-
rubygems_version: 3.
|
348
|
-
signing_key:
|
345
|
+
rubygems_version: 3.6.2
|
349
346
|
specification_version: 4
|
350
347
|
summary: Provides CLI tools for working with ruby packs.
|
351
348
|
test_files: []
|