pinject 0.1.2 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2d18d1b0abefc449635253839204b34bf14311dd6562db4b94456136a70f48f6
4
- data.tar.gz: 20458549d0f019c6d6d3a4bd3580fe3bc7b03b9f4ae1eede2de76917444af66c
3
+ metadata.gz: 6271c0367bf816f2f1729deca146efbc20a80fc2d2e2850fb55f13d15aaf3a1a
4
+ data.tar.gz: f8dda7a4f39e9a70fbaef42e2a4d02418cea19dcea8efaf56e0c90576cb3516d
5
5
  SHA512:
6
- metadata.gz: af674be462adbdc2d064015a06ad0907ad999b7f3fb6087b5a7fb103124659102e58e5578b060dfce8dfd5af0a7124edb24f9501fd419583662975b3fcd66584
7
- data.tar.gz: ac87f1ad0d95e8d5f4984de96d786ca9d2d191eaa75cc661f5f1acdabc292e64f2e2ab1832dea04f7dce7ba481304f326f00050bb134b2fd95a63aed2beea49b
6
+ metadata.gz: 107296960c0fa9b257c205011218f12f35c00e837749877474481e7a8da2eccb7fe6707df8c503ccad24ac17c13a932014eb99e48dc88cd16107fe2b3ad52619
7
+ data.tar.gz: 83bed08e3402fb1779e4878ed59fd35951df4dfdc88fe6eba1ea5241c69401ba7439d70ae4bd3d7f4b4d9152c195d35bb3bb072d7a7baa5a8fcd1545a7918c23
@@ -0,0 +1,43 @@
1
+ name: Ruby Gem
2
+
3
+ on:
4
+ push:
5
+ paths:
6
+ - 'lib/pinject/version.rb'
7
+ jobs:
8
+ build:
9
+ name: Build + Publish
10
+ runs-on: ubuntu-latest
11
+ permissions:
12
+ contents: read
13
+ packages: write
14
+
15
+ steps:
16
+ - uses: actions/checkout@v2
17
+ - name: Set up Ruby 2.6
18
+ uses: actions/setup-ruby@v1
19
+ with:
20
+ ruby-version: 3.0.3
21
+
22
+ - name: Publish to GPR
23
+ run: |
24
+ mkdir -p $HOME/.gem
25
+ touch $HOME/.gem/credentials
26
+ chmod 0600 $HOME/.gem/credentials
27
+ printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
28
+ gem build *.gemspec
29
+ gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
30
+ env:
31
+ GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}"
32
+ OWNER: ${{ github.repository_owner }}
33
+
34
+ - name: Publish to RubyGems
35
+ run: |
36
+ mkdir -p $HOME/.gem
37
+ touch $HOME/.gem/credentials
38
+ chmod 0600 $HOME/.gem/credentials
39
+ printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
40
+ gem build *.gemspec
41
+ gem push *.gem
42
+ env:
43
+ GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
@@ -0,0 +1,31 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: Ruby
9
+
10
+ on:
11
+ push:
12
+ branches: [ main ]
13
+ pull_request:
14
+ branches: [ main ]
15
+
16
+ jobs:
17
+ test:
18
+ runs-on: ubuntu-latest
19
+ strategy:
20
+ matrix:
21
+ ruby-version: ['2.6', '2.7', '3.0']
22
+
23
+ steps:
24
+ - uses: actions/checkout@v2
25
+ - name: Set up Ruby
26
+ uses: ruby/setup-ruby@v1
27
+ with:
28
+ ruby-version: ${{ matrix.ruby-version }}
29
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
30
+ - name: Run tests
31
+ run: bundle exec rake
data/.gitignore ADDED
@@ -0,0 +1,2 @@
1
+ vendor
2
+ test.rb
data/.rubocop.yml ADDED
@@ -0,0 +1 @@
1
+ inherit_from: .rubocop_todo.yml
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,58 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2021-12-27 07:20:52 UTC using RuboCop version 1.23.0.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 1
10
+ # Cop supports --auto-correct.
11
+ # Configuration parameters: EnforcedStyleAlignWith, Severity.
12
+ # SupportedStylesAlignWith: keyword, variable, start_of_line
13
+ Layout/EndAlignment:
14
+ Exclude:
15
+ - 'lib/pinject/docker.rb'
16
+
17
+ # Offense count: 1
18
+ # Configuration parameters: AllowSafeAssignment.
19
+ Lint/AssignmentInCondition:
20
+ Exclude:
21
+ - 'lib/pinject/docker.rb'
22
+
23
+ # Offense count: 3
24
+ # Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
25
+ Metrics/AbcSize:
26
+ Max: 19
27
+
28
+ # Offense count: 1
29
+ # Configuration parameters: CountComments, CountAsOne.
30
+ Metrics/ClassLength:
31
+ Max: 122
32
+
33
+ # Offense count: 4
34
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
35
+ Metrics/MethodLength:
36
+ Max: 20
37
+
38
+ # Offense count: 2
39
+ # Configuration parameters: ForbiddenDelimiters.
40
+ # ForbiddenDelimiters: (?-mix:(^|\s)(EO[A-Z]{1}|END)(\s|$))
41
+ Naming/HeredocDelimiterNaming:
42
+ Exclude:
43
+ - 'lib/pinject/docker.rb'
44
+
45
+ # Offense count: 2
46
+ # Configuration parameters: AllowedConstants.
47
+ Style/Documentation:
48
+ Exclude:
49
+ - 'spec/**/*'
50
+ - 'test/**/*'
51
+ - 'lib/pinject.rb'
52
+ - 'lib/pinject/docker.rb'
53
+
54
+ # Offense count: 3
55
+ # Configuration parameters: MinBodyLength.
56
+ Style/GuardClause:
57
+ Exclude:
58
+ - 'lib/pinject/docker.rb'
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2021-12-21
4
+
5
+ - Initial release
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at pyama@pepabo.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ # Specify your gem's dependencies in pinject.gemspec
6
+ gemspec
7
+
8
+ gem 'rake', '~> 13.0'
9
+ gem 'rubocop', '~> 1.21'
data/Gemfile.lock ADDED
@@ -0,0 +1,47 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ pinject (0.1.5)
5
+ docker-api
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ ast (2.4.2)
11
+ docker-api (2.2.0)
12
+ excon (>= 0.47.0)
13
+ multi_json
14
+ excon (0.89.0)
15
+ multi_json (1.15.0)
16
+ parallel (1.21.0)
17
+ parser (3.0.3.2)
18
+ ast (~> 2.4.1)
19
+ rainbow (3.0.0)
20
+ rake (13.0.6)
21
+ regexp_parser (2.2.0)
22
+ rexml (3.2.5)
23
+ rubocop (1.23.0)
24
+ parallel (~> 1.10)
25
+ parser (>= 3.0.0.0)
26
+ rainbow (>= 2.2.2, < 4.0)
27
+ regexp_parser (>= 1.8, < 3.0)
28
+ rexml
29
+ rubocop-ast (>= 1.12.0, < 2.0)
30
+ ruby-progressbar (~> 1.7)
31
+ unicode-display_width (>= 1.4.0, < 3.0)
32
+ rubocop-ast (1.15.0)
33
+ parser (>= 3.0.1.1)
34
+ ruby-progressbar (1.11.0)
35
+ unicode-display_width (2.1.0)
36
+
37
+ PLATFORMS
38
+ x86_64-darwin-20
39
+ x86_64-linux
40
+
41
+ DEPENDENCIES
42
+ pinject!
43
+ rake (~> 13.0)
44
+ rubocop (~> 1.21)
45
+
46
+ BUNDLED WITH
47
+ 2.2.33
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021 pyama
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,52 @@
1
+ # Pinject
2
+
3
+ Inject package upgrade command to your docker images.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'pinject'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle install
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install pinject
20
+
21
+ ## Usage
22
+
23
+ you can inject os update command to some docker images.
24
+
25
+ ```ruby
26
+ image = Pinject::Docker.new("ubuntu:latest")
27
+ inject_image = image.inject_build("pyama:ubuntu_inject") # run apt-get upgrade
28
+ inject_image.push
29
+ ```
30
+
31
+ ## Support Dist
32
+ - ubuntu
33
+ - centos
34
+ - alpine
35
+
36
+ ## Development
37
+
38
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake ` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
39
+
40
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
41
+
42
+ ## Contributing
43
+
44
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/pinject. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/pinject/blob/master/CODE_OF_CONDUCT.md).
45
+
46
+ ## License
47
+
48
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
49
+
50
+ ## Code of Conduct
51
+
52
+ Everyone interacting in the Pinject project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/pinject/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ require 'rubocop/rake_task'
5
+
6
+ RuboCop::RakeTask.new
7
+
8
+ task default: :rubocop
data/bin/console ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'bundler/setup'
5
+ require 'pinject'
6
+
7
+ require 'irb'
8
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/exe/pinject ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bi/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'pinject'
5
+
6
+ Pinject.new(ARGV[0]).inject_build
@@ -0,0 +1,147 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'docker'
4
+ require 'digest/md5'
5
+ require 'fileutils'
6
+ module Pinject
7
+ class Docker
8
+ attr_reader :log
9
+
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
17
+
18
+ def initialize(image_name, log: false)
19
+ @image_name = image_name
20
+ @log = log
21
+ end
22
+
23
+ def inject_build(repo)
24
+ if r = detect_os
25
+ Pinject.log.info "detect os #{r.inspect}" if log
26
+ upd = update_cmd(r[:dist], r[:version])
27
+ if upd
28
+ df = docker_file(@image_name, upd, r[:user])
29
+ ::Docker::Image.build(
30
+ df,
31
+ 't' => repo
32
+ ) do |v|
33
+ Pinject.log.info v if log
34
+ end
35
+ else
36
+ raise UnsupportedDistError, "unsupport os dist:#{r[:dist]} version:#{r[:version]}"
37
+ end
38
+ end
39
+ end
40
+
41
+ private
42
+
43
+ def detect_os
44
+ ::Docker::Container.all(all: true).each do |c|
45
+ c.delete(force: true) if c.info['Names'].first == "/#{container_name}"
46
+ end
47
+
48
+ container = ::Docker::Container.create({
49
+ 'name' => container_name,
50
+ 'Image' => image.id,
51
+ 'Entrypoint' => '',
52
+ 'Cmd' => ['/opt/detector']
53
+ })
54
+
55
+ result = nil
56
+ container.start
57
+ container.streaming_logs(stdout: true) { |stream, chunk| result = chunk.chomp if stream == :stdout }
58
+
59
+ if result
60
+ dist, version, user = result.split(%r{:|/})
61
+
62
+ {
63
+ dist: dist,
64
+ version: version,
65
+ user: user
66
+ }
67
+ end
68
+ end
69
+
70
+ def docker_file(image, cmd, user)
71
+ t = <<~EOS
72
+ FROM %s
73
+ USER root
74
+ RUN %s
75
+ USER %s
76
+ EOS
77
+ format(t, image, cmd, user)
78
+ end
79
+
80
+ def container_name
81
+ Digest::MD5.hexdigest(@image_name)[0..10]
82
+ end
83
+
84
+ def image
85
+ Pinject.log.info 'start detect os' if log
86
+ ::Docker.options[:read_timeout] = 300
87
+ begin
88
+ i = ::Docker::Image.create('fromImage' => @image_name)
89
+ rescue StandardError => e
90
+ Pinject.log.error "failed create container #{e.inspect}" if log
91
+ raise e
92
+ end
93
+
94
+ t = Tempfile.open('detector') do |f|
95
+ f.puts detector_code
96
+ f
97
+ end
98
+ FileUtils.chmod(0o755, t.path)
99
+ i.insert_local('localPath' => t.path, 'outputPath' => '/opt/detector')
100
+ end
101
+
102
+ def update_cmd(dist, version)
103
+ r = case dist
104
+ when 'ubuntu', 'debian'
105
+ ['apt-get update -qqy', 'apt-get upgrade -qqy', 'apt-get clean', 'rm -rf /var/lib/apt/lists/*']
106
+ when 'alpine'
107
+ ['apk update', 'apk upgrade --no-cache']
108
+ when 'centos'
109
+ case version
110
+ when '5', '6'
111
+ nil
112
+ else
113
+ ['yum update -y']
114
+ end
115
+ end
116
+ r&.join(' && ')
117
+ end
118
+
119
+ def detector_code
120
+ <<~EOS
121
+ #!/bin/sh
122
+ if [ -f /etc/lsb-release ]; then
123
+ . /etc/lsb-release
124
+ OS=$DISTRIB_ID
125
+ VER=`echo $DISTRIB_RELEASE | awk -F. '{ print $1 }'`
126
+ elif [ -f /etc/debian_version ]; then
127
+ OS=debian
128
+ VER=`cat /etc/debian_version | awk -F. '{ print $1 }'`
129
+ elif [ -f /etc/redhat-release ]; then
130
+ OS=centos
131
+ VER=`cat /etc/redhat-release | sed -e 's/.*\\s\\([0-9]\\)\\..*/\\1/'`
132
+ elif [ -f /etc/alpine-release ]; then
133
+ OS=alpine
134
+ VER=`cat /etc/alpine-release | awk -F. '{ print $1 }'`
135
+ elif [ -f /etc/os-release]; then
136
+ . /etc/os-release
137
+ OS=$ID
138
+ VER=`echo $VERSION_ID | sed -e 's/"//g'`
139
+ else
140
+ OS="other"
141
+ VER="unknown"
142
+ fi
143
+ echo $OS/$VER:`whoami` | tr '[:upper:]' '[:lower:]'
144
+ EOS
145
+ end
146
+ end
147
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinject
4
+ VERSION = '0.1.6'
5
+ end
data/lib/pinject.rb ADDED
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'pinject/version'
4
+ require_relative 'pinject/docker'
5
+ require 'logger'
6
+
7
+ module Pinject
8
+ def self.log
9
+ @log ||= Logger.new($stdout)
10
+ end
11
+
12
+ class Error < StandardError; end
13
+ class UnsupportedDistError < StandardError; end
14
+ # Your code goes here...
15
+ end
data/pinject.gemspec ADDED
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'lib/pinject/version'
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'pinject'
7
+ spec.version = Pinject::VERSION
8
+ spec.authors = ['pyama']
9
+ spec.email = ['pyama@pepabo.com']
10
+
11
+ spec.summary = 'inject package update commands to your docker images'
12
+ spec.description = 'detect os your docker image and update os pakaces.'
13
+ spec.homepage = 'https://github.com/pyama86/pinject'
14
+ spec.license = 'MIT'
15
+ spec.required_ruby_version = '>= 2.6.0'
16
+
17
+ spec.metadata['homepage_uri'] = spec.homepage
18
+ spec.metadata['source_code_uri'] = 'https://github.com/pyama86/pinject'
19
+ spec.metadata['changelog_uri'] = 'https://github.com/pyama86/pinject/CHANGELOG.md'
20
+
21
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
22
+ spec.bindir = 'exe'
23
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
24
+ spec.require_paths = ['lib']
25
+ spec.add_dependency 'docker-api'
26
+ end
data/sig/pinject.rbs ADDED
@@ -0,0 +1,4 @@
1
+ module Pinject
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
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.2
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
@@ -27,10 +27,31 @@ dependencies:
27
27
  description: detect os your docker image and update os pakaces.
28
28
  email:
29
29
  - pyama@pepabo.com
30
- executables: []
30
+ executables:
31
+ - pinject
31
32
  extensions: []
32
33
  extra_rdoc_files: []
33
- files: []
34
+ files:
35
+ - ".github/workflows/gem-push.yml"
36
+ - ".github/workflows/ruby.yml"
37
+ - ".gitignore"
38
+ - ".rubocop.yml"
39
+ - ".rubocop_todo.yml"
40
+ - CHANGELOG.md
41
+ - CODE_OF_CONDUCT.md
42
+ - Gemfile
43
+ - Gemfile.lock
44
+ - LICENSE.txt
45
+ - README.md
46
+ - Rakefile
47
+ - bin/console
48
+ - bin/setup
49
+ - exe/pinject
50
+ - lib/pinject.rb
51
+ - lib/pinject/docker.rb
52
+ - lib/pinject/version.rb
53
+ - pinject.gemspec
54
+ - sig/pinject.rbs
34
55
  homepage: https://github.com/pyama86/pinject
35
56
  licenses:
36
57
  - MIT