coral_cloud 0.1.1
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/.document +5 -0
- data/Gemfile +10 -0
- data/Gemfile.lock +37 -0
- data/LICENSE.txt +674 -0
- data/README.rdoc +36 -0
- data/Rakefile +68 -0
- data/VERSION +1 -0
- data/lib/coral_cloud/base.rb +236 -0
- data/lib/coral_cloud/event/puppet_event.rb +99 -0
- data/lib/coral_cloud/server.rb +254 -0
- data/lib/coral_cloud/share.rb +44 -0
- data/lib/coral_cloud.rb +82 -0
- metadata +194 -0
@@ -0,0 +1,44 @@
|
|
1
|
+
|
2
|
+
module Coral
|
3
|
+
module Cloud
|
4
|
+
class Share < Core
|
5
|
+
|
6
|
+
#-----------------------------------------------------------------------------
|
7
|
+
# Constructor / Destructor
|
8
|
+
|
9
|
+
def initialize(options = {})
|
10
|
+
super(options)
|
11
|
+
|
12
|
+
@name = ( options.has_key?(:name) ? string(options[:name]) : '' )
|
13
|
+
@remote_dir = ( options.has_key?(:remote_dir) ? string(options[:remote_dir]) : '' )
|
14
|
+
|
15
|
+
self.directory = ( options.has_key?(:directory) ? string(options[:directory]) : '' )
|
16
|
+
end
|
17
|
+
|
18
|
+
#-----------------------------------------------------------------------------
|
19
|
+
# Property accessors / modifiers
|
20
|
+
|
21
|
+
attr_accessor :name, :remote_dir
|
22
|
+
attr_reader :directory
|
23
|
+
|
24
|
+
#---
|
25
|
+
|
26
|
+
def directory=directory
|
27
|
+
@directory = string(directory)
|
28
|
+
ensure_directory
|
29
|
+
end
|
30
|
+
|
31
|
+
#-----------------------------------------------------------------------------
|
32
|
+
|
33
|
+
def ensure_directory
|
34
|
+
unless @directory.empty?
|
35
|
+
# @TODO: This is not OS agnostic.
|
36
|
+
if ! File.directory?(@directory) && system("which mkdir 2>1 1>/dev/null")
|
37
|
+
system("sudo mkdir -p #{@directory}")
|
38
|
+
end
|
39
|
+
end
|
40
|
+
return self
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
data/lib/coral_cloud.rb
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
|
2
|
+
home = File.dirname(__FILE__)
|
3
|
+
|
4
|
+
$:.unshift(home) unless
|
5
|
+
$:.include?(home) || $:.include?(File.expand_path(home))
|
6
|
+
|
7
|
+
#-------------------------------------------------------------------------------
|
8
|
+
|
9
|
+
require 'rubygems'
|
10
|
+
require 'coral_core'
|
11
|
+
|
12
|
+
#---
|
13
|
+
|
14
|
+
# Include data model
|
15
|
+
[ :share, :server, :base ].each do |name|
|
16
|
+
require File.join('coral_cloud', name.to_s + '.rb')
|
17
|
+
end
|
18
|
+
|
19
|
+
# Include specialized events
|
20
|
+
Dir.glob(File.join(home, 'coral_cloud', 'event', '*.rb')).each do |file|
|
21
|
+
require file
|
22
|
+
end
|
23
|
+
|
24
|
+
#*******************************************************************************
|
25
|
+
# Coral Cloud / Virtual Machine Management Library
|
26
|
+
#
|
27
|
+
# This provides the ability to manage a cloud of servers and sync them with
|
28
|
+
# associated VMs running on the local machine...
|
29
|
+
# (most of this is currently TODO!)
|
30
|
+
#
|
31
|
+
# Author:: Adrian Webb (mailto:adrian.webb@coraltech.net)
|
32
|
+
# License:: GPLv3
|
33
|
+
module Coral
|
34
|
+
|
35
|
+
#-----------------------------------------------------------------------------
|
36
|
+
# Constructor / Destructor
|
37
|
+
|
38
|
+
def self.create_cloud(name, options = {})
|
39
|
+
return Coral::Cloud.create(name, options)
|
40
|
+
end
|
41
|
+
|
42
|
+
#---
|
43
|
+
|
44
|
+
def self.delete_cloud(name)
|
45
|
+
return Coral::Cloud.delete(name)
|
46
|
+
end
|
47
|
+
|
48
|
+
#-----------------------------------------------------------------------------
|
49
|
+
# Accessors / Modifiers
|
50
|
+
|
51
|
+
def self.cloud(name)
|
52
|
+
return Coral::Cloud[name]
|
53
|
+
end
|
54
|
+
|
55
|
+
#*******************************************************************************
|
56
|
+
#*******************************************************************************
|
57
|
+
|
58
|
+
module Cloud
|
59
|
+
|
60
|
+
VERSION = File.read(File.join(File.dirname(__FILE__), '..', 'VERSION'))
|
61
|
+
|
62
|
+
#-----------------------------------------------------------------------------
|
63
|
+
# Constructor / Destructor
|
64
|
+
|
65
|
+
def self.create(name, options = {})
|
66
|
+
return Coral::Cloud::Base.create(name, options)
|
67
|
+
end
|
68
|
+
|
69
|
+
#---
|
70
|
+
|
71
|
+
def self.delete(name)
|
72
|
+
return Coral::Cloud::Base.delete(name)
|
73
|
+
end
|
74
|
+
|
75
|
+
#-----------------------------------------------------------------------------
|
76
|
+
# Accessors / Modifiers
|
77
|
+
|
78
|
+
def self.[](name)
|
79
|
+
return Coral::Cloud::Base[name]
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
metadata
ADDED
@@ -0,0 +1,194 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: coral_cloud
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 25
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Adrian Webb
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2013-02-07 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: coral_core
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ~>
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 9
|
29
|
+
segments:
|
30
|
+
- 0
|
31
|
+
- 1
|
32
|
+
version: "0.1"
|
33
|
+
type: :runtime
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: bundler
|
37
|
+
prerelease: false
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ~>
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
hash: 11
|
44
|
+
segments:
|
45
|
+
- 1
|
46
|
+
- 2
|
47
|
+
version: "1.2"
|
48
|
+
type: :development
|
49
|
+
version_requirements: *id002
|
50
|
+
- !ruby/object:Gem::Dependency
|
51
|
+
name: rspec
|
52
|
+
prerelease: false
|
53
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
54
|
+
none: false
|
55
|
+
requirements:
|
56
|
+
- - ~>
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
hash: 23
|
59
|
+
segments:
|
60
|
+
- 2
|
61
|
+
- 10
|
62
|
+
version: "2.10"
|
63
|
+
type: :development
|
64
|
+
version_requirements: *id003
|
65
|
+
- !ruby/object:Gem::Dependency
|
66
|
+
name: rdoc
|
67
|
+
prerelease: false
|
68
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
69
|
+
none: false
|
70
|
+
requirements:
|
71
|
+
- - ~>
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
hash: 31
|
74
|
+
segments:
|
75
|
+
- 3
|
76
|
+
- 12
|
77
|
+
version: "3.12"
|
78
|
+
type: :development
|
79
|
+
version_requirements: *id004
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: jeweler
|
82
|
+
prerelease: false
|
83
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
84
|
+
none: false
|
85
|
+
requirements:
|
86
|
+
- - ~>
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
hash: 31
|
89
|
+
segments:
|
90
|
+
- 1
|
91
|
+
- 8
|
92
|
+
version: "1.8"
|
93
|
+
type: :development
|
94
|
+
version_requirements: *id005
|
95
|
+
description: |-
|
96
|
+
= coral_cloud
|
97
|
+
|
98
|
+
This library provides the ability to define and manage servers. These servers
|
99
|
+
can be local virtual machines (interfaced by Vagrant) or (in the near future)
|
100
|
+
remote servers on various IAAS providers, such as Rackspace and Amazon.
|
101
|
+
|
102
|
+
This library utilizes the Puppet provisioner to build servers and Vagrant
|
103
|
+
to run them locally. Eventually a cohesive API will be developed that will
|
104
|
+
allow for easily switching and performing the same operations on different
|
105
|
+
providers. For now this library focuses on integration with Vagrant.
|
106
|
+
|
107
|
+
More to come soon...
|
108
|
+
|
109
|
+
Note: This library is still very early in development!
|
110
|
+
|
111
|
+
== Contributing to coral_cloud
|
112
|
+
|
113
|
+
* Check out the latest master to make sure the feature hasn't been implemented
|
114
|
+
or the bug hasn't been fixed yet.
|
115
|
+
* Check out the issue tracker to make sure someone already hasn't requested
|
116
|
+
it and/or contributed it.
|
117
|
+
* Fork the project.
|
118
|
+
* Start a feature/bugfix branch.
|
119
|
+
* Commit and push until you are happy with your contribution.
|
120
|
+
* Make sure to add tests for it. This is important so I don't break it in a
|
121
|
+
future version unintentionally.
|
122
|
+
* Please try not to mess with the Rakefile, version, or history. If you want
|
123
|
+
to have your own version, or is otherwise necessary, that is fine, but
|
124
|
+
please isolate to its own commit so I can cherry-pick around it.
|
125
|
+
|
126
|
+
== Copyright
|
127
|
+
|
128
|
+
Licensed under GPLv3. See LICENSE.txt for further details.
|
129
|
+
|
130
|
+
Copyright (c) 2013 Adrian Webb <adrian.webb@coraltech.net>
|
131
|
+
Coral Technology Group LLC
|
132
|
+
email: adrian.webb@coraltech.net
|
133
|
+
executables: []
|
134
|
+
|
135
|
+
extensions: []
|
136
|
+
|
137
|
+
extra_rdoc_files:
|
138
|
+
- LICENSE.txt
|
139
|
+
- README.rdoc
|
140
|
+
files:
|
141
|
+
- .document
|
142
|
+
- Gemfile
|
143
|
+
- Gemfile.lock
|
144
|
+
- LICENSE.txt
|
145
|
+
- README.rdoc
|
146
|
+
- Rakefile
|
147
|
+
- VERSION
|
148
|
+
- lib/coral_cloud.rb
|
149
|
+
- lib/coral_cloud/base.rb
|
150
|
+
- lib/coral_cloud/event/puppet_event.rb
|
151
|
+
- lib/coral_cloud/server.rb
|
152
|
+
- lib/coral_cloud/share.rb
|
153
|
+
homepage: http://github.com/coraltech/ruby-coral_cloud
|
154
|
+
licenses:
|
155
|
+
- GPLv3
|
156
|
+
post_install_message:
|
157
|
+
rdoc_options:
|
158
|
+
- --title
|
159
|
+
- Coral Cloud library
|
160
|
+
- --main
|
161
|
+
- README.rdoc
|
162
|
+
- --line-numbers
|
163
|
+
require_paths:
|
164
|
+
- lib
|
165
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
166
|
+
none: false
|
167
|
+
requirements:
|
168
|
+
- - ">="
|
169
|
+
- !ruby/object:Gem::Version
|
170
|
+
hash: 53
|
171
|
+
segments:
|
172
|
+
- 1
|
173
|
+
- 8
|
174
|
+
- 1
|
175
|
+
version: 1.8.1
|
176
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
177
|
+
none: false
|
178
|
+
requirements:
|
179
|
+
- - ">="
|
180
|
+
- !ruby/object:Gem::Version
|
181
|
+
hash: 3
|
182
|
+
segments:
|
183
|
+
- 0
|
184
|
+
version: "0"
|
185
|
+
requirements: []
|
186
|
+
|
187
|
+
rubyforge_project: coral_cloud
|
188
|
+
rubygems_version: 1.8.15
|
189
|
+
signing_key:
|
190
|
+
specification_version: 3
|
191
|
+
summary: Provides the ability to define and manage clouds of local and remote servers
|
192
|
+
test_files: []
|
193
|
+
|
194
|
+
has_rdoc:
|