dip 3.0.0 → 3.1.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6a9ad2527f29216fd1a230c2c8acc9032f08cd1eea686f89df433f8c59be50fb
4
- data.tar.gz: d84a3f71b392136dd0d275391ec0c58424b91a00e3ae0a1ea93233ec3a718026
3
+ metadata.gz: d0c6660d3c5dec159ce66556651d44345ce59c9d964fc016f740bf2d25a7f772
4
+ data.tar.gz: ad54f1140a5e5468fda94511e7e2261b81b093c2c5e416bbbef0a98d08ab4960
5
5
  SHA512:
6
- metadata.gz: 99e059244669e8aa9a7ab9393aaad1461231667ef66ce0073ad417462bae8996c9819794e8fba8006ea4fabf6296426b006ae5ff485afb0b92aefaafd5719bf2
7
- data.tar.gz: 5497a34f27a83e88f91eadca30dbaf3732f38da9b70c5d7bbfbe994ab3b0293156966bb187c3394120ab35a992995d3ea8b7d1e6e4b7d4384b55e141badfd28e
6
+ metadata.gz: 32be532c2a9926e4217ef81b696d73526bbaeaec6d2163489b96e9119a8370c70bfe5294ed4458945a7bbaf76bbe279a6504666955654ef1e3ebf5eca670ae43
7
+ data.tar.gz: d94e94a96a57df4dc9477fd58ace8ba92abf70af862f34e3336ec3628099b70d44e2e8e48eb18734cd0d18554893738a52d1268d7a19874705e387e448e2b06b
@@ -5,13 +5,6 @@ require 'thor'
5
5
  module Dip
6
6
  class CLI < Thor
7
7
  class << self
8
- def retrieve_command_name(args)
9
- meth = args.first.to_sym unless args.empty?
10
- args.unshift("run") if meth && ::Dip.config.interaction.key?(meth.to_sym)
11
-
12
- super(args)
13
- end
14
-
15
8
  # Hackery. Take the run method away from Thor so that we can redefine it.
16
9
  def is_thor_reserved_word?(word, type)
17
10
  return false if word == "run"
@@ -20,6 +13,22 @@ module Dip
20
13
  end
21
14
  end
22
15
 
16
+ stop_on_unknown_option! :up
17
+
18
+ def method_missing(cmd, *args)
19
+ if Dip.config.interaction.key?(cmd.to_sym)
20
+ args.unshift(cmd.to_s)
21
+ args.unshift("run")
22
+ self.class.start(args)
23
+ else
24
+ super
25
+ end
26
+ end
27
+
28
+ def respond_to_missing?(cmd)
29
+ Dip.config.interaction.key?(cmd.to_sym)
30
+ end
31
+
23
32
  desc 'version', 'dip version'
24
33
  def version
25
34
  require_relative 'version'
@@ -39,6 +48,11 @@ module Dip
39
48
  end
40
49
  end
41
50
 
51
+ desc "up [OPTIONS] SERVICE", "Run docker-compose up command"
52
+ def up(*argv)
53
+ compose("up", *argv)
54
+ end
55
+
42
56
  desc 'CMD or dip run CMD [OPTIONS]', 'Run configured command in a docker-compose service'
43
57
  method_option :help, aliases: '-h', type: :boolean,
44
58
  desc: 'Display usage information'
@@ -69,22 +83,16 @@ module Dip
69
83
  end
70
84
  end
71
85
 
86
+ require_relative 'cli/ssh'
72
87
  desc "ssh", "ssh-agent container commands"
73
- def ssh(*args)
74
- require_relative 'cli/ssh'
75
- Dip::CLI::SSH.start(args)
76
- end
88
+ subcommand :ssh, Dip::CLI::SSH
77
89
 
90
+ require_relative 'cli/dns'
78
91
  desc "dns", "DNS server for automatic docker container discovery"
79
- def dns(*args)
80
- require_relative 'cli/dns'
81
- Dip::CLI::DNS.start(args)
82
- end
92
+ subcommand :dns, Dip::CLI::DNS
83
93
 
94
+ require_relative 'cli/nginx'
84
95
  desc "nginx", "Nginx reverse proxy server"
85
- def nginx(*args)
86
- require_relative 'cli/nginx'
87
- Dip::CLI::Nginx.start(args)
88
- end
96
+ subcommand :nginx, Dip::CLI::Nginx
89
97
  end
90
98
  end
@@ -7,7 +7,7 @@ module Dip
7
7
  class CLI
8
8
  # See more https://github.com/aacebedo/dnsdock
9
9
  class DNS < Thor
