gem-ext-cleaner 0.0.2 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/gem-ext-cleaner +8 -0
- data/lib/gem-ext-cleaner.rb +19 -0
- data/lib/rubygems_plugin.rb +2 -15
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 73c77011b33a102341408753f7320f664811a8f757cecb461545cc525e9eacfc
|
4
|
+
data.tar.gz: 894d7f4f5b2bbd325de370ca8862ba80bf2d31fa56e356022d3cf239e7a0a3ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4fc14d2abd9276c650ac6248f09546c4974aa209fe0d481ef45a0f14c2288d436a95441fb618d4bd1d4b8b11f76b3b3c34402e0a2c31ef6e11c6480d7461c38
|
7
|
+
data.tar.gz: 516d9c5d70390ea730c1c43b7c30bdff95a54a827637ad2927d2d5f5240ffb135256b598148f9d44c7176a46a4124f0ae78c11d484cad434fdee40ea6be3760d
|
data/exe/gem-ext-cleaner
ADDED
@@ -0,0 +1,19 @@
|
|
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
|
+
# Prevent deleting files in versioned directories like google-protobuf, nokogiri
|
9
|
+
next if file =~ /(\d+\.\d+\/)/
|
10
|
+
|
11
|
+
if Pathname(file).extname == ".#{RbConfig::CONFIG["DLEXT"]}"
|
12
|
+
File.delete(file)
|
13
|
+
puts "Delete #{file}"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
rescue Errno::EPERM
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/rubygems_plugin.rb
CHANGED
@@ -1,18 +1,5 @@
|
|
1
|
-
|
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
|
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.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hiroshi SHIBATA
|
8
|
-
|
9
|
-
bindir: bin
|
8
|
+
bindir: exe
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
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.
|
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: []
|