picket 0.1.0.alpha
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 +7 -0
- checksums.yaml.gz.sig +3 -0
- data/CHANGELOG.md +5 -0
- data/MIT-LICENSE +22 -0
- data/README.md +7 -0
- data/SECURITY.md +25 -0
- data/app/assets/config/picket_manifest.js +5 -0
- data/app/controllers/picket/application_api_controller.rb +6 -0
- data/app/controllers/picket/application_controller.rb +6 -0
- data/app/controllers/picket/application_metal_controller.rb +6 -0
- data/app/javascript/helpers/picket/index.js +0 -0
- data/app/javascript/lib/picket/index.js +1 -0
- data/app/javascript/lib/picket/utils.js +0 -0
- data/app/jobs/picket/application_job.rb +6 -0
- data/app/mailers/picket/application_mailer.rb +6 -0
- data/app/models/picket/application_record.rb +7 -0
- data/config/i18n-tasks.yml +179 -0
- data/config/importmap.rb +9 -0
- data/config/locales/picket.en.yml +3 -0
- data/config/routes.rb +4 -0
- data/lib/generators/picket/install/USAGE +7 -0
- data/lib/generators/picket/install/install_generator.rb +12 -0
- data/lib/generators/picket/install/templates/config/initializers/picket.rb.tt +2 -0
- data/lib/generators/picket/install/templates/config/picket.yml.tt +10 -0
- data/lib/picket/configuration.rb +59 -0
- data/lib/picket/deprecator.rb +8 -0
- data/lib/picket/engine.rb +67 -0
- data/lib/picket/log_subscriber.rb +33 -0
- data/lib/picket/version.rb +23 -0
- data/lib/picket.rb +31 -0
- data/lib/tasks/picket_tasks.rake +6 -0
- data.tar.gz.sig +0 -0
- metadata +217 -0
- metadata.gz.sig +0 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f1e53a251ec4d182ded6c303fdbfb2e13f0441ba33c1937600a8abe9c3869f87
|
4
|
+
data.tar.gz: 4fe1cab09723930fbad4e8d88fdd98703b5ab76624837112cf696a7851da6156
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 84f0b0c9ddc07731a26c7f27014df89bd925d21e2ccc5c1740185e3b7dfaec44c6e0eb148432486711b162f231e102ca7a4baf7056cb9f76005414eef6daf3d3
|
7
|
+
data.tar.gz: 8a7dce818f2c063bb79f1fbe282381b60d1b1f5fd93dfa9c1ba3e82e37a2e77e379c836842539a1e07d965a420a84c9f79d1404708f30bfb59d80600cc893659
|
checksums.yaml.gz.sig
ADDED
data/CHANGELOG.md
ADDED
data/MIT-LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) Tony Burns
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
data/SECURITY.md
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# Picket Security Policy
|
2
|
+
|
3
|
+
## Reporting a Vulnerability
|
4
|
+
|
5
|
+
We take security bugs seriously and appreciate your efforts to responsibly disclose your findings and will make every effort to acknowledge your contributions.
|
6
|
+
|
7
|
+
To report a security issue, please do one of the following:
|
8
|
+
|
9
|
+
- Go to the [Security](https://github.com/picketengine/picket/security) tab on the repository and click **Report a vulnerability**. Fill in the advisory details form and click **Submit report**.
|
10
|
+
- Email <security@picketengine.org> with a description of the issue, the steps you took to create it, affected versions, and if known, mitigations for the issue. If possible, please sign and encrypt your email using our GPG key, which is available at <https://github.com/picketengine/securty@picketengine.org.gpg>. We will make every effort to respond within 48 hours.
|
11
|
+
|
12
|
+
Please **DO NOT** open public GitHub issues, pull requests, or discussions for security vulnerabilities.
|
13
|
+
|
14
|
+
## Disclosure Policy
|
15
|
+
|
16
|
+
When we receive a security bug report, we will:
|
17
|
+
|
18
|
+
1. Confirm the problem and determine the affected versions.
|
19
|
+
2. Audit code to find any potential similar problems.
|
20
|
+
3. Prepare fixes for all releases still under maintenance.
|
21
|
+
4. Release new versions and notify users.
|
22
|
+
|
23
|
+
## Comments on this Policy
|
24
|
+
|
25
|
+
If you have suggestions on how this process could be improved, please submit a pull request or email me at the address above.
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
import "picket/utils";
|
File without changes
|
@@ -0,0 +1,179 @@
|
|
1
|
+
# i18n-tasks finds and manages missing and unused translations: https://github.com/glebm/i18n-tasks
|
2
|
+
|
3
|
+
# The "main" locale.
|
4
|
+
base_locale: en
|
5
|
+
## All available locales are inferred from the data by default. Alternatively, specify them explicitly:
|
6
|
+
# locales: [es, fr]
|
7
|
+
## Reporting locale, default: en. Available: en, ru.
|
8
|
+
# internal_locale: en
|
9
|
+
|
10
|
+
# Read and write translations.
|
11
|
+
data:
|
12
|
+
## Translations are read from the file system. Supported format: YAML, JSON.
|
13
|
+
## Provide a custom adapter:
|
14
|
+
# adapter: I18n::Tasks::Data::FileSystem
|
15
|
+
|
16
|
+
# Locale files or `Dir.glob` patterns where translations are read from:
|
17
|
+
read:
|
18
|
+
## Default:
|
19
|
+
# - config/locales/%{locale}.yml
|
20
|
+
## More files:
|
21
|
+
- config/locales/*.%{locale}.yml
|
22
|
+
|
23
|
+
# Locale files to write new keys to, based on a list of key pattern => file rules. Matched from top to bottom:
|
24
|
+
# `i18n-tasks normalize -p` will force move the keys according to these rules
|
25
|
+
write:
|
26
|
+
## For example, write devise and simple form keys to their respective files:
|
27
|
+
# - ['{devise, simple_form}.*', 'config/locales/\1.%{locale}.yml']
|
28
|
+
## Catch-all default:
|
29
|
+
# - config/locales/%{locale}.yml
|
30
|
+
- config/locales/picket.%{locale}.yml
|
31
|
+
|
32
|
+
# External locale data (e.g. gems).
|
33
|
+
# This data is not considered unused and is never written to.
|
34
|
+
external:
|
35
|
+
## Example (replace %#= with %=):
|
36
|
+
# - "<%#= %x[bundle info vagrant --path].chomp %>/templates/locales/%{locale}.yml"
|
37
|
+
|
38
|
+
## Specify the router (see Readme for details). Valid values: conservative_router, pattern_router, or a custom class.
|
39
|
+
# router: conservative_router
|
40
|
+
|
41
|
+
yaml:
|
42
|
+
write:
|
43
|
+
# do not wrap lines at 80 characters
|
44
|
+
line_width: -1
|
45
|
+
|
46
|
+
## Pretty-print JSON:
|
47
|
+
# json:
|
48
|
+
# write:
|
49
|
+
# indent: ' '
|
50
|
+
# space: ' '
|
51
|
+
# object_nl: "\n"
|
52
|
+
# array_nl: "\n"
|
53
|
+
|
54
|
+
# Find translate calls
|
55
|
+
search:
|
56
|
+
## Paths or `Find.find` patterns to search in:
|
57
|
+
# paths:
|
58
|
+
# - app/
|
59
|
+
|
60
|
+
## Root directories for relative keys resolution.
|
61
|
+
# relative_roots:
|
62
|
+
# - app/controllers
|
63
|
+
# - app/helpers
|
64
|
+
# - app/mailers
|
65
|
+
# - app/presenters
|
66
|
+
# - app/views
|
67
|
+
|
68
|
+
## Directories where method names which should not be part of a relative key resolution.
|
69
|
+
# By default, if a relative translation is used inside a method, the name of the method will be considered part of the resolved key.
|
70
|
+
# Directories listed here will not consider the name of the method part of the resolved key
|
71
|
+
#
|
72
|
+
# relative_exclude_method_name_paths:
|
73
|
+
# -
|
74
|
+
|
75
|
+
## Files or `File.fnmatch` patterns to exclude from search. Some files are always excluded regardless of this setting:
|
76
|
+
## *.jpg *.jpeg *.png *.gif *.svg *.ico *.eot *.otf *.ttf *.woff *.woff2 *.pdf *.css *.sass *.scss *.less
|
77
|
+
## *.yml *.json *.zip *.tar.gz *.swf *.flv *.mp3 *.wav *.flac *.webm *.mp4 *.ogg *.opus *.webp *.map *.xlsx
|
78
|
+
exclude:
|
79
|
+
- app/assets/images
|
80
|
+
- app/assets/fonts
|
81
|
+
- app/assets/videos
|
82
|
+
- app/assets/builds
|
83
|
+
|
84
|
+
## Alternatively, the only files or `File.fnmatch patterns` to search in `paths`:
|
85
|
+
## If specified, this settings takes priority over `exclude`, but `exclude` still applies.
|
86
|
+
# only: ["*.rb", "*.html.slim"]
|
87
|
+
|
88
|
+
## If `strict` is `false`, guess usages such as t("categories.#{category}.title"). The default is `true`.
|
89
|
+
# strict: true
|
90
|
+
|
91
|
+
## Allows adding ast_matchers for finding translations using the AST-scanners
|
92
|
+
## The available matchers are:
|
93
|
+
## - RailsModelMatcher
|
94
|
+
## Matches ActiveRecord translations like
|
95
|
+
## User.human_attribute_name(:email) and User.model_name.human
|
96
|
+
## - DefaultI18nSubjectMatcher
|
97
|
+
## Matches ActionMailer's default_i18n_subject method
|
98
|
+
##
|
99
|
+
## To implement your own, please see `I18n::Tasks::Scanners::AstMatchers::BaseMatcher`.
|
100
|
+
# ast_matchers:
|
101
|
+
# - 'I18n::Tasks::Scanners::AstMatchers::RailsModelMatcher'
|
102
|
+
# - 'I18n::Tasks::Scanners::AstMatchers::DefaultI18nSubjectMatcher'
|
103
|
+
|
104
|
+
## Multiple scanners can be used. Their results are merged.
|
105
|
+
## The options specified above are passed down to each scanner. Per-scanner options can be specified as well.
|
106
|
+
## See this example of a custom scanner: https://github.com/glebm/i18n-tasks/wiki/A-custom-scanner-example
|
107
|
+
## Translation Services
|
108
|
+
# translation:
|
109
|
+
# # Google Translate
|
110
|
+
# # Get an API key and set billing info at https://code.google.com/apis/console to use Google Translate
|
111
|
+
# google_translate_api_key: "AbC-dEf5"
|
112
|
+
# # DeepL Pro Translate
|
113
|
+
# # Get an API key and subscription at https://www.deepl.com/pro to use DeepL Pro
|
114
|
+
# deepl_api_key: "48E92789-57A3-466A-9959-1A1A1A1A1A1A"
|
115
|
+
# # deepl_host: "https://api.deepl.com"
|
116
|
+
# # deepl_version: "v2"
|
117
|
+
# # deepl_glossary_ids:
|
118
|
+
# # - f28106eb-0e06-489e-82c6-8215d6f95089
|
119
|
+
# # - 2c6415be-1852-4f54-9e1b-d800463496b4
|
120
|
+
# # add additional options to the DeepL.translate call: https://www.deepl.com/docs-api/translate-text/translate-text/
|
121
|
+
# deepl_options:
|
122
|
+
# formality: prefer_less
|
123
|
+
# # OpenAI
|
124
|
+
# openai_api_key: "sk-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
125
|
+
# # openai_model: "gpt-3.5-turbo" # see https://platform.openai.com/docs/models
|
126
|
+
# # may contain `%{from}` and `%{to}`, which will be replaced by source and target locale codes, respectively (using `Kernel.format`)
|
127
|
+
# # openai_admin_prompt: >-
|
128
|
+
# # You are a professional translator that translates content from the %{from} locale
|
129
|
+
# # to the %{to} locale in an i18n locale array.
|
130
|
+
# #
|
131
|
+
# # The array has a structured format and contains multiple strings. Your task is to translate
|
132
|
+
# # each of these strings and create a new array with the translated strings.
|
133
|
+
# #
|
134
|
+
# # HTML markups (enclosed in < and > characters) must not be changed under any circumstance.
|
135
|
+
# # Variables (starting with %%{ and ending with }) must not be changed under any circumstance.
|
136
|
+
# #
|
137
|
+
# # Keep in mind the context of all the strings for a more accurate translation.
|
138
|
+
|
139
|
+
## Do not consider these keys missing:
|
140
|
+
# ignore_missing:
|
141
|
+
# - 'errors.messages.{accepted,blank,invalid,too_short,too_long}'
|
142
|
+
# - '{devise,simple_form}.*'
|
143
|
+
|
144
|
+
## Consider these keys used:
|
145
|
+
ignore_unused:
|
146
|
+
- "activerecord.attributes.*"
|
147
|
+
- "activerecord.errors.*"
|
148
|
+
# - '{devise,kaminari,will_paginate}.*'
|
149
|
+
# - 'simple_form.{yes,no}'
|
150
|
+
# - 'simple_form.{placeholders,hints,labels}.*'
|
151
|
+
# - 'simple_form.{error_notification,required}.:'
|
152
|
+
|
153
|
+
## Exclude these keys from the `i18n-tasks eq-base' report:
|
154
|
+
# ignore_eq_base:
|
155
|
+
# all:
|
156
|
+
# - common.ok
|
157
|
+
# fr,es:
|
158
|
+
# - common.brand
|
159
|
+
|
160
|
+
## Exclude these keys from the `i18n-tasks check-consistent-interpolations` report:
|
161
|
+
# ignore_inconsistent_interpolations:
|
162
|
+
# - 'activerecord.attributes.*'
|
163
|
+
|
164
|
+
## Ignore these keys completely:
|
165
|
+
# ignore:
|
166
|
+
# - kaminari.*
|
167
|
+
|
168
|
+
## Sometimes, it isn't possible for i18n-tasks to match the key correctly,
|
169
|
+
## e.g. in case of a relative key defined in a helper method.
|
170
|
+
## In these cases you can use the built-in PatternMapper to map patterns to keys, e.g.:
|
171
|
+
#
|
172
|
+
# <%# I18n::Tasks.add_scanner 'I18n::Tasks::Scanners::PatternMapper',
|
173
|
+
# only: %w(*.html.haml *.html.slim),
|
174
|
+
# patterns: [['= title\b', '.page_title']] %>
|
175
|
+
#
|
176
|
+
# The PatternMapper can also match key literals via a special %{key} interpolation, e.g.:
|
177
|
+
#
|
178
|
+
# <%# I18n::Tasks.add_scanner 'I18n::Tasks::Scanners::PatternMapper',
|
179
|
+
# patterns: [['\bSpree\.t[( ]\s*%{key}', 'spree.%{key}']] %>
|
data/config/importmap.rb
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
pin "@hotwired/turbo-rails", to: "turbo.min.js", preload: true
|
4
|
+
pin "@hotwired/stimulus", to: "stimulus.min.js", preload: true
|
5
|
+
pin "@hotwired/stimulus-loading", to: "stimulus-loading.js", preload: true
|
6
|
+
|
7
|
+
pin_all_from Picket::Engine.root.join("app/javascript/lib/picket"), under: "picket", to: "lib/picket"
|
8
|
+
pin_all_from Picket::Engine.root.join("app/javascript/controllers"), under: "controllers"
|
9
|
+
pin_all_from Picket::Engine.root.join("app/javascript/helpers"), under: "helpers"
|
data/config/routes.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Picket
|
4
|
+
class InstallGenerator < Rails::Generators::Base
|
5
|
+
source_root File.expand_path("templates", __dir__)
|
6
|
+
|
7
|
+
def copy_files
|
8
|
+
copy_file "config/initializers/picket.rb", force: true
|
9
|
+
copy_file "config/picket.yml", force: true
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Picket
|
4
|
+
class Configuration
|
5
|
+
include ActiveModel::Model
|
6
|
+
include ActiveModel::Attributes
|
7
|
+
|
8
|
+
# @!attribute base_api_controller_class_name
|
9
|
+
# @return [String] the name of the class to inherit {Picket::ApplicationAPIController} from.
|
10
|
+
attribute :base_api_controller_class_name, :string, default: "::ActionController::API"
|
11
|
+
|
12
|
+
# @!attribute base_controller_class_name
|
13
|
+
# @return [String] the name of the class to inherit {Picket::ApplicationController} from.
|
14
|
+
attribute :base_controller_class_name, :string, default: "::ApplicationController"
|
15
|
+
|
16
|
+
# @!attribute base_job_class_name
|
17
|
+
# @return [String] the name of the class to inherit {Picket::ApplicationJob} from.
|
18
|
+
attribute :base_job_class_name, :string, default: "::ApplicationJob"
|
19
|
+
|
20
|
+
# @!attribute base_mailer_class_name
|
21
|
+
# @return [String] the name of the class to inherit {Picket::ApplicationMailer} from.
|
22
|
+
attribute :base_mailer_class_name, :string, default: "::ApplicationMailer"
|
23
|
+
|
24
|
+
# @!attribute base_metal_controller_class_name
|
25
|
+
# @return [String] the name of the class to inherit {Picket::ApplicationMetalController} from.
|
26
|
+
attribute :base_metal_controller_class_name, :string, default: "::ActionController::Metal"
|
27
|
+
|
28
|
+
# @!attribute base_record_class_name
|
29
|
+
# @return [String] the name of the class to inherit {Picket::ApplicationRecord} from.
|
30
|
+
attribute :base_record_class_name, :string, default: "::ApplicationRecord"
|
31
|
+
|
32
|
+
validates! :base_controller_class_name, presence: true
|
33
|
+
validates! :base_api_controller_class_name, presence: true
|
34
|
+
validates! :base_metal_controller_class_name, presence: true
|
35
|
+
validates! :base_job_class_name, presence: true
|
36
|
+
validates! :base_mailer_class_name, presence: true
|
37
|
+
validates! :base_record_class_name, presence: true
|
38
|
+
|
39
|
+
# @return [Class] the class to inherit {Picket::ApplicationAPIController} from.
|
40
|
+
def base_api_controller_class = @base_api_controller_class ||= base_api_controller_class_name.constantize
|
41
|
+
|
42
|
+
# @return [Class] the class to inherit {Picket::ApplicationController} from.
|
43
|
+
def base_controller_class = @base_controller_class ||= base_controller_class_name.constantize
|
44
|
+
|
45
|
+
# @return [Class] the class to inherit {Picket::ApplicationJob} from.
|
46
|
+
def base_job_class = @base_job_class ||= base_job_class_name.constantize
|
47
|
+
|
48
|
+
# @return [Class] the class to inherit {Picket::ApplicationMailer} from.
|
49
|
+
def base_mailer_class = @base_mailer_class ||= base_mailer_class_name.constantize
|
50
|
+
|
51
|
+
# @return [Class] the class to inherit {Picket::ApplicationMetalController} from.
|
52
|
+
def base_metal_controller_class = @base_metal_controller_class ||= base_metal_controller_class_name.constantize
|
53
|
+
|
54
|
+
# @return [Class] the class to inherit {Picket::ApplicationRecord} from.
|
55
|
+
def base_record_class = @base_record_class ||= base_record_class_name.constantize
|
56
|
+
|
57
|
+
ActiveSupport.run_load_hooks(:picket_configuration, self)
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "rails"
|
4
|
+
require "importmap-rails"
|
5
|
+
require "stimulus-rails"
|
6
|
+
require "turbo-rails"
|
7
|
+
|
8
|
+
require "picket/log_subscriber"
|
9
|
+
|
10
|
+
module Picket
|
11
|
+
# @private
|
12
|
+
class Engine < ::Rails::Engine
|
13
|
+
config.picket = ActiveSupport::OrderedOptions.new
|
14
|
+
|
15
|
+
initializer "picket.deprecator", before: :load_environment_config do |app|
|
16
|
+
app.deprecators[:picket] = Picket.deprecator
|
17
|
+
end
|
18
|
+
|
19
|
+
initializer "picket.inflector" do |_app|
|
20
|
+
ActiveSupport::Inflector.inflections(:en) do |inflect|
|
21
|
+
inflect.acronym "API"
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
initializer "picket.config" do |_app|
|
26
|
+
Picket.config.assign_attributes(config.picket.to_h)
|
27
|
+
end
|
28
|
+
|
29
|
+
initializer "picket.logger" do
|
30
|
+
ActiveSupport.on_load(:picket) { self.logger ||= ::Rails.logger }
|
31
|
+
Picket::LogSubscriber.attach_to :picket
|
32
|
+
end
|
33
|
+
|
34
|
+
initializer "picket.asset" do |app|
|
35
|
+
config.after_initialize do
|
36
|
+
next unless app.config.respond_to?(:assets) && app.config.picket.precompile_assets
|
37
|
+
|
38
|
+
app.config.assets.paths << root.join("app/javascript")
|
39
|
+
app.config.assets.paths << root.join("vendor/javascript")
|
40
|
+
app.config.assets.precompile += %w[picket_manifest]
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
initializer "picket.importmap", before: "importmap" do |app|
|
45
|
+
next unless app.config.respond_to?(:importmap)
|
46
|
+
|
47
|
+
app.config.importmap.cache_sweepers << root.join("app/javascript")
|
48
|
+
app.config.importmap.cache_sweepers << root.join("vendor/javascript")
|
49
|
+
app.config.importmap.paths << root.join("config/importmap.rb")
|
50
|
+
end
|
51
|
+
|
52
|
+
config.after_initialize do |app|
|
53
|
+
# :nocov:
|
54
|
+
unless app.config.eager_load
|
55
|
+
Picket.config.base_api_controller_class
|
56
|
+
Picket.config.base_controller_class
|
57
|
+
Picket.config.base_job_class
|
58
|
+
Picket.config.base_mailer_class
|
59
|
+
Picket.config.base_metal_controller_class
|
60
|
+
Picket.config.base_record_class
|
61
|
+
end
|
62
|
+
# :nocov:
|
63
|
+
|
64
|
+
Picket.config.validate!
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Picket
|
4
|
+
# @private
|
5
|
+
class LogSubscriber < ActiveSupport::LogSubscriber
|
6
|
+
def initialize
|
7
|
+
super
|
8
|
+
@logger = logger || Picket.logger
|
9
|
+
end
|
10
|
+
|
11
|
+
attr_writer :logger
|
12
|
+
|
13
|
+
def logger
|
14
|
+
@logger ||= Picket.logger
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def formatted_event(event, operation, **)
|
20
|
+
" [Picket] #{operation} in #{formatted_duration(event)} (#{formatted_payload(**)})"
|
21
|
+
end
|
22
|
+
|
23
|
+
def formatted_duration(event)
|
24
|
+
format("%.1fms", event.duration)
|
25
|
+
end
|
26
|
+
|
27
|
+
def formatted_payload(**attributes)
|
28
|
+
attributes.map { |k, v| "#{k}: #{v.inspect}" }.join(" | ")
|
29
|
+
end
|
30
|
+
|
31
|
+
ActiveSupport.run_load_hooks(:picket_log_subscriber, self)
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Picket
|
4
|
+
# @private
|
5
|
+
module VERSION
|
6
|
+
MAJOR = 0
|
7
|
+
MINOR = 1
|
8
|
+
TINY = 0
|
9
|
+
PRE = "alpha"
|
10
|
+
|
11
|
+
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
12
|
+
end
|
13
|
+
|
14
|
+
# Returns the currently loaded version of Picket as a +Gem::Version+.
|
15
|
+
def self.gem_version
|
16
|
+
Gem::Version.new VERSION::STRING
|
17
|
+
end
|
18
|
+
|
19
|
+
# Returns the currently loaded version of Picket as a string.
|
20
|
+
def self.version
|
21
|
+
gem_version.to_s
|
22
|
+
end
|
23
|
+
end
|
data/lib/picket.rb
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "picket/version"
|
4
|
+
require "picket/deprecator"
|
5
|
+
require "picket/engine"
|
6
|
+
require "picket/configuration"
|
7
|
+
|
8
|
+
module Picket
|
9
|
+
# @!attribute [rw] self.config
|
10
|
+
# @return [Picket::Configuration] the configuration instance for Picket.
|
11
|
+
mattr_accessor :config, default: Picket::Configuration.new
|
12
|
+
|
13
|
+
# @!attribute [rw] self.logger
|
14
|
+
# @return [ActiveSupport::Logger] the logger to use for Picket.
|
15
|
+
mattr_accessor :logger
|
16
|
+
|
17
|
+
# Configures Picket.
|
18
|
+
# @yield [config] Yields {Picket.config} to the block.
|
19
|
+
# @yieldparam [Picket::Configuration] config the configuration instance.
|
20
|
+
def self.configure
|
21
|
+
yield config
|
22
|
+
validate_config!
|
23
|
+
end
|
24
|
+
|
25
|
+
# Validates {Picket.config} and raises an error on any validation failures.
|
26
|
+
def self.validate_config!
|
27
|
+
config.validate!
|
28
|
+
end
|
29
|
+
|
30
|
+
ActiveSupport.run_load_hooks(:picket, self)
|
31
|
+
end
|
data.tar.gz.sig
ADDED
Binary file
|
metadata
ADDED
@@ -0,0 +1,217 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: picket
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0.alpha
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Tony Burns
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain:
|
11
|
+
- |
|
12
|
+
-----BEGIN CERTIFICATE-----
|
13
|
+
MIIEcDCCAtigAwIBAgIBATANBgkqhkiG9w0BAQsFADA/MQ0wCwYDVQQDDAR0b255
|
14
|
+
MRkwFwYKCZImiZPyLGQBGRYJdG9ueWJ1cm5zMRMwEQYKCZImiZPyLGQBGRYDbmV0
|
15
|
+
MB4XDTI0MDcxNDAxMDg0OVoXDTI1MDcxNDAxMDg0OVowPzENMAsGA1UEAwwEdG9u
|
16
|
+
eTEZMBcGCgmSJomT8ixkARkWCXRvbnlidXJuczETMBEGCgmSJomT8ixkARkWA25l
|
17
|
+
dDCCAaIwDQYJKoZIhvcNAQEBBQADggGPADCCAYoCggGBAKggfvyjaYMtMwan119S
|
18
|
+
oOKyXi6ES6fn92c4jsiNowr15QR5VUlqI53RBowrLZzVTAYs7duxLT1jd6H58vpC
|
19
|
+
bJEkTtFWmJj8tL4+XozzESDnytcdLiT51fb7fmq9LUUwF+iJbotP7EOuzdp58p4O
|
20
|
+
qAIhL9HTPSgV02xqgoLV/9qBfMGMp2OIg8LxeY4j6tsu/NWxf19vBYI++ETr8vce
|
21
|
+
NjafoEa3zuVhB7aasnURf5nuhl+Rlp/CZ3DunXLsfCRil1Lu5FD53YDmozEVlWb0
|
22
|
+
wBbcbg/v73x2TV5jyIzxW6HOde2LhC/eI1sNitCflLZ0Q7kWAKMbx82RMTuNHNVa
|
23
|
+
JJRB2D6A64V+IJ9GAsYgyrkZ63sTlABylI2IXasif5Y4gsHLzr8m8f+6bKoKmKxo
|
24
|
+
qPs+sLlD3PbeWeNuxYnd2VP55NqTHSpFyytYjuFP0PErdChini435Zrxedq4UuRx
|
25
|
+
0Bhq4cVlspDqbVhJoFqL27ZVyJWVpwMPXbN8sWZCJgWaAQIDAQABo3cwdTAJBgNV
|
26
|
+
HRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQUJWq36v7uqFV7BcGsCCpzg+r7
|
27
|
+
OVQwHQYDVR0RBBYwFIESdG9ueUB0b255YnVybnMubmV0MB0GA1UdEgQWMBSBEnRv
|
28
|
+
bnlAdG9ueWJ1cm5zLm5ldDANBgkqhkiG9w0BAQsFAAOCAYEAhCrMM1e7kL5MtTRy
|
29
|
+
9kOU48uTLtLuyvUxFkdN/b/iMh+MKYRButfY35SxqRzs76Lta58V6cgRpRNb/WZv
|
30
|
+
Y5613dW/XF3oPOjaSyjYTGT/RyVobT5BydDIZ5uN/l38cd4fM++PEyIyP0D/CyNY
|
31
|
+
EVs+WvSSCAWzjO5PRgQDBU0+VrQaA2sp/qohi9kjxEFllkqi9eC2Py1rSndlXv0s
|
32
|
+
UW1jECxYZ56EHfypdqGjb9FRheRcEB6FtUzgjN8+IFsq1KyKDTproT3qVYFPT7IU
|
33
|
+
VSYwGC6ZO8B+/FxtebityYd+WuwSIcGoZVdbnl/GUPzT/O+5VdEmOFfn9lG3RbL2
|
34
|
+
xZax49uLQDvhfCrzISFszjYMMzfBhgpR+j9kq0HvZhrhZJRvlu8r7KP9EDvWrkXG
|
35
|
+
Gso2iuR/JK+nlYYHnXZSMQgPTNEv7urC3s3YBLkEeZAyKSzTub/yFiZ0f1rZECNq
|
36
|
+
RdwSWsf01XE0bKBtz4/dixrX45mIFrPmGp1gobRN/q4Tq3lU
|
37
|
+
-----END CERTIFICATE-----
|
38
|
+
date: 2024-11-12 00:00:00.000000000 Z
|
39
|
+
dependencies:
|
40
|
+
- !ruby/object:Gem::Dependency
|
41
|
+
name: actionmailer
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 8.0.0
|
47
|
+
type: :runtime
|
48
|
+
prerelease: false
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 8.0.0
|
54
|
+
- !ruby/object:Gem::Dependency
|
55
|
+
name: actionpack
|
56
|
+
requirement: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: 8.0.0
|
61
|
+
type: :runtime
|
62
|
+
prerelease: false
|
63
|
+
version_requirements: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: 8.0.0
|
68
|
+
- !ruby/object:Gem::Dependency
|
69
|
+
name: activejob
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: 8.0.0
|
75
|
+
type: :runtime
|
76
|
+
prerelease: false
|
77
|
+
version_requirements: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: 8.0.0
|
82
|
+
- !ruby/object:Gem::Dependency
|
83
|
+
name: activemodel
|
84
|
+
requirement: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: 8.0.0
|
89
|
+
type: :runtime
|
90
|
+
prerelease: false
|
91
|
+
version_requirements: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: 8.0.0
|
96
|
+
- !ruby/object:Gem::Dependency
|
97
|
+
name: activerecord
|
98
|
+
requirement: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: 8.0.0
|
103
|
+
type: :runtime
|
104
|
+
prerelease: false
|
105
|
+
version_requirements: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - ">="
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 8.0.0
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: activesupport
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - ">="
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: 8.0.0
|
117
|
+
type: :runtime
|
118
|
+
prerelease: false
|
119
|
+
version_requirements: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - ">="
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: 8.0.0
|
124
|
+
- !ruby/object:Gem::Dependency
|
125
|
+
name: railties
|
126
|
+
requirement: !ruby/object:Gem::Requirement
|
127
|
+
requirements:
|
128
|
+
- - ">="
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: 8.0.0
|
131
|
+
type: :runtime
|
132
|
+
prerelease: false
|
133
|
+
version_requirements: !ruby/object:Gem::Requirement
|
134
|
+
requirements:
|
135
|
+
- - ">="
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
version: 8.0.0
|
138
|
+
- !ruby/object:Gem::Dependency
|
139
|
+
name: bundler
|
140
|
+
requirement: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - ">="
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: 1.15.0
|
145
|
+
type: :runtime
|
146
|
+
prerelease: false
|
147
|
+
version_requirements: !ruby/object:Gem::Requirement
|
148
|
+
requirements:
|
149
|
+
- - ">="
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
version: 1.15.0
|
152
|
+
description: Identity and access management engine for Rails.
|
153
|
+
email:
|
154
|
+
- tony@tonyburns.net
|
155
|
+
executables: []
|
156
|
+
extensions: []
|
157
|
+
extra_rdoc_files: []
|
158
|
+
files:
|
159
|
+
- CHANGELOG.md
|
160
|
+
- MIT-LICENSE
|
161
|
+
- README.md
|
162
|
+
- SECURITY.md
|
163
|
+
- app/assets/config/picket_manifest.js
|
164
|
+
- app/controllers/picket/application_api_controller.rb
|
165
|
+
- app/controllers/picket/application_controller.rb
|
166
|
+
- app/controllers/picket/application_metal_controller.rb
|
167
|
+
- app/javascript/helpers/picket/index.js
|
168
|
+
- app/javascript/lib/picket/index.js
|
169
|
+
- app/javascript/lib/picket/utils.js
|
170
|
+
- app/jobs/picket/application_job.rb
|
171
|
+
- app/mailers/picket/application_mailer.rb
|
172
|
+
- app/models/picket/application_record.rb
|
173
|
+
- config/i18n-tasks.yml
|
174
|
+
- config/importmap.rb
|
175
|
+
- config/locales/picket.en.yml
|
176
|
+
- config/routes.rb
|
177
|
+
- lib/generators/picket/install/USAGE
|
178
|
+
- lib/generators/picket/install/install_generator.rb
|
179
|
+
- lib/generators/picket/install/templates/config/initializers/picket.rb.tt
|
180
|
+
- lib/generators/picket/install/templates/config/picket.yml.tt
|
181
|
+
- lib/picket.rb
|
182
|
+
- lib/picket/configuration.rb
|
183
|
+
- lib/picket/deprecator.rb
|
184
|
+
- lib/picket/engine.rb
|
185
|
+
- lib/picket/log_subscriber.rb
|
186
|
+
- lib/picket/version.rb
|
187
|
+
- lib/tasks/picket_tasks.rake
|
188
|
+
homepage: https://picketengine.org
|
189
|
+
licenses:
|
190
|
+
- MIT
|
191
|
+
metadata:
|
192
|
+
bug_tracker_uri: https://github.com/picketengine/picket/issues
|
193
|
+
changelog_uri: https://github.com/picketengine/picket/blob/v0.1.0.alpha/CHANGELOG.md
|
194
|
+
documentation_uri: https://api.picketengine.org/v0.1.0.alpha/
|
195
|
+
mailing_list_uri: https://github.com/picketengine/picket/discussions
|
196
|
+
source_code_uri: https://github.com/picketengine/picket/tree/v0.1.0.alpha
|
197
|
+
rubygems_mfa_required: 'true'
|
198
|
+
post_install_message:
|
199
|
+
rdoc_options: []
|
200
|
+
require_paths:
|
201
|
+
- lib
|
202
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
203
|
+
requirements:
|
204
|
+
- - ">="
|
205
|
+
- !ruby/object:Gem::Version
|
206
|
+
version: 3.2.0
|
207
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
208
|
+
requirements:
|
209
|
+
- - ">="
|
210
|
+
- !ruby/object:Gem::Version
|
211
|
+
version: 3.4.1
|
212
|
+
requirements: []
|
213
|
+
rubygems_version: 3.4.19
|
214
|
+
signing_key:
|
215
|
+
specification_version: 4
|
216
|
+
summary: Identity and access management engine for Rails.
|
217
|
+
test_files: []
|
metadata.gz.sig
ADDED
Binary file
|