feature_map 1.2.6 → 1.2.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 20d96ad4e61fb28fc9891cf32dd7e6102dbfb6d48d4a114973390cb5fc2fc805
4
- data.tar.gz: 951a84a6a993a8b03b7899c51b5e55e3ab3fcf356f90e122574658a3696da5cd
3
+ metadata.gz: addbdad7d39c22b44452e84d3217e810dcb4e9bbfa1c5676ea0872e3606c69d5
4
+ data.tar.gz: c85b5d1e30bb11194b74c97a05b432141ab815f28b07e09791f4dec3853fd656
5
5
  SHA512:
6
- metadata.gz: 3256049f99d24a887bc0644cbb64a1c7bcd8a305b23b019a864d68f84c101b342e742d236dfe85d1739cbc88dc4a42130b7fc25e5fc4de744a939f2ea3a77934
7
- data.tar.gz: 57f6b8091fa32823b5f199c0f0cad7fa8b0be3b15eabb9ecee7f16e2357be7234cd2931a8f2a6ecf984792b7a56103f9956a3241c2cae9130c0cfe48e9baf7da
6
+ metadata.gz: 8e0e106c8073cfa12cd8b92f8c7b9b982e57d66b12ee728662434afba3e17be0cd8ab4de665522187a5589ac6b144a29ead74da596419ea615dcf923fec409a0
7
+ data.tar.gz: 6b15a1b7d543ef3212c61720f84220597d0f78140722121afb668eca5150198bb7fd3cad6dec153665637594babc0a5a9c58b60f924b4dde1fbc55f6f46c070d
@@ -73,6 +73,9 @@ module FeatureMap
73
73
  end
74
74
 
75
75
  class Feature
76
+ LABEL_PREFIX = 'Feature '
77
+ LABEL_LIMIT = 50
78
+
76
79
  def self.from_yml(config_yml)
77
80
  hash = YAML.load_file(config_yml)
78
81
 
@@ -101,6 +104,13 @@ module FeatureMap
101
104
  Plugins::Identity.for(self).identity.name
102
105
  end
103
106
 
107
+ def label
108
+ # NOTE: Certain uses of feature labels have character
109
+ # limits. This allows us to stay comfortably within
110
+ # most without overly complex configuration.
111
+ "#{LABEL_PREFIX}#{name}"[0...LABEL_LIMIT]
112
+ end
113
+
104
114
  def to_tag
105
115
  CodeFeatures.tag_value_for(name)
106
116
  end
@@ -10,7 +10,7 @@ module FeatureMap
10
10
  @@map_files_to_features = {} # rubocop:disable Style/ClassVars
11
11
 
12
12
  def map_files_to_features(files)
13
- return @@map_files_to_features if @@map_files_to_features&.keys && @@map_files_to_features.keys.count.positive?
13
+ return @@map_files_to_features if @@map_files_to_features&.any?
14
14
 
15
15
  @@map_files_to_features = CodeFeatures.all.each_with_object({}) do |feature, map| # rubocop:disable Style/ClassVars
16
16
  # NOTE: The FeatureDefinitionAssignment naively assumes that all
@@ -11,7 +11,7 @@ module FeatureMap
11
11
  @@map_files_to_features = {} # rubocop:disable Style/ClassVars
12
12
 
13
13
  def map_files_to_features(files)
14
- return @@map_files_to_features if @@map_files_to_features&.keys && @@map_files_to_features.keys.count.positive?
14
+ return @@map_files_to_features if @@map_files_to_features&.any?
15
15
 
16
16
  @@map_files_to_features = FeatureMap::CodeFeatures.all.each_with_object({}) do |feature, map| # rubocop:disable Style/ClassVars
17
17
  FeaturePlugins::Assignment.for(feature).assigned_globs.each do |glob|