pinject 0.1.5 → 0.1.6

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: 3b9e9f711a85a5ed50b33b9c493c96331ba3ffeaa0df0a44ef488514f753ca2d
4
- data.tar.gz: 2f6a58a3d500f26aead0cd1a499929a6175389f4990a6b157dbbdf98441a1afa
3
+ metadata.gz: 6271c0367bf816f2f1729deca146efbc20a80fc2d2e2850fb55f13d15aaf3a1a
4
+ data.tar.gz: f8dda7a4f39e9a70fbaef42e2a4d02418cea19dcea8efaf56e0c90576cb3516d
5
5
  SHA512:
6
- metadata.gz: 46f011748ced9a35caf7a704a69c36b06ec5e8a1c06626e565980daed4bad8d5ec2506c6cb865dcc0fe86a73cad9484c6ae4a915fe32930faeb56f7214b3759b
7
- data.tar.gz: 18fc8bdde9eeaa4eb618b5b244bb7de20da92886d13459bb0806e5318dcefe04a1105cf026bd2d516baaf43ab531bd78e5fc0b37f0744b4c21e4f16a2b4126a3
6
+ metadata.gz: 107296960c0fa9b257c205011218f12f35c00e837749877474481e7a8da2eccb7fe6707df8c503ccad24ac17c13a932014eb99e48dc88cd16107fe2b3ad52619
7
+ data.tar.gz: 83bed08e3402fb1779e4878ed59fd35951df4dfdc88fe6eba1ea5241c69401ba7439d70ae4bd3d7f4b4d9152c195d35bb3bb072d7a7baa5a8fcd1545a7918c23
data/.rubocop_todo.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2021-12-22 01:50:28 UTC using RuboCop version 1.23.0.
3
+ # on 2021-12-27 07:20:52 UTC using RuboCop version 1.23.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
@@ -23,17 +23,17 @@ Lint/AssignmentInCondition:
23
23
  # Offense count: 3
24
24
  # Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
25
25
  Metrics/AbcSize:
26
- Max: 21
26
+ Max: 19
27
27
 
28
28
  # Offense count: 1
29
29
  # Configuration parameters: CountComments, CountAsOne.
30
30
  Metrics/ClassLength:
31
- Max: 112
31
+ Max: 122
32
32
 
33
33
  # Offense count: 4
34
34
  # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
35
35
  Metrics/MethodLength:
36
- Max: 21
36
+ Max: 20
37
37
 
38
38
  # Offense count: 2
39
39
  # Configuration parameters: ForbiddenDelimiters.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pinject (0.1.4)
4
+ pinject (0.1.5)
5
5
  docker-api
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -23,7 +23,7 @@ Or install it yourself as:
23
23
  you can inject os update command to some docker images.
24
24
 
25
25
  ```ruby
26
- image = Pinject.new("ubuntu:latest")
26
+ image = Pinject::Docker.new("ubuntu:latest")
27
27
  inject_image = image.inject_build("pyama:ubuntu_inject") # run apt-get upgrade
28
28
  inject_image.push
29
29
  ```
@@ -7,11 +7,13 @@ module Pinject
7
7
  class Docker
8
8
  attr_reader :log
9
9
 
10
- ::Docker.authenticate!(
11
- 'username' => ENV['DOCKER_USER'],
12
- 'password' => ENV['DOCKER_PASSWORD'],
13
- 'serveraddress' => ENV['DOCKER_REGISTRY']
14
- ) if %w(DOCKER_USER DOCKER_PASSWORD DOCKER_REGISTRY).all? {|a| ENV[a] }
10
+ if %w[DOCKER_USER DOCKER_PASSWORD DOCKER_REGISTRY].all? { |a| ENV[a] }
11
+ ::Docker.authenticate!(
12
+ 'username' => ENV['DOCKER_USER'],
13
+ 'password' => ENV['DOCKER_PASSWORD'],
14
+ 'serveraddress' => ENV['DOCKER_REGISTRY']
15
+ )
16
+ end
15
17
 
16
18
  def initialize(image_name, log: false)
17
19
  @image_name = image_name
@@ -51,9 +53,8 @@ module Pinject
51
53
  })
52
54
 
53
55
  result = nil
54
- t = Thread.new { container.attach { |stream, chunk| result = chunk.chomp if stream == :stdout } }
55
56
  container.start
56
- t.join
57
+ container.streaming_logs(stdout: true) { |stream, chunk| result = chunk.chomp if stream == :stdout }
57
58
 
58
59
  if result
59
60
  dist, version, user = result.split(%r{:|/})
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pinject
4
- VERSION = '0.1.5'
4
+ VERSION = '0.1.6'
5
5
  end
data/pinject.gemspec CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.metadata['source_code_uri'] = 'https://github.com/pyama86/pinject'
19
19
  spec.metadata['changelog_uri'] = 'https://github.com/pyama86/pinject/CHANGELOG.md'
20
20
 
21
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
21
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
22
22
  spec.bindir = 'exe'
23
23
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
24
24
  spec.require_paths = ['lib']
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pinject
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - pyama
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-12-22 00:00:00.000000000 Z
11
+ date: 2022-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docker-api