dockdev 0.3.1 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 85d884f66a688688873bd93b27d150359b7acc0e06c53e719745e6fba1eeb4dc
4
- data.tar.gz: d2463779c2e4111881817d912e8fd5c0b90e43da969894d617ed713793f00bd4
3
+ metadata.gz: ae98215aa8c67bca833b8a6d1c6845ba371a9585292b3ae655ebe3e9abc39ed8
4
+ data.tar.gz: b59ed76855649a092a037e556fd790372d75d17a8212a12f9f855e2462d7bcfa
5
5
  SHA512:
6
- metadata.gz: ddd4aac680340e10fe9ba71aed6255ec89bb3f2a03bd5eb4cc6182e38f49940f15a228cff17099b79ef9bc193b16589784e004e71876e2a90a5e2dfca9f880ba
7
- data.tar.gz: 62f4776b2171cf5d1ac6cf6bc8596b5b878b276c2b93f38a2ec037c243be245c275f3769bd510bdcf5924f1478e93bb57d9de2c72dce20cc56f044e33c75d140
6
+ metadata.gz: d8bba3afd72d45475389856f6e2284a9163c4ee6312ec344cb972091abb95d1598f27f2e8f3221e53ea6d5daa5decdb4deedf274499d03bb9efa08b8305854b5
7
+ data.tar.gz: 389d29a2e8f6bb00e1f5ca80ae7b6be2b8b42919e7e857912df7f1640ff4c2cdce1250d893c865a5b7e5bdbbeb59071e9538147de83be5474f8b39798b0cef77
@@ -21,10 +21,13 @@ module Dockdev
21
21
  Dir.glob(File.join(@path,"Gemfile"))
22
22
  end
23
23
 
24
- def process_mount(mount_hash)
24
+ def process_mount(mount_hash, dir_inside_docker = "/opt")
25
25
 
26
26
  if not mount_hash.nil? and mount_hash.is_a?(Hash)
27
27
 
28
+ script = ["#!/bin/bash"]
29
+ script << "alias be > /dev/null 2>&1 && echo 'alias be=bundle exec' >> ~/.bashrc"
30
+
28
31
  #
29
32
  # looking at source code
30
33
  # https://github.com/rubygems/rubygems/blob/master/bundler/lib/bundler/shared_helpers.rb#L246
@@ -35,12 +38,20 @@ module Dockdev
35
38
  if not d.source.nil?
36
39
  src = d.source
37
40
  if src.path.to_s != "."
38
- mount_hash[d.name] = src.path.expand_path.to_s
41
+ pathInsideDocker = File.join(dir_inside_docker, d.name)
42
+ mount_hash[src.path.expand_path.to_s] = pathInsideDocker
43
+ script << "bundle config --global local.#{d.name} #{pathInsideDocker}"
39
44
  #res[d.name] = src.path.expand_path.to_s
40
45
  end
41
46
  end
42
47
  end
43
48
 
49
+ scriptOut = File.join(@path,"to_be_executed_inside_docker.sh")
50
+ File.open(scriptOut,"w") do |f|
51
+ f.write script.join("\n")
52
+ end
53
+ `chmod +x #{scriptOut}`
54
+
44
55
  end
45
56
 
46
57
  mount_hash
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dockdev
4
- VERSION = "0.3.1"
4
+ VERSION = "0.3.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dockdev
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris