nib 1.6.0 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/bin/nib +1 -1
- data/lib/nib/command.rb +3 -0
- data/lib/nib/history.rb +8 -4
- data/lib/nib/shell.rb +4 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ae5c7c0fd0074c8bc59abecde13d264c9193b75
|
4
|
+
data.tar.gz: 333886e4de7e6097560e04d17101be5df9eafc03
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ebdc8d550836d01e26a6462c258d73d9e888b7789dd737df13dbd9e1021e1f7364cf847a44bd3d4b9e1ead7098461d42205851bab95ed05d2b3cec04a6320348
|
7
|
+
data.tar.gz: 317dc1f2302bbcf859b4f15b20b28340ca32c766750ec4bdb84ca6a9f250f0f2572809a192e4389b4a37da3b3e7629c9f50d899172a536d9c2a06e62739914af
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.7.0
|
data/bin/nib
CHANGED
@@ -47,7 +47,7 @@ on_error do |exception|
|
|
47
47
|
case exception
|
48
48
|
when GLI::UnknownCommand
|
49
49
|
# delegate unknown commands over to `docker-compose`
|
50
|
-
exec("docker-compose #{ARGV.join(' ')}")
|
50
|
+
exec("docker-compose -f #{Nib::History::Compose.new.path} #{ARGV.join(' ')}")
|
51
51
|
|
52
52
|
false
|
53
53
|
else
|
data/lib/nib/command.rb
CHANGED
@@ -29,6 +29,7 @@ module Nib::Command
|
|
29
29
|
#{alternate_compose_file} \
|
30
30
|
run \
|
31
31
|
--rm \
|
32
|
+
#{entrypoint} \
|
32
33
|
#{options} \
|
33
34
|
#{service} \
|
34
35
|
#{command}
|
@@ -36,4 +37,6 @@ module Nib::Command
|
|
36
37
|
end
|
37
38
|
|
38
39
|
def alternate_compose_file; end
|
40
|
+
|
41
|
+
def entrypoint; end
|
39
42
|
end
|
data/lib/nib/history.rb
CHANGED
@@ -17,19 +17,23 @@ module Nib::History
|
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
|
-
def
|
21
|
-
return if self.class.history_requires_command? && @command.to_s.empty?
|
22
|
-
|
20
|
+
def wrap(executable)
|
23
21
|
<<-COMMAND
|
24
22
|
/bin/sh -c \"
|
25
23
|
export HISTFILE=#{PATH}/shell_history
|
26
24
|
cp #{irbrc.container_path} /root/.irbrc 2>/dev/null
|
27
25
|
cp #{pryrc.container_path} /root/.pryrc 2>/dev/null
|
28
|
-
#{
|
26
|
+
#{executable}
|
29
27
|
\"
|
30
28
|
COMMAND
|
31
29
|
end
|
32
30
|
|
31
|
+
def command
|
32
|
+
return if self.class.history_requires_command? && @command.to_s.empty?
|
33
|
+
|
34
|
+
wrap(super)
|
35
|
+
end
|
36
|
+
|
33
37
|
def alternate_compose_file
|
34
38
|
"-f #{Compose.new.path}"
|
35
39
|
end
|
data/lib/nib/shell.rb
CHANGED
@@ -4,14 +4,16 @@ class Nib::Shell
|
|
4
4
|
|
5
5
|
private
|
6
6
|
|
7
|
-
def
|
7
|
+
def entrypoint
|
8
8
|
conditions = %i(zsh bash ash).map do |shell|
|
9
9
|
"elif hash #{shell} 2>/dev/null ; then #{shell};"
|
10
10
|
end
|
11
11
|
|
12
|
-
conditions
|
12
|
+
executable = conditions # default conditions
|
13
13
|
.unshift('if [ -f bin/shell ]; then bin/shell;') # prepend bin/shell
|
14
14
|
.push('else sh; fi') # add else clause (`sh`)
|
15
15
|
.join("\n")
|
16
|
+
|
17
|
+
"--entrypoint='#{wrap(executable)}'"
|
16
18
|
end
|
17
19
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Allen
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-
|
12
|
+
date: 2017-06-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: gli
|