lib/licensee/license_field.rb in licensee-9.16.0 vs lib/licensee/license_field.rb in licensee-9.16.1

- old
+ new

@@ -20,11 +20,11 @@ # Returns an array of all known LicenseFields def all @all ||= begin path = '../../vendor/choosealicense.com/_data/fields.yml' path = File.expand_path path, __dir__ - fields = YAML.safe_load File.read(path) + fields = YAML.safe_load_file(path) fields.map { |field| LicenseField.from_hash(field) } end end # Builds a LicenseField from a hash of properties @@ -45,10 +45,10 @@ LicenseField.from_array content.scan(FIELD_REGEX).flatten end end alias key name - FIELD_REGEX = /\[(#{Regexp.union(LicenseField.keys)})\]/.freeze + FIELD_REGEX = /\[(#{Regexp.union(LicenseField.keys)})\]/ # The human-readable field name def label key.sub('fullname', 'full name').capitalize end