bundler-common_gemfile 0.0.1 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bundler-common_gemfile.rb +15 -9
- 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: d68228fd08346adca6135364d436a88d95352e134127ad2c9b73a65b5fb146e9
|
4
|
+
data.tar.gz: 695050a1a22d2a321f76fa0ff6ec99ec983cc0d32d447eed4e3ce04eabecf52b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb40102e1be6048d96672668bf9ceab273c472e1877063e496eb38a62ba674b774bb2f4292ac040cc7557ff3a168c72152d63236c45224c0087d944d17833928
|
7
|
+
data.tar.gz: '0933d65f8109f35f649eeab0468d31a15e7b26065648be968afd36cc81f31a83b749a3ed92b5faf704838adb071baf477b88ffa9115fbacf1874e9f885a2a5f7'
|
@@ -1,32 +1,38 @@
|
|
1
|
-
|
1
|
+
module Bundler
|
2
2
|
class CommonGemfile
|
3
|
-
def self.load_other
|
4
|
-
puts 'SUPER BUNDLER START'
|
3
|
+
def self.load_other(context)
|
5
4
|
evaled = []
|
6
5
|
|
7
6
|
while true
|
8
7
|
number_of_evaled = evaled.size
|
9
|
-
sources = @sources.all_sources
|
8
|
+
sources = context.instance_variable_get('@sources').all_sources
|
10
9
|
|
11
10
|
sources.select { |s| s.is_a?(Bundler::Source::Git) || s.is_a?(Bundler::Source::Path) }.each do |source|
|
12
11
|
source.instance_variable_set('@allow_cached', true)
|
13
|
-
# source.specs # dobre do odświerzenia cache bundlera
|
14
12
|
gemfile_common_path = if source.respond_to?('install_path')
|
15
13
|
source.install_path
|
16
|
-
# source.specs # (taki ala robi bundle install wtf XD, samo pobiera z gita)
|
17
14
|
else
|
18
15
|
source.path
|
19
16
|
end.join('Gemfile-common.rb')
|
17
|
+
gem_path = File.dirname(gemfile_common_path)
|
18
|
+
|
19
|
+
if !File.exist?(gem_path) && source.is_a?(Bundler::Source::Git)
|
20
|
+
puts " fetching \e[1m\e[92m#{source.name}\e[0m"
|
21
|
+
source.specs
|
22
|
+
end
|
23
|
+
|
20
24
|
if !evaled.include?(gemfile_common_path) && File.exist?(gemfile_common_path)
|
21
25
|
evaled << gemfile_common_path
|
22
|
-
|
23
|
-
|
26
|
+
puts "Evaling \e[1m\e[92m#{gemfile_common_path}\e[0m"
|
27
|
+
content = File.read(gemfile_common_path)
|
28
|
+
puts content if ENV['DEBUG_GEMFILE_COMMOM']
|
29
|
+
eval(content, context.send(:binding))
|
30
|
+
puts "Evaling \e[1m\e[92m#{'done'}\e[0m"
|
24
31
|
end
|
25
32
|
end
|
26
33
|
|
27
34
|
break if evaled.size == number_of_evaled
|
28
35
|
end
|
29
|
-
puts 'SUPER BUNDLER END'
|
30
36
|
end
|
31
37
|
end
|
32
38
|
end
|