i2cssh 1.5.2 → 1.5.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/bin/i2cssh +7 -16
  3. data/i2cssh.gemspec +1 -1
  4. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.5.2
1
+ 1.5.3
data/bin/i2cssh CHANGED
@@ -6,7 +6,7 @@ require 'yaml'
6
6
 
7
7
  @config_file = File.expand_path "~/.i2csshrc"
8
8
 
9
- @i2_options, ssh_options, @servers, @clusters, @ssh_environment = {}, [], [], {}, {}
9
+ @i2_options, ssh_options, @servers, @clusters, @ssh_environment, opts_from_cmdline = {}, [], [], {}, {}, {}
10
10
 
11
11
  def get_hosts(c)
12
12
  if c =~ /(.+)@(.+)/ then
@@ -19,13 +19,11 @@ def get_hosts(c)
19
19
  if cluster
20
20
  set_options(cluster, login_from_cli)
21
21
 
22
- cluster_hosts = cluster["hosts"]
23
-
24
22
  if @i2_options[:login_override] then
25
- cluster_hosts = cluster_hosts.map{|h| "#{@i2_options[:login_override]}@#{h}"}
23
+ @servers += cluster["hosts"].map{|h| "#{@i2_options[:login_override]}@#{h}"}
24
+ else
25
+ @servers += cluster["hosts"]
26
26
  end
27
-
28
- @servers += cluster_hosts
29
27
  else
30
28
  puts "ERROR: unknown cluster #{c}. Check your #{@config_file}"
31
29
  exit 1
@@ -33,16 +31,11 @@ def get_hosts(c)
33
31
  end
34
32
 
35
33
  def set_options(config_hash, login_override=nil)
36
- if login_override then
37
- @i2_options[:login_override] = login_override
38
- else
39
- @i2_options[:login_override] = config_hash["login"].nil? ? @i2_options[:login_override] : config_hash["login"]
34
+ [:broadcast, :profile, :rank, :iterm2, :login_override].each do |p|
35
+ @i2_options[p] = config_hash[p.to_s].nil? ? @i2_options[p] : config_hash[p.to_s]
40
36
  end
41
37
 
42
- @i2_options[:broadcast] = config_hash["broadcast"].nil? ? @i2_options[:broadcast] : config_hash["broadcast"]
43
- @i2_options[:profile] = config_hash["profile"].nil? ? @i2_options[:profile] : config_hash["profile"]
44
- @i2_options[:rank] = config_hash["rank"].nil? ? @i2_options[:rank] : config_hash["rank"]
45
- @i2_options[:iterm2] = config_hash["iterm2"].nil? ? @i2_options[:iterm2] : config_hash["iterm2"]
38
+ @i2_options[:login_override] = login_override if login_override
46
39
 
47
40
  @ssh_environment.merge!(config_hash["environment"].inject({}){|m, v| m.merge(v)}) if config_hash["environment"]
48
41
  end
@@ -61,8 +54,6 @@ if File.exists?(@config_file)
61
54
 
62
55
  end
63
56
 
64
- opts_from_cmdline = {}
65
-
66
57
  optparse = OptionParser.new do |opts|
67
58
  opts.banner = "Usage: #{File.basename(__FILE__)} [options] [(username@host [username@host] | username@cluster)]"
68
59
 
data/i2cssh.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "i2cssh"
8
- s.version = "1.5.2"
8
+ s.version = "1.5.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Wouter de Bie"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: i2cssh
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
4
+ hash: 5
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 5
9
- - 2
10
- version: 1.5.2
9
+ - 3
10
+ version: 1.5.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Wouter de Bie