arkaan 0.8.11 → 0.8.12

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 582ae77affc1c3416bb3407251121f5dc3a5caa8
4
- data.tar.gz: 8a88991e5083e8027354e3f3d8d8922bf4cfd712
3
+ metadata.gz: 274d18d1f23d156f2665a5bd1359fe482a0736cd
4
+ data.tar.gz: 0db5765f3a5aec00ea6cbcd9e3f23828ee3a8eb9
5
5
  SHA512:
6
- metadata.gz: f836aaf8df7aa1fafecacb9917fd61355f4929581eadbc318e7c5d1b614978469e47355060ce5932b94ff253399e46cd4ba4d10eefc9b8fd74338f4fc12804a0
7
- data.tar.gz: 2ed179e505eb98b8ee3cea01dc251f47d133deb54c4d48377f4976af76c949509953289e0c266d4a55e3fd3f0963c57ae25013bccd9145c03c2a1d2d88f3ef39
6
+ metadata.gz: 2d8915708a7e1a471ae84c6e8d7201ae742aaa1b524b59d67a7beb9f9b0baa4d4510fc8fbb2d8f4291d9d685c12976138c55c6e1f7be68f97444fd58637018ec
7
+ data.tar.gz: a435fab17ee5dca22cf9a3de9c80b5c825f9aeda6e989cb060183e31c9c5c884d37844e445fb5726ab102c8dd88f14e2ed5ca72eb7b51cd4aeab2ad3a286ac6d
@@ -58,20 +58,20 @@ module Arkaan
58
58
  has_many :created_invitations, class_name: 'Arkaan::Campaigns::Invitation', inverse_of: :creator
59
59
 
60
60
  validates :username,
61
- presence: {message: 'account.username.blank'},
62
- length: {minimum: 6, message: 'account.username.short', if: :username?},
63
- uniqueness: {message: 'account.username.uniq', if: :username?}
61
+ presence: {message: 'required'},
62
+ length: {minimum: 6, message: 'minlength', if: :username?},
63
+ uniqueness: {message: 'uniq', if: :username?}
64
64
 
65
65
  validates :email,
66
- presence: {message: 'account.email.blank'},
67
- format: {with: /\A[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}\z/, message: 'account.email.format', if: :email?},
68
- uniqueness: {message: 'account.email.uniq', if: :email?}
66
+ presence: {message: 'required'},
67
+ format: {with: /\A[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}\z/, message: 'pattern', if: :email?},
68
+ uniqueness: {message: 'uniq', if: :email?}
69
69
 
70
70
  validates :password,
71
- presence: {message: 'account.password.blank', if: ->{ !persisted? || password_digest_changed? }},
72
- confirmation: {message: 'account.password.confirmation', if: :password_digest_changed?}
71
+ presence: {message: 'required', if: ->{ !persisted? || password_digest_changed? }},
72
+ confirmation: {message: 'confirmation', if: :password_digest_changed?}
73
73
 
74
74
  validates :password_confirmation,
75
- presence: {message: 'account.password_confirmation.blank', if: :password_digest_changed?}
75
+ presence: {message: 'required', if: :password_digest_changed?}
76
76
  end
77
77
  end
@@ -17,9 +17,9 @@ module Arkaan
17
17
  belongs_to :account, class_name: 'Arkaan::Account', inverse_of: :sessions
18
18
 
19
19
  validates :token,
20
- presence: {message: 'session.token.blank'},
21
- uniqueness: {message: 'session.token.uniq', if: :token?},
22
- length: {minimum: 10, message: 'session.token.short', if: :token?}
20
+ presence: {message: 'required'},
21
+ uniqueness: {message: 'uniq', if: :token?},
22
+ length: {minimum: 10, message: 'minlength', if: :token?}
23
23
  end
24
24
  end
25
25
  end
@@ -27,15 +27,15 @@ module Arkaan
27
27
  has_many :invitations, class_name: 'Arkaan::Campaigns::Invitation', inverse_of: :campaign
