awsborn 0.9.5 → 0.9.6

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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.5
1
+ 0.9.6
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{awsborn}
8
- s.version = "0.9.5"
8
+ s.version = "0.9.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["David Vrensk", "Jean-Louis Giordano"]
12
- s.date = %q{2012-04-02}
12
+ s.date = %q{2012-04-04}
13
13
  s.description = %q{Awsborn lets you define and launch a server cluster on Amazon EC2.}
14
14
  s.email = %q{david@icehouse.se}
15
15
  s.extra_rdoc_files = [
@@ -58,7 +58,7 @@ Gem::Specification.new do |s|
58
58
  s.homepage = %q{http://github.com/icehouse/awsborn}
59
59
  s.rdoc_options = ["--charset=UTF-8"]
60
60
  s.require_paths = ["lib"]
61
- s.rubygems_version = %q{1.3.7}
61
+ s.rubygems_version = %q{1.6.2}
62
62
  s.summary = %q{Awsborn defines servers as instances with a certain disk volume, which makes it easy to restart missing servers.}
63
63
  s.test_files = [
64
64
  "spec/aws_constants_spec.rb",
@@ -73,7 +73,6 @@ Gem::Specification.new do |s|
73
73
  ]
74
74
 
75
75
  if s.respond_to? :specification_version then
76
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
77
76
  s.specification_version = 3
78
77
 
79
78
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
@@ -7,10 +7,20 @@ module Awsborn
7
7
  @options = options.dup
8
8
  self.host_name = elastic_ip
9
9
  end
10
-
10
+
11
11
  class << self
12
12
  attr_accessor :logger
13
13
 
14
+ def get_class_attr(class_attr)
15
+ if (class_var = instance_variable_get("@#{class_attr}"))
16
+ class_var
17
+ elsif self != ::Awsborn::Server
18
+ superclass.send(class_attr)
19
+ else
20
+ nil
21
+ end
22
+ end
23
+
14
24
  # Set image_id. Examples:
15
25
  # image_id 'ami-123123'
16
26
  # image_id 'ami-123123', :sudo_user => 'ubuntu'
@@ -20,35 +30,35 @@ module Awsborn
20
30
  @image_id = args.first
21
31
  @sudo_user = args.last[:sudo_user] if args.last.is_a?(Hash)
22
32
  end
23
- @image_id
33
+ get_class_attr(:image_id)
24
34
  end
25
35
  def instance_type (*args)
26
36
  @instance_type = args.first unless args.empty?
27
- @instance_type
37
+ get_class_attr(:instance_type)
28
38
  end
29
39
  def security_group (*args)
30
40
  @security_group = args unless args.empty?
31
- @security_group
41
+ get_class_attr(:security_group)
32
42
  end
33
43
  def individual_security_group (*args)
34
44
  @individual_security_group = args.first unless args.empty?
35
- @individual_security_group
45
+ get_class_attr(:individual_security_group)
36
46
  end
37
47
  def keys (*args)
38
48
  @keys = args unless args.empty?
39
- @keys
49
+ get_class_attr(:keys)
40
50
  end
41
51
  def sudo_user (*args)
42
52
  @sudo_user = args.first unless args.empty?
43
- @sudo_user
53
+ get_class_attr(:sudo_user)
44
54
  end
45
55
  def bootstrap_script (*args)
46
56
  @bootstrap_script = args.first unless args.empty?
47
- @bootstrap_script
57
+ get_class_attr(:bootstrap_script)
48
58
  end
49
59
  def monitor (*args)
50
60
  @monitor = args.first unless args.empty?
51
- @monitor
61
+ get_class_attr(:monitor)
52
62
  end
53
63
 
54
64
  def cluster (name = ServerCluster.next_name, &block)
@@ -45,6 +45,9 @@ describe Awsborn::Server do
45
45
  server = BigAndSmallServer.new :sample, :zone => :eu_west_1a, :disk => {:sdf => "vol-a"}, :instance_type => :m1_large
46
46
  server.image_id.should == 'ami-big'
47
47
  end
48
+ it "should be inherited by subclasses" do
49
+ Class.new(SampleServer).image_id.should == 'ami-2fc2e95b'
50
+ end
48
51
  end
49
52
 
50
53
  describe "running?" do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awsborn
3
3
  version: !ruby/object:Gem::Version
4
- hash: 49
5
- prerelease: false
4
+ hash: 55
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 5
10
- version: 0.9.5
9
+ - 6
10
+ version: 0.9.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - David Vrensk
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2012-04-02 00:00:00 +02:00
19
+ date: 2012-04-04 00:00:00 +02:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -174,7 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
174
174
  requirements: []
175
175
 
176
176
  rubyforge_project:
177
- rubygems_version: 1.3.7
177
+ rubygems_version: 1.6.2
178
178
  signing_key:
179
179
  specification_version: 3
180
180
  summary: Awsborn defines servers as instances with a certain disk volume, which makes it easy to restart missing servers.