docker-swarm 0.5.0 → 0.5.2

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: a5c66a1153f6aa54787f22d1281e4b8d1932a951f70000ff0a3af72e79c9be7b
4
- data.tar.gz: 6469d6833f97509511d0bfffda44bbbdc650fa1c928d624efef79b5ba71221ef
3
+ metadata.gz: 563629df7e2265dea2e8b6743d8811e684ac7ceaafb174c1946380ddccc48f4c
4
+ data.tar.gz: 7600cec6cb458c4ce1d80471db893bf51d18220ad863f43ace64e57d4a51e3dc
5
5
  SHA512:
6
- metadata.gz: bc5f0fa14f81cf2d9da225c586458a155e8ac1042d5bc3d190b17a2f4c151d1239f2dd6046e1aa078d15ddea59a322476cdce5827945f8ad74a9fdd9030d79a5
7
- data.tar.gz: 3bd4011e41f199280010a1cb716735ef72ba54926c33c36425fb483b75611821a0ce12b07b0c731b88e0bfc63f7cfe66e84fe99c42b60c8f1ecf2745ed86feac
6
+ metadata.gz: 96368b74aa6c89662b0f6a383d88aeac1e33f75750f444b5733bf3d10a548e79fd70f1540a8ae221a8372a97dadbc89c72ec026d1d32a9b2328fa1c9e0193902
7
+ data.tar.gz: cdaae6e0385d994d730b76e584ced0e149fbe011ee011c2cd6aad87f908e999346ef215d1920112beaed475c349a68a4a403ec4abf0960bc0424aa1f4c5e235a
@@ -6,19 +6,19 @@ module DockerSwarm
6
6
  extend ActiveSupport::Concern
7
7
 
8
8
  def inspect
9
- inspection = if respond_to?(:ID) && ID.present?
10
- "ID: #{ID}"
9
+ inspection = if respond_to?(:ID) && send(:ID).present?
10
+ "ID: #{send(:ID)}"
11
11
  else
12
12
  "not persisted"
13
13
  end
14
14
 
15
15
  # Intentar añadir el nombre si existe
16
- name_attr = attributes["Name"] || (respond_to?(:Name) ? Name : nil)
16
+ name_attr = attributes["Name"] || (respond_to?(:Name) ? send(:Name) : nil)
17
17
  inspection += ", Name: #{name_attr}" if name_attr.present?
18
18
 
19
19
  # Intentar añadir la imagen para servicios/contenedores
20
- spec = attributes["Spec"] || (respond_to?(:Spec) ? Spec : nil)
21
- image = spec&.dig("TaskTemplate", "ContainerSpec", "Image") || attributes["Image"] || (respond_to?(:Image) ? Image : nil)
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
22
  inspection += ", Image: #{image}" if image.present?
23
23
 
24
24
  "#<#{self.class.name} #{inspection}>"
@@ -30,8 +30,8 @@ module DockerSwarm
30
30
 
31
31
  log_event("request_success",
32
32
  data: options.merge(
33
- status: response.status,
34
- duration_ms: calculate_duration(start_time)
33
+ http_status: response.status,
34
+ duration_s: calculate_duration(start_time)
35
35
  ))
36
36
 
37
37
  response.body
@@ -45,7 +45,7 @@ module DockerSwarm
45
45
  data: options.merge(
46
46
  error: actual_error.class.name,
47
47
  message: actual_error.message,
48
- duration_ms: calculate_duration(start_time)
48
+ duration_s: calculate_duration(start_time)
49
49
  ))
50
50
 
51
51
  if actual_error.class.name.include?("DockerSwarm::Error")
@@ -80,7 +80,7 @@ module DockerSwarm
80
80
  end
81
81
 
82
82
  def calculate_duration(start_time)
83
- ((Process.clock_gettime(Process::CLOCK_MONOTONIC) - start_time) * 1000).round(2)
83
+ (Process.clock_gettime(Process::CLOCK_MONOTONIC) - start_time).round(4)
84
84
  end
85
85
 
86
86
  def common_middlewares
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DockerSwarm
4
- VERSION = "0.5.0"
4
+ VERSION = "0.5.2"
5
5
  end
data/skill/SKILL.md CHANGED
@@ -6,7 +6,7 @@ Skill de conocimiento completo sobre DockerSwarm. Consultame para cualquier preg
6
6
 
7
7
  **Base** — Clase ORM base que hereda de ActiveModel::Model. Provee accessors dinámicos PascalCase, `find`, `all`, `where`, `reload`, `payload_for_docker`. Todos los modelos heredan de ella.
8
8
 
9
- **Concern** — Mixin ActiveSupport::Concern que agrega comportamiento CRUD a un modelo: Creatable (POST), Updatable (POST con Version.Index), Deletable (DELETE), Loggable (logs streaming), Inspectable (#inspect legible).
9
+ **Concern** — Mixin ActiveSupport::Concern que agrega comportamiento CRUD a un modelo: Creatable (POST), Updatable (POST con Version.Index), Deletable (DELETE), Loggable (logs streaming), Inspectable (#inspect legible). **Nota:** Los atributos dinámicos en Inspectable deben invocarse con `send(:ID)` para evitar `NameError` por interpretación como constante.
10
10
 
11
11
  **Middleware** — Capa Excon que procesa request/response: RequestEncoder (serialización body), ResponseJSONParser (parsing + indifferent access), ErrorHandler (status HTTP → excepción).
12
12
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docker-swarm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriel
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-04-04 00:00:00.000000000 Z
11
+ date: 2026-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport