1
0
mirror of https://github.com/bitwarden/help synced 2025-12-29 14:43:27 +00:00

Promote to Master (#748)

* initial commit

* adding quotes for the array error

* Create Gemfile

* Create Gemfile.lock

* add .nvmrc and .node-version

* removed /article from URL

* update links to work with netlify

* more fixed links

* link fixes

* update bad links

* Update netlify.toml

toml test for redirects

* article redirect

* link fixes

* Update index.html

* Update netlify.toml

* Update _config.yml

* Update netlify.toml

* Update netlify.toml

* Update netlify.toml

* Update netlify.toml

* Update netlify.toml

* add article back into URL for launch

* Update netlify.toml

* Update netlify.toml

* add order to categories front matter

* Update netlify.toml

* update

* sidemenu update

* Revert "sidemenu update"

This reverts commit 5441c3d35c.

* update order prop

* Navbar updates per Gary and compiler warnings

* font/style tweaks

* Update sidebar.html

* Stage Release Documentation (#739)

* initial drafts

* rewrite Custom Fields article to prioritize new context-menu option & better organize ancillary information

* edit

* edit

* Custom Field Context Menu & CAPTCHA item in release notes

* SSO relink event

* update rn

* small edits

* improve release notes titles

* fix side menu

* Edits courtest of mportune!

* update order

* link fixes

* link cleanup

* image updates and a link

* fix trailing slash

Co-authored-by: DanHillesheim <79476558+DanHillesheim@users.noreply.github.com>
This commit is contained in:
fred_the_tech_writer
2021-09-21 13:21:11 -04:00
committed by GitHub
parent 63f78e8979
commit 906e2ca0dd
3304 changed files with 386714 additions and 8864 deletions

View File

@@ -0,0 +1,129 @@
# Frozen-string-literal: true
# Copyright: 2015 - 2017 Jordon Bedwell - MIT License
# Encoding: utf-8
class Pathutil
module Helpers
extend self
# --
def allowed
return @allowed ||= begin
{
:yaml => {
:classes => [],
:symbols => []
}
}
end
end
# --
# Wraps around YAML and SafeYAML to provide alternatives to Rubies.
# @note We default aliases to yes so we can detect if you explicit true.
# @return Hash
# --
def load_yaml(data, safe: true, whitelist_classes: allowed[:yaml][:classes], \
whitelist_symbols: allowed[:yaml][:symbols], aliases: :yes)
require "yaml"
unless safe
return YAML.load(
data
)
end
if !YAML.respond_to?(:safe_load)
setup_safe_yaml whitelist_classes, aliases
SafeYAML.load(
data
)
else
YAML.safe_load(
data,
whitelist_classes,
whitelist_symbols,
aliases
)
end
end
# --
# Make a temporary name suitable for temporary files and directories.
# @return String
# --
def make_tmpname(prefix = "", suffix = nil, root = nil)
prefix = tmpname_prefix(prefix)
suffix = tmpname_suffix(suffix)
root ||= Dir::Tmpname.tmpdir
File.join(root, __make_tmpname(
prefix, suffix
))
end
# --
private
def __make_tmpname((prefix, suffix), number)
prefix &&= String.try_convert(prefix) || tmpname_agerr(:prefix, prefix)
suffix &&= String.try_convert(suffix) || tmpname_agerr(:suffix, suffix)
time = Time.now.strftime("%Y%m%d")
path = "#{prefix}#{time}-#{$$}-#{rand(0x100000000).to_s(36)}".dup
path << "-#{number}" if number
path << suffix if suffix
path
end
private
def tmpname_agerr(type, val)
raise ArgumentError, "unexpected #{type}: #{val.inspect}"
end
# --
private
def tmpname_suffix(suffix)
suffix = suffix.join("-") if suffix.is_a?(Array)
suffix = suffix.gsub(/\A\-/, "") unless !suffix || suffix.empty?
suffix
end
# --
# Cleanup the temp name prefix, joining if necessary.
# rubocop:disable Style/ParallelAssignment
# --
private
def tmpname_prefix(prefix)
ext, prefix = prefix, "" if !prefix.is_a?(Array) && prefix.start_with?(".")
ext = prefix.pop if prefix.is_a?(Array) && prefix[-1].start_with?(".")
prefix = prefix.join("-") if prefix.is_a?(Array)
unless prefix.empty?
prefix = prefix.gsub(/\-\Z/, "") \
+ "-"
end
return [
prefix, ext || ""
]
end
# --
# Wrap around, cleanup, deprecate and use SafeYAML.
# rubocop:enable Style/ParallelAssignment
# --
private
def setup_safe_yaml(whitelist_classes, aliases)
warn "WARN: SafeYAML does not support disabling of aliases." if aliases && aliases != :yes
warn "WARN: SafeYAML will be removed when Ruby 2.0 goes EOL."
require "safe_yaml/load"
SafeYAML.restore_defaults!
whitelist_classes.map(&SafeYAML.method(
:whitelist_class!
))
end
end
end

View File

@@ -0,0 +1,7 @@
# Frozen-string-literal: true
# Copyright: 2015 - 2017 Jordon Bedwell - MIT License
# Encoding: utf-8
class Pathutil
VERSION = "0.16.2"
end