nex_client 0.18.0.pre1 → 0.18.0.pre2

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
  SHA1:
3
- metadata.gz: 66bd6974504b943354286cb011099b8253e2556b
4
- data.tar.gz: 35dccc4896e4a3b77903803fcde4f828b4254d88
3
+ metadata.gz: 555b1668dddf8ee42cffd877f663011a51d494e1
4
+ data.tar.gz: '0396f9e547c95c3064919faee034326ccf850500'
5
5
  SHA512:
6
- metadata.gz: cec6f39591d8d9fcdc00b5f5c6c263c488daefa1cd537a15f7cefbaac547fd9e0c617f77e7a460c4eab26c7f755e7ba2062742b25903ce340eb38f18fbb52e61
7
- data.tar.gz: 41b075642837ce12f28bb4da41695b327fe68c6e02429cd29cc9401d9486c01ee91db32a051ccb65d8a31ff2a259e794e6b7ae23802b750cbd8e0bfd0b9414d4
6
+ metadata.gz: 223bbaf57773281074b5334ad684f75077e9acd4cc1a1df138480e581004ab8f335f169235fcb558ddd178f7319a87056894fbce23ce4adb0b371218e8cce878
7
+ data.tar.gz: 6bbc1b3be40eed2a31c4895591eee1028300b2da4783eeebd51cbfd7f5c98026e346de48caaa6965510ab914b97b0f65084ef5cb0cb157642b82446631e28c08
data/README.md CHANGED
@@ -35,3 +35,10 @@ export NEX_API_KEY=my-nex-key
35
35
  # Display all available commands
36
36
  nex-cli --help
37
37
  ```
38
+
39
+ ## Windows/PowerShell support
40
+ Most commands will work natively with ruby for windows apart from the ssh commands. E.g. `nex-cli racks:ssh <ip>` or `nex-cli apps:ssh <app_name>`.
41
+
42
+ In order to support these commands on Windows you need to:
43
+ - have PowerShell
44
+ - install OpenSSH for windows on PowerShell. See: https://github.com/PowerShell/Win32-OpenSSH/wiki/Install-Win32-OpenSSH
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'base64'
4
+
3
5
  module NexClient
4
6
  module Commands
5
7
  module Helpers
@@ -70,7 +72,15 @@ module NexClient
70
72
  ssh_cmd += " #{exec_cmd}" if exec_cmd
71
73
 
72
74
  # Run command
73
- system(ssh_cmd)
75
+ if Gem.win_platform?
76
+ # Invoke openssh through powershell. This requires openssh to be installed
77
+ # on powershell. See https://github.com/PowerShell/Win32-OpenSSH/wiki/Install-Win32-OpenSSH
78
+ # Note: use of exec instead of system seems to be required
79
+ encoded_cmd = Base64.strict_encode64(ssh_cmd.encode('utf-16le'))
80
+ exec("powershell.exe -encodedCommand #{encoded_cmd}")
81
+ else
82
+ system(ssh_cmd)
83
+ end
74
84
  end
75
85
  end
76
86
 
@@ -1,3 +1,3 @@
1
1
  module NexClient
2
- VERSION ||= '0.18.0.pre1'
2
+ VERSION ||= '0.18.0.pre2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nex_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.0.pre1
4
+ version: 0.18.0.pre2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arnaud Lachaume
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-23 00:00:00.000000000 Z
11
+ date: 2018-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json_api_client
@@ -204,9 +204,9 @@ signing_key:
204
204
  specification_version: 4
205
205
  summary: Maestrano Nex!™ Client
206
206
  test_files:
207
- - spec/nex_client/app_spec.rb
207
+ - spec/spec_helper.rb
208
208
  - spec/nex_client/cube_instance_spec.rb
209
209
  - spec/nex_client/exec_cmd_spec.rb
210
+ - spec/nex_client/app_spec.rb
210
211
  - spec/shared/base_resource.rb
211
- - spec/spec_helper.rb
212
212
  - spec/support/is_expected_block.rb