rightimage_tools 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.rspec +1 -0
- data/Gemfile +14 -0
- data/Gemfile.lock +50 -0
- data/LICENSE.txt +5 -0
- data/README.rdoc +19 -0
- data/Rakefile +49 -0
- data/VERSION +1 -0
- data/lib/mci.rb +204 -0
- data/lib/rightimage_tools.rb +5 -0
- data/spec/mci_spec.rb +97 -0
- data/spec/spec_helper.rb +13 -0
- metadata +180 -0
data/.document
ADDED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/Gemfile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
|
3
|
+
gem "rest_connection"
|
4
|
+
gem "ruby-debug"
|
5
|
+
|
6
|
+
# Add dependencies to develop your gem here.
|
7
|
+
# Include everything needed to run rake, tests, features, etc.
|
8
|
+
group :development do
|
9
|
+
gem "rspec", "~> 2.3.0"
|
10
|
+
gem "bundler", "~> 1.0.0"
|
11
|
+
gem "jeweler", "~> 1.6.4"
|
12
|
+
gem "rcov", ">= 0"
|
13
|
+
gem "flexmock"
|
14
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
activesupport (2.3.10)
|
5
|
+
columnize (0.3.4)
|
6
|
+
diff-lcs (1.1.3)
|
7
|
+
flexmock (0.9.0)
|
8
|
+
git (1.2.5)
|
9
|
+
highline (1.6.2)
|
10
|
+
jeweler (1.6.4)
|
11
|
+
bundler (~> 1.0)
|
12
|
+
git (>= 1.2.5)
|
13
|
+
rake
|
14
|
+
json (1.6.1)
|
15
|
+
linecache (0.46)
|
16
|
+
rbx-require-relative (> 0.0.4)
|
17
|
+
net-ssh (2.1.4)
|
18
|
+
rake (0.9.2.2)
|
19
|
+
rbx-require-relative (0.0.5)
|
20
|
+
rcov (1.0.0)
|
21
|
+
rest_connection (0.1.2)
|
22
|
+
activesupport (= 2.3.10)
|
23
|
+
highline
|
24
|
+
json
|
25
|
+
net-ssh (= 2.1.4)
|
26
|
+
rspec (2.3.0)
|
27
|
+
rspec-core (~> 2.3.0)
|
28
|
+
rspec-expectations (~> 2.3.0)
|
29
|
+
rspec-mocks (~> 2.3.0)
|
30
|
+
rspec-core (2.3.1)
|
31
|
+
rspec-expectations (2.3.0)
|
32
|
+
diff-lcs (~> 1.1.2)
|
33
|
+
rspec-mocks (2.3.0)
|
34
|
+
ruby-debug (0.10.4)
|
35
|
+
columnize (>= 0.1)
|
36
|
+
ruby-debug-base (~> 0.10.4.0)
|
37
|
+
ruby-debug-base (0.10.4)
|
38
|
+
linecache (>= 0.3)
|
39
|
+
|
40
|
+
PLATFORMS
|
41
|
+
ruby
|
42
|
+
|
43
|
+
DEPENDENCIES
|
44
|
+
bundler (~> 1.0.0)
|
45
|
+
flexmock
|
46
|
+
jeweler (~> 1.6.4)
|
47
|
+
rcov
|
48
|
+
rest_connection
|
49
|
+
rspec (~> 2.3.0)
|
50
|
+
ruby-debug
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,5 @@
|
|
1
|
+
# RightScale Tools
|
2
|
+
|
3
|
+
# Copyright RightScale, Inc. All rights reserved. All access and use subject to the
|
4
|
+
# RightScale Terms of Service available at http://www.rightscale.com/terms.php and,
|
5
|
+
# if applicable, other agreements such as a RightScale Master Subscription Agreement.
|
data/README.rdoc
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
= rightimage_tools
|
2
|
+
|
3
|
+
RightImage tools is a collection of miscellaneous scripts and libraries useful to the creation of RightImages
|
4
|
+
|
5
|
+
== Usage
|
6
|
+
require 'rightimage_tools'
|
7
|
+
|
8
|
+
# This will create a random mci if it doesn't exist.
|
9
|
+
mci_tool = RightImageTools::MCI.new
|
10
|
+
mci_tool.add_image_to_mci(
|
11
|
+
:name => "DEV: RightImage_CentOS_5.6_x64_v5.7",
|
12
|
+
:cloud_id => 6, #Oregon,
|
13
|
+
:image_id => "aws-xxxxxx")
|
14
|
+
|
15
|
+
|
16
|
+
== Copyright
|
17
|
+
|
18
|
+
Copyright (c) 2012 RightScale, Inc. See LICENSE.txt for further details.
|
19
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler'
|
5
|
+
begin
|
6
|
+
Bundler.setup(:default, :development)
|
7
|
+
rescue Bundler::BundlerError => e
|
8
|
+
$stderr.puts e.message
|
9
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
+
exit e.status_code
|
11
|
+
end
|
12
|
+
require 'rake'
|
13
|
+
|
14
|
+
require 'jeweler'
|
15
|
+
Jeweler::Tasks.new do |gem|
|
16
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
17
|
+
gem.name = "rightimage_tools"
|
18
|
+
gem.homepage = "http://github.com/rightscale/rightimage_tools"
|
19
|
+
gem.license = "MIT"
|
20
|
+
gem.summary = %Q{A set of tools to support the building of RightImages}
|
21
|
+
gem.description = gem.summary
|
22
|
+
gem.email = "peter.schroeter@rightscale.com"
|
23
|
+
gem.authors = ["Peter Schroeter"]
|
24
|
+
# dependencies defined in Gemfile
|
25
|
+
end
|
26
|
+
Jeweler::RubygemsDotOrgTasks.new
|
27
|
+
|
28
|
+
require 'rspec/core'
|
29
|
+
require 'rspec/core/rake_task'
|
30
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
31
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
32
|
+
end
|
33
|
+
|
34
|
+
RSpec::Core::RakeTask.new(:rcov) do |spec|
|
35
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
36
|
+
spec.rcov = true
|
37
|
+
end
|
38
|
+
|
39
|
+
task :default => :spec
|
40
|
+
|
41
|
+
require 'rake/rdoctask'
|
42
|
+
Rake::RDocTask.new do |rdoc|
|
43
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
44
|
+
|
45
|
+
rdoc.rdoc_dir = 'rdoc'
|
46
|
+
rdoc.title = "rightimage_tools #{version}"
|
47
|
+
rdoc.rdoc_files.include('README*')
|
48
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
49
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.0
|
data/lib/mci.rb
ADDED
@@ -0,0 +1,204 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'logger'
|
3
|
+
require 'ruby-debug'
|
4
|
+
require 'rest_connection'
|
5
|
+
|
6
|
+
module RightImageTools
|
7
|
+
class MCI
|
8
|
+
|
9
|
+
def initialize(options = {})
|
10
|
+
@options = options
|
11
|
+
@logger = (@options.key?(:logger)) ? @options[:logger] : Logger.new(STDOUT)
|
12
|
+
@api_url = Tag.connection.settings[:api_url]
|
13
|
+
end
|
14
|
+
|
15
|
+
def default_description(mci_name, is_ec2 = false)
|
16
|
+
# 32-Bit Image description
|
17
|
+
# OsName NN.NN Hypervisor with 32-bit architecture (i386)
|
18
|
+
# 64-Bit image description
|
19
|
+
# OsName NN.NN Hypervisor with 64-bit architecture (x64)
|
20
|
+
#
|
21
|
+
|
22
|
+
os = (mci_name =~ /(centos|ubuntu|windows|rhel)/i) ? $1 : ""
|
23
|
+
os_version = ""
|
24
|
+
unless os.empty?
|
25
|
+
os_version = (mci_name =~ /#{os}[\s_](\d+\.\d+)/) ? $1 : ""
|
26
|
+
end
|
27
|
+
os_arch = (mci_name =~ /(i[3|6]86|x64|x86_64|amd64)/i) ? $1 : ""
|
28
|
+
hypervisor = (mci_name =~ /(xenserver|xen|vmware|esxi|kvm)/i) ? $1 : ""
|
29
|
+
rl_version = (mci_name =~ /v(\d+\.\d+)/) ? $1 : ""
|
30
|
+
|
31
|
+
description = "Development build:"
|
32
|
+
description << " #{os}" if os
|
33
|
+
description << " #{os_version}" if os_version
|
34
|
+
description << " #{hypervisor}" if !hypervisor.empty? && !is_ec2
|
35
|
+
if os_arch
|
36
|
+
if os_arch =~ /i[3|6]86/
|
37
|
+
description << " with 32-bit architecture (#{os_arch})"
|
38
|
+
else
|
39
|
+
description << " with 64-bit architecture (#{os_arch})"
|
40
|
+
end
|
41
|
+
end
|
42
|
+
description << " and RightLink #{rl_version}" if rl_version
|
43
|
+
description << "."
|
44
|
+
end
|
45
|
+
|
46
|
+
# Adds an image to an mci, if the image is not already attached to the mci
|
47
|
+
#
|
48
|
+
# === Parameters
|
49
|
+
# image_id(String)
|
50
|
+
# cloud_id(Number)
|
51
|
+
# mci_name(String)
|
52
|
+
#
|
53
|
+
# === Return
|
54
|
+
# mci(MultiCloudImageCloudSettingInternal):: new or existing MCI setting
|
55
|
+
def add_image_to_mci(options)
|
56
|
+
cloud_id = options[:cloud_id].to_i
|
57
|
+
image_id = options[:image_id]
|
58
|
+
mci_name = options[:name]
|
59
|
+
description = options[:description]
|
60
|
+
|
61
|
+
raise ArgumentError, ":cloud_id not supplied" unless cloud_id > 0
|
62
|
+
raise ArgumentError, ":image_id not supplied" unless image_id =~ /./
|
63
|
+
raise ArgumentError, "MCI name (:name) not supplied" unless mci_name =~ /./
|
64
|
+
|
65
|
+
image_id = image_id.split("/").last
|
66
|
+
|
67
|
+
if api_version(cloud_id) == "1.0"
|
68
|
+
unless image_id =~ /^ami-[0-9a-z]+$/
|
69
|
+
raise ArgumentError, "image_id #{image_id} doesn't look like an amazon ami"
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
mci = find_mci(cloud_id, mci_name)
|
74
|
+
#validate_mci_name(mci_name) unless mci
|
75
|
+
mci = create_mci(cloud_id, mci_name, description) unless mci
|
76
|
+
add_rightlink_tag(mci)
|
77
|
+
mci_setting = find_or_create_cloud_setting(mci, image_id, cloud_id)
|
78
|
+
|
79
|
+
# Create the MCIs, if they don't exist.
|
80
|
+
|
81
|
+
return mci.href
|
82
|
+
end
|
83
|
+
|
84
|
+
def validate_mci_name(name)
|
85
|
+
end
|
86
|
+
|
87
|
+
def guess_instance_type(mci_name)
|
88
|
+
mci_name =~ /i386/ ? "m1.small" : "m1.large"
|
89
|
+
end
|
90
|
+
|
91
|
+
def find_cloud_setting(mci,cloud_id)
|
92
|
+
mci_setting = nil
|
93
|
+
mci_setting = mci.multi_cloud_image_cloud_settings.select { |setting| setting.cloud_id.to_i == cloud_id.to_i }.first
|
94
|
+
end
|
95
|
+
|
96
|
+
def find_or_create_cloud_setting(mci, image_id, cloud_id)
|
97
|
+
mci_setting = nil;
|
98
|
+
if api_version(cloud_id) == "1.0"
|
99
|
+
mci_setting = find_cloud_setting(mci, cloud_id)
|
100
|
+
instance_type = guess_instance_type(mci.name)
|
101
|
+
|
102
|
+
if mci_setting
|
103
|
+
unless mci_setting.image_href.include?(image_id)
|
104
|
+
@logger.warn("Replacing image for cloud #{cloud_id} for MCI #{mci.rs_id}")
|
105
|
+
res = mci_setting.destroy
|
106
|
+
raise "Non success code returned #{res.inspect} " if res.code.to_s !~ /^2\d\d$/
|
107
|
+
create_cloud_setting(mci, image_id, cloud_id, instance_type)
|
108
|
+
end
|
109
|
+
else
|
110
|
+
@logger.info("Adding cloud images to MCI #{mci.href}")
|
111
|
+
mci_setting = create_cloud_setting(mci, image_id, cloud_id, instance_type)
|
112
|
+
#returns nil
|
113
|
+
end
|
114
|
+
else
|
115
|
+
raise NotImplementedError, "API 1.5 not supported yet"
|
116
|
+
end
|
117
|
+
mci_setting
|
118
|
+
end
|
119
|
+
|
120
|
+
def create_cloud_setting(mci, image_id, cloud_id, instance_type = nil)
|
121
|
+
mci_setting = nil
|
122
|
+
if api_version(cloud_id) == "1.0"
|
123
|
+
# create the setting
|
124
|
+
#update_connection_settings(MultiCloudImageInternal)
|
125
|
+
image_href = "#{@api_url}/ec2_images/#{image_id}?cloud_id=#{cloud_id}"
|
126
|
+
mci_setting = MultiCloudImageCloudSettingInternal.create(
|
127
|
+
:multi_cloud_image_href => mci.href,
|
128
|
+
:cloud_id => cloud_id.to_i,
|
129
|
+
:ec2_image_href => image_href,
|
130
|
+
:aws_instance_type => instance_type)
|
131
|
+
else
|
132
|
+
raise NotImplementedError, "API 1.5 not supported yet"
|
133
|
+
end
|
134
|
+
mci_setting
|
135
|
+
end
|
136
|
+
|
137
|
+
# return MultiCloudImageInternal, or nil
|
138
|
+
def find_mci(cloud_id, mci_name)
|
139
|
+
mcis = []
|
140
|
+
if api_version(cloud_id) == "1.0"
|
141
|
+
#update_connection_settings(MultiCloudImage)
|
142
|
+
mcis = MultiCloudImage.find_all.
|
143
|
+
select {|n| n.is_head_version && n.name == mci_name }
|
144
|
+
mci_ids = mcis.map { |m| m.rs_id }
|
145
|
+
@logger.warn("Found multiple MCIs with name #{mci_name}: #{mci_ids.join(', ')}") if mcis.length > 1
|
146
|
+
if mcis.length > 0
|
147
|
+
existing_mci = MultiCloudImageInternal.find(mcis.first.rs_id.to_i)
|
148
|
+
end
|
149
|
+
else
|
150
|
+
# Double filter, find_with_filter is a wildcard ended match
|
151
|
+
# Also revision 0 is HEAD
|
152
|
+
#update_connection_settings(McMultiCloudImage)
|
153
|
+
mcis = McMultiCloudImage.
|
154
|
+
find_with_filter(:name=>mci_name).
|
155
|
+
select {|mci| mci.name == mci_name}.
|
156
|
+
select {|mci| mci.revision == 0}
|
157
|
+
@logger.warn("Found multiple MCIs with name #{mci_name}") if mcis.length > 1
|
158
|
+
existing_mci = mcis.first
|
159
|
+
end
|
160
|
+
|
161
|
+
@logger.info("Found mci #{existing_mci.rs_id}") if existing_mci
|
162
|
+
existing_mci
|
163
|
+
end
|
164
|
+
|
165
|
+
def create_mci(cloud_id, mci_name, description = nil)
|
166
|
+
description ||= default_description(mci_name, api_version(cloud_id) == "1.0")
|
167
|
+
@logger.info("Creating mci #{mci_name}")
|
168
|
+
mci = nil
|
169
|
+
|
170
|
+
#update_connection_settings(MultiCloudImageInternal)
|
171
|
+
mci = MultiCloudImageInternal.create(
|
172
|
+
:name => mci_name,
|
173
|
+
:description => description)
|
174
|
+
|
175
|
+
raise "Could not create MCI" unless mci
|
176
|
+
mci
|
177
|
+
end
|
178
|
+
|
179
|
+
def add_rightlink_tag(mci)
|
180
|
+
tag = "provides:rs_agent_type=right_link"
|
181
|
+
add_tag_to_mci(mci, tag)
|
182
|
+
end
|
183
|
+
|
184
|
+
# mci(MultiCloudImageInternal):: the MCI to add the tag to
|
185
|
+
# Tag an mci or raise an error on failure
|
186
|
+
def add_tag_to_mci(mci, tag)
|
187
|
+
begin
|
188
|
+
@logger.info "Adding tag #{tag} to #{mci.href}"
|
189
|
+
href = mci.href
|
190
|
+
result = Tag.set(href, ["#{tag}"])
|
191
|
+
#update_connection_settings(Tag)
|
192
|
+
@logger.debug("Successfully tagged MCI. Code: #{result.code}")
|
193
|
+
rescue Exception => e
|
194
|
+
@logger.error("Failed to tag MCI #{mci.name}! #{e.inspect}")
|
195
|
+
raise e
|
196
|
+
end
|
197
|
+
end
|
198
|
+
|
199
|
+
def api_version(cloud_id)
|
200
|
+
cloud_id.to_i < 50 ? "1.0" : "1.5"
|
201
|
+
end
|
202
|
+
|
203
|
+
end
|
204
|
+
end
|
data/spec/mci_spec.rb
ADDED
@@ -0,0 +1,97 @@
|
|
1
|
+
require 'flexmock/rspec'
|
2
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
3
|
+
|
4
|
+
describe RightImageTools::MCI do
|
5
|
+
|
6
|
+
before :each do
|
7
|
+
@mci = RightImageTools::MCI.new
|
8
|
+
|
9
|
+
@mock_mci_name = "Mock_RightImage_Ubuntu_10.04_x64_v5.7"
|
10
|
+
@mock_ami = "ami-2ehahaha"
|
11
|
+
|
12
|
+
@mock_mci = flexmock(MultiCloudImage,
|
13
|
+
:is_head_version => true,
|
14
|
+
:name => @mock_mci_name,
|
15
|
+
:rs_id => "10000",
|
16
|
+
:version=>0,
|
17
|
+
:href=>"https://my.rightscale.com/api/acct/99999/multi_cloud_images/10000")
|
18
|
+
|
19
|
+
@mock_mci_setting1 = flexmock(MultiCloudImageCloudSettingInternal,
|
20
|
+
:href=>"https://my.rightscale.com/api/acct/99999/multi_cloud_image_cloud_settings/20000",
|
21
|
+
:aws_instance_type =>"m1.large",
|
22
|
+
:image_name => @mock_mci_name,
|
23
|
+
:image_href => "https://my.rightscale.com/api/acct/0/ec2_images/#{@mock_ami}?cloud_id=5",
|
24
|
+
:cloud_id=>5,
|
25
|
+
:cloud=>"AWS AP-Tokyo")
|
26
|
+
|
27
|
+
@mock_mci_i = flexmock(MultiCloudImageInternal,
|
28
|
+
:is_head_version => @mock_mci.is_head_version,
|
29
|
+
:name=>@mock_mci.name,
|
30
|
+
:rs_id => @mock_mci.rs_id,
|
31
|
+
:version=>@mock_mci.version,
|
32
|
+
:href=>@mock_mci.href,
|
33
|
+
:multi_cloud_image_cloud_settings=>[@mock_mci_setting1])
|
34
|
+
end
|
35
|
+
|
36
|
+
# it "finds a MCI for gateway cloud (cloudstack)" do
|
37
|
+
# pending "TODO"
|
38
|
+
# end
|
39
|
+
# it "creates a MCI for gateway cloud (cloudstack)" do
|
40
|
+
# pending "TODO"
|
41
|
+
# end
|
42
|
+
# it "associates an image for a gateway cloud (cloudstack)" do
|
43
|
+
# pending "TODO"
|
44
|
+
# end
|
45
|
+
# it "replaces an image association for a gateway cloud (cloudstack)" do
|
46
|
+
# pending "TODO"
|
47
|
+
# end
|
48
|
+
#
|
49
|
+
it "finds a MCI for EC2 cloud" do
|
50
|
+
flexmock(MultiCloudImage).should_receive(:find_all).and_return([@mock_mci])
|
51
|
+
flexmock(MultiCloudImageInternal).should_receive(:find).with(10000).and_return(@mock_mci_i)
|
52
|
+
|
53
|
+
@mci.find_mci(6, @mock_mci_name).rs_id.should == "10000"
|
54
|
+
end
|
55
|
+
it "creates a MCI for EC2 mock cloud" do
|
56
|
+
flexmock(MultiCloudImageInternal).should_receive(:create).with(
|
57
|
+
:name=>@mock_mci_name,
|
58
|
+
:description => "blah"
|
59
|
+
).and_return(flexmock(MultiCloudImageInternal))
|
60
|
+
@mci.create_mci(6, @mock_mci_name, "blah")
|
61
|
+
end
|
62
|
+
|
63
|
+
it "associates an image to an EC2 cloud" do
|
64
|
+
flexmock(MultiCloudImage).should_receive(:find_all).and_return([@mock_mci])
|
65
|
+
flexmock(MultiCloudImageInternal).should_receive(:find).with(10000).and_return(@mock_mci_i)
|
66
|
+
flexmock(Tag).should_receive(:set).and_return(flexmock(Tag, :code=>"204"))
|
67
|
+
flexmock(MultiCloudImageCloudSettingInternal).should_receive(:create)
|
68
|
+
|
69
|
+
@mci.add_image_to_mci(
|
70
|
+
:cloud_id=>6,
|
71
|
+
:name=>@mock_mci_name,
|
72
|
+
:image_id=>"ami-b1ahb1ah")
|
73
|
+
end
|
74
|
+
|
75
|
+
it "replaces an image association for an EC2 cloud" do
|
76
|
+
flexmock(MultiCloudImage).should_receive(:find_all).and_return([@mock_mci])
|
77
|
+
flexmock(MultiCloudImageInternal).should_receive(:find).with(10000).and_return(@mock_mci_i)
|
78
|
+
flexmock(Tag).should_receive(:set).and_return(flexmock(Tag, :code=>"204"))
|
79
|
+
flexmock(MultiCloudImageCloudSettingInternal).should_receive(:destroy).and_return(flexmock("Response",:code=>"200"))
|
80
|
+
flexmock(MultiCloudImageCloudSettingInternal).should_receive(:create)
|
81
|
+
|
82
|
+
@mci.add_image_to_mci(
|
83
|
+
:cloud_id=>5,
|
84
|
+
:name=>@mock_mci_name,
|
85
|
+
:image_id=>"ami-b1ahb1ah")
|
86
|
+
end
|
87
|
+
|
88
|
+
it "sets a default description correctly" do
|
89
|
+
flexmock(MultiCloudImageInternal).should_receive(:create).with(
|
90
|
+
:name=>@mock_mci_name,
|
91
|
+
:description => "Development build: Ubuntu 10.04 with 64-bit architecture (x64) and RightLink 5.7."
|
92
|
+
).and_return(@mock_mci)
|
93
|
+
|
94
|
+
@mci.create_mci(5, @mock_mci_name)
|
95
|
+
end
|
96
|
+
|
97
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
3
|
+
require 'rspec'
|
4
|
+
require 'rightimage_tools'
|
5
|
+
|
6
|
+
|
7
|
+
# Requires supporting files with custom matchers and macros, etc,
|
8
|
+
# in ./support/ and its subdirectories.
|
9
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
10
|
+
|
11
|
+
RSpec.configure do |config|
|
12
|
+
config.mock_with :flexmock
|
13
|
+
end
|
metadata
ADDED
@@ -0,0 +1,180 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rightimage_tools
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 0
|
10
|
+
version: 0.1.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Peter Schroeter
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2012-02-07 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
22
|
+
none: false
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
hash: 3
|
27
|
+
segments:
|
28
|
+
- 0
|
29
|
+
version: "0"
|
30
|
+
requirement: *id001
|
31
|
+
prerelease: false
|
32
|
+
name: rest_connection
|
33
|
+
type: :runtime
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
36
|
+
none: false
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
hash: 3
|
41
|
+
segments:
|
42
|
+
- 0
|
43
|
+
version: "0"
|
44
|
+
requirement: *id002
|
45
|
+
prerelease: false
|
46
|
+
name: ruby-debug
|
47
|
+
type: :runtime
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
hash: 3
|
55
|
+
segments:
|
56
|
+
- 2
|
57
|
+
- 3
|
58
|
+
- 0
|
59
|
+
version: 2.3.0
|
60
|
+
requirement: *id003
|
61
|
+
prerelease: false
|
62
|
+
name: rspec
|
63
|
+
type: :development
|
64
|
+
- !ruby/object:Gem::Dependency
|
65
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
66
|
+
none: false
|
67
|
+
requirements:
|
68
|
+
- - ~>
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
hash: 23
|
71
|
+
segments:
|
72
|
+
- 1
|
73
|
+
- 0
|
74
|
+
- 0
|
75
|
+
version: 1.0.0
|
76
|
+
requirement: *id004
|
77
|
+
prerelease: false
|
78
|
+
name: bundler
|
79
|
+
type: :development
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
82
|
+
none: false
|
83
|
+
requirements:
|
84
|
+
- - ~>
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
hash: 7
|
87
|
+
segments:
|
88
|
+
- 1
|
89
|
+
- 6
|
90
|
+
- 4
|
91
|
+
version: 1.6.4
|
92
|
+
requirement: *id005
|
93
|
+
prerelease: false
|
94
|
+
name: jeweler
|
95
|
+
type: :development
|
96
|
+
- !ruby/object:Gem::Dependency
|
97
|
+
version_requirements: &id006 !ruby/object:Gem::Requirement
|
98
|
+
none: false
|
99
|
+
requirements:
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
hash: 3
|
103
|
+
segments:
|
104
|
+
- 0
|
105
|
+
version: "0"
|
106
|
+
requirement: *id006
|
107
|
+
prerelease: false
|
108
|
+
name: rcov
|
109
|
+
type: :development
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
version_requirements: &id007 !ruby/object:Gem::Requirement
|
112
|
+
none: false
|
113
|
+
requirements:
|
114
|
+
- - ">="
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
hash: 3
|
117
|
+
segments:
|
118
|
+
- 0
|
119
|
+
version: "0"
|
120
|
+
requirement: *id007
|
121
|
+
prerelease: false
|
122
|
+
name: flexmock
|
123
|
+
type: :development
|
124
|
+
description: A set of tools to support the building of RightImages
|
125
|
+
email: peter.schroeter@rightscale.com
|
126
|
+
executables: []
|
127
|
+
|
128
|
+
extensions: []
|
129
|
+
|
130
|
+
extra_rdoc_files:
|
131
|
+
- LICENSE.txt
|
132
|
+
- README.rdoc
|
133
|
+
files:
|
134
|
+
- .document
|
135
|
+
- .rspec
|
136
|
+
- Gemfile
|
137
|
+
- Gemfile.lock
|
138
|
+
- LICENSE.txt
|
139
|
+
- README.rdoc
|
140
|
+
- Rakefile
|
141
|
+
- VERSION
|
142
|
+
- lib/mci.rb
|
143
|
+
- lib/rightimage_tools.rb
|
144
|
+
- spec/mci_spec.rb
|
145
|
+
- spec/spec_helper.rb
|
146
|
+
homepage: http://github.com/rightscale/rightimage_tools
|
147
|
+
licenses:
|
148
|
+
- MIT
|
149
|
+
post_install_message:
|
150
|
+
rdoc_options: []
|
151
|
+
|
152
|
+
require_paths:
|
153
|
+
- lib
|
154
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
155
|
+
none: false
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
hash: 3
|
160
|
+
segments:
|
161
|
+
- 0
|
162
|
+
version: "0"
|
163
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
164
|
+
none: false
|
165
|
+
requirements:
|
166
|
+
- - ">="
|
167
|
+
- !ruby/object:Gem::Version
|
168
|
+
hash: 3
|
169
|
+
segments:
|
170
|
+
- 0
|
171
|
+
version: "0"
|
172
|
+
requirements: []
|
173
|
+
|
174
|
+
rubyforge_project:
|
175
|
+
rubygems_version: 1.8.10
|
176
|
+
signing_key:
|
177
|
+
specification_version: 3
|
178
|
+
summary: A set of tools to support the building of RightImages
|
179
|
+
test_files: []
|
180
|
+
|