diff options
Diffstat (limited to 'tooling/danger/feature_flag.rb')
-rw-r--r-- | tooling/danger/feature_flag.rb | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/tooling/danger/feature_flag.rb b/tooling/danger/feature_flag.rb index cef64e52af3..da0b7053af1 100644 --- a/tooling/danger/feature_flag.rb +++ b/tooling/danger/feature_flag.rb @@ -16,26 +16,22 @@ module Tooling end class Found + ATTRIBUTES = %w[name introduced_by_url rollout_issue_url milestone type group default_enabled].freeze + attr_reader :path def initialize(path) @path = path end - def raw - @raw ||= File.read(path) - end - - def group - @group ||= yaml['group'] + ATTRIBUTES.each do |attribute| + define_method(attribute) do + yaml[attribute] + end end - def default_enabled - @default_enabled ||= yaml['default_enabled'] - end - - def rollout_issue_url - @rollout_issue_url ||= yaml['rollout_issue_url'] + def raw + @raw ||= File.read(path) end def group_match_mr_label?(mr_group_label) |