28
28
 
29
29
  validates :title,
30
- presence: {message: 'campaign.title.blank'},
31
- length: {minimum: 4, message: 'campaign.title.short', if: :title?}
30
+ presence: {message: 'required'},
31
+ length: {minimum: 4, message: 'minlength', if: :title?}
32
32
 
33
33
  validate :title_unicity
34
34
 
35
35
  # Adds an error message if the account creating this campaign already has a campaign with the very same name.
36
36
  def title_unicity
37
37
  if creator? && title? && creator.campaigns.where(title: title, :id.ne => _id).exists?
38
- errors.add(:title, 'campaign.title.uniq')
38
+ errors.add(:title, 'uniq')
39
39
  end
40
40
  end
41
41
  end
@@ -14,8 +14,8 @@ module Arkaan
14
14
  field :count, type: Integer, default: 1
15
15
 
16
16
  validates :content,
17
- presence: {message: 'campaign.tag.content.blank'},
18
- uniqueness: {message: 'campaign.tag.content.uniq'}
17
+ presence: {message: 'required'},
18
+ uniqueness: {message: 'uniq'}
19
19
  end
20
20
  end
21
21
  end
@@ -16,9 +16,9 @@ module Arkaan
16
16
  field :diagnostic, type: String, default: '/status'
17
17
 
18
18
  validates :diagnostic,
19
- presence: {message: "#{entity_type}.diagnostic.blank"},
20
- length: {minimum: 4, message: "#{entity_type}.diagnostic.short"},
21
- format: {with: /\A(\/[a-z]+)+\z/, message: "#{entity_type}.diagnostic.format"}
19
+ presence: {message: "required"},
20
+ length: {minimum: 4, message: "minlength"},
21
+ format: {with: /\A(\/[a-z]+)+\z/, message: "pattern"}
22
22
  end
23
23
  end
24
24
  end
@@ -16,10 +16,10 @@ module Arkaan
16
16
  field :slug, type: String
17
17
 
18
18
  validates :slug,
19
- length: {minimum: 4, message: "#{entity_type}.slug.short"},
20
- format: {with: /\A[a-z]+(_[a-z]+)*\z/, message: "#{entity_type}.slug.format"},
21
- uniqueness: {message: "#{entity_type}.slug.uniq"},
22
- presence: {message: "#{entity_type}.slug.blank"}
19
+ length: {minimum: 4, message: 'minlength', if: :slug?},
20
+ format: {with: /\A[a-z]+(_[a-z]+)*\z/, message: 'pattern', if: :slug?},
21
+ uniqueness: {message: 'uniq', if: :slug?},
22
+ presence: {message: 'required'}
23
23
  end
24
24
  end
25
25
  end
@@ -23,16 +23,12 @@ module Arkaan
23
23
  make_diagnosticable 'gateway'
24
24
 
25
25
  validates :url,
