Chef_Solo_Nodes 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -95,7 +95,7 @@ If the file name does not exist:
95
95
  xx.xx.xx.xx
96
96
  # exit status = 1
97
97
 
98
- Usage: IP
98
+ Usage: IP, IP --no-user
99
99
  --------------------
100
100
 
101
101
  $ IP file_name
@@ -108,14 +108,12 @@ any form of the following:
108
108
  127.0.0.1:2222
109
109
  user@127.0.0.1:2222
110
110
 
111
- Usage: IP --no-user
112
- --------------------
113
- Removes the **user@** part of the address:
111
+ With **--no-user**:
114
112
 
115
- $ IP --no-user file_name
116
113
  127.0.0.1
114
+ 127.0.0.1:2222
117
115
 
118
- Usage: SSH
116
+ Usage: SSH, SSH --no-user
119
117
  --------------------
120
118
 
121
119
  $ SSH file_name
@@ -128,7 +126,10 @@ any form of the following:
128
126
  user@127.0.0.1
129
127
  -p 2222 user@127.0.0.1
130
128
 
131
- **Note:** SSH does not take any other options/arguments except for the file name.
129
+ With **--no-user**:
130
+
131
+ 127.0.0.1
132
+ -p 2222 127.0.0.1
132
133
 
133
134
  Run Tests
134
135
  ---------
data/bin/SSH CHANGED
@@ -1,6 +1,10 @@
1
1
  #!/usr/bin/env ruby
2
-
3
2
  require "Chef_Solo_Nodes"
3
+ require "trollop"
4
+
5
+ opts = Trollop::options do
6
+ opt :no_user, "Avoid printing any user/login value", :default=>false
7
+ end
4
8
 
5
9
  n = Chef_Solo_IPs(Dir.glob("nodes/#{ARGV.first}.json")).first
6
10
 
@@ -17,7 +21,7 @@ if uri.port
17
21
  str << "-p #{uri.port} "
18
22
  end
19
23
 
20
- if uri.user
24
+ if uri.user && !opts[:no_user]
21
25
  str << "#{uri.user}@"
22
26
  end
23
27
 
@@ -1,3 +1,3 @@
1
1
  class Chef_Solo_Nodes
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  end
data/spec/tests/SSH.rb CHANGED
@@ -37,6 +37,12 @@ describe "SSH" do
37
37
  `SSH "with_login"`.should == "log_RjD2@localhost"
38
38
  }
39
39
  end
40
+
41
+ it "excludes login if --no-user is specified" do
42
+ chdir {
43
+ `bundle exec SSH --no-user "with_login"`.should == "localhost"
44
+ }
45
+ end
40
46
 
41
47
  end # === SSH
42
48
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Chef_Solo_Nodes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: