guachiman 0.0.2 → 0.0.3

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: bb461ee01dde450aef11c476682464abbadc3bea
4
- data.tar.gz: 946f2fa5afb0ac8c04ca70bea40a555d8ad59c9c
3
+ metadata.gz: 0349ed86b960d1beed7f5504f4314bfe0c769ee5
4
+ data.tar.gz: 7567d0bf34e585ddcf44680fde8b237749832bf7
5
5
  SHA512:
6
- metadata.gz: c595ce58306613c4716d44a905e8b604313be6d8d8761bcb9b717df24099520aac0ae0d2c0666354518fb555fd43b5a86e626a2dff5052d97d720bda8277a20d
7
- data.tar.gz: 819f6bb872bec38d9e14d174496a1ba6fb0316a4f201fd3274a53bb6005b0044debe191f8d686d843add2fd5e343384286d5919961ea13738e89232af924a1a9
6
+ metadata.gz: 9d8d0dea24c0cba54bc58e44115e209f68699b240c724ebacb3980af8de9dba0e47651bd24933094e88de42c69c70c415a47f179d1f4b269683e8c7cdbbe08d9
7
+ data.tar.gz: c364758e4b3a5afd20ea2c2690f4fa34e6ac6b3e5a239a2c6c7037541636faf66d49c7a300fe8570d07b0f7e15f5c848d26ab289d041b5e7ff6d82d652e4f032
@@ -1,4 +1,12 @@
1
1
  class Permission
2
2
  include Guachiman::Permissions
3
3
  # include Guachiman::Params
4
+
5
+ def initialize user
6
+ if user
7
+ if user.admin?
8
+ allow_all!
9
+ end
10
+ end
11
+ end
4
12
  end
@@ -1,3 +1,3 @@
1
1
  module Guachiman
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
@@ -10,6 +10,7 @@ class InstallGeneratorTest < Rails::Generators::TestCase
10
10
  setup :prepare_destination
11
11
 
12
12
  def prepare_destination
13
+ FileUtils.rm_r "#{DESTINATION}/app"
13
14
  FileUtils.mkdir_p "#{DESTINATION}/app"
14
15
  FileUtils.mkdir_p "#{DESTINATION}/app/models"
15
16
  end
@@ -17,8 +18,11 @@ class InstallGeneratorTest < Rails::Generators::TestCase
17
18
  test 'create permission' do
18
19
  run_generator
19
20
 
20
- assert_file 'app/models/permission.rb', /Permission/
21
- assert_file 'app/models/permission.rb', /Guachiman::Permissions/
22
- assert_file 'app/models/permission.rb', /Guachiman::Params/
21
+ assert_file 'app/models/permission.rb' do |f|
22
+ assert_match /class Permission/, f
23
+ assert_match /include Guachiman::Permissions/, f
24
+ assert_match /include Guachiman::Params/, f
25
+ assert_match /initialize user/, f
26
+ end
23
27
  end
24
28
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guachiman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francesco Rodriguez
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-27 00:00:00.000000000 Z
12
+ date: 2013-04-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties