lux 0.1 → 0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/lux.rb +16 -0
  3. data/lib/lux/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 38ebce629f37858b431970695e06dd78bb7c1b04
4
- data.tar.gz: 113e1a1c30136788ec9b334eb9fd7907bc5bb33e
3
+ metadata.gz: 74bd15feb512dfda1768add70eae2cb4f24ed48c
4
+ data.tar.gz: 02dde3b639dedc7d68f5c1ba79954391a01cdee9
5
5
  SHA512:
6
- metadata.gz: f582e29ebf238f9c80085ef8ceb9594ef9d3f5fa2acf384dec1f78a84884f13fbb65fa729c3ef91079f86196d53a6731c44e845b731edee6e8b30a1440815e8d
7
- data.tar.gz: e978293de041075f563951bade0db7017ec6435f2bfb2533f8bee0ad731a2412722f4c0ccf2cc75dde31ea9c5b3c2957a1380a218b69fc2125f95b1590f60e3b
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
@@ -1,3 +1,3 @@
1
1
  module Lux
2
- VERSION = "0.1"
2
+ VERSION = "0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lux
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.1'
4
+ version: '0.2'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Townsend