simple_policy 0.1.0 → 0.2.0
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 +4 -4
- data/.github/dependabot.yml +6 -0
- data/.github/workflows/lint.yml +6 -1
- data/.github/workflows/specs.yml +8 -1
- data/.rubocop.yml +1 -0
- data/CHANGELOG.md +17 -0
- data/Gemfile.lock +12 -16
- data/lib/simple_policy/entity.rb +10 -4
- data/lib/simple_policy/version.rb +1 -1
- data/lib/simple_policy.rb +0 -3
- data/simple_policy.gemspec +2 -4
- metadata +7 -32
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f1f97d1888b7e42c51125710c62b77deef4734fdc6d0d1de889084e8c3e5e08e
|
|
4
|
+
data.tar.gz: 4e19aed3cb073ac7cca493a3088de7cb2cccbb67ec42f73b7046a58856eecaac
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 77f27f84c01d1c8c3838d10ac10deabde9fe122b716fe18b9bbf21f6722c0751edc9059c84d6619a385f7a81b932e30f0c5f7e1d1478fde568d9ea0e95527335
|
|
7
|
+
data.tar.gz: eb38763b146fd6b3cef27d5fcd8cc29dfbf298bed4765c8409f8f21390ec1060cd571fd2d45cab141445d1eaffaea771ce944ff8cf38376bd4c6b29816b4d77d
|
data/.github/workflows/lint.yml
CHANGED
|
@@ -5,12 +5,17 @@ on: [push,pull_request]
|
|
|
5
5
|
jobs:
|
|
6
6
|
build:
|
|
7
7
|
runs-on: ubuntu-latest
|
|
8
|
+
strategy:
|
|
9
|
+
fail-fast: false
|
|
10
|
+
matrix:
|
|
11
|
+
ruby:
|
|
12
|
+
- "3.0"
|
|
8
13
|
steps:
|
|
9
14
|
- uses: actions/checkout@v2
|
|
10
15
|
- name: Set up Ruby
|
|
11
16
|
uses: ruby/setup-ruby@v1
|
|
12
17
|
with:
|
|
13
|
-
ruby-version:
|
|
18
|
+
ruby-version: ${{matrix.ruby}}
|
|
14
19
|
bundler-cache: true
|
|
15
20
|
- name: Run rubocop
|
|
16
21
|
run: bundle exec rake rubocop
|
data/.github/workflows/specs.yml
CHANGED
|
@@ -5,12 +5,19 @@ on: [push,pull_request]
|
|
|
5
5
|
jobs:
|
|
6
6
|
build:
|
|
7
7
|
runs-on: ubuntu-latest
|
|
8
|
+
strategy:
|
|
9
|
+
fail-fast: false
|
|
10
|
+
matrix:
|
|
11
|
+
ruby:
|
|
12
|
+
- "3.1"
|
|
13
|
+
- "3.0"
|
|
14
|
+
- "2.7"
|
|
8
15
|
steps:
|
|
9
16
|
- uses: actions/checkout@v2
|
|
10
17
|
- name: Set up Ruby
|
|
11
18
|
uses: ruby/setup-ruby@v1
|
|
12
19
|
with:
|
|
13
|
-
ruby-version:
|
|
20
|
+
ruby-version: ${{matrix.ruby}}
|
|
14
21
|
bundler-cache: true
|
|
15
22
|
- name: Run specs
|
|
16
23
|
run: bundle exec rake spec
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
|
+
|
|
7
|
+
## [0.2.0] - 2022-01-20
|
|
8
|
+
|
|
9
|
+
### Removed
|
|
10
|
+
- Removed dry and active-support dependencies
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- Added Ruby 3.1.0 to specs matrix
|
|
14
|
+
|
|
15
|
+
## [0.1.0] - 2021-10-28
|
|
16
|
+
|
|
17
|
+
First public release
|
data/Gemfile.lock
CHANGED
|
@@ -1,29 +1,24 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
simple_policy (0.
|
|
5
|
-
callee
|
|
6
|
-
dry-initializer
|
|
4
|
+
simple_policy (0.2.0)
|
|
7
5
|
|
|
8
6
|
GEM
|
|
9
7
|
remote: https://rubygems.org/
|
|
10
8
|
specs:
|
|
11
9
|
ast (2.4.2)
|
|
12
|
-
callee (0.3.5)
|
|
13
|
-
dry-initializer (>= 2.5, < 4.0)
|
|
14
10
|
coderay (1.1.3)
|
|
15
11
|
diff-lcs (1.4.4)
|
|
16
|
-
dry-initializer (3.0.4)
|
|
17
12
|
method_source (1.0.0)
|
|
18
13
|
parallel (1.21.0)
|
|
19
|
-
parser (3.0.
|
|
14
|
+
parser (3.1.0.0)
|
|
20
15
|
ast (~> 2.4.1)
|
|
21
16
|
pry (0.14.1)
|
|
22
17
|
coderay (~> 1.1)
|
|
23
18
|
method_source (~> 1.0)
|
|
24
|
-
rainbow (3.
|
|
19
|
+
rainbow (3.1.1)
|
|
25
20
|
rake (13.0.6)
|
|
26
|
-
regexp_parser (2.
|
|
21
|
+
regexp_parser (2.2.0)
|
|
27
22
|
rexml (3.2.5)
|
|
28
23
|
rspec (3.10.0)
|
|
29
24
|
rspec-core (~> 3.10.0)
|
|
@@ -38,29 +33,30 @@ GEM
|
|
|
38
33
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
39
34
|
rspec-support (~> 3.10.0)
|
|
40
35
|
rspec-support (3.10.2)
|
|
41
|
-
rubocop (1.
|
|
36
|
+
rubocop (1.25.0)
|
|
42
37
|
parallel (~> 1.10)
|
|
43
|
-
parser (>= 3.
|
|
38
|
+
parser (>= 3.1.0.0)
|
|
44
39
|
rainbow (>= 2.2.2, < 4.0)
|
|
45
40
|
regexp_parser (>= 1.8, < 3.0)
|
|
46
41
|
rexml
|
|
47
|
-
rubocop-ast (>= 1.
|
|
42
|
+
rubocop-ast (>= 1.15.1, < 2.0)
|
|
48
43
|
ruby-progressbar (~> 1.7)
|
|
49
44
|
unicode-display_width (>= 1.4.0, < 3.0)
|
|
50
|
-
rubocop-ast (1.
|
|
45
|
+
rubocop-ast (1.15.1)
|
|
51
46
|
parser (>= 3.0.1.1)
|
|
52
|
-
rubocop-performance (1.
|
|
47
|
+
rubocop-performance (1.13.2)
|
|
53
48
|
rubocop (>= 1.7.0, < 2.0)
|
|
54
49
|
rubocop-ast (>= 0.4.0)
|
|
55
50
|
rubocop-rake (0.6.0)
|
|
56
51
|
rubocop (~> 1.0)
|
|
57
|
-
rubocop-rspec (2.
|
|
52
|
+
rubocop-rspec (2.7.0)
|
|
58
53
|
rubocop (~> 1.19)
|
|
59
54
|
ruby-progressbar (1.11.0)
|
|
60
55
|
unicode-display_width (2.1.0)
|
|
61
56
|
|
|
62
57
|
PLATFORMS
|
|
63
58
|
x86_64-darwin-20
|
|
59
|
+
x86_64-darwin-21
|
|
64
60
|
x86_64-linux
|
|
65
61
|
|
|
66
62
|
DEPENDENCIES
|
|
@@ -74,4 +70,4 @@ DEPENDENCIES
|
|
|
74
70
|
simple_policy!
|
|
75
71
|
|
|
76
72
|
BUNDLED WITH
|
|
77
|
-
2.
|
|
73
|
+
2.3.5
|
data/lib/simple_policy/entity.rb
CHANGED
|
@@ -2,11 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
module SimplePolicy
|
|
4
4
|
class Entity
|
|
5
|
-
|
|
5
|
+
attr_reader :object, :options, :block
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
def initialize(object, options, block)
|
|
8
|
+
@object = object
|
|
9
|
+
@options = options
|
|
10
|
+
@block = block
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def self.call(*params, **options, &block)
|
|
14
|
+
new(*params, **options).call(&block)
|
|
15
|
+
end
|
|
10
16
|
|
|
11
17
|
def self.object_alias(name)
|
|
12
18
|
define_method(name) do
|
data/lib/simple_policy.rb
CHANGED
data/simple_policy.gemspec
CHANGED
|
@@ -16,11 +16,12 @@ Gem::Specification.new do |spec|
|
|
|
16
16
|
|
|
17
17
|
spec.homepage = 'https://github.com/norbertmaleckii/simple-policy-rb'
|
|
18
18
|
spec.license = 'MIT'
|
|
19
|
-
spec.required_ruby_version = '>= 2.
|
|
19
|
+
spec.required_ruby_version = '>= 2.7.0'
|
|
20
20
|
|
|
21
21
|
spec.metadata['homepage_uri'] = spec.homepage
|
|
22
22
|
spec.metadata['source_code_uri'] = spec.homepage
|
|
23
23
|
spec.metadata['changelog_uri'] = "#{spec.homepage}/CHANGELOG.md"
|
|
24
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
|
24
25
|
|
|
25
26
|
# Specify which files should be added to the gem when it is released.
|
|
26
27
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
|
@@ -32,8 +33,5 @@ Gem::Specification.new do |spec|
|
|
|
32
33
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
|
33
34
|
spec.require_paths = ['lib']
|
|
34
35
|
|
|
35
|
-
spec.add_dependency 'callee'
|
|
36
|
-
spec.add_dependency 'dry-initializer'
|
|
37
|
-
|
|
38
36
|
spec.add_development_dependency 'pry'
|
|
39
37
|
end
|
metadata
CHANGED
|
@@ -1,43 +1,15 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: simple_policy
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Norbert Małecki
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2022-01-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
|
-
- !ruby/object:Gem::Dependency
|
|
14
|
-
name: callee
|
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
|
16
|
-
requirements:
|
|
17
|
-
- - ">="
|
|
18
|
-
- !ruby/object:Gem::Version
|
|
19
|
-
version: '0'
|
|
20
|
-
type: :runtime
|
|
21
|
-
prerelease: false
|
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
-
requirements:
|
|
24
|
-
- - ">="
|
|
25
|
-
- !ruby/object:Gem::Version
|
|
26
|
-
version: '0'
|
|
27
|
-
- !ruby/object:Gem::Dependency
|
|
28
|
-
name: dry-initializer
|
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
|
30
|
-
requirements:
|
|
31
|
-
- - ">="
|
|
32
|
-
- !ruby/object:Gem::Version
|
|
33
|
-
version: '0'
|
|
34
|
-
type: :runtime
|
|
35
|
-
prerelease: false
|
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
-
requirements:
|
|
38
|
-
- - ">="
|
|
39
|
-
- !ruby/object:Gem::Version
|
|
40
|
-
version: '0'
|
|
41
13
|
- !ruby/object:Gem::Dependency
|
|
42
14
|
name: pry
|
|
43
15
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -60,11 +32,13 @@ executables: []
|
|
|
60
32
|
extensions: []
|
|
61
33
|
extra_rdoc_files: []
|
|
62
34
|
files:
|
|
35
|
+
- ".github/dependabot.yml"
|
|
63
36
|
- ".github/workflows/lint.yml"
|
|
64
37
|
- ".github/workflows/specs.yml"
|
|
65
38
|
- ".gitignore"
|
|
66
39
|
- ".rspec"
|
|
67
40
|
- ".rubocop.yml"
|
|
41
|
+
- CHANGELOG.md
|
|
68
42
|
- CODE_OF_CONDUCT.md
|
|
69
43
|
- Gemfile
|
|
70
44
|
- Gemfile.lock
|
|
@@ -85,6 +59,7 @@ metadata:
|
|
|
85
59
|
homepage_uri: https://github.com/norbertmaleckii/simple-policy-rb
|
|
86
60
|
source_code_uri: https://github.com/norbertmaleckii/simple-policy-rb
|
|
87
61
|
changelog_uri: https://github.com/norbertmaleckii/simple-policy-rb/CHANGELOG.md
|
|
62
|
+
rubygems_mfa_required: 'true'
|
|
88
63
|
post_install_message:
|
|
89
64
|
rdoc_options: []
|
|
90
65
|
require_paths:
|
|
@@ -93,14 +68,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
93
68
|
requirements:
|
|
94
69
|
- - ">="
|
|
95
70
|
- !ruby/object:Gem::Version
|
|
96
|
-
version: 2.
|
|
71
|
+
version: 2.7.0
|
|
97
72
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
98
73
|
requirements:
|
|
99
74
|
- - ">="
|
|
100
75
|
- !ruby/object:Gem::Version
|
|
101
76
|
version: '0'
|
|
102
77
|
requirements: []
|
|
103
|
-
rubygems_version: 3.
|
|
78
|
+
rubygems_version: 3.3.3
|
|
104
79
|
signing_key:
|
|
105
80
|
specification_version: 4
|
|
106
81
|
summary: Policy system for Ruby with awesome features!
|