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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/bundler-common_gemfile.rb +15 -9
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '07139109e4cc9c4f5d91bcd160e1f30fe44233c90ea782adbcb219170755d3b4'
4
- data.tar.gz: 8f15fcc19e15651a275a0e02a5b7676d4071f1047619f1f3fa7ca51a8571ac70
3
+ metadata.gz: d68228fd08346adca6135364d436a88d95352e134127ad2c9b73a65b5fb146e9
4
+ data.tar.gz: 695050a1a22d2a321f76fa0ff6ec99ec983cc0d32d447eed4e3ce04eabecf52b
5
5
  SHA512:
6
- metadata.gz: 0cecee0b6458fdb77b32c97f76c9cb66b3cfedb0413b9c8ed108807688350bcecb4eb512dd66b69d56a6b673d01ae69cccbe4013eca7a6f6f92b472e987d3b16
7
- data.tar.gz: dd21d79236f5e99b8b4453b6480952805d8ac5b24e6eae812cdc647728043e4cc252264f79f99782d18b4e45c6a8d04db2ce392f70a5bf70a026b05c6a89d82c
6
+ metadata.gz: fb40102e1be6048d96672668bf9ceab273c472e1877063e496eb38a62ba674b774bb2f4292ac040cc7557ff3a168c72152d63236c45224c0087d944d17833928
7
+ data.tar.gz: '0933d65f8109f35f649eeab0468d31a15e7b26065648be968afd36cc81f31a83b749a3ed92b5faf704838adb071baf477b88ffa9115fbacf1874e9f885a2a5f7'
@@ -1,32 +1,38 @@
1
- class Bundler
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
- # eval_gemfile(gemfile_common_path) # ('', content)
23
- eval(File.read(gemfile_common_path))
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bundler-common_gemfile
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrzej Bisewski