bundler-common_gemfile 0.0.1 → 0.0.9

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/bundler-common_gemfile.rb +22 -16
  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: e1d622352d2332ad3ae9988efab9ad5580b9e7c121eec99666b60111804754f5
4
+ data.tar.gz: b6d58d87c622a24029068d60f24320bc45c530e798cf515b60e7d349b45a11d4
5
5
  SHA512:
6
- metadata.gz: 0cecee0b6458fdb77b32c97f76c9cb66b3cfedb0413b9c8ed108807688350bcecb4eb512dd66b69d56a6b673d01ae69cccbe4013eca7a6f6f92b472e987d3b16
7
- data.tar.gz: dd21d79236f5e99b8b4453b6480952805d8ac5b24e6eae812cdc647728043e4cc252264f79f99782d18b4e45c6a8d04db2ce392f70a5bf70a026b05c6a89d82c
6
+ metadata.gz: 9ea3c85dfca5cf838befe18f563f6621ad8333262ae25ea6a867abc9b4239875b0cbf800c59231cd4b68788756c8bc5d243ce2715f7931c4cd97b5bff5e2acdf
7
+ data.tar.gz: fccda69f3691b7dcba6a62e41e3a8e2186f7b1a03cd257e2ffdfb988b60695847aa2bbab990becd73cb45c7ddfde4dd927eab986356ae9e74d53619f09779aa2
@@ -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
10
-
8
+ sources = context.instance_variable_get('@sources').all_sources
11
9
  sources.select { |s| s.is_a?(Bundler::Source::Git) || s.is_a?(Bundler::Source::Path) }.each do |source|
10
+
12
11
  source.instance_variable_set('@allow_cached', true)
13
- # source.specs # dobre do odświerzenia cache bundlera
14
- gemfile_common_path = if source.respond_to?('install_path')
15
- source.install_path
16
- # source.specs # (taki ala robi bundle install wtf XD, samo pobiera z gita)
17
- else
18
- source.path
19
- end.join('Gemfile-common.rb')
12
+ gem_path = if source.respond_to?('install_path')
13
+ source.install_path
14
+ else
15
+ source.expanded_original_path
16
+ end
17
+
18
+ gemfile_common_path = gem_path.join('Gemfile-common.rb')
19
+
20
+ if !File.exist?(gem_path) && source.is_a?(Bundler::Source::Git)
21
+ puts " fetching \e[1m\e[92m#{source.name}\e[0m is search of common-gemfile"
22
+ source.specs
23
+ end
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
+ context.send(:eval, content)
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
- end
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.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrzej Bisewski