26
- presence: {message: 'gateway.url.blank'},
27
- format: {
28
- with: /\A(https?:\/\/)((localhost:[0-9]+)|(([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*))\/?\z/,
29
- message: 'gateway.url.format',
30
- if: :url?
31
- }
26
+ presence: {message: 'required'},
27
+ format: {with: /\A(https?:\/\/)((localhost:[0-9]+)|(([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*))\/?\z/, message: 'pattern', if: :url?}
32
28
 
33
29
  validates :token,
34
- presence: {message: 'gateway.token.blank'},
35
- uniqueness: {message: 'gateway.token.uniq'}
30
+ presence: {message: 'required'},
31
+ uniqueness: {message: 'uniq'}
36
32
  end
37
33
  end
38
34
  end
@@ -21,8 +21,8 @@ module Arkaan
21
21
  embedded_in :service, class_name: 'Arkaan::Monitoring::Service', inverse_of: :instances
22
22
 
23
23
  validates :url,
24
- presence: {message: 'instance.url.blank'},
25
- format: {with: /\A(https?:\/\/)([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?\z/, message: 'instance.url.format', if: :url?}
24
+ presence: {message: 'required'},
25
+ format: {with: /\A(https?:\/\/)([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?\z/, message: 'pattern', if: :url?}
26
26
  end
27
27
  end
28
28
  end
@@ -27,10 +27,10 @@ module Arkaan
27
27
  has_and_belongs_to_many :groups, class_name: 'Arkaan::Permissions::Group', inverse_of: :groups
28
28
 
29
29
  validates :path,
30
- format: {with: /\A(\/|((\/:?[a-zA-Z0-9]+)+))\z/, message: 'route.path.format', if: :path?}
30
+ format: {with: /\A(\/|((\/:?[a-zA-Z0-9]+)+))\z/, message: 'pattern', if: :path?}
31
31
 
32
32
  validates :verb,
33
- inclusion: {message: 'route.verb.unknown', in: ['get', 'post', 'put', 'delete', 'patch', 'option']}
33
+ inclusion: {message: 'unknown', in: ['get', 'post', 'put', 'delete', 'patch', 'option']}
34
34
  end
35
35
  end
36
36
  end
@@ -28,9 +28,9 @@ module Arkaan
28
28
  # @return [Array<Arkaan::Monitoring::Route>] the routes associated to this service, accessible from the gateway.
29
29
  has_many :routes, class_name: 'Arkaan::Monitoring::Route', inverse_of: :service
30
30
 
31
- validates :key, uniqueness: {message: 'service.key.uniq'}
31
+ validates :key, uniqueness: {message: 'uniq'}
32
32
 
33
- validates :path, format: {with: /\A(\/:?[a-z]+)+\z/, message: 'service.path.format'}
33
+ validates :path, format: {with: /\A(\/:?[a-z]+)+\z/, message: 'pattern'}
34
34
  end
35
35
  end
36
36
  end
@@ -17,7 +17,9 @@ module Arkaan
17
17
  # @return [Arkaan::OAuth::Authorization] the authorization code that issued this token to the application for this user.
18
18
  belongs_to :authorization, class_name: 'Arkaan::OAuth::Authorization', inverse_of: :access_token
19
19
 
20
- validates :value, presence: true, uniqueness: true
20
+ validates :value,
21
+ presence: {message: 'required'},
22
+ uniqueness: {message: 'uniq'}
21
23
  end
22
24
  end
23
25
  end
@@ -23,9 +23,14 @@ module Arkaan
23
23
  # @return [Array<Arkaan::OAuth::Authorization>] the authorizations linked to the accounts this application can get the data from.
24
24
  has_many :authorizations, class_name: 'Arkaan::OAuth::Authorization', inverse_of: :application
25
25
 
26
- validates :name, presence: true, length: {minimum: 6}, uniqueness: true
26
+ validates :name,
27
+ presence: {message: 'required'},
28
+ length: {minimum: 6, message: 'minlength'},
29
+ uniqueness: {message: 'uniq'}
27
30
 
28
- validates :key, presence: true, uniqueness: true
31
+ validates :key,
32
+ presence: {message: 'required'},
33
+ uniqueness: {message: 'uniq'}
29
34
  end
30
35
  end
31
36
  end
@@ -20,7 +20,9 @@ module Arkaan
20
20
  # @return [Arkaan::OAuth::AccessToken] the access token used further in the application process to access private data of the account.
21
21
  has_one :token, class_name: 'Arkaan::OAuth::AccessToken', inverse_of: :authorization
22
22
 
23
- validates :code, presence: true, uniqueness: true
23
+ validates :code,
24
+ presence: {message: 'required'},
25
+ uniqueness: {message: 'uniq'}
24
26
  end
25
27
  end
26
28
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arkaan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.11
4
+ version: 0.8.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vincent Courtois