10
- desc "dns up", "Run dnsdock container"
10
+ desc "up", "Run dnsdock container"
11
11
  method_option :help, aliases: '-h', type: :boolean,
12
12
  desc: 'Display usage information'
13
13
  method_option :name, aliases: '-n', type: :string, default: "dnsdock",
@@ -39,7 +39,7 @@ module Dip
39
39
  end
40
40
  # rubocop:enable Metrics/AbcSize, Metrics/MethodLength
41
41
 
42
- desc "dns down", "Stop dnsdock container"
42
+ desc "down", "Stop dnsdock container"
43
43
  method_option :help, aliases: '-h', type: :boolean,
44
44
  desc: 'Display usage information'
45
45
  method_option :name, aliases: '-n', type: :string, default: "dnsdock",
@@ -54,7 +54,7 @@ module Dip
54
54
  end
55
55
  end
56
56
 
57
- desc "dns restart", "Stop and start dnsdock container"
57
+ desc "restart", "Stop and start dnsdock container"
58
58
  method_option :help, aliases: '-h', type: :boolean,
59
59
  desc: 'Display usage information'
60
60
  def restart(*args)
@@ -67,7 +67,7 @@ module Dip
67
67
  end
68
68
  end
69
69
 
70
- desc "dns ip", "Get ip address of dnsdock container"
70
+ desc "ip", "Get ip address of dnsdock container"
71
71
  method_option :help, aliases: '-h', type: :boolean,
72
72
  desc: 'Display usage information'
73
73
  method_option :name, aliases: '-n', type: :string, default: "dnsdock",
@@ -7,7 +7,7 @@ module Dip
7
7
  class CLI
8
8
  # See more https://github.com/bibendi/nginx-proxy
9
9
  class Nginx < Thor
10
- desc "nginx up", "Run nginx container"
10
+ desc "up", "Run nginx container"
11
11
  method_option :help, aliases: '-h', type: :boolean,
12
12
  desc: 'Display usage information'
13
13
  method_option :name, aliases: '-n', type: :string, default: "nginx",
@@ -39,7 +39,7 @@ module Dip
39
39
  end
40
40
  # rubocop:enable Metrics/AbcSize, Metrics/MethodLength
41
41
 
42
- desc "nginx down", "Stop nginx container"
42
+ desc "down", "Stop nginx container"
43
43
  method_option :help, aliases: '-h', type: :boolean,
44
44
  desc: 'Display usage information'
45
45
  method_option :name, aliases: '-n', type: :string, default: "nginx",
@@ -54,7 +54,7 @@ module Dip
54
54
  end
55
55
  end
56
56
 
57
- desc "nginx restart", "Stop and start nginx container"
57
+ desc "restart", "Stop and start nginx container"
58
58
  method_option :help, aliases: '-h', type: :boolean,
59
59
  desc: 'Display usage information'
60
60
  def restart(*args)
@@ -6,7 +6,7 @@ require_relative "../commands/ssh"
6
6
  module Dip
7
7
  class CLI
8
8
  class SSH < Thor
9
- desc "ssh up", "Run ssh-agent container"
9
+ desc "up", "Run ssh-agent container"
10
10
  method_option :help, aliases: '-h', type: :boolean,
11
11
  desc: 'Display usage information'
12
12
  method_option :key, aliases: '-k', type: :string, default: "$HOME/.ssh/id_rsa",
@@ -32,7 +32,7 @@ module Dip
32
32
 
33
33
  map add: :up
34
34
 
35
- desc "ssh down", "Stop ssh-agent container"
35
+ desc "down", "Stop ssh-agent container"
36
36
  method_option :help, aliases: '-h', type: :boolean,
37
37
  desc: 'Display usage information'
38
38
  def down
@@ -43,7 +43,7 @@ module Dip
43
43
  end
44
44
  end
45
45
 
46
- desc "ssh restart", "Stop and start ssh-agent container"
46
+ desc "restart", "Stop and start ssh-agent container"
47
47
  method_option :help, aliases: '-h', type: :boolean,
48
48
  desc: 'Display usage information'
49
49
  def restart(*args)
@@ -56,7 +56,7 @@ module Dip
56
56
  end
57
57
  end
58
58
 
59
- desc "ssh status", "Show status of ssh-agent container"
59
+ desc "status", "Show status of ssh-agent container"
60
60
  method_option :help, aliases: '-h', type: :boolean,
61
61
  desc: 'Display usage information'
62
62
  def status
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dip
4
- VERSION = "3.0.0"
4
+ VERSION = "3.1.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dip
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - bibendi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-09-25 00:00:00.000000000 Z
11
+ date: 2018-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor