summaryrefslogtreecommitdiff
path: root/lib/declarative_policy
diff options
context:
space:
mode:
authorgfyoung <gfyoung17@gmail.com>2018-10-06 16:10:08 -0700
committergfyoung <gfyoung17@gmail.com>2018-10-06 17:02:50 -0700
commitd598e4fd937797a7f7778f5b4158ebf73139ce7f (patch)
treeaaf16bddfbd7b9aeba06b15e893c474b4f125506 /lib/declarative_policy
parentc3389c8006443e2b4d994eb15e60bd249fc4732f (diff)
downloadgitlab-ce-d598e4fd937797a7f7778f5b4158ebf73139ce7f.tar.gz
Enable more frozen string in lib/**/*.rb
Enables frozen for the following: * lib/*.rb * lib/banzai/**/*.rb * lib/bitbucket/**/*.rb * lib/constraints/**/*.rb * lib/container_registry/**/*.rb * lib/declarative_policy/**/*.rb Partially addresses #47424.
Diffstat (limited to 'lib/declarative_policy')
-rw-r--r--lib/declarative_policy/base.rb2
-rw-r--r--lib/declarative_policy/cache.rb2
-rw-r--r--lib/declarative_policy/condition.rb2
-rw-r--r--lib/declarative_policy/delegate_dsl.rb2
-rw-r--r--lib/declarative_policy/policy_dsl.rb2
-rw-r--r--lib/declarative_policy/preferred_scope.rb5
-rw-r--r--lib/declarative_policy/rule.rb2
-rw-r--r--lib/declarative_policy/rule_dsl.rb2
-rw-r--r--lib/declarative_policy/runner.rb2
-rw-r--r--lib/declarative_policy/step.rb2
10 files changed, 22 insertions, 1 deletions
diff --git a/lib/declarative_policy/base.rb b/lib/declarative_policy/base.rb
index da3fabba39b..cd6e1606f22 100644
--- a/lib/declarative_policy/base.rb
+++ b/lib/declarative_policy/base.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module DeclarativePolicy
class Base
# A map of ability => list of rules together with :enable
diff --git a/lib/declarative_policy/cache.rb b/lib/declarative_policy/cache.rb
index 780d8f707bd..13006e56454 100644
--- a/lib/declarative_policy/cache.rb
+++ b/lib/declarative_policy/cache.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module DeclarativePolicy
module Cache
class << self
diff --git a/lib/declarative_policy/condition.rb b/lib/declarative_policy/condition.rb
index 51c4a8b2bbe..b77f40b1093 100644
--- a/lib/declarative_policy/condition.rb
+++ b/lib/declarative_policy/condition.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module DeclarativePolicy
# A Condition is the data structure that is created by the
# `condition` declaration on DeclarativePolicy::Base. It is
diff --git a/lib/declarative_policy/delegate_dsl.rb b/lib/declarative_policy/delegate_dsl.rb
index ca2eb98e3e8..67e3429b696 100644
--- a/lib/declarative_policy/delegate_dsl.rb
+++ b/lib/declarative_policy/delegate_dsl.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module DeclarativePolicy
# Used when the name of a delegate is mentioned in
# the rule DSL.
diff --git a/lib/declarative_policy/policy_dsl.rb b/lib/declarative_policy/policy_dsl.rb
index c96049768a1..96741c0478e 100644
--- a/lib/declarative_policy/policy_dsl.rb
+++ b/lib/declarative_policy/policy_dsl.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module DeclarativePolicy
# The return value of a rule { ... } declaration.
# Can call back to register rules with the containing
diff --git a/lib/declarative_policy/preferred_scope.rb b/lib/declarative_policy/preferred_scope.rb
index c77784cb49d..239780d8626 100644
--- a/lib/declarative_policy/preferred_scope.rb
+++ b/lib/declarative_policy/preferred_scope.rb
@@ -1,4 +1,7 @@
-module DeclarativePolicy # rubocop:disable Naming/FileName
+# rubocop:disable Naming/FileName
+# frozen_string_literal: true
+
+module DeclarativePolicy
PREFERRED_SCOPE_KEY = :"DeclarativePolicy.preferred_scope"
class << self
diff --git a/lib/declarative_policy/rule.rb b/lib/declarative_policy/rule.rb
index 407398cc770..f38f4f0a50f 100644
--- a/lib/declarative_policy/rule.rb
+++ b/lib/declarative_policy/rule.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module DeclarativePolicy
module Rule
# A Rule is the object that results from the `rule` declaration,
diff --git a/lib/declarative_policy/rule_dsl.rb b/lib/declarative_policy/rule_dsl.rb
index 7254b08eda5..85da7f261fa 100644
--- a/lib/declarative_policy/rule_dsl.rb
+++ b/lib/declarative_policy/rule_dsl.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module DeclarativePolicy
# The DSL evaluation context inside rule { ... } blocks.
# Responsible for creating and combining Rule objects.
diff --git a/lib/declarative_policy/runner.rb b/lib/declarative_policy/runner.rb
index fec672f4b8c..f739fe5e16e 100644
--- a/lib/declarative_policy/runner.rb
+++ b/lib/declarative_policy/runner.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module DeclarativePolicy
class Runner
class State
diff --git a/lib/declarative_policy/step.rb b/lib/declarative_policy/step.rb
index 3469fe9f991..c289c17cc19 100644
--- a/lib/declarative_policy/step.rb
+++ b/lib/declarative_policy/step.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module DeclarativePolicy
# This object represents one step in the runtime decision of whether
# an ability is allowed. It contains a Rule and a context (instance