cosmo 0.1.1 → 0.2.0
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.
- data/bin/cosmo +10 -0
- data/lib/cosmo.rb +2 -2
- data/lib/cosmo/shell.rb +41 -0
- data/lib/cosmo/version.rb +1 -1
- metadata +12 -9
data/bin/cosmo
ADDED
data/lib/cosmo.rb
CHANGED
@@ -8,12 +8,12 @@ require "colored"
|
|
8
8
|
require "trollop"
|
9
9
|
|
10
10
|
module Cosmo
|
11
|
-
opts = Trollop::options do
|
11
|
+
@opts = Trollop::options do
|
12
12
|
opt :dry, "dry run"
|
13
13
|
opt :interactive, "For scripts which take interactive arguments"
|
14
14
|
end
|
15
15
|
|
16
|
-
if opts[:dry]
|
16
|
+
if @opts[:dry]
|
17
17
|
puts "This is a dry run!".blue
|
18
18
|
Cosmo.dry = true
|
19
19
|
end
|
data/lib/cosmo/shell.rb
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'bombshell'
|
2
|
+
module Cosmo
|
3
|
+
class Shell < Bombshell::Environment
|
4
|
+
include Bombshell::Shell
|
5
|
+
prompt_with 'cosmo'
|
6
|
+
def use arg = nil
|
7
|
+
if arg
|
8
|
+
if Cosmo.groups[arg]
|
9
|
+
Group.launch arg
|
10
|
+
else
|
11
|
+
puts "Sorry no such group try one of:"
|
12
|
+
puts Cosmo.groups.keys.join("\n")
|
13
|
+
end
|
14
|
+
else
|
15
|
+
puts "Sorry no such group try one of:"
|
16
|
+
puts Cosmo.groups.keys.join("\n")
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
class Group < Bombshell::Environment
|
21
|
+
include Bombshell::Shell
|
22
|
+
def initialize(name)
|
23
|
+
@name = name
|
24
|
+
end
|
25
|
+
prompt_with {|i| i.name}
|
26
|
+
|
27
|
+
def name
|
28
|
+
@name
|
29
|
+
end
|
30
|
+
|
31
|
+
def run command
|
32
|
+
Cosmo.groups[@name].run command
|
33
|
+
end
|
34
|
+
|
35
|
+
def main
|
36
|
+
quit
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
Bombshell.launch(Cosmo::Shell)
|
data/lib/cosmo/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cosmo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-03-
|
12
|
+
date: 2012-03-28 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: colors
|
16
|
-
requirement: &
|
16
|
+
requirement: &70139069807020 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70139069807020
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: trollop
|
27
|
-
requirement: &
|
27
|
+
requirement: &70139069806600 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70139069806600
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: net-ssh
|
38
|
-
requirement: &
|
38
|
+
requirement: &70139069806180 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,11 +43,12 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70139069806180
|
47
47
|
description: Makes running things on multiple machines easy
|
48
48
|
email:
|
49
49
|
- thom.mulvaney@gmail.com
|
50
|
-
executables:
|
50
|
+
executables:
|
51
|
+
- cosmo
|
51
52
|
extensions: []
|
52
53
|
extra_rdoc_files: []
|
53
54
|
files:
|
@@ -56,11 +57,13 @@ files:
|
|
56
57
|
- LICENSE
|
57
58
|
- README.md
|
58
59
|
- Rakefile
|
60
|
+
- bin/cosmo
|
59
61
|
- cosmo.gemspec
|
60
62
|
- lib/cosmo.rb
|
61
63
|
- lib/cosmo/account.rb
|
62
64
|
- lib/cosmo/cosmo.rb
|
63
65
|
- lib/cosmo/group.rb
|
66
|
+
- lib/cosmo/shell.rb
|
64
67
|
- lib/cosmo/version.rb
|
65
68
|
homepage: ''
|
66
69
|
licenses: []
|