policy 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/.travis.yml +2 -2
- data/Gemfile +1 -3
- data/README.md +2 -2
- data/Rakefile +7 -2
- data/lib/policy/version.rb +1 -1
- data/policy.gemspec +19 -17
- data/spec/spec_helper.rb +2 -2
- metadata +12 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 707dc12513a50ae6567790a05ea8ab848f7055e0
|
4
|
+
data.tar.gz: f28991b4dad44e835bfa43790b49fa3798a64921
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ffe5458110d6d8fd68558fe42018f9c3ad27559f1444ded2cd1b0e46b3d7ac0938b68b8bbec5326ef0cbd58ea887e3571c48f64ee1397a82e4965be5c1a83bba
|
7
|
+
data.tar.gz: cbe8335492c764aeaf6477470b848ecf4b3f21bf211681fcd06be7a3e05c430092fba3d9cd4f969f7edd6416c714c964bb9acbcbf16118917af8225493b70521
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -176,8 +176,8 @@ Check policies by names (you can also use singular forms `follow_policy?` and `f
|
|
176
176
|
|
177
177
|
```ruby
|
178
178
|
# Checks only consistency and skips all other policies
|
179
|
-
|
180
|
-
|
179
|
+
transfer.follow_policy? :consistency
|
180
|
+
transfer.follow_policy! :consistency
|
181
181
|
```
|
182
182
|
|
183
183
|
The set of policies can be checked at once:
|
data/Rakefile
CHANGED
@@ -10,8 +10,13 @@ end
|
|
10
10
|
Bundler::GemHelper.install_tasks
|
11
11
|
|
12
12
|
# Loads the Hexx::Suit and its tasks
|
13
|
-
|
14
|
-
|
13
|
+
begin
|
14
|
+
require "hexx-suit"
|
15
|
+
Hexx::Suit.install_tasks
|
16
|
+
rescue LoadError
|
17
|
+
require "hexx-rspec"
|
18
|
+
Hexx::RSpec.install_tasks
|
19
|
+
end
|
15
20
|
|
16
21
|
# Sets the Hexx::RSpec :test task to default
|
17
22
|
task default: :test
|
data/lib/policy/version.rb
CHANGED
data/policy.gemspec
CHANGED
@@ -1,23 +1,25 @@
|
|
1
1
|
$:.push File.expand_path("../lib", __FILE__)
|
2
2
|
require "policy/version"
|
3
3
|
|
4
|
-
Gem::Specification.new do |
|
5
|
-
s.name = "policy"
|
6
|
-
s.version = Policy::VERSION.dup
|
7
|
-
s.author = "Andrew Kozin"
|
8
|
-
s.email = "andrew.kozin@gmail.com"
|
9
|
-
s.homepage = "https://github.com/nepalez/policy"
|
10
|
-
s.summary = "Policy Objects for Ruby."
|
11
|
-
s.description = "A tiny library implementing the Policy Object pattern."
|
12
|
-
s.license = "MIT"
|
4
|
+
Gem::Specification.new do |gem|
|
13
5
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
6
|
+
gem.name = "policy"
|
7
|
+
gem.version = Policy::VERSION.dup
|
8
|
+
gem.author = "Andrew Kozin"
|
9
|
+
gem.email = "andrew.kozin@gmail.com"
|
10
|
+
gem.homepage = "https://github.com/nepalez/policy"
|
11
|
+
gem.summary = "Policy Objects for Ruby."
|
12
|
+
gem.description = "A tiny library implementing the Policy Object pattern."
|
13
|
+
gem.license = "MIT"
|
18
14
|
|
19
|
-
|
20
|
-
|
15
|
+
gem.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
16
|
+
gem.test_files = Dir["spec/**/*.rb"]
|
17
|
+
gem.extra_rdoc_files = Dir["README.md", "LICENSE"]
|
18
|
+
gem.require_paths = ["lib"]
|
21
19
|
|
22
|
-
|
23
|
-
|
20
|
+
gem.required_ruby_version = "~> 2.0"
|
21
|
+
gem.add_runtime_dependency "activemodel", ">= 3.1"
|
22
|
+
gem.add_runtime_dependency "adamantium", "~> 0.2"
|
23
|
+
gem.add_development_dependency "hexx-rspec", "~> 0.1"
|
24
|
+
|
25
|
+
end # Gem::Specification
|
data/spec/spec_helper.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
# Loads the RSpec test suit.
|
4
|
-
require "hexx-
|
4
|
+
require "hexx-rspec"
|
5
5
|
|
6
6
|
# Loads runtime metrics in the current scope
|
7
|
-
Hexx::
|
7
|
+
Hexx::RSpec.load_metrics_for(self)
|
8
8
|
|
9
9
|
# Loads the code of the module.
|
10
10
|
require "policy"
|
metadata
CHANGED
@@ -1,52 +1,52 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: policy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kozin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
type: :runtime
|
15
14
|
name: activemodel
|
16
|
-
prerelease: false
|
17
15
|
requirement: !ruby/object:Gem::Requirement
|
18
16
|
requirements:
|
19
17
|
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '3.1'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '3.1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
type: :runtime
|
29
28
|
name: adamantium
|
30
|
-
prerelease: false
|
31
29
|
requirement: !ruby/object:Gem::Requirement
|
32
30
|
requirements:
|
33
31
|
- - "~>"
|
34
32
|
- !ruby/object:Gem::Version
|
35
33
|
version: '0.2'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0.2'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
type: :development
|
43
42
|
name: hexx-rspec
|
44
|
-
prerelease: false
|
45
43
|
requirement: !ruby/object:Gem::Requirement
|
46
44
|
requirements:
|
47
45
|
- - "~>"
|
48
46
|
- !ruby/object:Gem::Version
|
49
47
|
version: '0.1'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
@@ -59,7 +59,6 @@ extensions: []
|
|
59
59
|
extra_rdoc_files:
|
60
60
|
- README.md
|
61
61
|
- LICENSE
|
62
|
-
- config/metrics/STYLEGUIDE
|
63
62
|
files:
|
64
63
|
- ".coveralls.yml"
|
65
64
|
- ".gitignore"
|
@@ -69,7 +68,6 @@ files:
|
|
69
68
|
- ".travis.yml"
|
70
69
|
- ".yardopts"
|
71
70
|
- Gemfile
|
72
|
-
- Gemfile.lock
|
73
71
|
- Guardfile
|
74
72
|
- LICENSE
|
75
73
|
- README.md
|
@@ -116,9 +114,9 @@ require_paths:
|
|
116
114
|
- lib
|
117
115
|
required_ruby_version: !ruby/object:Gem::Requirement
|
118
116
|
requirements:
|
119
|
-
- - "
|
117
|
+
- - "~>"
|
120
118
|
- !ruby/object:Gem::Version
|
121
|
-
version: '0'
|
119
|
+
version: '2.0'
|
122
120
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
123
121
|
requirements:
|
124
122
|
- - ">="
|
@@ -133,12 +131,12 @@ summary: Policy Objects for Ruby.
|
|
133
131
|
test_files:
|
134
132
|
- spec/spec_helper.rb
|
135
133
|
- spec/tests/policy_spec.rb
|
136
|
-
- spec/features/follower_spec.rb
|
137
134
|
- spec/tests/policy/follower_spec.rb
|
138
135
|
- spec/tests/policy/interface_spec.rb
|
139
136
|
- spec/tests/policy/validations_spec.rb
|
140
|
-
- spec/tests/policy/violation_error_spec.rb
|
141
137
|
- spec/tests/policy/follower/followed_policies_spec.rb
|
142
138
|
- spec/tests/policy/follower/followed_policy_spec.rb
|
143
139
|
- spec/tests/policy/follower/names_spec.rb
|
140
|
+
- spec/tests/policy/violation_error_spec.rb
|
141
|
+
- spec/features/follower_spec.rb
|
144
142
|
has_rdoc:
|