diff --git a/lib/flipper/api/v1/actions/actors_gate.rb b/lib/flipper/api/v1/actions/actors_gate.rb index b340fd058..b8e672ee5 100644 --- a/lib/flipper/api/v1/actions/actors_gate.rb +++ b/lib/flipper/api/v1/actions/actors_gate.rb @@ -6,7 +6,7 @@ module Api module V1 module Actions class ActorsGate < Api::Action - REGEX = %r{\A/features/(.*)/actors/?\Z} + REGEX = %r{\A/features/(?.*)/actors/?\Z} match { |request| request.path_info =~ REGEX } def post @@ -36,7 +36,7 @@ def ensure_valid_params def feature_name @feature_name ||= begin match = request.path_info.match(REGEX) - match ? match[1] : nil + match ? match[:feature_name] : nil end end diff --git a/lib/flipper/api/v1/actions/boolean_gate.rb b/lib/flipper/api/v1/actions/boolean_gate.rb index e85cd021a..2c0222362 100644 --- a/lib/flipper/api/v1/actions/boolean_gate.rb +++ b/lib/flipper/api/v1/actions/boolean_gate.rb @@ -6,7 +6,7 @@ module Api module V1 module Actions class BooleanGate < Api::Action - REGEX = %r{\A/features/(.*)/boolean/?\Z} + REGEX = %r{\A/features/(?.*)/boolean/?\Z} match { |request| request.path_info =~ REGEX } def post @@ -28,7 +28,7 @@ def delete def feature_name @feature_name ||= begin match = request.path_info.match(REGEX) - match ? match[1] : nil + match ? match[:feature_name] : nil end end end diff --git a/lib/flipper/api/v1/actions/clear_feature.rb b/lib/flipper/api/v1/actions/clear_feature.rb index 1359cce93..00feb4b4c 100644 --- a/lib/flipper/api/v1/actions/clear_feature.rb +++ b/lib/flipper/api/v1/actions/clear_feature.rb @@ -6,7 +6,7 @@ module Api module V1 module Actions class ClearFeature < Api::Action - REGEX = %r{\A/features/(.*)/clear/?\Z} + REGEX = %r{\A/features/(?.*)/clear/?\Z} match { |request| request.path_info =~ REGEX } def delete @@ -20,7 +20,7 @@ def delete def feature_name @feature_name ||= begin match = request.path_info.match(REGEX) - match ? match[1] : nil + match ? match[:feature_name] : nil end end end diff --git a/lib/flipper/api/v1/actions/feature.rb b/lib/flipper/api/v1/actions/feature.rb index 873a428af..ce0a40ddf 100644 --- a/lib/flipper/api/v1/actions/feature.rb +++ b/lib/flipper/api/v1/actions/feature.rb @@ -6,7 +6,7 @@ module Api module V1 module Actions class Feature < Api::Action - REGEX = %r{\A/features/(.*)/?\Z} + REGEX = %r{\A/features/(?.*)/?\Z} match { |request| request.path_info =~ REGEX } def get @@ -25,7 +25,7 @@ def delete def feature_name @feature_name ||= begin match = request.path_info.match(REGEX) - match ? match[1] : nil + match ? match[:feature_name] : nil end end diff --git a/lib/flipper/api/v1/actions/groups_gate.rb b/lib/flipper/api/v1/actions/groups_gate.rb index 12e6c115e..7232bae03 100644 --- a/lib/flipper/api/v1/actions/groups_gate.rb +++ b/lib/flipper/api/v1/actions/groups_gate.rb @@ -6,7 +6,7 @@ module Api module V1 module Actions class GroupsGate < Api::Action - REGEX = %r{\A/features/(.*)/groups/?\Z} + REGEX = %r{\A/features/(?.*)/groups/?\Z} match { |request| request.path_info =~ REGEX } def post @@ -50,7 +50,7 @@ def disallow_unregistered_groups? def feature_name @feature_name ||= begin match = request.path_info.match(REGEX) - match ? match[1] : nil + match ? match[:feature_name] : nil end end diff --git a/lib/flipper/api/v1/actions/percentage_of_actors_gate.rb b/lib/flipper/api/v1/actions/percentage_of_actors_gate.rb index bc54a701b..e88f45726 100644 --- a/lib/flipper/api/v1/actions/percentage_of_actors_gate.rb +++ b/lib/flipper/api/v1/actions/percentage_of_actors_gate.rb @@ -6,7 +6,7 @@ module Api module V1 module Actions class PercentageOfActorsGate < Api::Action - REGEX = %r{\A/features/(.*)/percentage_of_actors/?\Z} + REGEX = %r{\A/features/(?.*)/percentage_of_actors/?\Z} match { |request| request.path_info =~ REGEX } def post @@ -32,7 +32,7 @@ def delete def feature_name @feature_name ||= begin match = request.path_info.match(REGEX) - match ? match[1] : nil + match ? match[:feature_name] : nil end end diff --git a/lib/flipper/api/v1/actions/percentage_of_time_gate.rb b/lib/flipper/api/v1/actions/percentage_of_time_gate.rb index 76398762a..2d1a5f53d 100644 --- a/lib/flipper/api/v1/actions/percentage_of_time_gate.rb +++ b/lib/flipper/api/v1/actions/percentage_of_time_gate.rb @@ -6,7 +6,7 @@ module Api module V1 module Actions class PercentageOfTimeGate < Api::Action - REGEX = %r{\A/features/(.*)/percentage_of_time/?\Z} + REGEX = %r{\A/features/(?.*)/percentage_of_time/?\Z} match { |request| request.path_info =~ REGEX } def post @@ -33,7 +33,7 @@ def delete def feature_name @feature_name ||= begin match = request.path_info.match(REGEX) - match ? match[1] : nil + match ? match[:feature_name] : nil end end diff --git a/lib/flipper/ui/actions/actors_gate.rb b/lib/flipper/ui/actions/actors_gate.rb index 53f02bf8f..8f3ec187a 100644 --- a/lib/flipper/ui/actions/actors_gate.rb +++ b/lib/flipper/ui/actions/actors_gate.rb @@ -6,7 +6,7 @@ module Flipper module UI module Actions class ActorsGate < UI::Action - REGEX = %r{\A/features/(.*)/actors/?\Z} + REGEX = %r{\A/features/(?.*)/actors/?\Z} match { |request| request.path_info =~ REGEX } def get @@ -47,7 +47,7 @@ def post def feature_name @feature_name ||= begin match = request.path_info.match(REGEX) - match ? match[1] : nil + match ? match[:feature_name] : nil end end end diff --git a/lib/flipper/ui/actions/boolean_gate.rb b/lib/flipper/ui/actions/boolean_gate.rb index 038142b02..df957d769 100644 --- a/lib/flipper/ui/actions/boolean_gate.rb +++ b/lib/flipper/ui/actions/boolean_gate.rb @@ -5,7 +5,7 @@ module Flipper module UI module Actions class BooleanGate < UI::Action - REGEX = %r{\A/features/(.*)/boolean/?\Z} + REGEX = %r{\A/features/(?.*)/boolean/?\Z} match { |request| request.path_info =~ REGEX } def post @@ -26,7 +26,7 @@ def post def feature_name @feature_name ||= begin match = request.path_info.match(REGEX) - match ? match[1] : nil + match ? match[:feature_name] : nil end end end diff --git a/lib/flipper/ui/actions/feature.rb b/lib/flipper/ui/actions/feature.rb index 9e70b256a..7da7bf938 100644 --- a/lib/flipper/ui/actions/feature.rb +++ b/lib/flipper/ui/actions/feature.rb @@ -5,7 +5,7 @@ module Flipper module UI module Actions class Feature < UI::Action - REGEX = %r{\A/features/(.*)\Z} + REGEX = %r{\A/features/(?.*)\Z} match { |request| request.path_info =~ REGEX } def get @@ -40,7 +40,7 @@ def delete def feature_name @feature_name ||= begin match = request.path_info.match(REGEX) - match ? match[1] : nil + match ? match[:feature_name] : nil end end end diff --git a/lib/flipper/ui/actions/groups_gate.rb b/lib/flipper/ui/actions/groups_gate.rb index b5d5d1ab6..7ab2648b0 100644 --- a/lib/flipper/ui/actions/groups_gate.rb +++ b/lib/flipper/ui/actions/groups_gate.rb @@ -5,7 +5,7 @@ module Flipper module UI module Actions class GroupsGate < UI::Action - REGEX = %r{\A/features/(.*)/groups/?\Z} + REGEX = %r{\A/features/(?.*)/groups/?\Z} match { |request| request.path_info =~ REGEX } def get @@ -44,7 +44,7 @@ def post def feature_name @feature_name ||= begin match = request.path_info.match(REGEX) - match ? match[1] : nil + match ? match[:feature_name] : nil end end end diff --git a/lib/flipper/ui/actions/percentage_of_actors_gate.rb b/lib/flipper/ui/actions/percentage_of_actors_gate.rb index b0cd8b327..2ce28a262 100644 --- a/lib/flipper/ui/actions/percentage_of_actors_gate.rb +++ b/lib/flipper/ui/actions/percentage_of_actors_gate.rb @@ -5,7 +5,7 @@ module Flipper module UI module Actions class PercentageOfActorsGate < UI::Action - REGEX = %r{\A/features/(.*)/percentage_of_actors/?\Z} + REGEX = %r{\A/features/(?.*)/percentage_of_actors/?\Z} match { |request| request.path_info =~ REGEX } def post @@ -27,7 +27,7 @@ def post def feature_name @feature_name ||= begin match = request.path_info.match(REGEX) - match ? match[1] : nil + match ? match[:feature_name] : nil end end end diff --git a/lib/flipper/ui/actions/percentage_of_time_gate.rb b/lib/flipper/ui/actions/percentage_of_time_gate.rb index 51f72b97a..491797b15 100644 --- a/lib/flipper/ui/actions/percentage_of_time_gate.rb +++ b/lib/flipper/ui/actions/percentage_of_time_gate.rb @@ -5,7 +5,7 @@ module Flipper module UI module Actions class PercentageOfTimeGate < UI::Action - REGEX = %r{\A/features/(.*)/percentage_of_time/?\Z} + REGEX = %r{\A/features/(?.*)/percentage_of_time/?\Z} match { |request| request.path_info =~ REGEX } def post @@ -27,7 +27,7 @@ def post def feature_name @feature_name ||= begin match = request.path_info.match(REGEX) - match ? match[1] : nil + match ? match[:feature_name] : nil end end end