gem-ext-cleaner 0.0.1 → 0.1.0

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: 9364779d991ee7d0d09318155f4d5e884fa4d8b4d8b57d0b526b58594df1ba83
4
- data.tar.gz: 53a8c174742c29ab8b967a7b597d0a5ed76ddab4cbf0d614e5928085175322d2
3
+ metadata.gz: 0e1553d6f3ed36696dbb8625209f7ef21680904b89afeb347c2345ba6505ffba
4
+ data.tar.gz: 94cf5aad01aa04121eb07ba07c850a1393f7a6e683ea18033e2b08292e9498ca
5
5
  SHA512:
6
- metadata.gz: 2c3ac645ad79bdf8f208e6027f1b43e75f8219bf9572df4c4f376c13d197e42840fa509a79702968a109f90a4ab665bbc5fd549a4057332cb9c27b73ec096fad
7
- data.tar.gz: e223b20da66c82126a0253553c1f070a5584cc69e1bad693ceb36f17977fc963f4eb3888198fa77fcf5db5dff6b339090b7098a27ad902f8f19e50e2154e6613
6
+ metadata.gz: 3f94b7db519dc4184b7b1ab63b2357ccddc63360aa8b8f3d9cec9c5387610a7dd2222b3e836390d5fd9120e848e9be543e07afdae3ff037ac75d3938f1e46a92
7
+ data.tar.gz: 69cc56cbb35db6951c385a88df34c90626f7d36c4d1cbcd39dffebd473ada92109d5baf12381720ab157a2ba10ce1e5b40844c16f75f901aacc73c17a9eb95e0
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "gem-ext-cleaner"
4
+
5
+ Gem::Specification.each do |spec|
6
+ next if spec.extensions.empty?
7
+ GemExtCleaner.clean(spec)
8
+ end
@@ -0,0 +1,16 @@
1
+ require "rbconfig"
2
+ require "pathname"
3
+
4
+ module GemExtCleaner
5
+ def self.clean(spec)
6
+ (spec.full_require_paths - [spec.extension_dir]).each do |path|
7
+ Dir.glob(File.join(path, "**/*")).each do |file|
8
+ if Pathname(file).extname == ".#{RbConfig::CONFIG["DLEXT"]}"
9
+ File.delete(file)
10
+ puts "Delete #{file}"
11
+ end
12
+ end
13
+ rescue Errno::EPERM
14
+ end
15
+ end
16
+ end
@@ -1,17 +1,5 @@
1
- # このプラグインは gem のインストール後に実行される
2
- # このプラグインは `lib` の下にコピーされた foo.so や foo.bundle などのファイルを削除する
3
-
4
- require "rbconfig"
5
- require "pathname"
1
+ require "gem-ext-cleaner"
6
2
 
7
3
  Gem.post_install do |installer|
8
- (installer.spec.full_require_paths - [installer.spec.extension_dir]).each do |path|
9
- Dir.glob(File.join(path, "**/*")).each do |file|
10
- if Pathname(file).extname == ".#{RbConfig::CONFIG["DLEXT"]}"
11
- File.delete(file)
12
- puts "Delete #{file}"
13
- end
14
- end
15
- end
16
- rescue Errno::EPERM
4
+ GemExtCleaner.clean(installer.spec)
17
5
  end
metadata CHANGED
@@ -1,22 +1,24 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gem-ext-cleaner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroshi SHIBATA
8
- autorequire:
9
- bindir: bin
8
+ bindir: exe
10
9
  cert_chain: []
11
- date: 2023-10-11 00:00:00.000000000 Z
10
+ date: 2024-05-28 00:00:00.000000000 Z
12
11
  dependencies: []
13
12
  description: Clean up unnecessary extension files for gem command.
14
13
  email:
15
14
  - hsbt@ruby-lang.org
16
- executables: []
15
+ executables:
16
+ - gem-ext-cleaner
17
17
  extensions: []
18
18
  extra_rdoc_files: []
19
19
  files:
20
+ - exe/gem-ext-cleaner
21
+ - lib/gem-ext-cleaner.rb
20
22
  - lib/rubygems_plugin.rb
21
23
  homepage: https://github.com/hsbt/gem-ext-cleaner
22
24
  licenses:
@@ -25,7 +27,6 @@ licenses:
25
27
  metadata:
26
28
  homepage_uri: https://github.com/hsbt/gem-ext-cleaner
27
29
  source_code_uri: https://github.com/hsbt/gem-ext-cleaner
28
- post_install_message:
29
30
  rdoc_options: []
30
31
  require_paths:
31
32
  - lib
@@ -40,8 +41,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
40
41
  - !ruby/object:Gem::Version
41
42
  version: '0'
42
43
  requirements: []
43
- rubygems_version: 3.5.0.dev
44
- signing_key:
44
+ rubygems_version: 3.6.0.dev
45
45
  specification_version: 4
46
46
  summary: Clean up unnecessary extension files for gem command.
47
47
  test_files: []