gennaro 0.3.5 → 0.3.6

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: 5f541cd6e130743a5228509f69b4893924a27212
4
- data.tar.gz: faf4291c97a5d182b32c36963c1ec43620ba9a33
3
+ metadata.gz: 0feaf7039090decd2eadb3f002828c3cbf18bba0
4
+ data.tar.gz: 669b21a4f09f66b76cf87811302e56bb8de8e4f2
5
5
  SHA512:
6
- metadata.gz: d730423112e177b8d91558269ac271c3f548f07255b7613f5686420fad532736629f36ccb58e182bcbee6cdcfeb8e3f3a760abac4875063262166e77ac3e6b39
7
- data.tar.gz: 7dad55facca5ad8e637abdf8c40b02e0cb4f49a44418a8413a1db33a99ebba96452b9066977f1498c24f4163a55a4be3710f3a15f80640a22095d888c7a8db62
6
+ metadata.gz: af718ba64a9c71d6dd1ca0a10edb3af50ff13d8065f9f31763aed544aa3a04a0c20ace92828e0e7d767a86b62eb2a6713600087cf42b70085a1658188397beb2
7
+ data.tar.gz: f42fe4fa5ce91a9c5c08471592260d17f727ab7d8fb88a67cd9139e3f217f017f1a770b029e9c2e45e43a48a7c8c11771f422f75e35e152af4da544fb60b26d2
@@ -10,6 +10,6 @@
10
10
 
11
11
  class Gennaro
12
12
  def self.version
13
- '0.3.5'
13
+ '0.3.6'
14
14
  end
15
15
  end
@@ -79,7 +79,7 @@ class ${ClassName}
79
79
  level = User.empty? ? User.founder : User.user
80
80
  user = User.signup params[:username], params[:email], params[:password], level
81
81
  if user.errors.any?
82
- @error = user.errors.first
82
+ @error = user.errors.first.first
83
83
  else
84
84
  @success = 'Sign up successful.'
85
85
  end
@@ -118,7 +118,7 @@ class ${ClassName}
118
118
  post '/user/change_level/?' do
119
119
  if not logged_in?
120
120
  @error = 'You need to log in.'
121
- elsif not current_user.staff?
121
+ elsif not current_user.high_staff?
122
122
  @error = 'Go home, this is not a place for you.'
123
123
  elsif fields? :username, :go
124
124
  @user = User.get params[:username]
@@ -126,8 +126,7 @@ class ${ClassName}
126
126
  elsif not fields? :username, :level
127
127
  @error = 'To change a user level, you need to send his username and level.'
128
128
  else
129
- user = User.get params[:username]
130
-
129
+ user = User.get params[:username]
131
130
  level = case params[:level]
132
131
  when 'banned' then User.banned
133
132
  when 'founder' then User.founder
@@ -63,9 +63,15 @@ class User
63
63
  false
64
64
  end
65
65
 
66
+ def high_staff?
67
+ founder? || admin?
68
+ end
69
+ alias_method :high_staffer?, :high_staff?
70
+
66
71
  def staff?
67
72
  founder? || admin? || smod? || mod?
68
73
  end
74
+ alias_method :staffer?, :staff?
69
75
 
70
76
  def logged?(session)
71
77
  self.session == session
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gennaro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Giovanni Capuano