ruby_helm 0.1.0 → 0.2.0.pre.3

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: 1ce05cc2f8e041f5c74b32deec4f25bbda4bd7e1d03e79798533dec3ae03dc62
4
- data.tar.gz: 2a1ce0e73fc747c689758c9ac98ef2e4731d343629b1aa521d9ad481bcacb226
3
+ metadata.gz: 97c0adeb0c782207a59ff8b60dbcf785e21967a477492e8aa0021e3a13b9f69c
4
+ data.tar.gz: f8ad20b2719288ebcdbed4a8db7a2d7e9b25a1ec72eb453e3c5ac382ba99649e
5
5
  SHA512:
6
- metadata.gz: 83c3a2933ad12d17aff5cf868f93bf2919d34f33017165afdee90d702c27ab8437c4abb3b906cea97ce02c51067dbc3a9cda9070e1350ce0dc8e4f2be4906317
7
- data.tar.gz: 02034f23f0da6ac6b0b56653f4f8301808f864344ea7f274197af8a49dab715037f264b2a25d5c7828f2d65339946f4172095b2a9d6dfcd3774ba291eb0d8b63
6
+ metadata.gz: f08dba96260e9aa93ea85bd951afd32041a633e9ca5f38a5f65fb88204a65905e591b4432254d9ca5ff1607a133178a48b3acddb5cc17657f362557283976ed4
7
+ data.tar.gz: 48a30893792229ee729e8f9dea966f47768bd34d338d19ce86de8ee304e559df94126def81e5455bbdea4e2d4601a1e2940cc8f89fca705970512607f179dd5d
data/CODE_OF_CONDUCT.md CHANGED
@@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
55
55
  ## Enforcement
56
56
 
57
57
  Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at jimmy@jimmythompson.co.uk. All
58
+ reported by contacting the project team at maintainers@infrablocks.io. All
59
59
  complaints will be reviewed and investigated and will result in a response that
60
60
  is deemed necessary and appropriate to the circumstances. The project team is
61
61
  obligated to maintain confidentiality with regard to the reporter of an incident.
data/Gemfile CHANGED
@@ -1,6 +1,8 @@
1
- source "https://rubygems.org"
1
+ # frozen_string_literal: true
2
2
 
3
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
3
+ source 'https://rubygems.org'
4
+
5
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
4
6
 
5
7
  # Specify your gem's dependencies in ruby_helm.gemspec
6
8
  gemspec
data/Gemfile.lock CHANGED
@@ -1,43 +1,187 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby_helm (0.1.0)
5
- lino (~> 1.1)
4
+ ruby_helm (0.2.0.pre.3)
5
+ lino (~> 3.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- concurrent-ruby (1.1.4)
11
- diff-lcs (1.3)
10
+ activesupport (6.1.4.1)
11
+ concurrent-ruby (~> 1.0, >= 1.0.2)
12
+ i18n (>= 1.6, < 2)
13
+ minitest (>= 5.1)
14
+ tzinfo (~> 2.0)
15
+ zeitwerk (~> 2.3)
16
+ addressable (2.8.0)
17
+ public_suffix (>= 2.0.2, < 5.0)
18
+ ast (2.4.2)
19
+ coderay (1.1.3)
20
+ colored2 (3.1.2)
21
+ concurrent-ruby (1.1.9)
22
+ diff-lcs (1.4.4)
23
+ docile (1.4.0)
24
+ excon (0.87.0)
25
+ faraday (1.8.0)
26
+ faraday-em_http (~> 1.0)
27
+ faraday-em_synchrony (~> 1.0)
28
+ faraday-excon (~> 1.1)
29
+ faraday-httpclient (~> 1.0.1)
30
+ faraday-net_http (~> 1.0)
31
+ faraday-net_http_persistent (~> 1.1)
32
+ faraday-patron (~> 1.0)
33
+ faraday-rack (~> 1.0)
34
+ multipart-post (>= 1.2, < 3)
35
+ ruby2_keywords (>= 0.0.4)
36
+ faraday-em_http (1.0.0)
37
+ faraday-em_synchrony (1.0.0)
38
+ faraday-excon (1.1.0)
39
+ faraday-httpclient (1.0.1)
40
+ faraday-net_http (1.0.1)
41
+ faraday-net_http_persistent (1.2.0)
42
+ faraday-patron (1.0.0)
43
+ faraday-rack (1.0.0)
44
+ ffi (1.15.4)
45
+ formatador (0.3.0)
46
+ gem-release (2.2.2)
47
+ guard (2.18.0)
48
+ formatador (>= 0.2.4)
49
+ listen (>= 2.7, < 4.0)
50
+ lumberjack (>= 1.0.12, < 2.0)
51
+ nenv (~> 0.1)
52
+ notiffany (~> 0.0)
53
+ pry (>= 0.13.0)
54
+ shellany (~> 0.0)
55
+ thor (>= 0.18.1)
56
+ guard-compat (1.2.1)
57
+ guard-rspec (4.7.3)
58
+ guard (~> 2.1)
59
+ guard-compat (~> 1.1)
60
+ rspec (>= 2.99.0, < 4.0)
12
61
  hamster (3.0.0)
13
62
  concurrent-ruby (~> 1.0)
14
- lino (1.1.0)
63
+ i18n (1.8.10)
64
+ concurrent-ruby (~> 1.0)
65
+ lino (3.0.0)
15
66
  hamster (~> 3.0)
16
67
  open4 (~> 1.3)
68
+ listen (3.7.0)
69
+ rb-fsevent (~> 0.10, >= 0.10.3)
70
+ rb-inotify (~> 0.9, >= 0.9.10)
71
+ lumberjack (1.2.8)
72
+ method_source (1.0.0)
73
+ minitest (5.14.4)
74
+ multipart-post (2.1.1)
75
+ nenv (0.3.0)
76
+ notiffany (0.1.3)
77
+ nenv (~> 0.1)
78
+ shellany (~> 0.0)
79
+ octokit (4.21.0)
80
+ faraday (>= 0.9)
81
+ sawyer (~> 0.8.0, >= 0.5.3)
17
82
  open4 (1.3.4)
18
- rake (10.5.0)
19
- rspec (3.8.0)
20
- rspec-core (~> 3.8.0)
21
- rspec-expectations (~> 3.8.0)
22
- rspec-mocks (~> 3.8.0)
23
- rspec-core (3.8.0)
24
- rspec-support (~> 3.8.0)
25
- rspec-expectations (3.8.2)
83
+ parallel (1.21.0)
84
+ parser (3.0.2.0)
85
+ ast (~> 2.4.1)
86
+ pry (0.14.1)
87
+ coderay (~> 1.1)
88
+ method_source (~> 1.0)
89
+ public_suffix (4.0.6)
90
+ rainbow (3.0.0)
91
+ rake (13.0.6)
92
+ rake_circle_ci (0.9.0)
93
+ colored2 (~> 3.1)
94
+ excon (~> 0.72)
95
+ rake_factory (~> 0.23)
96
+ sshkey (~> 2.0)
97
+ rake_factory (0.29.0)
98
+ activesupport (>= 4)
99
+ rake (~> 13.0)
100
+ rake_github (0.7.0)
101
+ colored2 (~> 3.1)
102
+ octokit (~> 4.16)
103
+ rake_factory (~> 0.23)
104
+ sshkey (~> 2.0)
105
+ rake_gpg (0.16.0)
106
+ rake_factory (>= 0.23, < 1)
107
+ ruby_gpg2 (>= 0.6, < 1)
108
+ rake_ssh (0.6.0)
109
+ colored2 (~> 3.1)
110
+ rake_factory (~> 0.23)
111
+ sshkey (~> 2.0)
112
+ rb-fsevent (0.11.0)
113
+ rb-inotify (0.10.1)
114
+ ffi (~> 1.0)
115
+ regexp_parser (2.1.1)
116
+ rexml (3.2.5)
117
+ rspec (3.10.0)
118
+ rspec-core (~> 3.10.0)
119
+ rspec-expectations (~> 3.10.0)
120
+ rspec-mocks (~> 3.10.0)
121
+ rspec-core (3.10.1)
122
+ rspec-support (~> 3.10.0)
123
+ rspec-expectations (3.10.1)
26
124
  diff-lcs (>= 1.2.0, < 2.0)
27
- rspec-support (~> 3.8.0)
28
- rspec-mocks (3.8.0)
125
+ rspec-support (~> 3.10.0)
126
+ rspec-mocks (3.10.2)
29
127
  diff-lcs (>= 1.2.0, < 2.0)
30
- rspec-support (~> 3.8.0)
31
- rspec-support (3.8.0)
128
+ rspec-support (~> 3.10.0)
129
+ rspec-support (3.10.2)
130
+ rubocop (1.22.1)
131
+ parallel (~> 1.10)
132
+ parser (>= 3.0.0.0)
133
+ rainbow (>= 2.2.2, < 4.0)
134
+ regexp_parser (>= 1.8, < 3.0)
135
+ rexml
136
+ rubocop-ast (>= 1.12.0, < 2.0)
137
+ ruby-progressbar (~> 1.7)
138
+ unicode-display_width (>= 1.4.0, < 3.0)
139
+ rubocop-ast (1.12.0)
140
+ parser (>= 3.0.1.1)
141
+ rubocop-rake (0.6.0)
142
+ rubocop (~> 1.0)
143
+ rubocop-rspec (2.5.0)
144
+ rubocop (~> 1.19)
145
+ ruby-progressbar (1.11.0)
146
+ ruby2_keywords (0.0.5)
147
+ ruby_gpg2 (0.8.0)
148
+ lino (>= 1.5)
149
+ sawyer (0.8.2)
150
+ addressable (>= 2.3.5)
151
+ faraday (> 0.8, < 2.0)
152
+ shellany (0.0.1)
153
+ simplecov (0.21.2)
154
+ docile (~> 1.1)
155
+ simplecov-html (~> 0.11)
156
+ simplecov_json_formatter (~> 0.1)
157
+ simplecov-html (0.12.3)
158
+ simplecov_json_formatter (0.1.3)
159
+ sshkey (2.0.0)
160
+ thor (1.1.0)
161
+ tzinfo (2.0.4)
162
+ concurrent-ruby (~> 1.0)
163
+ unicode-display_width (2.1.0)
164
+ zeitwerk (2.4.2)
32
165
 
33
166
  PLATFORMS
34
167
  ruby
35
168
 
36
169
  DEPENDENCIES
37
- bundler (~> 1.17)
38
- rake (~> 10.0)
39
- rspec (~> 3.0)
170
+ bundler (~> 2.1)
171
+ gem-release (~> 2.1)
172
+ guard (~> 2.16)
173
+ guard-rspec (~> 4.7)
174
+ rake (~> 13.0)
175
+ rake_circle_ci (~> 0.9)
176
+ rake_github (~> 0.5)
177
+ rake_gpg (~> 0.12)
178
+ rake_ssh (~> 0.4)
179
+ rspec (~> 3.9)
180
+ rubocop (~> 1.12)
181
+ rubocop-rake (~> 0.5)
182
+ rubocop-rspec (~> 2.2)
40
183
  ruby_helm!
184
+ simplecov (~> 0.21)
41
185
 
42
186
  BUNDLED WITH
43
- 1.17.2
187
+ 2.2.31
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2018 jimmythompson
3
+ Copyright (c) 2021 InfraBlocks Maintainers
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,6 +1,9 @@
1
1
  # RubyHelm
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/ruby_helm`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ Welcome to your new gem! In this directory, you'll find the files you need to
4
+ be able to package up your Ruby library into a gem. Put your Ruby code in the
5
+ file `lib/ruby_helm`. To experiment with that code, run `bin/console` for an
6
+ interactive prompt.
4
7
 
5
8
  TODO: Delete this and the text above, and describe your gem
6
9
 
@@ -26,18 +29,30 @@ TODO: Write usage instructions here
26
29
 
27
30
  ## Development
28
31
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
32
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run
33
+ `rake spec` to run the tests. You can also run `bin/console` for an interactive
34
+ prompt that will allow you to experiment.
30
35
 
31
- 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 tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
36
+ To install this gem onto your local machine, run `bundle exec rake install`. To
37
+ release a new version, update the version number in `version.rb`, and then run
38
+ `bundle exec rake release`, which will create a git tag for the version, push
39
+ git commits and tags, and push the `.gem` file to
40
+ [rubygems.org](https://rubygems.org).
32
41
 
33
42
  ## Contributing
34
43
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/ruby_helm. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
44
+ Bug reports and pull requests are welcome on GitHub at
45
+ https://github.com/infrablocks/ruby_helm. This project is intended to be a safe,
46
+ welcoming space for collaboration, and contributors are expected to adhere to
47
+ the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
36
48
 
37
49
  ## License
38
50
 
39
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
51
+ The gem is available as open source under the terms of the
52
+ [MIT License](https://opensource.org/licenses/MIT).
40
53
 
41
54
  ## Code of Conduct
42
55
 
43
- Everyone interacting in the RubyHelm project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/ruby_helm/blob/master/CODE_OF_CONDUCT.md).
56
+ Everyone interacting in the RubyHelm project’s codebases, issue trackers, chat
57
+ rooms and mailing lists is expected to follow the
58
+ [code of conduct](https://github.com/[USERNAME]/ruby_helm/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile CHANGED
@@ -1,6 +1,148 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
1
+ # frozen_string_literal: true
3
2
 
4
- RSpec::Core::RakeTask.new(:spec)
3
+ require 'yaml'
4
+ require 'rake_circle_ci'
5
+ require 'rake_github'
6
+ require 'rake_ssh'
7
+ require 'rake_gpg'
8
+ require 'securerandom'
9
+ require 'rspec/core/rake_task'
10
+ require 'rubocop/rake_task'
5
11
 
6
- task :default => :spec
12
+ task default: %i[
13
+ library:fix
14
+ test:unit
15
+ ]
16
+
17
+ namespace :encryption do
18
+ namespace :directory do
19
+ desc 'Ensure CI secrets directory exists.'
20
+ task :ensure do
21
+ FileUtils.mkdir_p('config/secrets/ci')
22
+ end
23
+ end
24
+
25
+ namespace :passphrase do
26
+ desc 'Generate encryption passphrase used by CI.'
27
+ task generate: ['directory:ensure'] do
28
+ File.open('config/secrets/ci/encryption.passphrase', 'w') do |f|
29
+ f.write(SecureRandom.base64(36))
30
+ end
31
+ end
32
+ end
33
+ end
34
+
35
+ namespace :keys do
36
+ namespace :deploy do
37
+ RakeSSH.define_key_tasks(
38
+ path: 'config/secrets/ci/',
39
+ comment: 'maintainers@infrablocks.io'
40
+ )
41
+ end
42
+
43
+ namespace :secrets do
44
+ namespace :gpg do
45
+ RakeGPG.define_generate_key_task(
46
+ output_directory: 'config/secrets/ci',
47
+ name_prefix: 'gpg',
48
+ owner_name: 'InfraBlocks Maintainers',
49
+ owner_email: 'maintainers@infrablocks.io',
50
+ owner_comment: 'ruby_helm CI Key'
51
+ )
52
+ end
53
+
54
+ desc 'Generate key used by CI to access secrets.'
55
+ task generate: [:'gpg:generate']
56
+ end
57
+ end
58
+
59
+ namespace :secrets do
60
+ desc 'Regenerate all generatable secrets.'
61
+ task regenerate: %w[
62
+ encryption:passphrase:generate
63
+ keys:deploy:generate
64
+ keys:secrets:generate
65
+ ]
66
+ end
67
+
68
+ RuboCop::RakeTask.new
69
+
70
+ namespace :library do
71
+ desc 'Run all checks of the library'
72
+ task check: [:rubocop]
73
+
74
+ desc 'Attempt to automatically fix issues with the library'
75
+ task fix: [:'rubocop:auto_correct']
76
+ end
77
+
78
+ namespace :test do
79
+ RSpec::Core::RakeTask.new(:unit)
80
+ end
81
+
82
+ RakeCircleCI.define_project_tasks(
83
+ namespace: :circle_ci,
84
+ project_slug: 'github/infrablocks/ruby_helm'
85
+ ) do |t|
86
+ circle_ci_config =
87
+ YAML.load_file('config/secrets/circle_ci/config.yaml')
88
+
89
+ t.api_token = circle_ci_config['circle_ci_api_token']
90
+ t.environment_variables = {
91
+ ENCRYPTION_PASSPHRASE:
92
+ File.read('config/secrets/ci/encryption.passphrase')
93
+ .chomp
94
+ }
95
+ t.checkout_keys = []
96
+ t.ssh_keys = [
97
+ {
98
+ hostname: 'github.com',
99
+ private_key: File.read('config/secrets/ci/ssh.private')
100
+ }
101
+ ]
102
+ end
103
+
104
+ RakeGithub.define_repository_tasks(
105
+ namespace: :github,
106
+ repository: 'infrablocks/ruby_helm'
107
+ ) do |t|
108
+ github_config =
109
+ YAML.load_file('config/secrets/github/config.yaml')
110
+
111
+ t.access_token = github_config['github_personal_access_token']
112
+ t.deploy_keys = [
113
+ {
114
+ title: 'CircleCI',
115
+ public_key: File.read('config/secrets/ci/ssh.public')
116
+ }
117
+ ]
118
+ end
119
+
120
+ namespace :pipeline do
121
+ desc 'Prepare CircleCI Pipeline'
122
+ task prepare: %i[
123
+ circle_ci:project:follow
124
+ circle_ci:env_vars:ensure
125
+ circle_ci:checkout_keys:ensure
126
+ circle_ci:ssh_keys:ensure
127
+ github:deploy_keys:ensure
128
+ ]
129
+ end
130
+
131
+ namespace :version do
132
+ desc 'Bump version for specified type (pre, major, minor, patch)'
133
+ task :bump, [:type] do |_, args|
134
+ bump_version_for(args.type)
135
+ end
136
+ end
137
+
138
+ desc 'Release gem'
139
+ task :release do
140
+ sh 'gem release --tag --push'
141
+ end
142
+
143
+ def bump_version_for(version_type)
144
+ sh "gem bump --version #{version_type} " \
145
+ '&& bundle install ' \
146
+ '&& export LAST_MESSAGE="$(git log -1 --pretty=%B)" ' \
147
+ '&& git commit -a --amend -m "${LAST_MESSAGE} [ci skip]"'
148
+ end
data/bin/console CHANGED
@@ -1,7 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
- require "bundler/setup"
4
- require "ruby_helm"
4
+ require 'bundler/setup'
5
+ require 'ruby_helm'
5
6
 
6
7
  # You can add fixtures and/or initialization code here to make experimenting
7
8
  # with your gem easier. You can also use a different console, if you like.
@@ -10,5 +11,5 @@ require "ruby_helm"
10
11
  # require "pry"
11
12
  # Pry.start
12
13
 
13
- require "irb"
14
+ require 'irb'
14
15
  IRB.start(__FILE__)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'lino'
2
4
 
3
5
  module RubyHelm
@@ -26,28 +28,26 @@ module RubyHelm
26
28
 
27
29
  do_before(opts)
28
30
  configure_command(builder, opts)
29
- .build
30
- .execute(
31
- stdin: stdin,
32
- stdout: stdout,
33
- stderr: stderr)
31
+ .build
32
+ .execute(
33
+ stdin: stdin,
34
+ stdout: stdout,
35
+ stderr: stderr
36
+ )
34
37
  do_after(opts)
35
38
  end
36
39
 
37
40
  def instantiate_builder
38
41
  Lino::CommandLineBuilder
39
- .for_command(binary)
40
- .with_option_separator('=')
42
+ .for_command(binary)
43
+ .with_option_separator('=')
41
44
  end
42
45
 
43
- def do_before(opts)
44
- end
46
+ def do_before(opts); end
45
47
 
46
- def configure_command(builder, opts)
47
- end
48
+ def configure_command(builder, opts); end
48
49
 
49
- def do_after(opts)
50
- end
50
+ def do_after(opts); end
51
51
  end
52
52
  end
53
- end
53
+ end
@@ -1,10 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'lino'
2
4
  require_relative 'base'
3
5
 
4
6
  module RubyHelm
5
7
  module Commands
6
8
  class Init < Base
7
- def configure_command(builder, opts)
9
+ def configure_command(builder, _opts)
8
10
  builder.with_subcommand('init')
9
11
  end
10
12
  end
@@ -1,9 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'lino'
2
4
  require_relative 'base'
3
5
 
4
6
  module RubyHelm
5
7
  module Commands
6
8
  class Install < Base
9
+ # rubocop:disable Metrics/MethodLength
7
10
  def configure_command(builder, opts)
8
11
  chart = opts[:chart]
9
12
  name = opts[:name]
@@ -14,15 +17,19 @@ module RubyHelm
14
17
  end
15
18
 
16
19
  builder.with_subcommand('install') do |sub|
17
- sub = sub.with_option(
20
+ unless values.empty?
21
+ sub = sub.with_option(
18
22
  '--set',
19
- paired_values.join(","),
20
- separator: ' ') unless values.empty?
23
+ paired_values.join(','),
24
+ separator: ' '
25
+ )
26
+ end
21
27
  sub = sub.with_option('--name', name, separator: ' ') if name
22
28
  sub
23
29
  end
24
- .with_argument(chart)
30
+ .with_argument(chart)
25
31
  end
32
+ # rubocop:enable Metrics/MethodLength
26
33
  end
27
34
  end
28
35
  end
@@ -1,10 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'lino'
2
4
  require_relative 'base'
3
5
 
4
6
  module RubyHelm
5
7
  module Commands
6
8
  class Reset < Base
7
- def configure_command(builder, opts)
9
+ def configure_command(builder, _opts)
8
10
  builder.with_subcommand('reset')
9
11
  end
10
12
  end
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'lino'
4
+ require_relative 'base'
5
+
6
+ module RubyHelm
7
+ module Commands
8
+ class Template < Base
9
+ # rubocop:disable Metrics/AbcSize
10
+ # rubocop:disable Metrics/MethodLength
11
+ def configure_command(builder, opts)
12
+ chart = opts[:chart]
13
+ name = opts[:name]
14
+ output_directory = opts[:output_directory]
15
+ values = opts[:values] || {}
16
+
17
+ paired_values = values.map do |key, value|
18
+ "#{key}=#{value}"
19
+ end
20
+
21
+ builder.with_subcommand('template') do |sub|
22
+ unless values.empty?
23
+ sub = sub.with_option(
24
+ '--set',
25
+ paired_values.join(','),
26
+ separator: ' '
27
+ )
28
+ end
29
+ sub = sub.with_option('--name', name, separator: ' ') if name
30
+ if output_directory
31
+ sub = sub.with_option(
32
+ '--output-dir',
33
+ output_directory,
34
+ separator: ' '
35
+ )
36
+ end
37
+ sub
38
+ end
39
+ .with_argument(chart)
40
+ end
41
+ # rubocop:enable Metrics/MethodLength
42
+ # rubocop:enable Metrics/AbcSize
43
+ end
44
+ end
45
+ end
@@ -1,9 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'lino'
2
4
  require_relative 'base'
3
5
 
4
6
  module RubyHelm
5
7
  module Commands
6
8
  class Upgrade < Base
9
+ # rubocop:disable Metrics/MethodLength
7
10
  def configure_command(builder, opts)
8
11
  release = opts[:release]
9
12
  chart = opts[:chart]
@@ -15,16 +18,20 @@ module RubyHelm
15
18
  end
16
19
 
17
20
  builder.with_subcommand('upgrade') do |sub|
18
- sub = sub.with_option(
21
+ unless values.empty?
22
+ sub = sub.with_option(
19
23
  '--set',
20
- paired_values.join(","),
21
- separator: ' ') unless values.empty?
24
+ paired_values.join(','),
25
+ separator: ' '
26
+ )
27
+ end
22
28
  sub = sub.with_flag('--install') if should_install
23
29
  sub
24
30
  end
25
- .with_argument(release)
26
- .with_argument(chart)
31
+ .with_argument(release)
32
+ .with_argument(chart)
27
33
  end
34
+ # rubocop:enable Metrics/MethodLength
28
35
  end
29
36
  end
30
37
  end
@@ -1,9 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'commands/init'
2
4
  require_relative 'commands/install'
3
- require_relative 'commands/upgrade'
4
5
  require_relative 'commands/reset'
6
+ require_relative 'commands/template'
7
+ require_relative 'commands/upgrade'
5
8
 
6
9
  module RubyHelm
7
10
  module Commands
8
11
  end
9
- end
12
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module RubyHelm
2
- VERSION = "0.1.0"
4
+ VERSION = '0.2.0.pre.3'
3
5
  end
data/lib/ruby_helm.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'ruby_helm/version'
2
4
  require 'ruby_helm/commands'
3
5
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_helm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0.pre.3
5
5
  platform: ruby
6
6
  authors:
7
- - jimmythompson
7
+ - InfraBlocks Maintainers
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-12-25 00:00:00.000000000 Z
11
+ date: 2021-11-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lino
@@ -16,81 +16,217 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.1'
19
+ version: '3.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.1'
26
+ version: '3.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.17'
33
+ version: '2.1'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '2.1'
41
+ - !ruby/object:Gem::Dependency
42
+ name: gem-release
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '2.1'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '2.1'
55
+ - !ruby/object:Gem::Dependency
56
+ name: guard
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '2.16'
34
62
  type: :development
35
63
  prerelease: false
36
64
  version_requirements: !ruby/object:Gem::Requirement
37
65
  requirements:
38
66
  - - "~>"
39
67
  - !ruby/object:Gem::Version
40
- version: '1.17'
68
+ version: '2.16'
69
+ - !ruby/object:Gem::Dependency
70
+ name: guard-rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '4.7'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '4.7'
41
83
  - !ruby/object:Gem::Dependency
42
84
  name: rake
43
85
  requirement: !ruby/object:Gem::Requirement
44
86
  requirements:
45
87
  - - "~>"
46
88
  - !ruby/object:Gem::Version
47
- version: '10.0'
89
+ version: '13.0'
48
90
  type: :development
49
91
  prerelease: false
50
92
  version_requirements: !ruby/object:Gem::Requirement
51
93
  requirements:
52
94
  - - "~>"
53
95
  - !ruby/object:Gem::Version
54
- version: '10.0'
96
+ version: '13.0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rake_circle_ci
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '0.9'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '0.9'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rake_github
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '0.5'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '0.5'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rake_gpg
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '0.12'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '0.12'
139
+ - !ruby/object:Gem::Dependency
140
+ name: rake_ssh
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: '0.4'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: '0.4'
55
153
  - !ruby/object:Gem::Dependency
56
154
  name: rspec
57
155
  requirement: !ruby/object:Gem::Requirement
58
156
  requirements:
59
157
  - - "~>"
60
158
  - !ruby/object:Gem::Version
61
- version: '3.0'
159
+ version: '3.9'
62
160
  type: :development
63
161
  prerelease: false
64
162
  version_requirements: !ruby/object:Gem::Requirement
65
163
  requirements:
66
164
  - - "~>"
67
165
  - !ruby/object:Gem::Version
68
- version: '3.0'
166
+ version: '3.9'
69
167
  - !ruby/object:Gem::Dependency
70
- name: gem-release
168
+ name: rubocop
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: '1.12'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: '1.12'
181
+ - !ruby/object:Gem::Dependency
182
+ name: rubocop-rake
71
183
  requirement: !ruby/object:Gem::Requirement
72
184
  requirements:
73
185
  - - "~>"
74
186
  - !ruby/object:Gem::Version
75
- version: '2.0'
187
+ version: '0.5'
76
188
  type: :development
77
189
  prerelease: false
78
190
  version_requirements: !ruby/object:Gem::Requirement
79
191
  requirements:
80
192
  - - "~>"
81
193
  - !ruby/object:Gem::Version
82
- version: '2.0'
194
+ version: '0.5'
195
+ - !ruby/object:Gem::Dependency
196
+ name: rubocop-rspec
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - "~>"
200
+ - !ruby/object:Gem::Version
201
+ version: '2.2'
202
+ type: :development
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - "~>"
207
+ - !ruby/object:Gem::Version
208
+ version: '2.2'
209
+ - !ruby/object:Gem::Dependency
210
+ name: simplecov
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - "~>"
214
+ - !ruby/object:Gem::Version
215
+ version: '0.21'
216
+ type: :development
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - "~>"
221
+ - !ruby/object:Gem::Version
222
+ version: '0.21'
83
223
  description: A thin Ruby wrapper around Helm
84
224
  email:
85
- - jimmy@jimmythompson.co.uk
225
+ - maintainers@infrablocks.io
86
226
  executables: []
87
227
  extensions: []
88
228
  extra_rdoc_files: []
89
229
  files:
90
- - ".gitignore"
91
- - ".rspec"
92
- - ".ruby-version"
93
- - ".travis.yml"
94
230
  - CODE_OF_CONDUCT.md
95
231
  - Gemfile
96
232
  - Gemfile.lock
@@ -105,16 +241,13 @@ files:
105
241
  - lib/ruby_helm/commands/init.rb
106
242
  - lib/ruby_helm/commands/install.rb
107
243
  - lib/ruby_helm/commands/reset.rb
244
+ - lib/ruby_helm/commands/template.rb
108
245
  - lib/ruby_helm/commands/upgrade.rb
109
246
  - lib/ruby_helm/version.rb
110
- - ruby_helm.gemspec
111
247
  homepage: https://github.com/infrablocks/ruby_helm
112
248
  licenses:
113
249
  - MIT
114
- metadata:
115
- homepage_uri: https://github.com/infrablocks/ruby_helm
116
- source_code_uri: https://github.com/infrablocks/ruby_helm
117
- changelog_uri: https://github.com/infrablocks/ruby_helm
250
+ metadata: {}
118
251
  post_install_message:
119
252
  rdoc_options: []
120
253
  require_paths:
@@ -123,15 +256,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
123
256
  requirements:
124
257
  - - ">="
125
258
  - !ruby/object:Gem::Version
126
- version: '0'
259
+ version: '2.6'
127
260
  required_rubygems_version: !ruby/object:Gem::Requirement
128
261
  requirements:
129
- - - ">="
262
+ - - ">"
130
263
  - !ruby/object:Gem::Version
131
- version: '0'
264
+ version: 1.3.1
132
265
  requirements: []
133
- rubyforge_project:
134
- rubygems_version: 2.7.6
266
+ rubygems_version: 3.0.1
135
267
  signing_key:
136
268
  specification_version: 4
137
269
  summary: A thin Ruby wrapper around Helm
data/.gitignore DELETED
@@ -1,11 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
9
-
10
- # rspec failure tracking
11
- .rspec_status
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- 2.5.1
data/.travis.yml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- sudo: false
3
- language: ruby
4
- cache: bundler
5
- rvm:
6
- - 2.5.1
7
- before_install: gem install bundler -v 1.17.2
data/ruby_helm.gemspec DELETED
@@ -1,43 +0,0 @@
1
-
2
- lib = File.expand_path("../lib", __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require "ruby_helm/version"
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = "ruby_helm"
8
- spec.version = RubyHelm::VERSION
9
- spec.authors = ["jimmythompson"]
10
- spec.email = ["jimmy@jimmythompson.co.uk"]
11
-
12
- spec.summary = "A thin Ruby wrapper around Helm"
13
- spec.description = "A thin Ruby wrapper around Helm"
14
- spec.homepage = "https://github.com/infrablocks/ruby_helm"
15
- spec.license = "MIT"
16
-
17
- # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
- # to allow pushing to a single host or delete this section to allow pushing to any host.
19
- if spec.respond_to?(:metadata)
20
- spec.metadata["homepage_uri"] = spec.homepage
21
- spec.metadata["source_code_uri"] = "https://github.com/infrablocks/ruby_helm"
22
- spec.metadata["changelog_uri"] = "https://github.com/infrablocks/ruby_helm"
23
- else
24
- raise "RubyGems 2.0 or newer is required to protect against " \
25
- "public gem pushes."
26
- end
27
-
28
- # Specify which files should be added to the gem when it is released.
29
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
30
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
31
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
32
- end
33
- spec.bindir = "exe"
34
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
35
- spec.require_paths = ["lib"]
36
-
37
- spec.add_dependency 'lino', '~> 1.1'
38
-
39
- spec.add_development_dependency "bundler", "~> 1.17"
40
- spec.add_development_dependency "rake", "~> 10.0"
41
- spec.add_development_dependency "rspec", "~> 3.0"
42
- spec.add_development_dependency 'gem-release', "~> 2.0"
43
- end