lux 0.1 → 0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lux.rb +16 -0
- data/lib/lux/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74bd15feb512dfda1768add70eae2cb4f24ed48c
|
4
|
+
data.tar.gz: 02dde3b639dedc7d68f5c1ba79954391a01cdee9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81d0a9a9ad3dd74936f437e0f9eb411f28b468b6551715d27c3222fb6ae7dbcd19488f8792920665e1bc5950f7785ca77d0742b4346bc7b3c173e7d27f94b8df
|
7
|
+
data.tar.gz: 68a553cbc574bd55c36ed5ef1a325766f22309fc6962633360b1e51234f9b73d4e0816ab32fbbca9b89a13fd041f4d6b6196a364fe4b7f8ad175e1a615371e92
|
data/lib/lux.rb
CHANGED
@@ -2,6 +2,7 @@ require "lux/version"
|
|
2
2
|
require 'pathname'
|
3
3
|
require 'shellwords'
|
4
4
|
require 'thor'
|
5
|
+
require 'uri'
|
5
6
|
|
6
7
|
class Lux::App < Thor
|
7
8
|
|
@@ -115,6 +116,21 @@ class Lux::App < Thor
|
|
115
116
|
end
|
116
117
|
end
|
117
118
|
|
119
|
+
desc "dockerip", "Show DOCKER_HOST IP address"
|
120
|
+
def dockerenv
|
121
|
+
docker_url = URI(ENV['DOCKER_HOST'])
|
122
|
+
name = docker_url.host
|
123
|
+
if z = Socket.gethostbyname(name) rescue nil
|
124
|
+
z.shift 3
|
125
|
+
z.each do |a|
|
126
|
+
name = a.unpack('CCCC').join('.') if a.size == 4
|
127
|
+
end
|
128
|
+
end
|
129
|
+
puts "DOCKER_HOST=#{docker_url.to_s}"
|
130
|
+
docker_url.host = name
|
131
|
+
puts "export DOCKER_HOST=#{docker_url.to_s}"
|
132
|
+
end
|
133
|
+
|
118
134
|
private
|
119
135
|
|
120
136
|
# Get the current list of images and make a guess at which one it is...
|
data/lib/lux/version.rb
CHANGED