ranch-hand 0.7.0 → 0.7.1

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: 739b914a9a3aaa61cbd1ea414310158a5de894f02f93028c6c6927d3dcf4d567
4
- data.tar.gz: 0166cfe7b29ad795d8f8ee3e0bef4a91bb3fce4e55e2a662ab24e7cf06474596
3
+ metadata.gz: 1fcf2dcd9fa4d7109d4e40ee519904acde93eab7d6861444900e045d8f9e85fd
4
+ data.tar.gz: 579f8858997fc6d180e400d97463cf49f64a6f29084d4224108b7256a61b1708
5
5
  SHA512:
6
- metadata.gz: d0608be5112035aa5f4ca5e9e7ce1fc570763f485d688541de6c9095bcd3345cf0ce69378c820f60b782f0051b88322e4f7c052960f75db9c18ddffd3be44dc8
7
- data.tar.gz: 957785da2e00ac1fb0834a9cb9cec97a6ed7628d1c0ad02e458ab1da3fdf76625801b733c1d4439a58ab8d1437d7ab6b3ce80ad09978a4d79417e1e39ff86f72
6
+ metadata.gz: ee5fa837162469e9076186dd625bd4d8f2491836494a91d72861bc5571fba58a37719be2d8d190a948bc571e9542fb8098dd6888a5bba01073db15b25bfea78f
7
+ data.tar.gz: 11d3035683053d219e80d1da994b3a0ef634e07c4908344fb924c88ffe728724bd35651aa014d074e31904cdec85856c30334e475311bc803ed4f3de152f104f
data/Changelog.md CHANGED
@@ -1,3 +1,12 @@
1
+ ### 0.7.0
2
+ #### Features
3
+ Add support for command arguments. Commands that use arguments no longer need to be wrapped in a string in order to be passed properly. This provides a better interface for editor plugins that automatically append arguments to the end of a custom command.
4
+ - https://github.com/peregrinator/ranch-hand/commit/a70d44042507d407c0088a2a8ffa4d4514a800af
5
+ - ex: before: `ranch-hand exec -c 'rspec spec/foo.rb:21'`, now: `ranch-hand exec -c rspec spec/foo.rb:21`
6
+
7
+ #### Bugfixes:
8
+ - d76855: correctly handle scenario in which the namespace queried has no pods
9
+
1
10
  ### 0.6.0
2
11
 
3
12
  Updates for Ruby 3.0 compat
data/bin/ranch-hand CHANGED
@@ -23,6 +23,13 @@ module RanchHandCLI
23
23
  end
24
24
  end
25
25
 
26
+ desc 'Installs ranch hand Oh My Zsh shortcuts'
27
+ command :ohmyzsh do |c|
28
+ c.action do |global_options, options, args|
29
+ RanchHand::Base.install_ohmyzsh
30
+ end
31
+ end
32
+
26
33
  desc 'Initializes ranch hand for project'
27
34
  command :init do |c|
28
35
  c.action do |global_options, command_options, args|
@@ -37,7 +44,7 @@ module RanchHandCLI
37
44
  c.switch [:g, :group], negatable: true, default_value: config[:group] || false, desc: "Group pods returned so that there is only one from each deployment, --no-group can be used to override project config as needed."
38
45
  c.switch [:rm, :remove], negatable: false, desc: "Used to indicated that you want to remove a previously saved command."
39
46
  c.switch [:r, :repeat], negatable: false, desc: "Repeat the last command ran (against the same pod)."
40
-
47
+
41
48
  c.flag [:c, :command], desc: "Command to run once (not permanently stored)"
42
49
  c.flag [:f, :filter], desc: "Filter pods returned to those that contain the string provided (negative matches supported). Examples: '-f nginx', '-f -apache'"
43
50
  c.flag [:n, :namespace], required: true, default_value: config[:namespace], desc: "Namespace against which to retreive pods and run command"
@@ -0,0 +1,4 @@
1
+ alias rh='ranch-hand' # main binary alias
2
+ alias rhs='ranch-hand setup' # setup ranch hand with Rancher CLI credentials
3
+ alias rhi='ranch-hand init' # initialize default ranch hand settings in a project
4
+ alias rhe='ranch-hand exec' # run a command in a container
@@ -12,5 +12,27 @@ module RanchHand
12
12
  RanchHand::Config.create
13
13
  RanchHand::Logger.info("initialization complete")
14
14
  end
15
+
16
+ def self.install_ohmyzsh
17
+ RanchHand::Logger.info("installing ranch-hand Oh My Zsh shortcuts")
18
+
19
+ unless ENV['ZSH_CUSTOM'] || ENV['ZSH']
20
+ RanchHand::Logger.warn("Could not find $ZSH_CUSTOM or $ZSH in your environment, can not install shortcuts")
21
+ return
22
+ end
23
+
24
+ zsh_custom_dir = ENV['ZSH_CUSTOM'] || File.join(ENV['ZSH'], 'custom')
25
+
26
+ zsh_plugin_dir = File.join(zsh_custom_dir, 'plugins', 'ranch-hand')
27
+ FileUtils.mkdir_p(zsh_plugin_dir)
28
+
29
+ current_path = File.expand_path(File.dirname(__FILE__))
30
+ gem_plugin_path = File.join(current_path, '..', '..', 'files', 'ranch-hand.plugin.zsh')
31
+
32
+ FileUtils.cp(gem_plugin_path, zsh_plugin_dir)
33
+
34
+ RanchHand::Logger.info("installation complete")
35
+ RanchHand::Logger.info("Don't forget to add 'ranch-hand' to your plugins in ~/.zshrc -- e.g. plugins=(ranch-hand) -- and then 'source ~/.zshrc'")
36
+ end
15
37
  end
16
- end
38
+ end
@@ -1,3 +1,3 @@
1
1
  module RanchHand
2
- VERSION = "0.7.0"
2
+ VERSION = "0.7.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ranch-hand
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peregrinator
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-19 00:00:00.000000000 Z
11
+ date: 2021-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -129,6 +129,7 @@ files:
129
129
  - bin/ranch-hand
130
130
  - bin/setup
131
131
  - doc/ranch-hand-demo.gif
132
+ - files/ranch-hand.plugin.zsh
132
133
  - lib/ranch_hand.rb
133
134
  - lib/ranch_hand/base.rb
134
135
  - lib/ranch_hand/commands.rb
@@ -158,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
159
  - !ruby/object:Gem::Version
159
160
  version: '0'
160
161
  requirements: []
161
- rubygems_version: 3.2.3
162
+ rubygems_version: 3.2.22
162
163
  signing_key:
163
164
  specification_version: 4
164
165
  summary: Provides an interface between the Rancher CLI and the Kubectl commands