rolypoly 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -0
- data/lib/rolypoly/role_gatekeeper.rb +4 -9
- data/lib/rolypoly/version.rb +1 -1
- data/rolypoly.gemspec +0 -1
- metadata +3 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1edb5688538c2b284ffedf79a379a70e92073484
|
4
|
+
data.tar.gz: b1e672c8bb90ce9b2061a4ffb3c3aa93f9696865
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1fdab74446c185aff377f3cb4ef238cea5ff23237001d4401d11ceb34b102ffa16d2661272084a42e04b992011e074dcd296920a4ed7e17ff04e5927eeab6f5e
|
7
|
+
data.tar.gz: 54e68d95397017a05f272ef9d708d808d4f8c2c456f8b81d6837e9f4ab2e81f649bf9f6a31661d811a5e3094393c73125a1accf5af8ac85f6de061396445fe71
|
data/.travis.yml
ADDED
@@ -86,17 +86,12 @@ module Rolypoly
|
|
86
86
|
return true unless require_resource?
|
87
87
|
return false unless check_role.respond_to?(:resource?)
|
88
88
|
|
89
|
-
|
90
|
-
|
91
|
-
check_role.resource?(r)
|
92
|
-
end
|
93
|
-
else
|
94
|
-
check_role.resource?(required_resource)
|
95
|
-
end
|
89
|
+
required_resources = type_id_resource?(required_resource) ? [required_resource] : Array(required_resource)
|
90
|
+
required_resources.any? {|r| check_role.resource?(r) }
|
96
91
|
end
|
97
92
|
|
98
|
-
private def
|
99
|
-
|
93
|
+
private def type_id_resource?(required_resource)
|
94
|
+
required_resource.is_a?(Array) && %w(String Symbol).include?(required_resource.first.class.name)
|
100
95
|
end
|
101
96
|
|
102
97
|
private def find_required_resource(options = {})
|
data/lib/rolypoly/version.rb
CHANGED
data/rolypoly.gemspec
CHANGED
@@ -18,7 +18,6 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_development_dependency "bundler", "~> 1.8"
|
22
21
|
spec.add_development_dependency "rake"
|
23
22
|
spec.add_development_dependency "rspec"
|
24
23
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rolypoly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Phenow
|
@@ -9,22 +9,8 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-10-
|
12
|
+
date: 2017-10-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
|
-
- !ruby/object:Gem::Dependency
|
15
|
-
name: bundler
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
requirements:
|
18
|
-
- - "~>"
|
19
|
-
- !ruby/object:Gem::Version
|
20
|
-
version: '1.8'
|
21
|
-
type: :development
|
22
|
-
prerelease: false
|
23
|
-
version_requirements: !ruby/object:Gem::Requirement
|
24
|
-
requirements:
|
25
|
-
- - "~>"
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
version: '1.8'
|
28
14
|
- !ruby/object:Gem::Dependency
|
29
15
|
name: rake
|
30
16
|
requirement: !ruby/object:Gem::Requirement
|
@@ -65,6 +51,7 @@ files:
|
|
65
51
|
- ".rspec"
|
66
52
|
- ".ruby-gemset"
|
67
53
|
- ".ruby-version"
|
54
|
+
- ".travis.yml"
|
68
55
|
- Gemfile
|
69
56
|
- LICENSE.txt
|
70
57
|
- README.md
|