gem-ext-cleaner 0.0.2 → 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: 760320c93bfc30499f74c87aef23af8c93d02f4eeea2ad386e95e84b1ee8bbbb
4
- data.tar.gz: 81f6acb573637084dfc91e5158168ce7a4d3b4583c50a1ad4814821469dcebfa
3
+ metadata.gz: 0e1553d6f3ed36696dbb8625209f7ef21680904b89afeb347c2345ba6505ffba
4
+ data.tar.gz: 94cf5aad01aa04121eb07ba07c850a1393f7a6e683ea18033e2b08292e9498ca
5
5
  SHA512:
6
- metadata.gz: 65bfd08c9370320c3b59843dc40dbd3ec098a41d5256190155357bcaeb329e7bdb7cbe14b3d8c046c81b4d47ab3f63d8a19c37b95132370cbbdc4e8c2d22686c
7
- data.tar.gz: 555c1dd7de34e832068f624d634f5e6a4a322c08ddaaea297aab9bf91a25f8286f39cf2d18127cb7e8370bb29c87301a4af32756fe07be3b19c0117d21fee91f
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,18 +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
- next if file =~ /\/\d+\.\d\// # for fat gem
11
- if Pathname(file).extname == ".#{RbConfig::CONFIG["DLEXT"]}"
12
- File.delete(file)
13
- puts "Delete #{file}"
14
- end
15
- end
16
- end
17
- rescue Errno::EPERM
4
+ GemExtCleaner.clean(installer.spec)
18
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.2
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-11-08 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: []