precompiled_gems 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/precompiled_gems/patches.rb +13 -1
- data/lib/precompiled_gems/version.rb +1 -1
- data/lib/precompiled_gems.rb +21 -23
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5950d5c63d441303202985c9c9c4e9132ae60c3fdf2cdd6da846753d268f1c0b
|
|
4
|
+
data.tar.gz: dcde75c5a15d803f475c303a8ae0e80bf85bbab6281f2c57beff1075bcd01c90
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f2ae852cf998d26eb8d89e4673bdd7c66e2e36ff5403fe52f6759a1b7fa17dd810baec72d84b562b0fc9591eb60bd5b0083e496a63af93a795e8b2cc23334bde
|
|
7
|
+
data.tar.gz: e2f8a243f764b12636adab8658b9ab3d974d7746219ba958f50ee59cf7e85628eafb36ae65a77ac5cb638db36eb522074a42c77c2f41904ef0b09868f3ef8029
|
|
@@ -4,8 +4,9 @@ require "bundler"
|
|
|
4
4
|
|
|
5
5
|
module PrecompiledGems
|
|
6
6
|
module DslPatch
|
|
7
|
-
def
|
|
7
|
+
def use_precompiled_gems!(gems = {})
|
|
8
8
|
PrecompiledGems.enabled = true
|
|
9
|
+
PrecompiledGems.gems.merge!(gems)
|
|
9
10
|
end
|
|
10
11
|
|
|
11
12
|
def gem(name, *args)
|
|
@@ -36,10 +37,21 @@ module PrecompiledGems
|
|
|
36
37
|
super(PrecompiledGems.takeover(name), *args)
|
|
37
38
|
end
|
|
38
39
|
end
|
|
40
|
+
|
|
41
|
+
module RubygemsIntegrationPatch
|
|
42
|
+
def installed_specs
|
|
43
|
+
super.each do |spec|
|
|
44
|
+
spec.runtime_dependencies.each do |dep|
|
|
45
|
+
dep.name = PrecompiledGems.takeover(dep.name)
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
39
50
|
end
|
|
40
51
|
|
|
41
52
|
Bundler::Dsl.prepend(PrecompiledGems::DslPatch)
|
|
42
53
|
Bundler::CompactIndexClient.prepend(PrecompiledGems::CompactIndexClientPatch)
|
|
43
54
|
Bundler::EndpointSpecification.prepend(PrecompiledGems::EndpointSpecificationPatch)
|
|
44
55
|
Bundler::SharedHelpers.singleton_class.prepend(PrecompiledGems::SharedHelpersPatch)
|
|
56
|
+
Bundler::RubygemsIntegration.prepend(PrecompiledGems::RubygemsIntegrationPatch)
|
|
45
57
|
Kernel.prepend(PrecompiledGems::KernelGemPatch)
|
data/lib/precompiled_gems.rb
CHANGED
|
@@ -6,34 +6,32 @@ require_relative "precompiled_gems/patches"
|
|
|
6
6
|
module PrecompiledGems
|
|
7
7
|
extend self
|
|
8
8
|
|
|
9
|
+
attr_accessor :gems
|
|
10
|
+
self.gems = {
|
|
11
|
+
"bigdecimal" => "ed-precompiled_bigdecimal",
|
|
12
|
+
"websocket-driver" => "ed3-precompiled_websocket-driver",
|
|
13
|
+
"prism" => "ed-precompiled_prism",
|
|
14
|
+
"nio4r" => "ed-precompiled_nio4r",
|
|
15
|
+
"erb" => "ed-precompiled_erb",
|
|
16
|
+
"racc" => "ed-precompiled_racc",
|
|
17
|
+
"date" => "ed-precompiled_date",
|
|
18
|
+
"stringio" => "ed-precompiled_stringio",
|
|
19
|
+
"json" => "ed-precompiled_json",
|
|
20
|
+
"io-console" => "ed-precompiled_io-console",
|
|
21
|
+
"bootsnap" => "ed-precompiled_bootsnap",
|
|
22
|
+
"puma" => "ed2-precompiled_puma",
|
|
23
|
+
"bindex" => "ed-precompiled_bindex",
|
|
24
|
+
"msgpack" => "ed-precompiled_msgpack",
|
|
25
|
+
"debug" => "ed2-precompiled_debug",
|
|
26
|
+
"bcrypt_pbkdf" => "ed-precompiled_bcrypt_pbkdf",
|
|
27
|
+
"ed25519" => "ed-precompiled_ed25519",
|
|
28
|
+
}
|
|
9
29
|
attr_accessor :enabled
|
|
10
30
|
self.enabled = false
|
|
11
31
|
|
|
12
32
|
def takeover(original_gem)
|
|
13
33
|
return original_gem unless enabled
|
|
14
34
|
|
|
15
|
-
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def list
|
|
19
|
-
{
|
|
20
|
-
"bigdecimal" => "ed-precompiled_bigdecimal",
|
|
21
|
-
"websocket-driver" => "ed3-precompiled_websocket-driver",
|
|
22
|
-
"prism" => "ed-precompiled_prism",
|
|
23
|
-
"nio4r" => "ed-precompiled_nio4r",
|
|
24
|
-
"erb" => "ed-precompiled_erb",
|
|
25
|
-
"racc" => "ed-precompiled_racc",
|
|
26
|
-
"date" => "ed-precompiled_date",
|
|
27
|
-
"stringio" => "ed-precompiled_stringio",
|
|
28
|
-
"json" => "ed-precompiled_json",
|
|
29
|
-
"io-console" => "ed-precompiled_io-console",
|
|
30
|
-
"bootsnap" => "ed-precompiled_bootsnap",
|
|
31
|
-
"puma" => "ed2-precompiled_puma",
|
|
32
|
-
"bindex" => "ed-precompiled_bindex",
|
|
33
|
-
"msgpack" => "ed-precompiled_msgpack",
|
|
34
|
-
"debug" => "ed2-precompiled_debug",
|
|
35
|
-
"bcrypt_pbkdf" => "ed-precompiled_bcrypt_pbkdf",
|
|
36
|
-
"ed25519" => "ed-precompiled_ed25519",
|
|
37
|
-
}
|
|
35
|
+
gems.fetch(original_gem, original_gem)
|
|
38
36
|
end
|
|
39
37
|
end
|