source stringclasses 1
value | repo stringlengths 5 63 | repo_url stringlengths 24 82 | path stringlengths 5 167 | language stringclasses 1
value | license stringclasses 5
values | stars int64 10 51.4k | ref stringclasses 23
values | size_bytes int64 200 258k | text stringlengths 137 258k |
|---|---|---|---|---|---|---|---|---|---|
github | solutious/rudy | https://github.com/solutious/rudy | tryouts/15_huxtable/10_huxtable_tryouts.rb | Ruby | mit | 88 | master | 1,002 | group "Rudy::Huxtable"
library :rudy, 'lib'
tryout "Is well kept" do
set :oldlogger, Rudy::Huxtable.logger
setup do
#Rudy::Huxtable.update_config
end
clean do
Rudy::Huxtable.update_logger oldlogger
end
drill "has config", Rudy::Huxtable.config, :class, Rudy::Config
drill "has global", Rudy::Hu... |
github | solutious/rudy | https://github.com/solutious/rudy | tryouts/12_config/50_commands_tryouts.rb | Ruby | mit | 88 | master | 360 | rudy_lib_path = File.expand_path(File.join(GYMNASIUM_HOME, '..', 'lib'))
group "Config"
library :rudy, rudy_lib_path
tryout "Commands" do
setup do
@@config = Rudy::Config.new
@@config.look_and_load # looks for and loads config files
end
drill "is a well-formed hash", [:allow] do
@@config.comman... |
github | solutious/rudy | https://github.com/solutious/rudy | tryouts/12_config/20_defaults_tryouts.rb | Ruby | mit | 88 | master | 434 | group "Config"
library :rudy, File.expand_path(File.join(GYMNASIUM_HOME, '..', 'lib'))
tryout "Defaults" do
setup do
@@config = Rudy::Config.new
@@config.look_and_load # looks for and loads config files
end
drill "has some defaults", ["color", "environment", "role", "zone"].sort do
# Sorted so w... |
github | solutious/rudy | https://github.com/solutious/rudy | tryouts/12_config/10_load_config_tryouts.rb | Ruby | mit | 88 | master | 1,037 | group "Config"
library :rudy, File.expand_path(File.join(GYMNASIUM_HOME, '..', 'lib'))
tryout "Loads config files" do
drill "load configs when created", 1 do
@@config = Rudy::Config.new Rudy::CONFIG_FILE
@@config.paths.size
end
drill "has accounts", :class, Rudy::Config::Accounts do
@@config.ac... |
github | solutious/rudy | https://github.com/solutious/rudy | tryouts/12_config/40_machines_tryouts.rb | Ruby | mit | 88 | master | 1,642 | group "Config"
library :rudy, File.expand_path(File.join(GYMNASIUM_HOME, '..', 'lib'))
tryout "Machines" do
## drill "Setup vars", :dream => true do
drill "Setup vars", true do
@@config = Rudy::Config.new
@@config.look_and_load # looks for and loads config files
@@reg, @@zon = @@config.defaults.regio... |
github | solutious/rudy | https://github.com/solutious/rudy | tryouts/12_config/60_routines_tryouts.rb | Ruby | mit | 88 | master | 300 | rudy_lib_path = File.expand_path(File.join(GYMNASIUM_HOME, '..', 'lib'))
group "Config"
library :rudy, rudy_lib_path
tryout "Routines" do
setup do
@@config = Rudy::Config.new
@@config.look_and_load # looks for and loads config files
end
xdrill "has aws account" do
end
end |
github | solutious/rudy | https://github.com/solutious/rudy | tryouts/12_config/30_accounts_tryouts.rb | Ruby | mit | 88 | master | 462 | group "Config"
library :rudy, File.expand_path(File.join(GYMNASIUM_HOME, '..', 'lib'))
tryout "Accounts" do
setup do
@@config = Rudy::Config.new
@@config.look_and_load # looks for and loads config files
end
dream ["accesskey", "accountnum", "cert", "name", "pkey", "secretkey"]
drill "has aws accou... |
github | solutious/rudy | https://github.com/solutious/rudy | tryouts/30_metadata/53_disk_list_tryouts.rb | Ruby | mit | 88 | master | 751 | group "Metadata"
library :rudy, 'lib'
Gibbler.enable_debug if Tryouts.verbose > 3
tryout "List Disks" do
setup do
#Rudy.enable_debug
Rudy::Huxtable.update_config # Read config files
global = Rudy::Huxtable.global
akey, skey, region = global.accesskey, global.secretkey, global.region
... |
github | solutious/rudy | https://github.com/solutious/rudy | tryouts/30_metadata/50_disk_tryouts.rb | Ruby | mit | 88 | master | 2,949 | group "Metadata"
library :rudy, 'lib'
tryout "Disk API" do
set :test_domain, Rudy::DEFAULT_DOMAIN #'test_' << Rudy::Utils.strand(4)
set :test_env, 'stage' #'env_' << Rudy::Utils.strand(4)
setup do
#Rudy.enable_debug
Rudy::Huxtable.global.offline = true
Rudy::Huxtable.update_config # Re... |
github | solutious/rudy | https://github.com/solutious/rudy | tryouts/30_metadata/51_disk_digest_tryouts.rb | Ruby | mit | 88 | master | 538 | group "Metadata"
library :rudy, 'lib'
Gibbler.enable_debug if Tryouts.verbose > 3
tryout "Disk API" do
setup do
#Rudy.enable_debug
Rudy::Huxtable.update_config # Read config files
global = Rudy::Huxtable.global
akey, skey, region = global.accesskey, global.secretkey, global.region
... |
github | solutious/rudy | https://github.com/solutious/rudy | tryouts/30_metadata/73_machine_list_tryouts.rb | Ruby | mit | 88 | master | 1,450 | group "Metadata"
library :rudy, 'lib'
Gibbler.enable_debug if Tryouts.verbose > 3
tryout "List Machines" do
setup do
#Rudy.enable_debug
Rudy::Huxtable.update_config # Read config files
global = Rudy::Huxtable.global
akey, skey, region = global.accesskey, global.secretkey, global.region... |
github | solutious/rudy | https://github.com/solutious/rudy | tryouts/30_metadata/63_backup_list_tryouts.rb | Ruby | mit | 88 | master | 918 | group "Metadata"
library :rudy, 'lib'
Gibbler.enable_debug if Tryouts.verbose > 3
tryout "List Backups" do
set :sample_time, Time.now.utc
setup do
#Rudy.enable_debug
Rudy::Huxtable.update_config # Read config files
global = Rudy::Huxtable.global
akey, skey, region = global.accessk... |
github | solutious/rudy | https://github.com/solutious/rudy | tryouts/30_metadata/56_disk_volume_tryouts.rb | Ruby | mit | 88 | master | 1,641 | group "Metadata"
library :rudy, 'lib'
tryout "Disk Volume API" do
set :test_domain, 'test_' #<< Rudy::Utils.strand(4)
set :test_env, 'stage' << Rudy::Utils.strand(4)
setup do
#Rudy.enable_debug
Rudy::Huxtable.global.offline = true
Rudy::Huxtable.update_config # Read config files
gl... |
github | solutious/rudy | https://github.com/solutious/rudy | tryouts/30_metadata/60_backup_tryouts.rb | Ruby | mit | 88 | master | 2,887 | group "Metadata"
library :rudy, 'lib'
tryout "Backup API" do
set :sample_time, Time.now.utc
set :test_domain, Rudy::DEFAULT_DOMAIN #'test_' << Rudy::Utils.strand(4)
set :test_env, :stage #'env_' << Rudy::Utils.strand(4)
setup do
#Rudy.enable_debug
Rudy::Huxtable.global.offline = true
Rudy::Hu... |
github | solutious/rudy | https://github.com/solutious/rudy | tryouts/30_metadata/77_machines_tryouts.rb | Ruby | mit | 88 | master | 1,196 | library :rudy, 'lib'
group "Metadata"
tryout "Rudy::Machines API" do
set :test_domain, Rudy::DEFAULT_DOMAIN #'test_' << Rudy::Utils.strand(4)
set :test_env, 'stage' #'env_' << Rudy::Utils.strand(4)
setup do
#Rudy.enable_debug
Rudy::Huxtable.global.offline = true
Rudy::Huxtable.update_config ... |
github | solutious/rudy | https://github.com/solutious/rudy | tryouts/30_metadata/66_backup_snapshot_tryouts.rb | Ruby | mit | 88 | master | 1,977 | group "Metadata"
library :rudy, 'lib'
tryout "Backup Snapshot API" do
set :sample_time, Time.now.utc
set :test_domain, Rudy::DEFAULT_DOMAIN #'test_' << Rudy::Utils.strand(4)
set :test_env, :stage #'env_' << Rudy::Utils.strand(4)
setup do
#Rudy.enable_debug
Rudy::Huxtable.global.offline = true
... |
github | solutious/rudy | https://github.com/solutious/rudy | tryouts/30_metadata/13_object_tryouts.rb | Ruby | mit | 88 | master | 499 | group "Metadata"
library :rudy, 'lib'
tryouts "Rudy::Metadata objects" do
set :test_domain, 'test_' #<< Rudy::Utils.strand
setup do
Rudy::Huxtable.update_config
global = Rudy::Huxtable.global
akey, skey, region = global.accesskey, global.secretkey, global.region
class Anything < Storable
in... |
github | solutious/rudy | https://github.com/solutious/rudy | tryouts/30_metadata/70_machine_tryouts.rb | Ruby | mit | 88 | master | 2,164 | library :rudy, 'lib'
group "Metadata"
tryout "Rudy::Machine API" do
set :test_domain, Rudy::DEFAULT_DOMAIN #'test_' << Rudy::Utils.strand(4)
set :test_env, 'stage' #'env_' << Rudy::Utils.strand(4)
setup do
#Rudy.enable_debug
Rudy::Huxtable.global.offline = true
Rudy::Huxtable.update_config ... |
github | solutious/rudy | https://github.com/solutious/rudy | tryouts/30_metadata/10_include_tryouts.rb | Ruby | mit | 88 | master | 1,214 | group "Metadata"
library :rudy, 'lib'
tryouts "include Rudy::Metadata" do
set :test_domain, 'test_' #<< Rudy::Utils.strand
setup do
Rudy::Huxtable.global.offline = true
Rudy::Huxtable.update_config # Read config files
end
clean do
Rudy::Huxtable.global.offline = false
end
drill "h... |
github | solutious/rudy | https://github.com/solutious/rudy | tryouts/30_metadata/64_backup_disk_tryouts.rb | Ruby | mit | 88 | master | 1,556 | group "Metadata"
library :rudy, 'lib'
Gibbler.enable_debug if Tryouts.verbose > 3
tryout "Disk Backups" do
setup do
#Rudy.enable_debug
Rudy::Huxtable.update_config # Read config files
global = Rudy::Huxtable.global
akey, skey, region = global.accesskey, global.secretkey, global.region
... |
github | solutious/rudy | https://github.com/solutious/rudy | tryouts/30_metadata/76_machine_instance_tryouts.rb | Ruby | mit | 88 | master | 1,879 | library :rudy, 'lib'
group "Metadata"
tryout "Rudy::Machine Instance API" do
set :test_domain, Rudy::DEFAULT_DOMAIN #'test_' << Rudy::Utils.strand(4)
set :test_env, 'stage' #'env_' << Rudy::Utils.strand(4)
setup do
#Rudy.enable_debug
Rudy::Huxtable.global.offline = true
Rudy::Huxtable.update_conf... |
github | solutious/rudy | https://github.com/solutious/rudy | tryouts/80_cli/60_rudy_tryouts.rb | Ruby | mit | 88 | master | 1,138 | RUDY_HOME = File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
group "Rudy CLI"
command :rudy, File.join(RUDY_HOME, 'bin', 'rudy')
dreams File.join(GYMNASIUM_HOME, '80_cli', '60_rudy_dreams.rb')
xtryout "rudy machines" do
drill "no machines, no args", :machines
##drill "startup", :startup
end
xtryou... |
github | solutious/rudy | https://github.com/solutious/rudy | tryouts/10_require_time/15_global_tryouts.rb | Ruby | mit | 88 | master | 1,692 | rudy_lib_path = File.expand_path(File.join(GYMNASIUM_HOME, '..', 'lib'))
group "Require-time"
library :rudy, rudy_lib_path
tryout "Initialization of Global" do
global = Rudy::Huxtable.global
drill "has global", global, :class, Rudy::Global
drill "has default region", global.region, :'us-east-1'
drill "has def... |
github | solutious/rudy | https://github.com/solutious/rudy | tryouts/10_require_time/10_rudy_tryouts.rb | Ruby | mit | 88 | master | 751 | group "Require-time"
library :rudy, File.expand_path(File.join(GYMNASIUM_HOME, '..', 'lib'))
tryout "Rudy Initialization" do
setup do
end
drill "version matches gemspec", Rudy::VERSION.to_s do
require 'rubygems' unless defined?(Gem)
eval( File.read(File.join(RUDY_HOME, 'rudy.gemspec')))
@spec.versio... |
github | solutious/rudy | https://github.com/solutious/rudy | tryouts/25_ec2/22_groups_authorize_account_tryouts.rb | Ruby | mit | 88 | master | 1,745 | group "EC2"
library :rudy, 'lib'
tryouts "Groups Authorize/Revoke Account" do
set :global, Rudy::Huxtable.global
set :group_name, 'grp-' << Rudy::Utils.strand
setup do
Rudy::Huxtable.update_config
Rudy::AWS::EC2.connect global.accesskey, global.secretkey, global.region
Rudy::AWS::EC2::Groups.create g... |
github | solutious/rudy | https://github.com/solutious/rudy | tryouts/25_ec2/50_snapshots_tryouts.rb | Ruby | mit | 88 | master | 1,955 | group "EC2"
library :rudy, 'lib'
tryouts "Snapshots" do
set :global, Rudy::Huxtable.global
setup do
Rudy::Huxtable.update_config
Rudy::AWS::EC2.connect global.accesskey, global.secretkey, global.region
Rudy::AWS::EC2::Volumes.create 3, global.zone
end
clean do
Rudy::AWS::EC2::Volumes.list(:avai... |
github | solutious/rudy | https://github.com/solutious/rudy | tryouts/25_ec2/40_volumes_tryouts.rb | Ruby | mit | 88 | master | 1,339 | group "EC2"
library :rudy, 'lib'
tryouts "Volumes" do
set :global, Rudy::Huxtable.global
setup do
Rudy::Huxtable.update_config
Rudy::AWS::EC2.connect global.accesskey, global.secretkey, global.region
end
drill "no existing volumes", false do
Rudy::AWS::EC2::Volumes.any? :available
end
dre... |
github | solutious/rudy | https://github.com/solutious/rudy | tryouts/25_ec2/10_keypairs_tryouts.rb | Ruby | mit | 88 | master | 1,327 | group "EC2"
library :rudy, 'lib'
tryouts "Keypairs" do
set :global, Rudy::Huxtable.global
set :keypair_name, 'key-' << Rudy::Utils.strand
setup do
Rudy::Huxtable.update_config
#Rudy::Huxtable.global.region = :'eu-west-1'
Rudy::AWS::EC2.connect global.accesskey, global.secretkey, global.region
... |
github | solutious/rudy | https://github.com/solutious/rudy | tryouts/25_ec2/21_groups_authorize_address_tryouts.rb | Ruby | mit | 88 | master | 1,522 | group "EC2"
library :rudy, 'lib'
tryouts "Groups Authorize Address" do
set :global, Rudy::Huxtable.global
set :group_name, 'grp-' << Rudy::Utils.strand
set :protocols, ['tcp', 'udp']
set :external_ip, Rudy::Utils::external_ip_address || '192.168.0.1/32'
set :addresses, [external_ip]
set :ports, [[3100,3150... |
github | solutious/rudy | https://github.com/solutious/rudy | tryouts/25_ec2/30_addresses_tryouts.rb | Ruby | mit | 88 | master | 1,030 | group "EC2"
library :rudy, 'lib'
tryouts "Addresses" do
set :global, Rudy::Huxtable.global
set :group_name, 'grp-' << Rudy::Utils.strand
set :group_desc, 'desc-' << group_name
setup do
Rudy::Huxtable.update_config
Rudy::AWS::EC2.connect global.accesskey, global.secretkey, global.region
end
drill... |
github | solutious/rudy | https://github.com/solutious/rudy | tryouts/25_ec2/20_groups_tryouts.rb | Ruby | mit | 88 | master | 1,450 | group "EC2"
library :rudy, 'lib'
tryouts "Groups" do
set :global, Rudy::Huxtable.global
set :group_name, 'grp-' << Rudy::Utils.strand
set :group_desc, 'desc-' << group_name
setup do
Rudy::Huxtable.update_config
Rudy::AWS::EC2.connect global.accesskey, global.secretkey, global.region
end
dream :c... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy.rb | Ruby | mit | 88 | master | 4,013 | unless defined?(RUDY_HOME)
RUDY_HOME = File.join(File.dirname(__FILE__), '..')
RUDY_LIB = File.join(File.dirname(__FILE__), '..', 'lib')
end
local_libs = %w{net-ssh net-scp aws-s3 caesars drydock rye storable sysinfo annoy gibbler}
local_libs.each { |dir| $:.unshift File.join(RUDY_HOME, '..', dir, 'lib') }
requir... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/huxtable.rb | Ruby | mit | 88 | master | 13,789 | module Rudy
# = Rudy::Huxtable
#
# Huxtable gives access to instances for config, global, and logger to any
# class that includes it.
#
# class Rudy::Hello
# include Rudy::Huxtable
#
# def print_config
# p @@config.defaults # {:nocolor => true, ...}
# p @@global... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/global.rb | Ruby | mit | 88 | master | 5,051 | module Rudy
# = Rudy::Global
#
# This global class is used by all Huxtable objects.
# When a new CLI global is added, the appropriate field must
# be added to this class (optional: a default value in initialize).
class Global < Storable
field :config => String
field :region
field :zone
... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/mixins.rb | Ruby | mit | 88 | master | 713 | module REXML
module Node
include Gibbler::String
end
end
class Hash
# A depth-first look to find the deepest point in the Hash.
# The top level Hash is counted in the total so the final
# number is the depth of its children + 1. An example:
#
# ahash = { :level1 => { :level2 => {} } }
# a... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/config.rb | Ruby | mit | 88 | master | 5,405 | module Rudy
require 'caesars'
class Config < Caesars::Config
require 'rudy/config/objects'
dsl Rudy::Config::Accounts::DSL
dsl Rudy::Config::Defaults::DSL
dsl Rudy::Config::Routines::DSL # Organized processes
dsl Rudy::Config::Machines::DSL # Organized instances
dsl Rud... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/cli.rb | Ruby | mit | 88 | master | 2,704 | require 'drydock'
module Rudy
# = CLI
#
# These classes provide the functionality for the Command
# line interfaces. See the bin/ files if you're interested.
#
module CLI
require 'rudy/cli/execbase'
require 'rudy/cli/base'
class NoCred < RuntimeError #:nodoc
end
... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/backups.rb | Ruby | mit | 88 | master | 595 | module Rudy
module Backups
RTYPE = 'back'.freeze
extend self
extend Rudy::Metadata::ClassMethods
include Rudy::Huxtable
extend Rudy::Huxtable
# Returns the most recent backup object for the given path
def get(path)
tmp = Rudy::Backup.new path
backups = Rudy::Backu... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/disks.rb | Ruby | mit | 88 | master | 785 | module Rudy
module Disks
RTYPE = 'disk'.freeze
extend self
extend Rudy::Metadata::ClassMethods
include Rudy::Huxtable
extend Rudy::Huxtable
def get(path)
tmp = Rudy::Disk.new path
record = Rudy::Metadata.get tmp.name
return nil unless record.is_a?(Hash)
tmp... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/exceptions.rb | Ruby | mit | 88 | master | 2,189 | module Rudy
class Error < RuntimeError
def initialize(obj=nil); @obj = obj; end
def message; "#{self.class}: #{@obj}"; end
end
class InsecureKeyPermissions < Rudy::Error
def message
lines = ["Insecure file permissions for #{@obj}"]
lines << "Try: chmod 600 #{@obj}"
lines.join($/)
... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/aws.rb | Ruby | mit | 88 | master | 756 | require 'AWS' # amazon-ec2 gem
module Rudy
module AWS
extend self
unless defined?(Rudy::AWS::VALID_REGIONS)
VALID_REGIONS = [:'eu-west-1', :'us-east-1', :'us-west-1', :'ap-southeast-1'].freeze
end
def valid_region?(r); VALID_REGIONS.member?(r.to_sym || ''); end
# Modif... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/utils.rb | Ruby | mit | 88 | master | 10,915 | #require 'drydock/mixins'
require 'socket'
require 'open-uri'
require 'date'
require 'timeout'
module Rudy
# A motley collection of methods that Rudy loves to call!
module Utils
extend self
include Socket::Constants
# Return the external IP address (the one seen by the internet)
def extern... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/guidelines.rb | Ruby | mit | 88 | master | 457 | module Rudy
module Guidelines
extend self
AFE = "Always fail early"
ABA = "Always be accurate"
CBC = "Consistency before cuteness"
UNO = "Ugly's not okay"
WOC = "Write offensive code"
def inspect
all = Guidelines.constants
g = all.collect { |c| '%s="%s"' % [c, const_get(c)] }
... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/metadata.rb | Ruby | mit | 88 | master | 7,770 | module Rudy
module Metadata
include Rudy::Huxtable
COMMON_FIELDS = [:region, :zone, :project, :environment, :role].freeze
@@rsdb = nil
@@domain = Rudy::Huxtable.domain
#
def self.get_rclass(rtype)
case rtype
when Rudy::Machines::RTYPE
Rudy::Machines
w... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/machines.rb | Ruby | mit | 88 | master | 2,498 | module Rudy
module Machines
RTYPE = 'm'.freeze
extend self
extend Rudy::Metadata::ClassMethods
extend Rudy::Huxtable
def get(position)
tmp = Rudy::Machine.new position
record = Rudy::Metadata.get tmp.name
return nil unless record.is_a?(Hash)
tmp.from_hash reco... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/routines.rb | Ruby | mit | 88 | master | 5,437 | module Rudy
# = Rudy::Routines
#
# Every Rudy routine is associated to a handler. There are four standard
# handler types: Startup, Shutdown, Reboot, and Passthrough. The first
# three are associated to routines of the same same. All other routines
# are handled by Rudy::Routines::Passthrough.
#
... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/aws/ec2.rb | Ruby | mit | 88 | master | 4,290 | module Rudy; module AWS
module EC2
include Rudy::Huxtable
@@mutex = Mutex.new
def self.connect(access_key=nil, secret_key=nil, region=nil, logger=nil)
if region
raise InvalidRegion, region unless Rudy::AWS.valid_region?(region)
host = "#{region}.ec2.amazonaws.com"
e... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/aws/s3.rb | Ruby | mit | 88 | master | 1,640 | module Rudy::AWS
class S3
def initialize(access_key=nil, secret_key=nil, region=nil, debug=nil)
require 'aws/s3'
url ||= 'http://sdb.amazonaws.com'
# There is a bug with passing :server to EC2::Base.new so
# we'll use the environment variable for now.
#if region && ... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/aws/sdb.rb | Ruby | mit | 88 | master | 7,791 | require 'time'
require 'cgi'
require 'uri'
require 'net/http'
require 'base64'
require 'openssl'
require 'rexml/document'
require 'rexml/xpath'
module Rudy
module AWS
class SDB
class NoAccessKey < RuntimeError; end
class NoSecretKey < RuntimeError; end
require 'rudy/aws/sdb/error'
... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/aws/ec2/group.rb | Ruby | mit | 88 | master | 9,650 | module Rudy::AWS
class EC2::Group < Storable
class Rule < Storable
field :ports => Range # Port range
field :protocol => String
def to_s(with_title=false)
if self.ports.first == self.ports.last
"%s(%s)" % [self.protocol, self.ports.last]
else
... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/aws/ec2/keypair.rb | Ruby | mit | 88 | master | 2,330 | module Rudy::AWS
module EC2
class Keypair < Storable
field :name => String
field :fingerprint => String
field :private_key => String
def to_s(titles=false)
[@name.bright, @fingerprint].join '; '
end
def public_key
return unless @priva... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/aws/ec2/instance.rb | Ruby | mit | 88 | master | 14,448 | module Rudy::AWS
class EC2::Instance < Storable
@@sformat = " -> %10s; %10s; %12s; %10s; groups: %s"
field :launch_index => Time
field :groups => Array
field :aki => String
field :ari => String
field :created => String
field :keyname => String
field :size => String
field :ami => ... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/aws/ec2/address.rb | Ruby | mit | 88 | master | 4,624 | module Rudy::AWS
module EC2
class Address < Storable
field :ipaddress => String
field :instid => String
def liner_note
info = self.associated? ? @instid : "available"
"%s (%s)" % [@ipaddress.to_s.bright, info]
end
def to_s(with_titles=false)
... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/aws/ec2/zone.rb | Ruby | mit | 88 | master | 1,502 | module Rudy::AWS
module EC2
class Zone < Storable
field :name
field :region
field :state
def to_s(titles=false)
[@name.bright, @region, @state].join '; '
end
end
module Zones
include Rudy::AWS::EC2 # important! include,
extend s... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/aws/ec2/snapshot.rb | Ruby | mit | 88 | master | 2,423 | module Rudy::AWS
module EC2
class Snapshot < Storable
field :awsid
field :progress
field :created
field :volid
field :status
def to_s(with_title=false)
[@awsid.bright, @volid, @created, @status, @progress].join '; '
end
def completed?
... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/aws/ec2/spot_request.rb | Ruby | mit | 88 | master | 3,201 | module Rudy::AWS
module EC2
class SpotRequest < Storable
field :id => String
field :price => Float
field :type => String
field :state => String
field :ami => String
field :keyname => String
field :groups => Array
field :size => String
field :zone => String
... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/aws/ec2/image.rb | Ruby | mit | 88 | master | 5,537 | module Rudy::AWS
class EC2::Image < Storable
@@sformat = " -> %8s; %12s; %12s; %12s; %8s"
field :awsid => String
field :owner => String
field :aki => String
field :ari => String
field :state => String
field :arch => String
field :visibility => String
field :location => Strin... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/aws/ec2/volume.rb | Ruby | mit | 88 | master | 7,222 | module Rudy::AWS
module EC2
class Volume < Storable
@@sformat = "%s %10s;%4sGB; %s " # cram the terabyte
field :size => Integer
field :zone => Symbol
field :created => Time
field :attached => Time
field :awsid
field :status
field :snapid
field :ins... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/aws/sdb/error.rb | Ruby | mit | 88 | master | 1,431 | module Rudy
module AWS
class SDB
class Error < RuntimeError ; end
class RequestError < Error
attr_reader :request_id
def initialize(message, request_id=nil)
super(message)
@request_id = request_id
end
end
class InvalidDomainNameError < Request... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/config/objects.rb | Ruby | mit | 88 | master | 6,214 | class Rudy::Config
class Error < Rudy::Error
def initialize(ctype, obj)
@ctype, @obj = ctype, obj
end
def message; "Error in #{@ctype}: #{@obj}"; end
end
class Accounts < Caesars
include Gibbler::Complex
def valid?
(!aws.nil? && !aws.accesskey.nil? && !aws.secretkey.nil?) &... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/metadata/machine.rb | Ruby | mit | 88 | master | 6,417 | ##--
## CONSIDER: http://docs.rackspacecloud.com/servers/api/v1.0/cs-devguide-20090713.pdf
##++
module Rudy
class Machine < Storable
include Rudy::Metadata
include Gibbler::Complex
field :created => Time
field :started => Time
field :rtype => String
field :instid => String
... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/metadata/disk.rb | Ruby | mit | 88 | master | 4,619 | module Rudy
class Disk < Storable
include Rudy::Metadata
include Gibbler::Complex
field :created => Time
field :rtype => String
field :volid => String
field :status => String
field :instid => String
field :path => String
field :device => String
field :size => String
... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/metadata/backup.rb | Ruby | mit | 88 | master | 4,261 | require 'date'
module Rudy
class Backup < Storable
include Rudy::Metadata
include Gibbler::Complex
field :created => Time
field :rtype => String
field :snapid => String
field :volid => String
field :path => String
field :year => String
field :month => String
... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/routines/startup.rb | Ruby | mit | 88 | master | 4,644 | module Rudy; module Routines;
class Startup < Rudy::Routines::Base
Rudy::Routines.add_routine :startup, self
@@allowed_actions = [:before, :before_local, :disks, :adduser,
:authorize, :local, :remote, :after]
def init(*args)
@routine ||= {}
end
#... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/routines/base.rb | Ruby | mit | 88 | master | 2,573 | module Rudy; module Routines;
class Base
include Rudy::Huxtable
@@run = true
def self.run?; @@run; end
def self.disable_run; @@run = false; end
def self.enable_run; @@run = true; end
def run?; @@run; end
def disable_run; @@run = false; end
def enable_run; @@run = true; e... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/routines/reboot.rb | Ruby | mit | 88 | master | 4,233 | module Rudy; module Routines;
class Reboot < Rudy::Routines::Base
Rudy::Routines.add_routine :reboot, self
@@allowed_actions = [:before, :disks, :adduser, :authorize,
:before_local, :before_remote,
:local, :remote, :after]
... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/routines/passthrough.rb | Ruby | mit | 88 | master | 1,659 | module Rudy; module Routines;
class Passthrough < Rudy::Routines::Base
Rudy::Routines.add_routine :startup, Rudy::Routines::Startup
Rudy::Routines.add_routine :shutdown, Rudy::Routines::Shutdown
Rudy::Routines.add_routine :reboot, Rudy::Routines::Reboot
def init(*args)
Rudy::Routines.r... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/routines/shutdown.rb | Ruby | mit | 88 | master | 3,085 | module Rudy; module Routines;
class Shutdown < Rudy::Routines::Base
Rudy::Routines.add_routine :shutdown, self
@@allowed_actions = [:before, :disks, :adduser, :authorize,
:local, :remote, :after_local, :after]
def init(*args)
@routine ||= ... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/routines/handlers/script.rb | Ruby | mit | 88 | master | 2,789 | module Rudy; module Routines; module Handlers;
module Script
include Rudy::Routines::Handlers::Base
extend self
Rudy::Routines.add_handler :local, self
Rudy::Routines.add_handler :remote, self
Rudy::Routines.add_handler :xlocal, self
Rudy::Routines.add_handler :xremote, self
... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/routines/handlers/spot_request.rb | Ruby | mit | 88 | master | 1,143 | module Rudy; module Routines; module Handlers;
module SpotRequest
include Rudy::Routines::Handlers::Base
extend self
def needed?
current_machine_pricing.is_a?(Hash) || current_machine_pricing.to_sym == :spot
end
def create
opts = {
:price => current_machine_pricing[:bid],
... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/routines/handlers/depends.rb | Ruby | mit | 88 | master | 1,804 | module Rudy; module Routines; module Handlers;
module Depends
include Rudy::Routines::Handlers::Base
extend self
## NOTE: Dependencies don't use Rudy::Routines.add_handler but we
## define them ehere anyway so raise_early_exceptions passes.
Rudy::Routines.add_handler :before, self
Rud... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/routines/handlers/keypair.rb | Ruby | mit | 88 | master | 2,591 | module Rudy; module Routines; module Handlers;
module Keypair
include Rudy::Routines::Handlers::Base
extend self
##Rudy::Routines.add_handler :machines, self
def raise_early_exceptions(name=nil)
name ||= current_machine_root
keyname = user_keypairname name
kp_file = pk... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/routines/handlers/user.rb | Ruby | mit | 88 | master | 1,425 | module Rudy; module Routines; module Handlers;
module User
include Rudy::Routines::Handlers::Base
extend self
Rudy::Routines.add_handler :adduser, self
Rudy::Routines.add_handler :authorize, self
def raise_early_exceptions(type, user, rset, lbox, argv=nil)
end
def ex... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/routines/handlers/base.rb | Ruby | mit | 88 | master | 1,309 | module Rudy; module Routines; module Handlers;
module Base
include Rudy::Huxtable
def trap_rbox_errors(ret=nil, &command)
begin
ret = command.call if command
return unless ret.is_a?(Rye::Rap)
li ' ' << ret.stdout.join("#{$/} ") if !ret.stdout.empty?
print_response(ret)
... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/routines/handlers/rye.rb | Ruby | mit | 88 | master | 5,751 | module Rudy::Routines::Handlers;
module RyeTools
include Rudy::Routines::Handlers::Base
extend self
# Create an instance of Rye::Box for +hostname+. +opts+ is
# an optional Hash of options. See Rye::Box.initialize
#
# This method should be used throughout the Rudy::Routines
# names... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/routines/handlers/group.rb | Ruby | mit | 88 | master | 2,095 | module Rudy; module Routines; module Handlers;
module Group
include Rudy::Routines::Handlers::Base
extend self
Rudy::Routines.add_handler :network, self
def raise_early_exceptions(type, batch, rset, lbox, argv=nil)
end
def execute(type, routine, rset, lbox, argv=nil)... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/routines/handlers/host.rb | Ruby | mit | 88 | master | 4,144 | module Rudy; module Routines; module Handlers;
module Host
include Rudy::Routines::Handlers::Base
extend self
## NOTE: This handler doesn't use Rudy::Routines.add_handler
def is_running?(rset)
raise NoMachines if rset.boxes.empty?
rset.boxes.each do |rbox|
msg = "Waiting... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/routines/handlers/disks.rb | Ruby | mit | 88 | master | 10,242 | module Rudy::Routines::Handlers;
module Disks
include Rudy::Routines::Handlers::Base
extend self
ACTIONS = [:create, :destroy, :archive, :mount, :restore,
:attach, :detach, :mount, :umount, :fstype].freeze
Rudy::Routines.add_handler :disks, self
Rye::Cmd.add_command(:... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/cli/images.rb | Ruby | mit | 88 | master | 3,086 | module Rudy
module CLI
class Images < Rudy::CLI::CommandBase
def bundle_valid?
raise "No S3 bucket provided. See rudy bundle -h" unless @@global.bucket
raise "No image name provided. See rudy bundle -h" unless @argv.name
@machines = Rudy::Machines.list
raise... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/cli/backups.rb | Ruby | mit | 88 | master | 1,057 | module Rudy
module CLI
class Backups < Rudy::CLI::CommandBase
def backups
blist = get_backups
print_stobjects blist
end
def backups_wash
dirt = (get_backups || []).select { |b| !b.snapshot_exists? }
if dirt.empty?
li "Nothing to wash in #{... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/cli/metadata.rb | Ruby | mit | 88 | master | 1,324 | module Rudy
module CLI
class Metadata < Rudy::CLI::CommandBase
def metadata_valid?
@option.rtype ||= 'm'
@metaobj = Rudy::Metadata.get_rclass @option.rtype
true
end
def metadata
unless @argv.empty?
h = Rudy::Metadata.get(@argv.first)
... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/cli/machines.rb | Ruby | mit | 88 | master | 11,006 | module Rudy
module CLI
class Machines < Rudy::CLI::CommandBase
def machines
mlist = get_machines
print_stobjects mlist
end
def machines_console
mlist = get_machines
mlist.each do |machine|
li machine_separator(machine.name, machine.instid)
... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/cli/routines.rb | Ruby | mit | 88 | master | 3,410 | module Rudy; module CLI;
class Routines < Rudy::CLI::CommandBase
def routines_valid?
raise Rudy::NoRoutinesConfig unless @@config.routines
true
end
def routines
if @@config.nil? || @@config.empty?
return if @@global.quiet
raise Rudy::NoConfig
end
... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/cli/base.rb | Ruby | mit | 88 | master | 4,638 | module Rudy::CLI
class CommandBase < Drydock::Command
include Rudy::Huxtable
attr_reader :config
protected
def init
if Drydock.debug?
#Caesars.enable_debug
Rudy.enable_debug
end
# The CLI wants output!
Rudy::Huxtable.update_logger STDOUT
# Send The H... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/cli/candy.rb | Ruby | mit | 88 | master | 290 | module Rudy
module CLI
class Candy < Rudy::CLI::CommandBase
def open
machines = Rudy::Machines.list
if machines
`open http://#{machines.first.dns_public}`
else
li "No machines"
end
end
end
end
end |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/cli/config.rb | Ruby | mit | 88 | master | 3,038 | module Rudy
module CLI
class Config < Rudy::CLI::CommandBase
# We force the CLI::Base#print_header to be quiet
def print_header
#@@global.quiet = true
#super
end
# Display configuration from the local user data file (~/.rudy/config).
# This config... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/cli/networks.rb | Ruby | mit | 88 | master | 3,579 | module Rudy
module CLI
class Networks < Rudy::CLI::CommandBase
def networks
name = current_group_name
Rudy::AWS::EC2::Groups.list(name).each do |group|
li @@global.verbose > 0 ? group.inspect : group.dump(@@global.format)
end
end
def create_network... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/cli/execbase.rb | Ruby | mit | 88 | master | 2,036 | module Rudy::CLI
# A base for all Drydock executables (bin/rudy etc...).
class Base
extend Drydock
before do |obj|
# Don't print Rudy header unless requested to
obj.global.print_header = false if (obj.global.verbose == 0)
@start = Time.now
end
after do |obj|
if o... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/cli/keypairs.rb | Ruby | mit | 88 | master | 825 | module Rudy
module CLI
class Keypairs < Rudy::CLI::CommandBase
def keypairs_add_valid?
true
end
def keypairs_add
li current_group_name
end
def keypairs_valid?
@pkey = current_user_keypairpath
unless File.exists? @pkey
... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/cli/disks.rb | Ruby | mit | 88 | master | 3,529 | module Rudy
module CLI
class Disks < Rudy::CLI::CommandBase
def disks
disk_list = get_disks
# If there are no disks currently, there could be backups
# so we grab those to create a list of disks.
if @option.backups
backups = Rudy::Backups.list(more, less) ||... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/cli/info.rb | Ruby | mit | 88 | master | 1,172 | module Rudy
module CLI
class Info < Rudy::CLI::CommandBase
def info
process_region @@global.region
oregions = Rudy::AWS::VALID_REGIONS - [@@global.region.to_sym]
if @option.all
oregions.each do |region|
Rudy::AWS::EC2.connect @@global.accesskey, @@global.secre... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/cli/aws/ec2/snapshots.rb | Ruby | mit | 88 | master | 1,016 | module Rudy; module CLI;
module AWS; module EC2;
class Snapshots < Rudy::CLI::CommandBase
def create_snapshots_valid?
raise Drydock::ArgError.new('volume ID', @alias) unless @option.volume
@volume = Rudy::AWS::EC2::Volumes.get(@option.volume)
!@volume.nil?
end
def create_snapsho... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/cli/aws/ec2/zones.rb | Ruby | mit | 88 | master | 243 | module Rudy; module CLI;
module AWS; module EC2;
class Zones < Rudy::CLI::CommandBase
def zones
zlist = Rudy::AWS::EC2::Zones.list(@argv.name)
print_stobjects zlist
end
end
end; end
end; end |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/cli/aws/ec2/images.rb | Ruby | mit | 88 | master | 1,826 | module Rudy; module CLI;
module AWS; module EC2;
class Images < Rudy::CLI::CommandBase
def images_valid?
if @option.owner == 'self'
raise "AWS_ACCOUNT_NUMBER not set" unless @@global.accountnum
@option.owner = @@global.accountnum
end
true
end
def image... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/cli/aws/ec2/candy.rb | Ruby | mit | 88 | master | 7,189 | module Rudy; module CLI;
module AWS; module EC2;
class Candy < Rudy::CLI::CommandBase
def status_valid?
avail = Rudy::Utils.service_available?('status.aws.amazon.com', 80, 5)
raise ServiceUnavailable, 'status.aws.amazon.com' unless @@global.offline || avail
true
end
def status
... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/cli/aws/ec2/info.rb | Ruby | mit | 88 | master | 1,920 | module Rudy; module CLI
module AWS; module EC2;
class Info < Rudy::CLI::CommandBase
def info
process_region @@global.region
oregions = Rudy::AWS::VALID_REGIONS - [@@global.region.to_sym]
if @option.all
oregions.each do |region|
Rudy::AWS::EC2.connect @@global.accesskey, @@gl... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/cli/aws/ec2/volumes.rb | Ruby | mit | 88 | master | 3,528 | module Rudy; module CLI;
module AWS; module EC2;
class Volumes < Rudy::CLI::CommandBase
def volumes_create_valid?
raise "You must supply a volume size. See rudy volume -h" unless @option.size
raise "You must supply a zone." unless @@global.zone
true
end
def volumes_create... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/cli/aws/ec2/instances.rb | Ruby | mit | 88 | master | 7,132 | module Rudy; module CLI;
module AWS; module EC2;
class InstanceAndGroupError < Drydock::ArgError
def message; "You cannot provide a group and an instance ID"; end
end
class NoInstanceError < Drydock::ArgError
def message; "You must provide a group or instance ID"; end
end
class Instances < Rudy::C... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/cli/aws/ec2/addresses.rb | Ruby | mit | 88 | master | 3,398 | module Rudy; module CLI;
module AWS; module EC2;
class Addresses < Rudy::CLI::CommandBase
def addresses_create
address = Rudy::AWS::EC2::Addresses.create
print_stobject address
end
def addresses_destroy_valid?
raise Drydock::ArgError.new("IP address", @alias) unless @argv.i... |
github | solutious/rudy | https://github.com/solutious/rudy | lib/rudy/cli/aws/ec2/groups.rb | Ruby | mit | 88 | master | 3,750 | module Rudy; module CLI;
module AWS; module EC2;
class Groups < Rudy::CLI::CommandBase
def create_groups_valid?
raise Drydock::ArgError.new('group name', @alias) unless @argv.name
raise "Group #{@argv.name} alread exists" if Rudy::AWS::EC2::Groups.exists?(@argv.name)
true
end
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.