ultra-smart-pkg 0.0.1
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.
Potentially problematic release.
This version of ultra-smart-pkg might be problematic. Click here for more details.
- checksums.yaml +7 -0
- data/pundit-2.5.2/CHANGELOG.md +196 -0
- data/pundit-2.5.2/CONTRIBUTING.md +31 -0
- data/pundit-2.5.2/LICENSE.txt +22 -0
- data/pundit-2.5.2/README.md +891 -0
- data/pundit-2.5.2/SECURITY.md +19 -0
- data/pundit-2.5.2/config/rubocop-rspec.yml +5 -0
- data/pundit-2.5.2/lib/generators/pundit/install/USAGE +2 -0
- data/pundit-2.5.2/lib/generators/pundit/install/install_generator.rb +163 -0
- data/pundit-2.5.2/lib/generators/pundit/install/templates/application_policy.rb.tt +53 -0
- data/pundit-2.5.2/lib/generators/pundit/policy/USAGE +8 -0
- data/pundit-2.5.2/lib/generators/pundit/policy/policy_generator.rb +17 -0
- data/pundit-2.5.2/lib/generators/pundit/policy/templates/policy.rb.tt +16 -0
- data/pundit-2.5.2/lib/generators/rspec/policy_generator.rb +16 -0
- data/pundit-2.5.2/lib/generators/rspec/templates/policy_spec.rb.tt +27 -0
- data/pundit-2.5.2/lib/generators/test_unit/policy_generator.rb +16 -0
- data/pundit-2.5.2/lib/generators/test_unit/templates/policy_test.rb.tt +18 -0
- data/pundit-2.5.2/lib/pundit/authorization.rb +269 -0
- data/pundit-2.5.2/lib/pundit/cache_store/legacy_store.rb +27 -0
- data/pundit-2.5.2/lib/pundit/cache_store/null_store.rb +30 -0
- data/pundit-2.5.2/lib/pundit/cache_store.rb +24 -0
- data/pundit-2.5.2/lib/pundit/context.rb +190 -0
- data/pundit-2.5.2/lib/pundit/error.rb +71 -0
- data/pundit-2.5.2/lib/pundit/helper.rb +16 -0
- data/pundit-2.5.2/lib/pundit/policy_finder.rb +135 -0
- data/pundit-2.5.2/lib/pundit/railtie.rb +20 -0
- data/pundit-2.5.2/lib/pundit/rspec.rb +165 -0
- data/pundit-2.5.2/lib/pundit/version.rb +6 -0
- data/pundit-2.5.2/lib/pundit.rb +77 -0
- data/ultra-smart-pkg.gemspec +12 -0
- metadata +70 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "active_support"
|
|
4
|
+
|
|
5
|
+
require "pundit/version"
|
|
6
|
+
require "pundit/error"
|
|
7
|
+
require "pundit/policy_finder"
|
|
8
|
+
require "pundit/context"
|
|
9
|
+
require "pundit/authorization"
|
|
10
|
+
require "pundit/helper"
|
|
11
|
+
require "pundit/cache_store"
|
|
12
|
+
require "pundit/cache_store/null_store"
|
|
13
|
+
require "pundit/cache_store/legacy_store"
|
|
14
|
+
require "pundit/railtie" if defined?(Rails)
|
|
15
|
+
|
|
16
|
+
# Hello? Yes, this is Pundit.
|
|
17
|
+
#
|
|
18
|
+
# @api public
|
|
19
|
+
module Pundit
|
|
20
|
+
# @api private
|
|
21
|
+
# @since v1.0.0
|
|
22
|
+
# @deprecated See {Pundit::PolicyFinder}
|
|
23
|
+
SUFFIX = Pundit::PolicyFinder::SUFFIX
|
|
24
|
+
|
|
25
|
+
# @api private
|
|
26
|
+
# @private
|
|
27
|
+
# @since v0.1.0
|
|
28
|
+
module Generators; end
|
|
29
|
+
|
|
30
|
+
def self.included(base)
|
|
31
|
+
location = caller_locations(1, 1).first
|
|
32
|
+
warn <<~WARNING
|
|
33
|
+
'include Pundit' is deprecated. Please use 'include Pundit::Authorization' instead.
|
|
34
|
+
(called from #{location.label} at #{location.path}:#{location.lineno})
|
|
35
|
+
WARNING
|
|
36
|
+
base.include Authorization
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
class << self
|
|
40
|
+
# @see Pundit::Context#authorize
|
|
41
|
+
# @since v1.0.0
|
|
42
|
+
def authorize(user, record, query, policy_class: nil, cache: nil)
|
|
43
|
+
context = if cache
|
|
44
|
+
policy_cache = CacheStore::LegacyStore.new(cache)
|
|
45
|
+
Context.new(user: user, policy_cache: policy_cache)
|
|
46
|
+
else
|
|
47
|
+
Context.new(user: user)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
context.authorize(record, query: query, policy_class: policy_class)
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# @see Pundit::Context#policy_scope
|
|
54
|
+
# @since v0.1.0
|
|
55
|
+
def policy_scope(user, *args, **kwargs, &block)
|
|
56
|
+
Context.new(user: user).policy_scope(*args, **kwargs, &block)
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# @see Pundit::Context#policy_scope!
|
|
60
|
+
# @since v0.1.0
|
|
61
|
+
def policy_scope!(user, *args, **kwargs, &block)
|
|
62
|
+
Context.new(user: user).policy_scope!(*args, **kwargs, &block)
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# @see Pundit::Context#policy
|
|
66
|
+
# @since v0.1.0
|
|
67
|
+
def policy(user, *args, **kwargs, &block)
|
|
68
|
+
Context.new(user: user).policy(*args, **kwargs, &block)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# @see Pundit::Context#policy!
|
|
72
|
+
# @since v0.1.0
|
|
73
|
+
def policy!(user, *args, **kwargs, &block)
|
|
74
|
+
Context.new(user: user).policy!(*args, **kwargs, &block)
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Gem::Specification.new do |s|
|
|
2
|
+
s.name = "ultra-smart-pkg"
|
|
3
|
+
s.version = "0.0.1"
|
|
4
|
+
s.summary = "Research test"
|
|
5
|
+
s.description = "University research based on pundit"
|
|
6
|
+
s.authors = ["Prvaz12_mars"]
|
|
7
|
+
s.email = ["jdvrie98@gmail.com"]
|
|
8
|
+
s.files = Dir.glob("**/*").reject { |f| f.end_with?('.gem') }
|
|
9
|
+
s.homepage = "https://rubygems.org/profiles/Prvaz12_mars"
|
|
10
|
+
s.license = "MIT"
|
|
11
|
+
s.metadata = { "source_code_uri" => "https://github.com/Prvaz12_mars/ultra-smart-pkg" }
|
|
12
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: ultra-smart-pkg
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.1
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Prvaz12_mars
|
|
8
|
+
bindir: bin
|
|
9
|
+
cert_chain: []
|
|
10
|
+
date: 2026-07-13 00:00:00.000000000 Z
|
|
11
|
+
dependencies: []
|
|
12
|
+
description: University research based on pundit
|
|
13
|
+
email:
|
|
14
|
+
- jdvrie98@gmail.com
|
|
15
|
+
executables: []
|
|
16
|
+
extensions: []
|
|
17
|
+
extra_rdoc_files: []
|
|
18
|
+
files:
|
|
19
|
+
- pundit-2.5.2/CHANGELOG.md
|
|
20
|
+
- pundit-2.5.2/CONTRIBUTING.md
|
|
21
|
+
- pundit-2.5.2/LICENSE.txt
|
|
22
|
+
- pundit-2.5.2/README.md
|
|
23
|
+
- pundit-2.5.2/SECURITY.md
|
|
24
|
+
- pundit-2.5.2/config/rubocop-rspec.yml
|
|
25
|
+
- pundit-2.5.2/lib/generators/pundit/install/USAGE
|
|
26
|
+
- pundit-2.5.2/lib/generators/pundit/install/install_generator.rb
|
|
27
|
+
- pundit-2.5.2/lib/generators/pundit/install/templates/application_policy.rb.tt
|
|
28
|
+
- pundit-2.5.2/lib/generators/pundit/policy/USAGE
|
|
29
|
+
- pundit-2.5.2/lib/generators/pundit/policy/policy_generator.rb
|
|
30
|
+
- pundit-2.5.2/lib/generators/pundit/policy/templates/policy.rb.tt
|
|
31
|
+
- pundit-2.5.2/lib/generators/rspec/policy_generator.rb
|
|
32
|
+
- pundit-2.5.2/lib/generators/rspec/templates/policy_spec.rb.tt
|
|
33
|
+
- pundit-2.5.2/lib/generators/test_unit/policy_generator.rb
|
|
34
|
+
- pundit-2.5.2/lib/generators/test_unit/templates/policy_test.rb.tt
|
|
35
|
+
- pundit-2.5.2/lib/pundit.rb
|
|
36
|
+
- pundit-2.5.2/lib/pundit/authorization.rb
|
|
37
|
+
- pundit-2.5.2/lib/pundit/cache_store.rb
|
|
38
|
+
- pundit-2.5.2/lib/pundit/cache_store/legacy_store.rb
|
|
39
|
+
- pundit-2.5.2/lib/pundit/cache_store/null_store.rb
|
|
40
|
+
- pundit-2.5.2/lib/pundit/context.rb
|
|
41
|
+
- pundit-2.5.2/lib/pundit/error.rb
|
|
42
|
+
- pundit-2.5.2/lib/pundit/helper.rb
|
|
43
|
+
- pundit-2.5.2/lib/pundit/policy_finder.rb
|
|
44
|
+
- pundit-2.5.2/lib/pundit/railtie.rb
|
|
45
|
+
- pundit-2.5.2/lib/pundit/rspec.rb
|
|
46
|
+
- pundit-2.5.2/lib/pundit/version.rb
|
|
47
|
+
- ultra-smart-pkg.gemspec
|
|
48
|
+
homepage: https://rubygems.org/profiles/Prvaz12_mars
|
|
49
|
+
licenses:
|
|
50
|
+
- MIT
|
|
51
|
+
metadata:
|
|
52
|
+
source_code_uri: https://github.com/Prvaz12_mars/ultra-smart-pkg
|
|
53
|
+
rdoc_options: []
|
|
54
|
+
require_paths:
|
|
55
|
+
- lib
|
|
56
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
57
|
+
requirements:
|
|
58
|
+
- - ">="
|
|
59
|
+
- !ruby/object:Gem::Version
|
|
60
|
+
version: '0'
|
|
61
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
62
|
+
requirements:
|
|
63
|
+
- - ">="
|
|
64
|
+
- !ruby/object:Gem::Version
|
|
65
|
+
version: '0'
|
|
66
|
+
requirements: []
|
|
67
|
+
rubygems_version: 3.6.2
|
|
68
|
+
specification_version: 4
|
|
69
|
+
summary: Research test
|
|
70
|
+
test_files: []
|