gollum-auth 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5867d2b55705e2b346060eaf138626e937d4862e
4
- data.tar.gz: af8d05dd55933ecf3bc4a87214d41fce69c6e3d7
3
+ metadata.gz: 5cbd79ba09fbb336544e7ef52c1000a385b748c2
4
+ data.tar.gz: d6a259ada4ef14639d287edeaefeb8e9dad93b38
5
5
  SHA512:
6
- metadata.gz: e17eb31adfcc920b856c6bd9f79d02b297954eac6cbf70075dcf5ef91a7dca9d5eb1f15844bdd654351fd2ffd9fd68b5c95900b0848da628cc42142ddcdd345f
7
- data.tar.gz: a43bdaf6d61526b431fbfb3da7b27a69fae027ba81ece03298a3006e1f3be1b4d400f2bd5b14edbba617c5417fee6de703ca903d39286bd2ae8ee87fd1bb14b5
6
+ metadata.gz: adae779482ba1f8b3e5698591658078086132bf1c28d6c5b71cafe9604256f4b984379285940c19c001ab1be29b0fcb26ecc4dd8cade1470955b59285786ec4f
7
+ data.tar.gz: f42ee673c27678a7aadaa42bee5e64ba659dd46f4a02886205cfdeb27c75e15976a6acab34213a7918a208e8b74716a3300b2745a610321ea345c0419e6d8118
data/README.md CHANGED
@@ -45,15 +45,18 @@ require 'rubygems'
45
45
  require 'gollum/auth' # Don't forget to load the gem!
46
46
  require 'gollum/app'
47
47
 
48
- # Define list of authorized users where each must have a "name", "password"
49
- # and "email":
48
+ # Define list of authorized users.
49
+ # Each user must have a username, password, name and email.
50
+ # Example:
50
51
  users = YAML.load %q{
51
52
  ---
52
- - name: Rick Sanchez
53
+ - username: rick
53
54
  password: asdf754&1129-@lUZw
55
+ name: Rick Sanchez
54
56
  email: rick@example.com
55
- - name: Morty Smith
57
+ - username: morty
56
58
  password: 12345
59
+ name: Morty Smith
57
60
  email: morty@example.com
58
61
  }
59
62
 
@@ -5,13 +5,14 @@ module Gollum::Auth
5
5
  class User
6
6
  include ActiveModel::Model
7
7
 
8
- attr_accessor :name, :password, :email
8
+ attr_accessor :username, :password, :name, :email
9
9
 
10
- validates_presence_of :name, :password, :email
10
+ validates_presence_of :username, :password, :name, :email
11
+ validates_format_of :username, with: /\A[\w\.-]+\Z/
11
12
 
12
13
  class << self
13
- def find(name)
14
- all.select { |u| u.name == name }.first
14
+ def find(username)
15
+ all.select { |u| u.username == username }.first
15
16
  end
16
17
 
17
18
  def all
@@ -1,5 +1,5 @@
1
1
  module Gollum
2
2
  module Auth
3
- VERSION = '0.4.0'
3
+ VERSION = '0.5.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gollum-auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Björn Albers
@@ -168,5 +168,5 @@ rubyforge_project:
168
168
  rubygems_version: 2.6.10
169
169
  signing_key:
170
170
  specification_version: 4
171
- summary: gollum-auth-0.4.0
171
+ summary: gollum-auth-0.5.0
172
172
  test_files: []