rudy 0.9.5.004 → 0.9.6.001
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/CHANGES.txt +4 -1
- data/Rakefile +4 -1
- data/Rudyfile +15 -10
- data/lib/rudy/aws/ec2.rb +17 -1
- data/lib/rudy/aws/s3.rb +3 -0
- data/lib/rudy/aws/sdb/error.rb +0 -1
- data/lib/rudy/aws.rb +3 -5
- data/lib/rudy/backups.rb +4 -0
- data/lib/rudy/cli/aws/ec2/keypairs.rb +1 -1
- data/lib/rudy/cli/aws/ec2/volumes.rb +0 -1
- data/lib/rudy/cli/execbase.rb +4 -1
- data/lib/rudy/cli.rb +36 -2
- data/lib/rudy/disks.rb +9 -0
- data/lib/rudy/exceptions.rb +0 -27
- data/lib/rudy/global.rb +1 -0
- data/lib/rudy/machines.rb +12 -0
- data/lib/rudy/metadata/machine.rb +2 -0
- data/lib/rudy/metadata.rb +3 -1
- data/lib/rudy/mixins.rb +36 -3
- data/lib/rudy/routines.rb +19 -3
- data/lib/rudy/utils.rb +1 -1
- data/lib/rudy.rb +20 -17
- data/rudy.gemspec +1 -5
- metadata +2 -6
- data/lib/rudy/mixins/gibbler.rb +0 -7
- data/lib/rudy/mixins/hash.rb +0 -27
- data/lib/rudy/mixins/symbol.rb +0 -8
- data/lib/rudy/routines/handlers/machines.rb +0 -15
data/CHANGES.txt
CHANGED
@@ -1,11 +1,14 @@
|
|
1
1
|
RUDY, CHANGES
|
2
2
|
|
3
3
|
|
4
|
-
#### 0.9.6 (
|
4
|
+
#### 0.9.6 (2010-01-16) ###########################
|
5
5
|
|
6
6
|
* FIXED: Include Gibbler for REXML
|
7
7
|
* FIXED: Elastic IP binding on startup (GH-40)
|
8
|
+
* FIXED: rudy-ec2 volumes should be quiet!
|
8
9
|
* CHANGE: Increased max instances from 5 to 20.
|
10
|
+
* CHANGE: Maximum autoloads
|
11
|
+
* ADDED: Debug mode global option -D
|
9
12
|
|
10
13
|
|
11
14
|
#### 0.9.5 (2009-09-01) ###########################
|
data/Rakefile
CHANGED
@@ -5,7 +5,6 @@ require 'hanna/rdoctask'
|
|
5
5
|
require 'rake/testtask'
|
6
6
|
require 'shoulda/tasks'
|
7
7
|
require 'rake/runtest'
|
8
|
-
require 'monkeyspecdoc' # http://jgre.org/2008/09/03/monkeyspecdoc/
|
9
8
|
require 'fileutils'
|
10
9
|
include FileUtils
|
11
10
|
|
@@ -23,6 +22,10 @@ Rake::GemPackageTask.new(@spec) do |p|
|
|
23
22
|
p.need_tar = true if RUBY_PLATFORM !~ /mswin/
|
24
23
|
end
|
25
24
|
|
25
|
+
task :test do
|
26
|
+
puts "Success!"
|
27
|
+
end
|
28
|
+
|
26
29
|
task :release => [ "publish:gem", :clean, "publish:rdoc" ] do
|
27
30
|
$: << File.join(File.dirname(__FILE__), 'lib')
|
28
31
|
require "rudy"
|
data/Rudyfile
CHANGED
@@ -45,8 +45,12 @@ machines do
|
|
45
45
|
user :root # User to connect as
|
46
46
|
size 'm1.small' # EC2 machine type for all machines
|
47
47
|
# in the 'stage' environment
|
48
|
-
|
49
|
-
|
48
|
+
|
49
|
+
role :app do # stage-app is the default
|
50
|
+
end # machine group.
|
51
|
+
|
52
|
+
role :db do
|
53
|
+
positions 1 # 2 machines in stage-app
|
50
54
|
#addresses '11.22.33.44' # Define an elastic IP to reuse
|
51
55
|
|
52
56
|
disks do # Define EBS volumes
|
@@ -55,13 +59,13 @@ machines do
|
|
55
59
|
device '/dev/sdr' # Devices must be unique too.
|
56
60
|
end
|
57
61
|
end
|
58
|
-
|
62
|
+
|
63
|
+
end
|
59
64
|
|
60
|
-
role :
|
65
|
+
role :balancer do # You can define as many roles
|
61
66
|
end # as you like. These are just
|
62
|
-
|
63
|
-
|
64
|
-
|
67
|
+
# a couple examples.
|
68
|
+
|
65
69
|
users do # Specify existing private keys per user
|
66
70
|
#rudy do
|
67
71
|
# keypair '/path/2/private-key'
|
@@ -97,8 +101,8 @@ end
|
|
97
101
|
# To run a routine, specify its name on the command-line: rudy startup
|
98
102
|
routines do
|
99
103
|
|
100
|
-
env :stage, :prod do # We'll define routines for the stage-
|
101
|
-
role :
|
104
|
+
env :stage, :prod do # We'll define routines for the stage-db
|
105
|
+
role :db do # and prod-db machine groups.
|
102
106
|
|
103
107
|
user :root # The default remote user
|
104
108
|
|
@@ -145,10 +149,11 @@ routines do
|
|
145
149
|
# install essential libraries.
|
146
150
|
# See http://github.com/rudy/arcade
|
147
151
|
sysupdate do # $ rudy sysupdate
|
152
|
+
adduser :rudy
|
148
153
|
remote :root do
|
149
154
|
apt_get 'update' # Update debian / ubuntu
|
150
155
|
apt_get 'install', 'build-essential', 'sqlite3', 'libsqlite3-dev'
|
151
|
-
apt_get 'install', 'apache2-prefork-dev', 'libapr1-dev'
|
156
|
+
apt_get 'install', 'apache2-prefork-dev', 'libapr1-dev', 'rubygems'
|
152
157
|
gem_install 'rudy'
|
153
158
|
end
|
154
159
|
end
|
data/lib/rudy/aws/ec2.rb
CHANGED
@@ -98,5 +98,21 @@ module Rudy; module AWS
|
|
98
98
|
class NoDevice < Rudy::Error; end
|
99
99
|
|
100
100
|
|
101
|
+
autoload :Address, 'rudy/aws/ec2/address'
|
102
|
+
autoload :Addresses, 'rudy/aws/ec2/address'
|
103
|
+
autoload :Group, 'rudy/aws/ec2/group'
|
104
|
+
autoload :Groups, 'rudy/aws/ec2/group'
|
105
|
+
autoload :Image, 'rudy/aws/ec2/image'
|
106
|
+
autoload :Images, 'rudy/aws/ec2/image'
|
107
|
+
autoload :Instance, 'rudy/aws/ec2/instance'
|
108
|
+
autoload :Instances, 'rudy/aws/ec2/instance'
|
109
|
+
autoload :Keypair, 'rudy/aws/ec2/keypair'
|
110
|
+
autoload :Keypairs, 'rudy/aws/ec2/keypair'
|
111
|
+
autoload :Snapshot, 'rudy/aws/ec2/snapshot'
|
112
|
+
autoload :Snapshots, 'rudy/aws/ec2/snapshot'
|
113
|
+
autoload :Volume, 'rudy/aws/ec2/volume'
|
114
|
+
autoload :Volumes, 'rudy/aws/ec2/volume'
|
115
|
+
autoload :Zone, 'rudy/aws/ec2/zone'
|
116
|
+
autoload :Zones, 'rudy/aws/ec2/zone'
|
101
117
|
end
|
102
|
-
end; end
|
118
|
+
end; end
|
data/lib/rudy/aws/s3.rb
CHANGED
data/lib/rudy/aws/sdb/error.rb
CHANGED
data/lib/rudy/aws.rb
CHANGED
@@ -20,12 +20,10 @@ module Rudy
|
|
20
20
|
def escape!(str)
|
21
21
|
str.to_s.tr!("[\0\n\r\032\\\\]", '').gsub!(/([\'\"])/, '\\1\\1')
|
22
22
|
end
|
23
|
-
|
24
|
-
require 'rudy/aws/sdb'
|
25
|
-
require 'rudy/aws/ec2'
|
26
|
-
require 'rudy/aws/s3'
|
27
23
|
|
28
|
-
|
24
|
+
autoload :SDB, 'rudy/aws/sdb'
|
25
|
+
autoload :EC2, 'rudy/aws/ec2'
|
26
|
+
autoload :S3, 'rudy/aws/s3'
|
29
27
|
|
30
28
|
class Error < ::AWS::Error; end
|
31
29
|
end
|
data/lib/rudy/backups.rb
CHANGED
data/lib/rudy/cli/execbase.rb
CHANGED
data/lib/rudy/cli.rb
CHANGED
@@ -46,10 +46,44 @@ module Rudy
|
|
46
46
|
header.read
|
47
47
|
end
|
48
48
|
|
49
|
-
|
49
|
+
autoload :Backups, 'rudy/cli/backups'
|
50
|
+
autoload :Candy, 'rudy/cli/candy'
|
51
|
+
autoload :Config, 'rudy/cli/config'
|
52
|
+
autoload :Disks, 'rudy/cli/disks'
|
53
|
+
autoload :Images, 'rudy/cli/images'
|
54
|
+
autoload :Info, 'rudy/cli/info'
|
55
|
+
autoload :Keypairs, 'rudy/cli/keypairs'
|
56
|
+
autoload :Machines, 'rudy/cli/machines'
|
57
|
+
autoload :Metadata, 'rudy/cli/metadata'
|
58
|
+
autoload :Networks, 'rudy/cli/networks'
|
59
|
+
autoload :Routines, 'rudy/cli/routines'
|
60
|
+
|
61
|
+
module AWS
|
62
|
+
module EC2
|
63
|
+
autoload :Info, 'rudy/cli/aws/ec2/info'
|
64
|
+
autoload :Candy, 'rudy/cli/aws/ec2/candy'
|
65
|
+
autoload :Addresses, 'rudy/cli/aws/ec2/addresses'
|
66
|
+
autoload :Addresses, 'rudy/cli/aws/ec2/addresses'
|
67
|
+
autoload :Groups, 'rudy/cli/aws/ec2/groups'
|
68
|
+
autoload :Images, 'rudy/cli/aws/ec2/images'
|
69
|
+
autoload :Instances, 'rudy/cli/aws/ec2/instances'
|
70
|
+
autoload :Keypairs, 'rudy/cli/aws/ec2/keypairs'
|
71
|
+
autoload :Snapshots, 'rudy/cli/aws/ec2/snapshots'
|
72
|
+
autoload :Volumes, 'rudy/cli/aws/ec2/volumes'
|
73
|
+
autoload :Zones, 'rudy/cli/aws/ec2/zones'
|
74
|
+
end
|
75
|
+
module SDB
|
76
|
+
autoload :Domains, 'rudy/cli/aws/sdb/domains'
|
77
|
+
autoload :Objects, 'rudy/cli/aws/sdb/objects'
|
78
|
+
autoload :Select, 'rudy/cli/aws/sdb/select'
|
79
|
+
end
|
80
|
+
module S3
|
81
|
+
autoload :Buckets, 'rudy/cli/aws/s3/buckets'
|
82
|
+
autoload :Store, 'rudy/cli/aws/s3/store'
|
83
|
+
end
|
84
|
+
end
|
50
85
|
end
|
51
86
|
end
|
52
87
|
|
53
|
-
Rudy::Utils.require_glob(RUDY_LIB, 'rudy', 'cli', '**', '*.rb')
|
54
88
|
|
55
89
|
|
data/lib/rudy/disks.rb
CHANGED
@@ -25,5 +25,14 @@ module Rudy
|
|
25
25
|
!get(path).nil?
|
26
26
|
end
|
27
27
|
|
28
|
+
|
29
|
+
class NotAttached < Rudy::Error; end
|
30
|
+
class NotFormatted < Rudy::Error; end
|
31
|
+
class AlreadyFormatted < Rudy::Error; end
|
32
|
+
class AlreadyMounted < Rudy::Error; end
|
33
|
+
class AlreadyAttached < Rudy::Error; end
|
34
|
+
class NotMounted < Rudy::Error; end
|
35
|
+
class InUse < Rudy::Error; end
|
36
|
+
|
28
37
|
end
|
29
38
|
end
|
data/lib/rudy/exceptions.rb
CHANGED
@@ -68,32 +68,5 @@ module Rudy
|
|
68
68
|
|
69
69
|
class NotImplemented < Rudy::Error; end
|
70
70
|
|
71
|
-
|
72
|
-
module Metadata
|
73
|
-
class UnknownRecordType < Rudy::Error
|
74
|
-
def message; "Unknown record type: #{@obj}"; end
|
75
|
-
end
|
76
|
-
class UnknownObject < Rudy::Error
|
77
|
-
def message; "Unknown object: #{@obj}"; end
|
78
|
-
end
|
79
|
-
# Raised when trying to save a record with a key that already exists
|
80
|
-
class DuplicateRecord < Rudy::Error; end
|
81
|
-
|
82
|
-
end
|
83
|
-
|
84
|
-
module Disks
|
85
|
-
class NotAttached < Rudy::Error; end
|
86
|
-
class NotFormatted < Rudy::Error; end
|
87
|
-
class AlreadyFormatted < Rudy::Error; end
|
88
|
-
class AlreadyMounted < Rudy::Error; end
|
89
|
-
class AlreadyAttached < Rudy::Error; end
|
90
|
-
class NotMounted < Rudy::Error; end
|
91
|
-
class InUse < Rudy::Error; end
|
92
|
-
end
|
93
|
-
|
94
|
-
module Backups
|
95
|
-
class NoDisk < Rudy::Error; end
|
96
|
-
class NoBackup < Rudy::Error; end
|
97
|
-
end
|
98
71
|
|
99
72
|
end
|
data/lib/rudy/global.rb
CHANGED
data/lib/rudy/machines.rb
CHANGED
@@ -69,6 +69,18 @@ module Rudy
|
|
69
69
|
Rudy::Machine.from_hash h
|
70
70
|
end
|
71
71
|
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
class UnknownRecordType < Rudy::Error
|
76
|
+
def message; "Unknown record type: #{@obj}"; end
|
77
|
+
end
|
78
|
+
class UnknownObject < Rudy::Error
|
79
|
+
def message; "Unknown object: #{@obj}"; end
|
80
|
+
end
|
81
|
+
# Raised when trying to save a record with a key that already exists
|
82
|
+
class DuplicateRecord < Rudy::Error; end
|
83
|
+
|
72
84
|
end
|
73
85
|
|
74
86
|
end
|
data/lib/rudy/metadata.rb
CHANGED
data/lib/rudy/mixins.rb
CHANGED
@@ -1,4 +1,37 @@
|
|
1
1
|
|
2
|
-
|
3
|
-
|
4
|
-
|
2
|
+
|
3
|
+
module REXML
|
4
|
+
module Node
|
5
|
+
include Gibbler::String
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
class Hash
|
10
|
+
# A depth-first look to find the deepest point in the Hash.
|
11
|
+
# The top level Hash is counted in the total so the final
|
12
|
+
# number is the depth of its children + 1. An example:
|
13
|
+
#
|
14
|
+
# ahash = { :level1 => { :level2 => {} } }
|
15
|
+
# ahash.deepest_point # => 3
|
16
|
+
#
|
17
|
+
def deepest_point(h=self, steps=0)
|
18
|
+
if h.is_a?(Hash)
|
19
|
+
steps += 1
|
20
|
+
h.each_pair do |n,possible_h|
|
21
|
+
ret = deepest_point(possible_h, steps)
|
22
|
+
steps = ret if steps < ret
|
23
|
+
end
|
24
|
+
else
|
25
|
+
return 0
|
26
|
+
end
|
27
|
+
steps
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
class Symbol
|
32
|
+
unless method_defined? :empty?
|
33
|
+
def empty?
|
34
|
+
self.to_s.empty?
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
data/lib/rudy/routines.rb
CHANGED
@@ -139,10 +139,26 @@ module Rudy
|
|
139
139
|
routine_name &&= routine_name.to_sym
|
140
140
|
store[routine_name]
|
141
141
|
end
|
142
|
-
|
142
|
+
|
143
|
+
autoload :Passthrough, 'rudy/routines/passthrough'
|
144
|
+
autoload :Reboot, 'rudy/routines/reboot'
|
145
|
+
autoload :Shutdown, 'rudy/routines/shutdown'
|
146
|
+
autoload :Startup, 'rudy/routines/startup'
|
147
|
+
|
148
|
+
module Handlers
|
149
|
+
autoload :Host, 'rudy/routines/handlers/host'
|
150
|
+
autoload :Keypair, 'rudy/routines/handlers/keypair'
|
151
|
+
autoload :Machines, 'rudy/routines/handlers/machines'
|
152
|
+
autoload :RyeTools, 'rudy/routines/handlers/rye'
|
153
|
+
# The following can't be autoloaded because they call
|
154
|
+
# Rudy::Routines.add_handler when they're loaded.
|
155
|
+
require 'rudy/routines/handlers/depends'
|
156
|
+
require 'rudy/routines/handlers/disks'
|
157
|
+
require 'rudy/routines/handlers/group'
|
158
|
+
require 'rudy/routines/handlers/script'
|
159
|
+
require 'rudy/routines/handlers/user'
|
160
|
+
end
|
143
161
|
end
|
144
162
|
end
|
145
163
|
|
146
|
-
Rudy::Utils.require_glob(RUDY_LIB, 'rudy', 'routines', '*.rb')
|
147
|
-
Rudy::Utils.require_glob(RUDY_LIB, 'rudy', 'routines', 'handlers', '*.rb')
|
148
164
|
|
data/lib/rudy/utils.rb
CHANGED
data/lib/rudy.rb
CHANGED
@@ -13,19 +13,21 @@ begin; require 'json'; rescue LoadError; end # Silence!
|
|
13
13
|
require 'digest/md5'
|
14
14
|
require 'stringio'
|
15
15
|
require 'ostruct'
|
16
|
-
require 'yaml'
|
17
16
|
require 'logger'
|
18
17
|
require 'socket'
|
19
18
|
require 'resolv'
|
20
|
-
|
19
|
+
|
21
20
|
require 'gibbler/aliases'
|
22
|
-
require 'tempfile'
|
23
21
|
require 'rudy/mixins'
|
24
22
|
require 'storable'
|
25
23
|
require 'sysinfo'
|
26
24
|
require 'attic'
|
27
|
-
|
25
|
+
|
28
26
|
require 'rye'
|
27
|
+
require 'annoy'
|
28
|
+
require 'tempfile'
|
29
|
+
require 'timeout'
|
30
|
+
require 'yaml'
|
29
31
|
|
30
32
|
# = Rudy
|
31
33
|
#
|
@@ -41,8 +43,8 @@ module Rudy
|
|
41
43
|
unless defined?(MAJOR)
|
42
44
|
MAJOR = 0.freeze
|
43
45
|
MINOR = 9.freeze
|
44
|
-
TINY =
|
45
|
-
PATCH = '
|
46
|
+
TINY = 6.freeze
|
47
|
+
PATCH = '001'.freeze
|
46
48
|
end
|
47
49
|
def self.to_s; [MAJOR, MINOR, TINY, PATCH].join('.'); end
|
48
50
|
def self.to_f; self.to_s.to_f; end
|
@@ -119,6 +121,18 @@ module Rudy
|
|
119
121
|
def Rudy.debug?; @@debug == true; end
|
120
122
|
def Rudy.enable_debug; @@debug = true; end
|
121
123
|
def Rudy.disable_debug; @@debug = false; end
|
124
|
+
|
125
|
+
require 'rudy/exceptions'
|
126
|
+
require 'rudy/utils' # The
|
127
|
+
require 'rudy/global' # order
|
128
|
+
require 'rudy/config' # of
|
129
|
+
require 'rudy/huxtable' # requires
|
130
|
+
autoload :AWS, 'rudy/aws' # is
|
131
|
+
autoload :Metadata, 'rudy/metadata' # super
|
132
|
+
autoload :Machines, 'rudy/machines' # important.
|
133
|
+
autoload :Backups, 'rudy/backups'
|
134
|
+
autoload :Disks, 'rudy/disks'
|
135
|
+
autoload :Routines, 'rudy/routines'
|
122
136
|
|
123
137
|
end
|
124
138
|
|
@@ -130,14 +144,3 @@ if Rudy.sysinfo.vm == :java
|
|
130
144
|
end
|
131
145
|
end
|
132
146
|
|
133
|
-
require 'rudy/exceptions'
|
134
|
-
require 'rudy/utils' # The
|
135
|
-
require 'rudy/global' # order
|
136
|
-
require 'rudy/config' # of
|
137
|
-
require 'rudy/huxtable' # requires
|
138
|
-
require 'rudy/aws' # is
|
139
|
-
require 'rudy/metadata' # super
|
140
|
-
require 'rudy/machines' # important.
|
141
|
-
require 'rudy/backups'
|
142
|
-
require 'rudy/disks'
|
143
|
-
require 'rudy/routines'
|
data/rudy.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
@spec = Gem::Specification.new do |s|
|
2
2
|
s.name = "rudy"
|
3
3
|
s.rubyforge_project = 'rudy'
|
4
|
-
s.version = "0.9.
|
4
|
+
s.version = "0.9.6.001"
|
5
5
|
s.summary = "Rudy: Not your grandparents' EC2 deployment tool."
|
6
6
|
s.description = s.summary
|
7
7
|
s.author = "Delano Mandelbaum"
|
@@ -104,9 +104,6 @@
|
|
104
104
|
lib/rudy/metadata/disk.rb
|
105
105
|
lib/rudy/metadata/machine.rb
|
106
106
|
lib/rudy/mixins.rb
|
107
|
-
lib/rudy/mixins/gibbler.rb
|
108
|
-
lib/rudy/mixins/hash.rb
|
109
|
-
lib/rudy/mixins/symbol.rb
|
110
107
|
lib/rudy/routines.rb
|
111
108
|
lib/rudy/routines/base.rb
|
112
109
|
lib/rudy/routines/handlers/base.rb
|
@@ -115,7 +112,6 @@
|
|
115
112
|
lib/rudy/routines/handlers/group.rb
|
116
113
|
lib/rudy/routines/handlers/host.rb
|
117
114
|
lib/rudy/routines/handlers/keypair.rb
|
118
|
-
lib/rudy/routines/handlers/machines.rb
|
119
115
|
lib/rudy/routines/handlers/rye.rb
|
120
116
|
lib/rudy/routines/handlers/script.rb
|
121
117
|
lib/rudy/routines/handlers/user.rb
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rudy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.6.001
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Delano Mandelbaum
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2010-02-12 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -218,9 +218,6 @@ files:
|
|
218
218
|
- lib/rudy/metadata/disk.rb
|
219
219
|
- lib/rudy/metadata/machine.rb
|
220
220
|
- lib/rudy/mixins.rb
|
221
|
-
- lib/rudy/mixins/gibbler.rb
|
222
|
-
- lib/rudy/mixins/hash.rb
|
223
|
-
- lib/rudy/mixins/symbol.rb
|
224
221
|
- lib/rudy/routines.rb
|
225
222
|
- lib/rudy/routines/base.rb
|
226
223
|
- lib/rudy/routines/handlers/base.rb
|
@@ -229,7 +226,6 @@ files:
|
|
229
226
|
- lib/rudy/routines/handlers/group.rb
|
230
227
|
- lib/rudy/routines/handlers/host.rb
|
231
228
|
- lib/rudy/routines/handlers/keypair.rb
|
232
|
-
- lib/rudy/routines/handlers/machines.rb
|
233
229
|
- lib/rudy/routines/handlers/rye.rb
|
234
230
|
- lib/rudy/routines/handlers/script.rb
|
235
231
|
- lib/rudy/routines/handlers/user.rb
|
data/lib/rudy/mixins/gibbler.rb
DELETED
data/lib/rudy/mixins/hash.rb
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
|
2
|
-
class Hash
|
3
|
-
|
4
|
-
# A depth-first look to find the deepest point in the Hash.
|
5
|
-
# The top level Hash is counted in the total so the final
|
6
|
-
# number is the depth of its children + 1. An example:
|
7
|
-
#
|
8
|
-
# ahash = { :level1 => { :level2 => {} } }
|
9
|
-
# ahash.deepest_point # => 3
|
10
|
-
#
|
11
|
-
def deepest_point(h=self, steps=0)
|
12
|
-
if h.is_a?(Hash)
|
13
|
-
steps += 1
|
14
|
-
h.each_pair do |n,possible_h|
|
15
|
-
ret = deepest_point(possible_h, steps)
|
16
|
-
steps = ret if steps < ret
|
17
|
-
end
|
18
|
-
else
|
19
|
-
return 0
|
20
|
-
end
|
21
|
-
steps
|
22
|
-
end
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
end
|
27
|
-
|
data/lib/rudy/mixins/symbol.rb
DELETED