docker-swarm 0.5.2 → 0.5.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: 563629df7e2265dea2e8b6743d8811e684ac7ceaafb174c1946380ddccc48f4c
4
- data.tar.gz: 7600cec6cb458c4ce1d80471db893bf51d18220ad863f43ace64e57d4a51e3dc
3
+ metadata.gz: eff62dbb2cde8d0e147463814a7d0a24006816bbd47e5d653eaf4509dfeffa0e
4
+ data.tar.gz: caddf055cebef26efa50937c93821a44c2fd24d85f74eb90ebc3cfa7c37a383a
5
5
  SHA512:
6
- metadata.gz: 96368b74aa6c89662b0f6a383d88aeac1e33f75750f444b5733bf3d10a548e79fd70f1540a8ae221a8372a97dadbc89c72ec026d1d32a9b2328fa1c9e0193902
7
- data.tar.gz: cdaae6e0385d994d730b76e584ced0e149fbe011ee011c2cd6aad87f908e999346ef215d1920112beaed475c349a68a4a403ec4abf0960bc0424aa1f4c5e235a
6
+ metadata.gz: 12a814dcb83bdd56ae1f2bb968131959d2c6f76d4d44b88ca059e21ce5b1e023b89cb626fb86d38664a3556767bb27d52c61214e5ae08d3267958eb07adf3995
7
+ data.tar.gz: 21802ca76f9eaecf8846c473609429ea460e0a23b9fb1c752ea313ebd0627e15d4b1f302b2eae4393d357df27c54a3141d1dc30005bff1a5fcadc2114065918d
@@ -6,22 +6,21 @@ module DockerSwarm
6
6
  extend ActiveSupport::Concern
7
7
 
8
8
  def inspect
9
- inspection = if respond_to?(:ID) && send(:ID).present?
10
- "ID: #{send(:ID)}"
11
- else
12
- "not persisted"
13
- end
9
+ return "#<#{self.class.name} not persisted>" unless persisted?
14
10
 
15
- # Intentar añadir el nombre si existe
16
- name_attr = attributes["Name"] || (respond_to?(:Name) ? send(:Name) : nil)
17
- inspection += ", Name: #{name_attr}" if name_attr.present?
11
+ parts = []
12
+ parts << "ID: #{ID}" if respond_to?(:ID) && ID.present?
13
+ parts << "Name: #{Name}" if respond_to?(:Name) && Name.present?
14
+ parts << "CreatedAt: #{CreatedAt}" if respond_to?(:CreatedAt) && CreatedAt.present?
15
+ parts << "UpdatedAt: #{UpdatedAt}" if respond_to?(:UpdatedAt) && UpdatedAt.present?
16
+ parts << "Version: #{Version}" if respond_to?(:Version) && Version.present?
18
17
 
19
- # Intentar añadir la imagen para servicios/contenedores
20
- spec = attributes["Spec"] || (respond_to?(:Spec) ? send(:Spec) : nil)
21
- image = spec&.dig("TaskTemplate", "ContainerSpec", "Image") || attributes["Image"] || (respond_to?(:Image) ? send(:Image) : nil)
22
- inspection += ", Image: #{image}" if image.present?
18
+ if respond_to?(:Spec) && Spec.present?
19
+ spec_str = Spec.map { |k, v| "#{k}=#{v.inspect}" }.join(", ")
20
+ parts << "Spec(#{spec_str})"
21
+ end
23
22
 
24
- "#<#{self.class.name} #{inspection}>"
23
+ "#<#{self.class.name} #{parts.join(", ")}>"
25
24
  end
26
25
  end
27
26
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DockerSwarm
4
- VERSION = "0.5.2"
4
+ VERSION = "0.5.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docker-swarm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriel