i2cssh 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +14 -0
- data/VERSION +1 -1
- data/bin/i2cssh +12 -6
- data/i2cssh.gemspec +68 -0
- metadata +4 -3
data/README.markdown
CHANGED
@@ -16,6 +16,20 @@ to all sessions.
|
|
16
16
|
-F, --fullscreen Fullscreen
|
17
17
|
-g, --grid WxH Grid size
|
18
18
|
-u, --username USERNAME SSH username
|
19
|
+
-c, --cluster CLUSTERNAME Name of the cluster specified in ~/.i2csshrc
|
20
|
+
|
21
|
+
The cluster file format is one host per line.
|
22
|
+
|
23
|
+
## i2csshrc
|
24
|
+
|
25
|
+
The i2csshrc file is a YAML formatted file that contains the following structure:
|
26
|
+
|
27
|
+
---
|
28
|
+
clusters:
|
29
|
+
mycluster:
|
30
|
+
- host1
|
31
|
+
- host2
|
32
|
+
- ...
|
19
33
|
|
20
34
|
## Contributing to i2cssh
|
21
35
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.2
|
data/bin/i2cssh
CHANGED
@@ -17,16 +17,17 @@ optparse = OptionParser.new do |opts|
|
|
17
17
|
opts.on('-F', '--fullscreen', "Fullscreen") { options[:fullscreen] = true }
|
18
18
|
opts.on('-g', '--grid WxH', "Grid size") { |f| options[:grid] = f.split("x")}
|
19
19
|
opts.on('-u', '--username USERNAME', "SSH username") { |u| options[:username] = u }
|
20
|
+
opts.on('-c', '--cluster CLUSTERNAME', "Name of the cluster specified in ~/.i2csshrc") { |c| options[:cluster] = c }
|
20
21
|
end
|
21
22
|
|
22
23
|
optparse.parse!
|
23
24
|
|
24
|
-
unless options[:file] || options[:grid] then
|
25
|
+
unless options[:file] || options[:grid] || options[:cluster] then
|
25
26
|
puts optparse.help
|
26
27
|
exit
|
27
28
|
end
|
28
29
|
|
29
|
-
if options[:file]
|
30
|
+
if options[:file] && options[:grid] then
|
30
31
|
puts "ERROR: -g and -f can't be used at the same time"
|
31
32
|
puts optparse.help
|
32
33
|
exit
|
@@ -36,15 +37,20 @@ ssh_prefix = "ssh " + (options[:username] ? "#{options[:username]}@" : "")
|
|
36
37
|
|
37
38
|
if options[:file] then
|
38
39
|
servers = File.read(options[:file]).split("\n")
|
39
|
-
|
40
|
-
count = servers.size
|
41
|
-
rows = Math.sqrt(count).ceil
|
42
|
-
columns = (count / rows.to_f).ceil
|
43
40
|
elsif options[:grid] then
|
44
41
|
columns = options[:grid][0].to_i
|
45
42
|
rows = options[:grid][1].to_i
|
43
|
+
elsif options[:cluster] then
|
44
|
+
require 'yaml'
|
45
|
+
config_hash = YAML.load(File.read(File.expand_path("~/.i2csshrc")))
|
46
|
+
puts config_hash.inspect
|
47
|
+
servers = config_hash["clusters"][options[:cluster]]
|
46
48
|
end
|
47
49
|
|
50
|
+
count = servers.size
|
51
|
+
rows ||= Math.sqrt(count).ceil
|
52
|
+
columns ||= (count / rows.to_f).ceil
|
53
|
+
|
48
54
|
iterm = Appscript.app.by_name('iTerm')
|
49
55
|
finder = Appscript.app.by_name('Finder')
|
50
56
|
sys_events = Appscript.app.by_name('System Events')
|
data/i2cssh.gemspec
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{i2cssh}
|
8
|
+
s.version = "0.0.2"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Wouter de Bie"]
|
12
|
+
s.date = %q{2011-06-12}
|
13
|
+
s.default_executable = %q{i2cssh}
|
14
|
+
s.description = %q{csshX like cluster ssh using iTerm2 panes}
|
15
|
+
s.email = %q{wouter@evenflow.se}
|
16
|
+
s.executables = ["i2cssh"]
|
17
|
+
s.extra_rdoc_files = [
|
18
|
+
"LICENSE.txt",
|
19
|
+
"README.markdown"
|
20
|
+
]
|
21
|
+
s.files = [
|
22
|
+
".document",
|
23
|
+
"Gemfile",
|
24
|
+
"Gemfile.lock",
|
25
|
+
"LICENSE.txt",
|
26
|
+
"README.markdown",
|
27
|
+
"Rakefile",
|
28
|
+
"VERSION",
|
29
|
+
"bin/i2cssh",
|
30
|
+
"i2cssh.gemspec",
|
31
|
+
"lib/i2cssh.rb",
|
32
|
+
"test/helper.rb",
|
33
|
+
"test/test_i2cssh.rb"
|
34
|
+
]
|
35
|
+
s.homepage = %q{http://github.com/wouterdebie/i2cssh}
|
36
|
+
s.licenses = ["MIT"]
|
37
|
+
s.require_paths = ["lib"]
|
38
|
+
s.rubygems_version = %q{1.6.2}
|
39
|
+
s.summary = %q{csshX like cluster ssh using iTerm2 panes}
|
40
|
+
|
41
|
+
if s.respond_to? :specification_version then
|
42
|
+
s.specification_version = 3
|
43
|
+
|
44
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
45
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
46
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.6.2"])
|
47
|
+
s.add_development_dependency(%q<rcov>, [">= 0"])
|
48
|
+
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
49
|
+
s.add_runtime_dependency(%q<rb-appscript>, ["~> 0.6.1"])
|
50
|
+
s.add_runtime_dependency(%q<ripl>, ["~> 0.4.1"])
|
51
|
+
else
|
52
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
53
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.2"])
|
54
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
55
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
56
|
+
s.add_dependency(%q<rb-appscript>, ["~> 0.6.1"])
|
57
|
+
s.add_dependency(%q<ripl>, ["~> 0.4.1"])
|
58
|
+
end
|
59
|
+
else
|
60
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
61
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.2"])
|
62
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
63
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
64
|
+
s.add_dependency(%q<rb-appscript>, ["~> 0.6.1"])
|
65
|
+
s.add_dependency(%q<ripl>, ["~> 0.4.1"])
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
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:
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Wouter de Bie
|
@@ -128,6 +128,7 @@ files:
|
|
128
128
|
- Rakefile
|
129
129
|
- VERSION
|
130
130
|
- bin/i2cssh
|
131
|
+
- i2cssh.gemspec
|
131
132
|
- lib/i2cssh.rb
|
132
133
|
- test/helper.rb
|
133
134
|
- test/test_i2cssh.rb
|