rutty 2.5.2 → 2.5.3
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +2 -2
- data/README.md +10 -3
- data/lib/rutty.rb +3 -86
- data/lib/rutty/runner.rb +86 -0
- data/lib/rutty/version.rb +1 -1
- data/rutty.gemspec +3 -2
- metadata +5 -4
data/LICENSE
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Copyright (c)
|
1
|
+
Copyright (c) 2011 Josh Lindsey at Cloudspace
|
2
2
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining
|
4
4
|
a copy of this software and associated documentation files (the
|
@@ -17,4 +17,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
17
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
18
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
19
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -21,8 +21,8 @@ Requirements
|
|
21
21
|
Since RuTTY is essentially a wrapper around SSH connections, a system that is capable of recieving SSH
|
22
22
|
connections must be available to fully test this tool. Currently, I have the tests setup to attempt to
|
23
23
|
log into the current system via the loopback interface (localhost) as the user who ran the tests (as
|
24
|
-
detected by
|
25
|
-
|
24
|
+
detected by `$USER`). It attempts to do this on port 22 using the public key found in
|
25
|
+
`$HOME/.ssh/id_rsa`.
|
26
26
|
|
27
27
|
Note that unless all these conditions are met on your system, tests will not be fully successful.
|
28
28
|
|
@@ -33,6 +33,13 @@ Installation
|
|
33
33
|
$ rutty init
|
34
34
|
$ rutty help
|
35
35
|
|
36
|
+
Or, for development checkouts:
|
37
|
+
|
38
|
+
$ git clone git://github.com/jlindsey/rutty.git
|
39
|
+
$ cd rutty
|
40
|
+
$ gem install bundler ; bundle install
|
41
|
+
$ rake install
|
42
|
+
|
36
43
|
Usage
|
37
44
|
-----
|
38
45
|
|
@@ -143,5 +150,5 @@ Note on Patches/Pull Requests
|
|
143
150
|
Copyright
|
144
151
|
---------
|
145
152
|
|
146
|
-
Copyright (c)
|
153
|
+
Copyright (c) 2011 Josh Lindsey at Cloudspace. See LICENSE for details.
|
147
154
|
|
data/lib/rutty.rb
CHANGED
@@ -1,93 +1,10 @@
|
|
1
1
|
require 'rubygems'
|
2
|
-
require 'rutty/
|
3
|
-
require 'rutty/config'
|
4
|
-
require 'rutty/consts'
|
5
|
-
require 'rutty/errors'
|
6
|
-
require 'rutty/helpers'
|
7
|
-
require 'rutty/node'
|
8
|
-
require 'rutty/nodes'
|
2
|
+
require 'rutty/runner'
|
9
3
|
|
10
4
|
##
|
11
5
|
# The RuTTY top-level module. Everything in the RuTTY gem is contained in this module.
|
12
6
|
#
|
13
7
|
# @author Josh Lindsey
|
14
8
|
# @since 2.0.0
|
15
|
-
module Rutty
|
16
|
-
|
17
|
-
##
|
18
|
-
# The Rutty::Runner class includes mixins from the other modules. All end-user interaction
|
19
|
-
# should be done through this class.
|
20
|
-
#
|
21
|
-
# @author Josh Lindsey
|
22
|
-
# @since 2.0.0
|
23
|
-
class Runner
|
24
|
-
attr_writer :config_dir
|
25
|
-
attr :config
|
26
|
-
attr :nodes
|
27
|
-
attr :output_format
|
28
|
-
|
29
|
-
include Rutty::Consts
|
30
|
-
include Rutty::Helpers
|
31
|
-
include Rutty::Actions
|
32
|
-
|
33
|
-
##
|
34
|
-
# Initialize a new {Rutty::Runner} instance
|
35
|
-
#
|
36
|
-
# @param config_dir [String] Optional parameter specifying the directory RuTTY has been init'd into
|
37
|
-
def initialize config_dir = nil
|
38
|
-
self.config_dir = config_dir
|
39
|
-
end
|
40
|
-
|
41
|
-
##
|
42
|
-
# Lazy-load the {Rutty::Config} object for this instance, based on the config_dir param
|
43
|
-
# passed to {#initialize}.
|
44
|
-
#
|
45
|
-
# @return [Rutty::Config] The loaded and parsed config object
|
46
|
-
def config
|
47
|
-
@config ||= Rutty::Config.load_config self.config_dir
|
48
|
-
end
|
49
|
-
|
50
|
-
##
|
51
|
-
# Lazy-load the {Rutty::Nodes} object containing the user-defined nodes' connection info.
|
52
|
-
# Loads from the config_dir param passed to {#initialize}
|
53
|
-
#
|
54
|
-
# @return [Rutty::Nodes] The Nodes loaded from the config
|
55
|
-
def nodes
|
56
|
-
@nodes ||= Rutty::Nodes.load_config self.config_dir
|
57
|
-
end
|
58
|
-
|
59
|
-
##
|
60
|
-
# The user-specified config directory, falling back to the default on nil.
|
61
|
-
# Used by {Rutty::Nodes.load_config} and {Rutty::Config.load_config} to determine
|
62
|
-
# where to look for config files.
|
63
|
-
#
|
64
|
-
# @see Rutty::Consts::CONF_DIR
|
65
|
-
# @return [String] The user-specified config directory, falling back to the default on nil.
|
66
|
-
def config_dir
|
67
|
-
(@config_dir.nil? && Rutty::Consts::CONF_DIR) || @config_dir
|
68
|
-
end
|
69
|
-
|
70
|
-
##
|
71
|
-
# The tool's output format, passed by the user via the rutty bin's flag.
|
72
|
-
# Must be one of the elements of {Rutty::Consts::OUTPUT_FORMATS}.
|
73
|
-
# Defaults to {Rutty::Consts::DEFAULT_OUTPUT_FORMAT}
|
74
|
-
#
|
75
|
-
# @see Rutty::Consts::OUTPUT_FORMATS
|
76
|
-
# @see Rutty::Consts::DEFAULT_OUTPUT_FORMAT
|
77
|
-
# @return [String] The configured output format
|
78
|
-
def output_format
|
79
|
-
(@output_format.nil? && Rutty::Consts::DEFAULT_OUTPUT_FORMAT) || @output_format
|
80
|
-
end
|
81
|
-
|
82
|
-
##
|
83
|
-
# Sets @output_format, or raises an exception if the value is not included in {Rutty::Consts::OUTPUT_FORMATS}.
|
84
|
-
#
|
85
|
-
# @see Rutty::Consts::OUTPUT_FORMATS
|
86
|
-
# @raise [Rutty::InvalidOutputFormat] On a disallowed output format string
|
87
|
-
def output_format= format
|
88
|
-
raise Rutty::InvalidOutputFormat.new "Invalid output format: #{format}" unless Rutty::Consts::OUTPUT_FORMATS.include? format
|
89
|
-
|
90
|
-
@output_format = format
|
91
|
-
end
|
92
|
-
end
|
93
|
-
end
|
9
|
+
module Rutty; end
|
10
|
+
|
data/lib/rutty/runner.rb
ADDED
@@ -0,0 +1,86 @@
|
|
1
|
+
require 'rutty/actions'
|
2
|
+
require 'rutty/config'
|
3
|
+
require 'rutty/consts'
|
4
|
+
require 'rutty/errors'
|
5
|
+
require 'rutty/helpers'
|
6
|
+
require 'rutty/node'
|
7
|
+
require 'rutty/nodes'
|
8
|
+
|
9
|
+
module Rutty
|
10
|
+
##
|
11
|
+
# The Rutty::Runner class includes mixins from the other modules. All end-user interaction
|
12
|
+
# should be done through this class.
|
13
|
+
#
|
14
|
+
# @author Josh Lindsey
|
15
|
+
# @since 2.0.0
|
16
|
+
class Runner
|
17
|
+
attr_writer :config_dir
|
18
|
+
attr :config
|
19
|
+
attr :nodes
|
20
|
+
attr :output_format
|
21
|
+
|
22
|
+
include Rutty::Consts
|
23
|
+
include Rutty::Helpers
|
24
|
+
include Rutty::Actions
|
25
|
+
|
26
|
+
##
|
27
|
+
# Initialize a new {Rutty::Runner} instance
|
28
|
+
#
|
29
|
+
# @param config_dir [String] Optional parameter specifying the directory RuTTY has been init'd into
|
30
|
+
def initialize config_dir = nil
|
31
|
+
self.config_dir = config_dir
|
32
|
+
end
|
33
|
+
|
34
|
+
##
|
35
|
+
# Lazy-load the {Rutty::Config} object for this instance, based on the config_dir param
|
36
|
+
# passed to {#initialize}.
|
37
|
+
#
|
38
|
+
# @return [Rutty::Config] The loaded and parsed config object
|
39
|
+
def config
|
40
|
+
@config ||= Rutty::Config.load_config self.config_dir
|
41
|
+
end
|
42
|
+
|
43
|
+
##
|
44
|
+
# Lazy-load the {Rutty::Nodes} object containing the user-defined nodes' connection info.
|
45
|
+
# Loads from the config_dir param passed to {#initialize}
|
46
|
+
#
|
47
|
+
# @return [Rutty::Nodes] The Nodes loaded from the config
|
48
|
+
def nodes
|
49
|
+
@nodes ||= Rutty::Nodes.load_config self.config_dir
|
50
|
+
end
|
51
|
+
|
52
|
+
##
|
53
|
+
# The user-specified config directory, falling back to the default on nil.
|
54
|
+
# Used by {Rutty::Nodes.load_config} and {Rutty::Config.load_config} to determine
|
55
|
+
# where to look for config files.
|
56
|
+
#
|
57
|
+
# @see Rutty::Consts::CONF_DIR
|
58
|
+
# @return [String] The user-specified config directory, falling back to the default on nil.
|
59
|
+
def config_dir
|
60
|
+
(@config_dir.nil? && Rutty::Consts::CONF_DIR) || @config_dir
|
61
|
+
end
|
62
|
+
|
63
|
+
##
|
64
|
+
# The tool's output format, passed by the user via the rutty bin's flag.
|
65
|
+
# Must be one of the elements of {Rutty::Consts::OUTPUT_FORMATS}.
|
66
|
+
# Defaults to {Rutty::Consts::DEFAULT_OUTPUT_FORMAT}
|
67
|
+
#
|
68
|
+
# @see Rutty::Consts::OUTPUT_FORMATS
|
69
|
+
# @see Rutty::Consts::DEFAULT_OUTPUT_FORMAT
|
70
|
+
# @return [String] The configured output format
|
71
|
+
def output_format
|
72
|
+
(@output_format.nil? && Rutty::Consts::DEFAULT_OUTPUT_FORMAT) || @output_format
|
73
|
+
end
|
74
|
+
|
75
|
+
##
|
76
|
+
# Sets @output_format, or raises an exception if the value is not included in {Rutty::Consts::OUTPUT_FORMATS}.
|
77
|
+
#
|
78
|
+
# @see Rutty::Consts::OUTPUT_FORMATS
|
79
|
+
# @raise [Rutty::InvalidOutputFormat] On a disallowed output format string
|
80
|
+
def output_format= format
|
81
|
+
raise Rutty::InvalidOutputFormat.new "Invalid output format: #{format}" unless Rutty::Consts::OUTPUT_FORMATS.include? format
|
82
|
+
|
83
|
+
@output_format = format
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
data/lib/rutty/version.rb
CHANGED
data/rutty.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{rutty}
|
8
|
-
s.version = "2.5.
|
8
|
+
s.version = "2.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 = ["Josh Lindsey"]
|
12
|
-
s.date = %q{2011-06-
|
12
|
+
s.date = %q{2011-06-21}
|
13
13
|
s.default_executable = %q{rutty}
|
14
14
|
s.description = %q{
|
15
15
|
RuTTY is a DSH (distributed / dancer's shell) written in Ruby. It's used to run commands
|
@@ -40,6 +40,7 @@ Gem::Specification.new do |s|
|
|
40
40
|
"lib/rutty/node.rb",
|
41
41
|
"lib/rutty/nodes.rb",
|
42
42
|
"lib/rutty/proc_classes.rb",
|
43
|
+
"lib/rutty/runner.rb",
|
43
44
|
"lib/rutty/treetop/syntax_nodes.rb",
|
44
45
|
"lib/rutty/treetop/tag_query.rb",
|
45
46
|
"lib/rutty/treetop/tag_query.treetop",
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rutty
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 29
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 2.5.
|
9
|
+
- 3
|
10
|
+
version: 2.5.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Josh Lindsey
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-06-
|
18
|
+
date: 2011-06-21 00:00:00 -04:00
|
19
19
|
default_executable: rutty
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -281,6 +281,7 @@ files:
|
|
281
281
|
- lib/rutty/node.rb
|
282
282
|
- lib/rutty/nodes.rb
|
283
283
|
- lib/rutty/proc_classes.rb
|
284
|
+
- lib/rutty/runner.rb
|
284
285
|
- lib/rutty/treetop/syntax_nodes.rb
|
285
286
|
- lib/rutty/treetop/tag_query.rb
|
286
287
|
- lib/rutty/treetop/tag_query.treetop
|