openstack_activeresource 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.2
1
+ 0.3.3
@@ -33,9 +33,14 @@ module OpenStack
33
33
  attribute :description, :string
34
34
  end
35
35
 
36
- validates :enabled, :inclusion => {:in => [true, false]}
37
- validates :name, :format => {:with => /\A\w[\w\s]+\w\Z/}
38
- validates :description, :format => {:with => /\A[\w\s\.\-:@+,'"]+\Z/}
36
+ validates :enabled,
37
+ :presence => true,
38
+ :inclusion => {:in => [true, false], :allow_blank => true}
39
+ validates :name,
40
+ :presence => true,
41
+ :format => {:with => /\A\w[\w\s]+\w\Z/, :allow_blank => true}
42
+ validates :description,
43
+ :format => {:with => /\A[\w\s\.\-:@+,'"]+\Z/, :allow_blank => true}
39
44
 
40
45
  def initialize(params = {}, persisted = false) #:notnew:
41
46
  super(params, persisted)
@@ -37,13 +37,20 @@ module OpenStack
37
37
  attribute :tenant_id, :string
38
38
  end
39
39
 
40
- validates :name, :presence => true
41
- validates_length_of :name, :minimum => 4
42
- validates_format_of :name, :with => /\A[0-9a-z_]+\Z/i
43
- validates_format_of :password, :with => /(?=.*[\d\W])/, :message => :must_contain_at_least_one_digit_or_one_special_character
44
- validates_length_of :password, :minimum => 8
45
- validates_format_of :email, :with => /\A[-a-z0-9_+\.]+\@([-a-z0-9]+\.)+[a-z0-9]{2,4}\Z/i
46
- validates :enabled, :presence => true, :inclusion => {:in => [true, false]}
40
+ validates :name,
41
+ :presence => true,
42
+ :length => {:minimum => 4, :allow_blank => true},
43
+ :format => {:with => /\A[0-9a-z_]+\Z/i, :allow_blank => true}
44
+ validates :password,
45
+ :presence => true,
46
+ :format => {:with => /(?=.*[\d\W])/, :message => :must_contain_at_least_one_digit_or_one_special_character, :allow_blank => true},
47
+ :length => {:minimum => 8, :allow_blank => true}
48
+ validates :email,
49
+ :presence => true,
50
+ :formate => {:with => /\A[-a-z0-9_+\.]+\@([-a-z0-9]+\.)+[a-z0-9]{2,4}\Z/i, :allow_blank => true}
51
+ validates :enabled,
52
+ :presence => true,
53
+ :inclusion => {:in => [true, false], :allow_blank => true}
47
54
 
48
55
  def initialize(attributes = {}, persisted = false) #:notnew:
49
56
  attributes = attributes.with_indifferent_access
@@ -29,8 +29,12 @@ module OpenStack
29
29
  attribute :tenant_id, :string
30
30
  end
31
31
 
32
- validates :username, :presence => true, :unless => Proc.new { token.present? }
33
- validates :password, :presence => true, :unless => Proc.new { token.present? }
32
+ validates :username,
33
+ :presence => true,
34
+ :unless => Proc.new { token.present? }
35
+ validates :password,
36
+ :presence => true,
37
+ :unless => Proc.new { token.present? }
34
38
 
35
39
  def initialize(attributes = {}, persisted = false) #:notnew:
36
40
  attributes[:username] ||= ""
@@ -39,11 +39,22 @@ module OpenStack
39
39
  attribute :ephemeral_disk, :integer
40
40
  end
41
41
 
42
- validates :name, :presence => true, :format => {:with => /\A[\w\.\-]+\Z/}, :length => {:minimum => 2, :maximum => 255}
43
- validates :ram, :presence => true, :numericality => {:greater_than_or_equal_to => 1, :only_integer => true}
44
- validates :vcpus, :presence => true, :numericality => {:greater_than_or_equal_to => 1, :only_integer => true}
45
- validates :disk, :presence => true, :numericality => {:greater_than_or_equal_to => 10, :only_integer => true}
46
- validates :ephemeral_disk, :presence => false, :numericality => {:greater_than_or_equal_to => 10, :only_integer => true}
42
+ validates :name,
43
+ :presence => true,
44
+ :format => {:with => /\A[\w\.\-]+\Z/, :allow_blank => true},
45
+ :length => {:minimum => 2, :maximum => 255, :allow_blank => true}
46
+ validates :ram,
47
+ :presence => true,
48
+ :numericality => {:greater_than_or_equal_to => 1, :only_integer => true, :allow_blank => true}
49
+ validates :vcpus,
50
+ :presence => true,
51
+ :numericality => {:greater_than_or_equal_to => 1, :only_integer => true, :allow_blank => true}
52
+ validates :disk,
53
+ :presence => true,
54
+ :numericality => {:greater_than_or_equal_to => 10, :only_integer => true, :allow_blank => true}
55
+ validates :ephemeral_disk,
56
+ :presence => false,
57
+ :numericality => {:greater_than_or_equal_to => 10, :only_integer => true}
47
58
 
48
59
  # Returns a list of Flavor for a given name
49
60
  #
@@ -42,11 +42,16 @@ module OpenStack
42
42
  attribute :project_id, :string
43
43
  end
44
44
 
45
- validates :bridge, :format => {:with => /\A[a-z][a-z0-9]{1,8}\Z/i}
46
- validates :bridge_interface, :format => {:with => /\A[a-z]{1,5}[a-z0-9]{1,5}(\.[0-9]{1,4})?\Z/i}
45
+ validates :bridge,
46
+ :format => {:with => /\A[a-z][a-z0-9]{1,8}\Z/i}
47
+ validates :bridge_interface,
48
+ :format => {:with => /\A[a-z]{1,5}[a-z0-9]{1,5}(\.[0-9]{1,4})?\Z/i}
47
49
  validates :cidr, :presence => true
48
- validates :label, :presence => true, :format => {:with => /\A[\w\s\d]{1,20}\Z/i}
49
- validates :vlan, :presence => true, :numericality => {:greater_than_or_equal_to => 2, :less_than_or_equal_to => 4096}
50
+ validates :label, :presence => true,
51
+ :format => {:with => /\A[\w\s\d]{1,20}\Z/i}
52
+ validates :vlan,
53
+ :presence => true,
54
+ :numericality => {:greater_than_or_equal_to => 2, :less_than_or_equal_to => 4096, :allow_blank => true}
50
55
 
51
56
  end
52
57
 
@@ -35,8 +35,10 @@ module OpenStack
35
35
  attribute :description, :string
36
36
  end
37
37
 
38
- validates :name, :presence => true
39
- validates :description, :presence => true
38
+ validates :name,
39
+ :presence => true
40
+ validates :description,
41
+ :presence => true
40
42
 
41
43
  end
42
44
 
@@ -52,9 +52,14 @@ module OpenStack
52
52
  attribute :key_pair_id, :string
53
53
  end
54
54
 
55
- validates :name, :format => {:with => /\A[\w\.\-\_]{2,}\Z/}, :length => {:maximum => 255}
56
- validates :image, :presence => true
57
- validates :flavor, :presence => true
55
+ validates :name,
56
+ :presence => true,
57
+ :format => {:with => /\A[\w\.\-\_]{2,}\Z/, :allow_blank => true},
58
+ :length => {:maximum => 255}
59
+ validates :image,
60
+ :presence => true
61
+ validates :flavor,
62
+ :presence => true
58
63
 
59
64
  # Return the list of server for a given tenant
60
65
  #
@@ -34,9 +34,13 @@ module OpenStack
34
34
  attribute :server_id, :string
35
35
  end
36
36
 
37
- validates :device, :presence => true, :format => {:with => /\A[\/\\a-zA-Z0-9]+\Z/}
38
- validates :volume, :presence => true
39
- validates :server, :presence => true
37
+ validates :device,
38
+ :presence => true,
39
+ :format => {:with => /\A[\/\\a-zA-Z0-9]+\Z/, :allow_blank => true}
40
+ validates :volume,
41
+ :presence => true
42
+ validates :server,
43
+ :presence => true
40
44
 
41
45
  def initialize(attributes = {}, persisted = false) #:notnew:
42
46
  attributes = attributes.with_indifferent_access
@@ -65,7 +69,7 @@ module OpenStack
65
69
 
66
70
  # Overloads ActiveRecord::encode method
67
71
  def encode(options={}) #:nodoc:
68
- # Custom encoding to deal with openstack API
72
+ # Custom encoding to deal with openstack API
69
73
  to_encode = {
70
74
  VolumeAttachment.element_name => {
71
75
  :device => device,
@@ -43,8 +43,13 @@ module OpenStack
43
43
 
44
44
  alias_attribute :name, :display_name
45
45
 
46
- validates :display_name, :presence => true, :format => {:with => /\A[\w\.\-]+\Z/}, :length => {:minimum => 2, :maximum => 255}
47
- validates :size, :presence => true, :numericality => {:greater_than_or_equal_to => 1, :only_integer => true}
46
+ validates :display_name,
47
+ :presence => true,
48
+ :format => {:with => /\A[\w\.\-]+\Z/, :allow_blank => true},
49
+ :length => {:minimum => 2, :maximum => 255, :allow_blank => true}
50
+ validates :size,
51
+ :presence => true,
52
+ :numericality => {:greater_than_or_equal_to => 1, :only_integer => true, :allow_blank => true}
48
53
 
49
54
  def initialize(attributes = {}, persisted = false) #:notnew:
50
55
  attributes = attributes.with_indifferent_access
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "openstack_activeresource"
8
- s.version = "0.3.2"
8
+ s.version = "0.3.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Davide Guerri"]
12
- s.date = "2013-02-17"
12
+ s.date = "2013-02-18"
13
13
  s.description = "OpenStack Ruby and RoR bindings implemented with ActiveResource - See also http://www.unicloud.it"
14
14
  s.email = "d.guerri@rd.unidata.it"
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openstack_activeresource
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-17 00:00:00.000000000 Z
12
+ date: 2013-02-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activemodel
@@ -228,7 +228,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
228
228
  version: '0'
229
229
  segments:
230
230
  - 0
231
- hash: 4393919038669507967
231
+ hash: -4030906719901189313
232
232
  required_rubygems_version: !ruby/object:Gem::Requirement
233
233
  none: false
234
234
  requirements: