containers 0.1.2 → 0.1.3

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: cd15c1e87342149b417b3b8671d6a435badd75d2bed6c32d4ca81d5cdce6e5b8
4
- data.tar.gz: 9066bc4c1a4890a9eea31c5d22d92ed812090ebdb3bc45dad76f130ae686ad7f
3
+ metadata.gz: 5f3784b3013279542f697c744a5eea116d5272f09c1641d86d5b643d973b88d3
4
+ data.tar.gz: 70d25bfc0859a02f22032b8b5ef6bb8ac79458d4ee6eb0a57a32f7369676932d
5
5
  SHA512:
6
- metadata.gz: 2f6d65ae82057568913304f231b84fa46671418d2e4119469b0e6691cc5937663b33cd06fc4787b5c7fabaffd4f364774fc49b4313a2a8aee71a38d7b4b1d9d0
7
- data.tar.gz: 184d0fe60b715ec9e90c39520b54eba1045e13c2247c35ec849d885aa371d7cfcbd510a4c98d1ffaa4f011d3fd7b661b8225c71431f3a1e735218b38cde19840
6
+ metadata.gz: 6df7ceec75fd5654ec0cc6ea146781b116c61b6a415b723f2c799b863bcb91090dcd3c43df42323d3b1e76fcfd2cbe1eb940b0352feca65c2188fd345feab71f
7
+ data.tar.gz: 8ce7cb11bd0c47fdcb4e094c002c38e4a4ca9faef00256786765de4afdc330fbbead793af55eb01bb3f844f7888a97ee76a421dfaa8fd8cc0c0449ecf6fa46f0
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "pry-byebug"
4
3
  require "thor"
4
+ require "awesome_print"
5
5
  require "rainbow"
6
6
  require "active_support/all"
7
7
  require_relative "concerns/commandable"
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Containers::CLI < Thor
4
+ desc "config:print", "Prints the configuration for the current directory"
5
+ def config_print(*args)
6
+ awesome_print configuration
7
+ end
8
+
9
+ map "config:print" => :config_print
10
+ map "config" => :config_print
11
+ end
@@ -10,5 +10,5 @@ class Containers::CLI < Thor
10
10
  execute_command "docker exec -it #{container} #{args.join " "}"
11
11
  end
12
12
 
13
- map x: :exec
13
+ map "x" => :exec
14
14
  end
@@ -2,6 +2,7 @@
2
2
 
3
3
  class Containers::CLI < Thor
4
4
  desc "list", "Lists all containers for this project"
5
+ long_desc "Also aliased as `ls` for convenience"
5
6
  method_option :detailed, type: :boolean, aliases: "-d", desc: "List detailed container information"
6
7
  method_option :service, type: :boolean, aliases: "-s", desc: "List container service names"
7
8
  def list(*args)
@@ -20,4 +21,6 @@ class Containers::CLI < Thor
20
21
  list = `#{command}`.split("\n").reject { |item| item.strip == "" || item.include?(PREFIX) }
21
22
  puts list.map { |item| item.split(" ").last.strip }.sort.join("\n")
22
23
  end
24
+
25
+ map "ls" => :list
23
26
  end
@@ -2,10 +2,14 @@
2
2
 
3
3
  class Containers::CLI < Thor
4
4
  desc "tail", "Tails container logs"
5
+ long_desc "Also aliased as `logs` and `log` for convenience"
5
6
  method_option :container, type: :array, aliases: "-c", desc: "A list of container names (space delimited)"
6
7
  method_option :service, type: :array, aliases: "-s", desc: "A list of service names (space delimited)"
7
8
  def tail(*args)
8
9
  args << "--since 5m" unless args.include?("--since")
9
10
  execute_command "docker compose #{docker_compose_files.map { |f| "-f #{f}" }.join " "} logs #{args.join " "} -f #{requested_service_names.join " "}"
10
11
  end
12
+
13
+ map "logs" => :tail
14
+ map "log" => :tail
11
15
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Containers
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: containers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hopsoft
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-05-18 00:00:00.000000000 Z
11
+ date: 2023-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '6.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: awesome_print
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '1.9'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '1.9'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: rainbow
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -138,6 +152,7 @@ files:
138
152
  - lib/containers/commands/attach.rb
139
153
  - lib/containers/commands/bash.rb
140
154
  - lib/containers/commands/bin.rb
155
+ - lib/containers/commands/config/print.rb
141
156
  - lib/containers/commands/down.rb
142
157
  - lib/containers/commands/exec.rb
143
158
  - lib/containers/commands/inspect.rb